diff options
author | Tony Lindgren <tony@atomide.com> | 2012-10-29 16:54:06 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-10-31 13:14:13 -0400 |
commit | bf027ca13738b1548910351952c3fe9b63263a9a (patch) | |
tree | 546f201d9ad7c5dc7b3597c88ea9a6ed8647de30 /arch/arm/plat-omap | |
parent | eba36d77a80ba2b0bc435fafc8a1ea4f571da4f6 (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>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/sram.h | 12 | ||||
-rw-r--r-- | arch/arm/plat-omap/sram.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-omap/sram.h | 107 |
3 files changed, 15 insertions, 109 deletions
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 @@ | |||
1 | int omap_sram_init(void); | ||
2 | |||
3 | extern 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" |
diff --git a/arch/arm/plat-omap/sram.h b/arch/arm/plat-omap/sram.h deleted file mode 100644 index cefda2e09869..000000000000 --- a/arch/arm/plat-omap/sram.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/sram.h | ||
3 | * | ||
4 | * Interface for functions that need to be run in internal SRAM | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ARCH_ARM_OMAP_SRAM_H | ||
12 | #define __ARCH_ARM_OMAP_SRAM_H | ||
13 | |||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <asm/fncpy.h> | ||
16 | |||
17 | int __init omap_sram_init(void); | ||
18 | |||
19 | extern 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 | |||
30 | extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); | ||
31 | |||
32 | extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | ||
33 | u32 base_cs, u32 force_unlock); | ||
34 | extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | ||
35 | u32 mem_type); | ||
36 | extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); | ||
37 | |||
38 | extern u32 omap3_configure_core_dpll( | ||
39 | u32 m2, u32 unlock_dll, u32 f, u32 inc, | ||
40 | u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, | ||
41 | u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, | ||
42 | u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, | ||
43 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); | ||
44 | extern void omap3_sram_restore_context(void); | ||
45 | |||
46 | /* Do not use these */ | ||
47 | extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); | ||
48 | extern unsigned long omap1_sram_reprogram_clock_sz; | ||
49 | |||
50 | extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl); | ||
51 | extern unsigned long omap24xx_sram_reprogram_clock_sz; | ||
52 | |||
53 | extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | ||
54 | u32 base_cs, u32 force_unlock); | ||
55 | extern unsigned long omap242x_sram_ddr_init_sz; | ||
56 | |||
57 | extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, | ||
58 | int bypass); | ||
59 | extern unsigned long omap242x_sram_set_prcm_sz; | ||
60 | |||
61 | extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | ||
62 | u32 mem_type); | ||
63 | extern unsigned long omap242x_sram_reprogram_sdrc_sz; | ||
64 | |||
65 | |||
66 | extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | ||
67 | u32 base_cs, u32 force_unlock); | ||
68 | extern unsigned long omap243x_sram_ddr_init_sz; | ||
69 | |||
70 | extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, | ||
71 | int bypass); | ||
72 | extern unsigned long omap243x_sram_set_prcm_sz; | ||
73 | |||
74 | extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | ||
75 | u32 mem_type); | ||
76 | extern unsigned long omap243x_sram_reprogram_sdrc_sz; | ||
77 | |||
78 | extern u32 omap3_sram_configure_core_dpll( | ||
79 | u32 m2, u32 unlock_dll, u32 f, u32 inc, | ||
80 | u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0, | ||
81 | u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, | ||
82 | u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, | ||
83 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); | ||
84 | extern unsigned long omap3_sram_configure_core_dpll_sz; | ||
85 | |||
86 | #ifdef CONFIG_PM | ||
87 | extern void omap_push_sram_idle(void); | ||
88 | #else | ||
89 | static inline void omap_push_sram_idle(void) {} | ||
90 | #endif /* CONFIG_PM */ | ||
91 | |||
92 | #endif /* __ASSEMBLY__ */ | ||
93 | |||
94 | /* | ||
95 | * OMAP2+: define the SRAM PA addresses. | ||
96 | * Used by the SRAM management code and the idle sleep code. | ||
97 | */ | ||
98 | #define OMAP2_SRAM_PA 0x40200000 | ||
99 | #define OMAP3_SRAM_PA 0x40200000 | ||
100 | #ifdef CONFIG_OMAP4_ERRATA_I688 | ||
101 | #define OMAP4_SRAM_PA 0x40304000 | ||
102 | #define OMAP4_SRAM_VA 0xfe404000 | ||
103 | #else | ||
104 | #define OMAP4_SRAM_PA 0x40300000 | ||
105 | #endif | ||
106 | #define AM33XX_SRAM_PA 0x40300000 | ||
107 | #endif | ||