diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2009-06-30 05:48:03 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-05-25 08:13:41 -0400 |
commit | bc6b92f8c31788a2fdc65d9be903983e5da78921 (patch) | |
tree | 644b0834cd437094ca41ddf8a3155238d8fe1512 /arch/blackfin/include | |
parent | 73ecfcf9088672220f7ca98811b2d05339c4f14c (diff) |
Blackfin: don't attempt to flush on-chip L1 SRAM regions
Since the on-chip L1 regions are not cacheable, there is no point in
trying to flush/invalidate them. Plus, older Blackfin parts like to
trigger an exception (like BF533-0.3).
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/include')
-rw-r--r-- | arch/blackfin/include/asm/cacheflush.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/arch/blackfin/include/asm/cacheflush.h b/arch/blackfin/include/asm/cacheflush.h index 77135b62818e..9a5b2c572ebf 100644 --- a/arch/blackfin/include/asm/cacheflush.h +++ b/arch/blackfin/include/asm/cacheflush.h | |||
@@ -39,8 +39,13 @@ extern void blackfin_invalidate_entire_icache(void); | |||
39 | 39 | ||
40 | static inline void flush_icache_range(unsigned start, unsigned end) | 40 | static inline void flush_icache_range(unsigned start, unsigned end) |
41 | { | 41 | { |
42 | #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) | 42 | #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) |
43 | blackfin_dcache_flush_range(start, end); | 43 | if (end <= physical_mem_end) |
44 | blackfin_dcache_flush_range(start, end); | ||
45 | #endif | ||
46 | #if defined(CONFIG_BFIN_L2_WRITEBACK) | ||
47 | if (start >= L2_START && end <= L2_START + L2_LENGTH) | ||
48 | blackfin_dcache_flush_range(start, end); | ||
44 | #endif | 49 | #endif |
45 | 50 | ||
46 | /* Make sure all write buffers in the data side of the core | 51 | /* Make sure all write buffers in the data side of the core |
@@ -52,9 +57,17 @@ static inline void flush_icache_range(unsigned start, unsigned end) | |||
52 | * the pipeline. | 57 | * the pipeline. |
53 | */ | 58 | */ |
54 | SSYNC(); | 59 | SSYNC(); |
55 | #if defined(CONFIG_BFIN_ICACHE) | 60 | #if defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) |
56 | blackfin_icache_flush_range(start, end); | 61 | if (end <= physical_mem_end) { |
57 | flush_icache_range_others(start, end); | 62 | blackfin_icache_flush_range(start, end); |
63 | flush_icache_range_others(start, end); | ||
64 | } | ||
65 | #endif | ||
66 | #if defined(CONFIG_BFIN_L2_ICACHEABLE) | ||
67 | if (start >= L2_START && end <= L2_START + L2_LENGTH) { | ||
68 | blackfin_icache_flush_range(start, end); | ||
69 | flush_icache_range_others(start, end); | ||
70 | } | ||
58 | #endif | 71 | #endif |
59 | } | 72 | } |
60 | 73 | ||