diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2007-11-26 17:40:01 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-01-29 05:14:57 -0500 |
commit | e9c33572a92aa2ee565da5136745ea304ac23d9a (patch) | |
tree | c2a56008c9205540438352363fbcfea593019741 | |
parent | 87353d8ac39c52784da605ecbe965ecdfad609ad (diff) |
[MIPS] Use real cache invalidate
R10k non coherent machines need a real dma cache invalidate to get rid of
speculative stores in cache. For other machines this promises a slight
speedup.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/mm/c-r4k.c | 4 | ||||
-rw-r--r-- | include/asm-mips/r4kcache.h | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index c91b59680695..06074948450d 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -589,7 +589,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||
589 | if (size >= scache_size) | 589 | if (size >= scache_size) |
590 | r4k_blast_scache(); | 590 | r4k_blast_scache(); |
591 | else | 591 | else |
592 | blast_scache_range(addr, addr + size); | 592 | blast_inv_scache_range(addr, addr + size); |
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | 595 | ||
@@ -597,7 +597,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||
597 | r4k_blast_dcache(); | 597 | r4k_blast_dcache(); |
598 | } else { | 598 | } else { |
599 | R4600_HIT_CACHEOP_WAR_IMPL; | 599 | R4600_HIT_CACHEOP_WAR_IMPL; |
600 | blast_dcache_range(addr, addr + size); | 600 | blast_inv_dcache_range(addr, addr + size); |
601 | } | 601 | } |
602 | 602 | ||
603 | bc_inv(addr, size); | 603 | bc_inv(addr, size); |
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h index 2b8466ffd3ca..4c140db36786 100644 --- a/include/asm-mips/r4kcache.h +++ b/include/asm-mips/r4kcache.h | |||
@@ -403,6 +403,13 @@ __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) | |||
403 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) | 403 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) |
404 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) | 404 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) |
405 | 405 | ||
406 | __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16) | ||
407 | __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32) | ||
408 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16) | ||
409 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32) | ||
410 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64) | ||
411 | __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128) | ||
412 | |||
406 | /* build blast_xxx_range, protected_blast_xxx_range */ | 413 | /* build blast_xxx_range, protected_blast_xxx_range */ |
407 | #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \ | 414 | #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \ |
408 | static inline void prot##blast_##pfx##cache##_range(unsigned long start, \ | 415 | static inline void prot##blast_##pfx##cache##_range(unsigned long start, \ |