Skip to content

Commit

Permalink
[ARM] Kirkwood: invalidate L2 cache before enabling it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maxime Bizon authored and Nicolas Pitre committed Mar 29, 2009
1 parent c31f403 commit d75de08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mm/cache-feroceon-l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ static inline void l2_inv_pa_range(unsigned long start, unsigned long end)
raw_local_irq_restore(flags);
}

static inline void l2_inv_all(void)
{
__asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0));
}

/*
* Linux primitives.
Expand Down Expand Up @@ -321,6 +325,7 @@ static void __init enable_l2(void)

d = flush_and_disable_dcache();
i = invalidate_and_disable_icache();
l2_inv_all();
write_extra_features(u | 0x00400000);
if (i)
enable_icache();
Expand Down

0 comments on commit d75de08

Please sign in to comment.