aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/cache-feroceon-l2.c
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2009-03-27 13:42:19 -0400
committerNicolas Pitre <nico@cam.org>2009-03-28 22:39:30 -0400
commitd75de08727018659cd7e060cf0018eaf53e49aaf (patch)
tree355e43af6605aeff23102af26615c9a679306407 /arch/arm/mm/cache-feroceon-l2.c
parentc31f403de62415c738ddc9e673cf8e722c82f861 (diff)
[ARM] Kirkwood: invalidate L2 cache before enabling it
I get random oopses on my Kirkwood board at startup when L2 cache is enabled. FYI I'm using Marvell uboot version 3.4.16 Each boot produces the same oops, but anything that changes the kernel size (even only changing initramfs) makes the oops different. I noticed that nothing invalidates the L2 cache before enabling it, doing so fixes my problem. Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mm/cache-feroceon-l2.c')
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index d6dd83826f8a..1afed5068c2d 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -115,6 +115,10 @@ static inline void l2_inv_pa_range(unsigned long start, unsigned long end)
115 raw_local_irq_restore(flags); 115 raw_local_irq_restore(flags);
116} 116}
117 117
118static inline void l2_inv_all(void)
119{
120 __asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0));
121}
118 122
119/* 123/*
120 * Linux primitives. 124 * Linux primitives.
@@ -321,6 +325,7 @@ static void __init enable_l2(void)
321 325
322 d = flush_and_disable_dcache(); 326 d = flush_and_disable_dcache();
323 i = invalidate_and_disable_icache(); 327 i = invalidate_and_disable_icache();
328 l2_inv_all();
324 write_extra_features(u | 0x00400000); 329 write_extra_features(u | 0x00400000);
325 if (i) 330 if (i)
326 enable_icache(); 331 enable_icache();