diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 01:57:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 01:57:44 -0400 |
commit | 298476220d1f793ca0ac6c9e5dc817e1ad3e9851 (patch) | |
tree | 59cff744ad1837844cb7a5a43a0623d39058fb44 /arch/sh/mm/cache-sh4.c | |
parent | 749cf486920bf53f16e6a6889d9635a91ffb6c82 (diff) |
sh: Add control register barriers.
Currently when making changes to control registers, we
typically need some time for changes to take effect (8
nops, generally). However, for sh4a we simply need to
do an icbi..
This is a simple patch for implementing a general purpose
ctrl_barrier() which functions as a control register write
barrier. There's some additional documentation in the patch
itself, but it's pretty self explanatory.
There were also some places where we were not doing the
barrier, which didn't seem to have any adverse effects on
legacy parts, but certainly did on sh4a. It's safer to have
the barrier in place for legacy parts as well in these cases,
though this does make flush_tlb_all() more expensive (by an
order of 8 nops). We can ifdef around the flush_tlb_all()
case for now if it's clear that all legacy parts won't have
a problem with this.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/cache-sh4.c')
-rw-r--r-- | arch/sh/mm/cache-sh4.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index c036c2b4ac2b..2203bd6aadb3 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -269,6 +269,11 @@ static inline void flush_icache_all(void) | |||
269 | ccr |= CCR_CACHE_ICI; | 269 | ccr |= CCR_CACHE_ICI; |
270 | ctrl_outl(ccr, CCR); | 270 | ctrl_outl(ccr, CCR); |
271 | 271 | ||
272 | /* | ||
273 | * back_to_P1() will take care of the barrier for us, don't add | ||
274 | * another one! | ||
275 | */ | ||
276 | |||
272 | back_to_P1(); | 277 | back_to_P1(); |
273 | local_irq_restore(flags); | 278 | local_irq_restore(flags); |
274 | } | 279 | } |