aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-10-29 16:54:06 -0400
committerTony Lindgren <tony@atomide.com>2012-10-31 13:14:13 -0400
commitbf027ca13738b1548910351952c3fe9b63263a9a (patch)
tree546f201d9ad7c5dc7b3597c88ea9a6ed8647de30
parenteba36d77a80ba2b0bc435fafc8a1ea4f571da4f6 (diff)
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: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap1/clock.c3
-rw-r--r--arch/arm/mach-omap1/clock_data.c3
-rw-r--r--arch/arm/mach-omap1/devices.c3
-rw-r--r--arch/arm/mach-omap1/pm.c4
-rw-r--r--arch/arm/mach-omap1/sram.h7
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c3
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c3
-rw-r--r--arch/arm/mach-omap2/clkt34xx_dpll3m2.c3
-rw-r--r--arch/arm/mach-omap2/io.c3
-rw-r--r--arch/arm/mach-omap2/omap4-common.c2
-rw-r--r--arch/arm/mach-omap2/pm24xx.c5
-rw-r--r--arch/arm/mach-omap2/pm34xx.c4
-rw-r--r--arch/arm/mach-omap2/sdrc.c2
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c3
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S3
-rw-r--r--arch/arm/mach-omap2/sram.h (renamed from arch/arm/plat-omap/sram.h)26
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h12
-rw-r--r--arch/arm/plat-omap/sram.c5
18 files changed, 39 insertions, 55 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 931f3f6d396b..4f5fd4a084c0 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -24,12 +24,11 @@
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26 26
27#include "../plat-omap/sram.h"
28
29#include "soc.h" 27#include "soc.h"
30#include "iomap.h" 28#include "iomap.h"
31#include "clock.h" 29#include "clock.h"
32#include "opp.h" 30#include "opp.h"
31#include "sram.h"
33 32
34__u32 arm_idlect1_mask; 33__u32 arm_idlect1_mask;
35struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p; 34struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 28aea55a412e..cb7c6ae2e3fc 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -27,10 +27,9 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/usb.h> /* for OTG_BASE */ 28#include <mach/usb.h> /* for OTG_BASE */
29 29
30#include "../plat-omap/sram.h"
31
32#include "iomap.h" 30#include "iomap.h"
33#include "clock.h" 31#include "clock.h"
32#include "sram.h"
34 33
35/* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */ 34/* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */
36#define IDL_CLKOUT_ARM_SHIFT 12 35#define IDL_CLKOUT_ARM_SHIFT 12
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 645668e2b1d5..7155ed8b97f8 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -26,12 +26,11 @@
26#include <mach/camera.h> 26#include <mach/camera.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28 28
29#include "../plat-omap/sram.h"
30
31#include "common.h" 29#include "common.h"
32#include "clock.h" 30#include "clock.h"
33#include "dma.h" 31#include "dma.h"
34#include "mmc.h" 32#include "mmc.h"
33#include "sram.h"
35 34
36#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) 35#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
37 36
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b2c2328d7c18..66d663a6ef3a 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -44,6 +44,7 @@
44#include <linux/io.h> 44#include <linux/io.h>
45#include <linux/atomic.h> 45#include <linux/atomic.h>
46 46
47#include <asm/fncpy.h>
47#include <asm/system_misc.h> 48#include <asm/system_misc.h>
48#include <asm/irq.h> 49#include <asm/irq.h>
49#include <asm/mach/time.h> 50#include <asm/mach/time.h>
@@ -56,11 +57,10 @@
56 57
57#include <mach/irqs.h> 58#include <mach/irqs.h>
58 59
59#include "../plat-omap/sram.h"
60
61#include "iomap.h" 60#include "iomap.h"
62#include "clock.h" 61#include "clock.h"
63#include "pm.h" 62#include "pm.h"
63#include "sram.h"
64 64
65static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 65static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
66static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 66static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
diff --git a/arch/arm/mach-omap1/sram.h b/arch/arm/mach-omap1/sram.h
new file mode 100644
index 000000000000..d5a6c8362301
--- /dev/null
+++ b/arch/arm/mach-omap1/sram.h
@@ -0,0 +1,7 @@
1#include <plat/sram.h>
2
3extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
4
5/* Do not use these */
6extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
7extern unsigned long omap1_sram_reprogram_clock_sz;
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 3432f913f743..0d2f14c2dcce 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -25,14 +25,13 @@
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include "../plat-omap/sram.h"
29
30#include "clock.h" 28#include "clock.h"
31#include "clock2xxx.h" 29#include "clock2xxx.h"
32#include "opp2xxx.h" 30#include "opp2xxx.h"
33#include "cm2xxx_3xxx.h" 31#include "cm2xxx_3xxx.h"
34#include "cm-regbits-24xx.h" 32#include "cm-regbits-24xx.h"
35#include "sdrc.h" 33#include "sdrc.h"
34#include "sram.h"
36 35
37/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 36/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
38 37
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index c66276b2bf0a..a38ebb209721 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -33,8 +33,6 @@
33#include <linux/cpufreq.h> 33#include <linux/cpufreq.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35 35
36#include "../plat-omap/sram.h"
37
38#include "soc.h" 36#include "soc.h"
39#include "clock.h" 37#include "clock.h"
40#include "clock2xxx.h" 38#include "clock2xxx.h"
@@ -42,6 +40,7 @@
42#include "cm2xxx_3xxx.h" 40#include "cm2xxx_3xxx.h"
43#include "cm-regbits-24xx.h" 41#include "cm-regbits-24xx.h"
44#include "sdrc.h" 42#include "sdrc.h"
43#include "sram.h"
45 44
46const struct prcm_config *curr_prcm_set; 45const struct prcm_config *curr_prcm_set;
47const struct prcm_config *rate_table; 46const struct prcm_config *rate_table;
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
index 5510d92abe6e..6cf298e262f6 100644
--- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
+++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
@@ -21,12 +21,11 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include "../plat-omap/sram.h"
25
26#include "clock.h" 24#include "clock.h"
27#include "clock3xxx.h" 25#include "clock3xxx.h"
28#include "clock34xx.h" 26#include "clock34xx.h"
29#include "sdrc.h" 27#include "sdrc.h"
28#include "sram.h"
30 29
31#define CYCLES_PER_MHZ 1000000 30#define CYCLES_PER_MHZ 1000000
32 31
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4fadc7895579..814f69955d72 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -27,8 +27,6 @@
27 27
28#include <plat-omap/dma-omap.h> 28#include <plat-omap/dma-omap.h>
29 29
30#include "../plat-omap/sram.h"
31
32#include "omap_hwmod.h" 30#include "omap_hwmod.h"
33#include "soc.h" 31#include "soc.h"
34#include "iomap.h" 32#include "iomap.h"
@@ -43,6 +41,7 @@
43#include "omap-pm.h" 41#include "omap-pm.h"
44#include "sdrc.h" 42#include "sdrc.h"
45#include "serial.h" 43#include "serial.h"
44#include "sram.h"
46 45
47/* 46/*
48 * The machine specific code may provide the extra mapping besides the 47 * The machine specific code may provide the extra mapping besides the
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index d25845c471da..8a7fc04f4ba5 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -25,8 +25,6 @@
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include <asm/memblock.h> 26#include <asm/memblock.h>
27 27
28#include "../plat-omap/sram.h"
29
30#include "omap-wakeupgen.h" 28#include "omap-wakeupgen.h"
31#include "soc.h" 29#include "soc.h"
32#include "common.h" 30#include "common.h"
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 6d17e044ffb8..9a2f5594a7dc 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -31,6 +31,8 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/platform_data/gpio-omap.h> 32#include <linux/platform_data/gpio-omap.h>
33 33
34#include <asm/fncpy.h>
35
34#include <asm/mach/time.h> 36#include <asm/mach/time.h>
35#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -38,8 +40,6 @@
38 40
39#include <plat-omap/dma-omap.h> 41#include <plat-omap/dma-omap.h>
40 42
41#include "../plat-omap/sram.h"
42
43#include "soc.h" 43#include "soc.h"
44#include "common.h" 44#include "common.h"
45#include "clock.h" 45#include "clock.h"
@@ -48,6 +48,7 @@
48#include "cm2xxx_3xxx.h" 48#include "cm2xxx_3xxx.h"
49#include "cm-regbits-24xx.h" 49#include "cm-regbits-24xx.h"
50#include "sdrc.h" 50#include "sdrc.h"
51#include "sram.h"
51#include "pm.h" 52#include "pm.h"
52#include "control.h" 53#include "control.h"
53#include "powerdomain.h" 54#include "powerdomain.h"
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 160fa250c41e..4c85762107bd 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -32,6 +32,7 @@
32 32
33#include <trace/events/power.h> 33#include <trace/events/power.h>
34 34
35#include <asm/fncpy.h>
35#include <asm/suspend.h> 36#include <asm/suspend.h>
36#include <asm/system_misc.h> 37#include <asm/system_misc.h>
37 38
@@ -40,8 +41,6 @@
40#include <plat/prcm.h> 41#include <plat/prcm.h>
41#include <plat-omap/dma-omap.h> 42#include <plat-omap/dma-omap.h>
42 43
43#include "../plat-omap/sram.h"
44
45#include "soc.h" 44#include "soc.h"
46#include "common.h" 45#include "common.h"
47#include "cm2xxx_3xxx.h" 46#include "cm2xxx_3xxx.h"
@@ -52,6 +51,7 @@
52#include "prm2xxx_3xxx.h" 51#include "prm2xxx_3xxx.h"
53#include "pm.h" 52#include "pm.h"
54#include "sdrc.h" 53#include "sdrc.h"
54#include "sram.h"
55#include "control.h" 55#include "control.h"
56 56
57/* pm34xx errata defined in pm.h */ 57/* pm34xx errata defined in pm.h */
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 94d4082f87ed..c64ee1904be8 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -23,8 +23,6 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include "../plat-omap/sram.h"
27
28#include "common.h" 26#include "common.h"
29#include "clock.h" 27#include "clock.h"
30#include "sdrc.h" 28#include "sdrc.h"
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 3b8bfdf848d5..20cc950db4de 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,14 +24,13 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include "../plat-omap/sram.h"
28
29#include "soc.h" 27#include "soc.h"
30#include "iomap.h" 28#include "iomap.h"
31#include "common.h" 29#include "common.h"
32#include "prm2xxx_3xxx.h" 30#include "prm2xxx_3xxx.h"
33#include "clock.h" 31#include "clock.h"
34#include "sdrc.h" 32#include "sdrc.h"
33#include "sram.h"
35 34
36/* Memory timing, DLL mode flags */ 35/* Memory timing, DLL mode flags */
37#define M_DDR 1 36#define M_DDR 1
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 75afe11207ff..7046c3c67181 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -26,13 +26,12 @@
26 26
27#include <asm/assembler.h> 27#include <asm/assembler.h>
28 28
29#include "../plat-omap/sram.h"
30
31#include "omap34xx.h" 29#include "omap34xx.h"
32#include "iomap.h" 30#include "iomap.h"
33#include "cm2xxx_3xxx.h" 31#include "cm2xxx_3xxx.h"
34#include "prm2xxx_3xxx.h" 32#include "prm2xxx_3xxx.h"
35#include "sdrc.h" 33#include "sdrc.h"
34#include "sram.h"
36#include "control.h" 35#include "control.h"
37 36
38/* 37/*
diff --git a/arch/arm/plat-omap/sram.h b/arch/arm/mach-omap2/sram.h
index cefda2e09869..ca7277c2a9ee 100644
--- a/arch/arm/plat-omap/sram.h
+++ b/arch/arm/mach-omap2/sram.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/sram.h
3 *
4 * Interface for functions that need to be run in internal SRAM 2 * Interface for functions that need to be run in internal SRAM
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -8,26 +6,8 @@
8 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
9 */ 7 */
10 8
11#ifndef __ARCH_ARM_OMAP_SRAM_H
12#define __ARCH_ARM_OMAP_SRAM_H
13
14#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
15#include <asm/fncpy.h> 10#include <plat/sram.h>
16
17int __init omap_sram_init(void);
18
19extern void *omap_sram_push_address(unsigned long size);
20
21/* Macro to push a function to the internal SRAM, using the fncpy API */
22#define omap_sram_push(funcp, size) ({ \
23 typeof(&(funcp)) _res = NULL; \
24 void *_sram_address = omap_sram_push_address(size); \
25 if (_sram_address) \
26 _res = fncpy(_sram_address, &(funcp), size); \
27 _res; \
28})
29
30extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
31 11
32extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 12extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
33 u32 base_cs, u32 force_unlock); 13 u32 base_cs, u32 force_unlock);
@@ -44,9 +24,6 @@ extern u32 omap3_configure_core_dpll(
44extern void omap3_sram_restore_context(void); 24extern void omap3_sram_restore_context(void);
45 25
46/* Do not use these */ 26/* Do not use these */
47extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
48extern unsigned long omap1_sram_reprogram_clock_sz;
49
50extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); 27extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
51extern unsigned long omap24xx_sram_reprogram_clock_sz; 28extern unsigned long omap24xx_sram_reprogram_clock_sz;
52 29
@@ -104,4 +81,3 @@ static inline void omap_push_sram_idle(void) {}
104#define OMAP4_SRAM_PA 0x40300000 81#define OMAP4_SRAM_PA 0x40300000
105#endif 82#endif
106#define AM33XX_SRAM_PA 0x40300000 83#define AM33XX_SRAM_PA 0x40300000
107#endif
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
new file mode 100644
index 000000000000..c60025a45ee1
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -0,0 +1,12 @@
1int omap_sram_init(void);
2
3extern void *omap_sram_push_address(unsigned long size);
4
5/* Macro to push a function to the internal SRAM, using the fncpy API */
6#define omap_sram_push(funcp, size) ({ \
7 typeof(&(funcp)) _res = NULL; \
8 void *_sram_address = omap_sram_push_address(size); \
9 if (_sram_address) \
10 _res = fncpy(_sram_address, &(funcp), size); \
11 _res; \
12})
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 70dcc225157f..337292935256 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -20,15 +20,16 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/fncpy.h>
23#include <asm/tlb.h> 24#include <asm/tlb.h>
24#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
25 26
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27 28
28#include "../mach-omap1/soc.h" 29#include "../mach-omap1/soc.h"
30#include "../mach-omap1/sram.h"
29#include "../mach-omap2/soc.h" 31#include "../mach-omap2/soc.h"
30 32#include "../mach-omap2/sram.h"
31#include "sram.h"
32 33
33/* XXX These "sideways" includes will disappear when sram.c becomes a driver */ 34/* XXX These "sideways" includes will disappear when sram.c becomes a driver */
34#include "../mach-omap2/iomap.h" 35#include "../mach-omap2/iomap.h"