Commit bf027ca1 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP: Split sram.h to local headers and minimal shared header

Most of the defines are specific to omap1 and omap2+,
and should be in the local headers. Only minimal function
prototypes need to be shared.

As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* shared code:

http://www.spinics.net/lists/linux-omap/msg80520.html

So this patch re-adds a minimal plat/sram.h.

The new plat/sram.h must not be included from drivers,
that will break build for omap2+ CONFIG_MULTIPLATFORM.

Note that this patch temporarily adds two more
relative includes; Those will be removed in the
following patch.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent eba36d77
...@@ -24,12 +24,11 @@ ...@@ -24,12 +24,11 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include "../plat-omap/sram.h"
#include "soc.h" #include "soc.h"
#include "iomap.h" #include "iomap.h"
#include "clock.h" #include "clock.h"
#include "opp.h" #include "opp.h"
#include "sram.h"
__u32 arm_idlect1_mask; __u32 arm_idlect1_mask;
struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p; struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
......
...@@ -27,10 +27,9 @@ ...@@ -27,10 +27,9 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/usb.h> /* for OTG_BASE */ #include <mach/usb.h> /* for OTG_BASE */
#include "../plat-omap/sram.h"
#include "iomap.h" #include "iomap.h"
#include "clock.h" #include "clock.h"
#include "sram.h"
/* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */ /* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */
#define IDL_CLKOUT_ARM_SHIFT 12 #define IDL_CLKOUT_ARM_SHIFT 12
......
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
#include <mach/camera.h> #include <mach/camera.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include "../plat-omap/sram.h"
#include "common.h" #include "common.h"
#include "clock.h" #include "clock.h"
#include "dma.h" #include "dma.h"
#include "mmc.h" #include "mmc.h"
#include "sram.h"
#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/fncpy.h>
#include <asm/system_misc.h> #include <asm/system_misc.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
...@@ -56,11 +57,10 @@ ...@@ -56,11 +57,10 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include "../plat-omap/sram.h"
#include "iomap.h" #include "iomap.h"
#include "clock.h" #include "clock.h"
#include "pm.h" #include "pm.h"
#include "sram.h"
static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
......
#include <plat/sram.h>
extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
/* Do not use these */
extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
extern unsigned long omap1_sram_reprogram_clock_sz;
...@@ -25,14 +25,13 @@ ...@@ -25,14 +25,13 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include "../plat-omap/sram.h"
#include "clock.h" #include "clock.h"
#include "clock2xxx.h" #include "clock2xxx.h"
#include "opp2xxx.h" #include "opp2xxx.h"
#include "cm2xxx_3xxx.h" #include "cm2xxx_3xxx.h"
#include "cm-regbits-24xx.h" #include "cm-regbits-24xx.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "../plat-omap/sram.h"
#include "soc.h" #include "soc.h"
#include "clock.h" #include "clock.h"
#include "clock2xxx.h" #include "clock2xxx.h"
...@@ -42,6 +40,7 @@ ...@@ -42,6 +40,7 @@
#include "cm2xxx_3xxx.h" #include "cm2xxx_3xxx.h"
#include "cm-regbits-24xx.h" #include "cm-regbits-24xx.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
const struct prcm_config *curr_prcm_set; const struct prcm_config *curr_prcm_set;
const struct prcm_config *rate_table; const struct prcm_config *rate_table;
......
...@@ -21,12 +21,11 @@ ...@@ -21,12 +21,11 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include "../plat-omap/sram.h"
#include "clock.h" #include "clock.h"
#include "clock3xxx.h" #include "clock3xxx.h"
#include "clock34xx.h" #include "clock34xx.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
#define CYCLES_PER_MHZ 1000000 #define CYCLES_PER_MHZ 1000000
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include <plat-omap/dma-omap.h> #include <plat-omap/dma-omap.h>
#include "../plat-omap/sram.h"
#include "omap_hwmod.h" #include "omap_hwmod.h"
#include "soc.h" #include "soc.h"
#include "iomap.h" #include "iomap.h"
...@@ -43,6 +41,7 @@ ...@@ -43,6 +41,7 @@
#include "omap-pm.h" #include "omap-pm.h"
#include "sdrc.h" #include "sdrc.h"
#include "serial.h" #include "serial.h"
#include "sram.h"
/* /*
* The machine specific code may provide the extra mapping besides the * The machine specific code may provide the extra mapping besides the
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/memblock.h> #include <asm/memblock.h>
#include "../plat-omap/sram.h"
#include "omap-wakeupgen.h" #include "omap-wakeupgen.h"
#include "soc.h" #include "soc.h"
#include "common.h" #include "common.h"
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/platform_data/gpio-omap.h> #include <linux/platform_data/gpio-omap.h>
#include <asm/fncpy.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -38,8 +40,6 @@ ...@@ -38,8 +40,6 @@
#include <plat-omap/dma-omap.h> #include <plat-omap/dma-omap.h>
#include "../plat-omap/sram.h"
#include "soc.h" #include "soc.h"
#include "common.h" #include "common.h"
#include "clock.h" #include "clock.h"
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "cm2xxx_3xxx.h" #include "cm2xxx_3xxx.h"
#include "cm-regbits-24xx.h" #include "cm-regbits-24xx.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
#include "pm.h" #include "pm.h"
#include "control.h" #include "control.h"
#include "powerdomain.h" #include "powerdomain.h"
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <trace/events/power.h> #include <trace/events/power.h>
#include <asm/fncpy.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include <asm/system_misc.h> #include <asm/system_misc.h>
...@@ -40,8 +41,6 @@ ...@@ -40,8 +41,6 @@
#include <plat/prcm.h> #include <plat/prcm.h>
#include <plat-omap/dma-omap.h> #include <plat-omap/dma-omap.h>
#include "../plat-omap/sram.h"
#include "soc.h" #include "soc.h"
#include "common.h" #include "common.h"
#include "cm2xxx_3xxx.h" #include "cm2xxx_3xxx.h"
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
#include "prm2xxx_3xxx.h" #include "prm2xxx_3xxx.h"
#include "pm.h" #include "pm.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
#include "control.h" #include "control.h"
/* pm34xx errata defined in pm.h */ /* pm34xx errata defined in pm.h */
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include "../plat-omap/sram.h"
#include "common.h" #include "common.h"
#include "clock.h" #include "clock.h"
#include "sdrc.h" #include "sdrc.h"
......
...@@ -24,14 +24,13 @@ ...@@ -24,14 +24,13 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include "../plat-omap/sram.h"
#include "soc.h" #include "soc.h"
#include "iomap.h" #include "iomap.h"
#include "common.h" #include "common.h"
#include "prm2xxx_3xxx.h" #include "prm2xxx_3xxx.h"
#include "clock.h" #include "clock.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
/* Memory timing, DLL mode flags */ /* Memory timing, DLL mode flags */
#define M_DDR 1 #define M_DDR 1
......
...@@ -26,13 +26,12 @@ ...@@ -26,13 +26,12 @@
#include <asm/assembler.h> #include <asm/assembler.h>
#include "../plat-omap/sram.h"
#include "omap34xx.h" #include "omap34xx.h"
#include "iomap.h" #include "iomap.h"
#include "cm2xxx_3xxx.h" #include "cm2xxx_3xxx.h"
#include "prm2xxx_3xxx.h" #include "prm2xxx_3xxx.h"
#include "sdrc.h" #include "sdrc.h"
#include "sram.h"
#include "control.h" #include "control.h"
/* /*
......
/* /*
* arch/arm/plat-omap/include/mach/sram.h
*
* Interface for functions that need to be run in internal SRAM * Interface for functions that need to be run in internal SRAM
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -8,26 +6,8 @@ ...@@ -8,26 +6,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef __ARCH_ARM_OMAP_SRAM_H
#define __ARCH_ARM_OMAP_SRAM_H
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm/fncpy.h> #include <plat/sram.h>
int __init omap_sram_init(void);
extern void *omap_sram_push_address(unsigned long size);
/* Macro to push a function to the internal SRAM, using the fncpy API */
#define omap_sram_push(funcp, size) ({ \
typeof(&(funcp)) _res = NULL; \
void *_sram_address = omap_sram_push_address(size); \
if (_sram_address) \
_res = fncpy(_sram_address, &(funcp), size); \
_res; \
})
extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
u32 base_cs, u32 force_unlock); u32 base_cs, u32 force_unlock);
...@@ -44,9 +24,6 @@ extern u32 omap3_configure_core_dpll( ...@@ -44,9 +24,6 @@ extern u32 omap3_configure_core_dpll(
extern void omap3_sram_restore_context(void); extern void omap3_sram_restore_context(void);
/* Do not use these */ /* Do not use these */
extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
extern unsigned long omap1_sram_reprogram_clock_sz;
extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
extern unsigned long omap24xx_sram_reprogram_clock_sz; extern unsigned long omap24xx_sram_reprogram_clock_sz;
...@@ -104,4 +81,3 @@ static inline void omap_push_sram_idle(void) {} ...@@ -104,4 +81,3 @@ static inline void omap_push_sram_idle(void) {}
#define OMAP4_SRAM_PA 0x40300000 #define OMAP4_SRAM_PA 0x40300000
#endif #endif
#define AM33XX_SRAM_PA 0x40300000 #define AM33XX_SRAM_PA 0x40300000
#endif
int omap_sram_init(void);
extern void *omap_sram_push_address(unsigned long size);
/* Macro to push a function to the internal SRAM, using the fncpy API */
#define omap_sram_push(funcp, size) ({ \
typeof(&(funcp)) _res = NULL; \
void *_sram_address = omap_sram_push_address(size); \
if (_sram_address) \
_res = fncpy(_sram_address, &(funcp), size); \
_res; \
})
...@@ -20,15 +20,16 @@ ...@@ -20,15 +20,16 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/fncpy.h>
#include <asm/tlb.h> #include <asm/tlb.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "../mach-omap1/soc.h" #include "../mach-omap1/soc.h"
#include "../mach-omap1/sram.h"
#include "../mach-omap2/soc.h" #include "../mach-omap2/soc.h"
#include "../mach-omap2/sram.h"
#include "sram.h"
/* XXX These "sideways" includes will disappear when sram.c becomes a driver */ /* XXX These "sideways" includes will disappear when sram.c becomes a driver */
#include "../mach-omap2/iomap.h" #include "../mach-omap2/iomap.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment