diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-01-08 01:48:58 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-01-16 09:35:24 -0500 |
commit | 944e9df1d4f71f946aa044abc00726346e3c597c (patch) | |
tree | 4147cd8119e00a3311c09d62f7dff9c70301cd49 | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) |
ARM: 8257/1: OMAP2+: use common l2cache initialization code
This patch implements generic DT L2C initialisation (the one from
init_IRQ in arch/arm/kernel/irq.c) for Omap4 and AM43 platforms and
kills the SoC specific stuff in arch/arm/mach-omap2/omap4-common.c.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Nishanth Menon <nm@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 16 |
3 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 608079a1aba6..c5c480b76da5 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -171,6 +171,9 @@ static const char *const omap4_boards_compat[] __initconst = { | |||
171 | }; | 171 | }; |
172 | 172 | ||
173 | DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") | 173 | DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") |
174 | .l2c_aux_val = OMAP_L2C_AUX_CTRL, | ||
175 | .l2c_aux_mask = 0xcf9fffff, | ||
176 | .l2c_write_sec = omap4_l2c310_write_sec, | ||
174 | .reserve = omap_reserve, | 177 | .reserve = omap_reserve, |
175 | .smp = smp_ops(omap4_smp_ops), | 178 | .smp = smp_ops(omap4_smp_ops), |
176 | .map_io = omap4_map_io, | 179 | .map_io = omap4_map_io, |
@@ -214,6 +217,9 @@ static const char *const am43_boards_compat[] __initconst = { | |||
214 | }; | 217 | }; |
215 | 218 | ||
216 | DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") | 219 | DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") |
220 | .l2c_aux_val = OMAP_L2C_AUX_CTRL, | ||
221 | .l2c_aux_mask = 0xcf9fffff, | ||
222 | .l2c_write_sec = omap4_l2c310_write_sec, | ||
217 | .map_io = am33xx_map_io, | 223 | .map_io = am33xx_map_io, |
218 | .init_early = am43xx_init_early, | 224 | .init_early = am43xx_init_early, |
219 | .init_late = am43xx_init_late, | 225 | .init_late = am43xx_init_late, |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 377eea849e7b..2610c9f8d29f 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/irqchip/irq-omap-intc.h> | 35 | #include <linux/irqchip/irq-omap-intc.h> |
36 | 36 | ||
37 | #include <asm/proc-fns.h> | 37 | #include <asm/proc-fns.h> |
38 | #include <asm/hardware/cache-l2x0.h> | ||
38 | 39 | ||
39 | #include "i2c.h" | 40 | #include "i2c.h" |
40 | #include "serial.h" | 41 | #include "serial.h" |
@@ -94,11 +95,18 @@ extern void omap3_gptimer_timer_init(void); | |||
94 | extern void omap4_local_timer_init(void); | 95 | extern void omap4_local_timer_init(void); |
95 | #ifdef CONFIG_CACHE_L2X0 | 96 | #ifdef CONFIG_CACHE_L2X0 |
96 | int omap_l2_cache_init(void); | 97 | int omap_l2_cache_init(void); |
98 | #define OMAP_L2C_AUX_CTRL (L2C_AUX_CTRL_SHARED_OVERRIDE | \ | ||
99 | L310_AUX_CTRL_DATA_PREFETCH | \ | ||
100 | L310_AUX_CTRL_INSTR_PREFETCH) | ||
101 | void omap4_l2c310_write_sec(unsigned long val, unsigned reg); | ||
97 | #else | 102 | #else |
98 | static inline int omap_l2_cache_init(void) | 103 | static inline int omap_l2_cache_init(void) |
99 | { | 104 | { |
100 | return 0; | 105 | return 0; |
101 | } | 106 | } |
107 | |||
108 | #define OMAP_L2C_AUX_CTRL 0 | ||
109 | #define omap4_l2c310_write_sec NULL | ||
102 | #endif | 110 | #endif |
103 | extern void omap5_realtime_timer_init(void); | 111 | extern void omap5_realtime_timer_init(void); |
104 | 112 | ||
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index b7cb44abe49b..fe99ceff2e2d 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -166,7 +166,7 @@ void __iomem *omap4_get_l2cache_base(void) | |||
166 | return l2cache_base; | 166 | return l2cache_base; |
167 | } | 167 | } |
168 | 168 | ||
169 | static void omap4_l2c310_write_sec(unsigned long val, unsigned reg) | 169 | void omap4_l2c310_write_sec(unsigned long val, unsigned reg) |
170 | { | 170 | { |
171 | unsigned smc_op; | 171 | unsigned smc_op; |
172 | 172 | ||
@@ -201,24 +201,10 @@ static void omap4_l2c310_write_sec(unsigned long val, unsigned reg) | |||
201 | 201 | ||
202 | int __init omap_l2_cache_init(void) | 202 | int __init omap_l2_cache_init(void) |
203 | { | 203 | { |
204 | u32 aux_ctrl; | ||
205 | |||
206 | /* Static mapping, never released */ | 204 | /* Static mapping, never released */ |
207 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); | 205 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); |
208 | if (WARN_ON(!l2cache_base)) | 206 | if (WARN_ON(!l2cache_base)) |
209 | return -ENOMEM; | 207 | return -ENOMEM; |
210 | |||
211 | /* 16-way associativity, parity disabled, way size - 64KB (es2.0 +) */ | ||
212 | aux_ctrl = L2C_AUX_CTRL_SHARED_OVERRIDE | | ||
213 | L310_AUX_CTRL_DATA_PREFETCH | | ||
214 | L310_AUX_CTRL_INSTR_PREFETCH; | ||
215 | |||
216 | outer_cache.write_sec = omap4_l2c310_write_sec; | ||
217 | if (of_have_populated_dt()) | ||
218 | l2x0_of_init(aux_ctrl, 0xcf9fffff); | ||
219 | else | ||
220 | l2x0_init(l2cache_base, aux_ctrl, 0xcf9fffff); | ||
221 | |||
222 | return 0; | 208 | return 0; |
223 | } | 209 | } |
224 | #endif | 210 | #endif |