diff options
Diffstat (limited to 'arch/mn10300/mm/cache-inv-by-reg.S')
-rw-r--r-- | arch/mn10300/mm/cache-inv-by-reg.S | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/mn10300/mm/cache-inv-by-reg.S b/arch/mn10300/mm/cache-inv-by-reg.S index c8950861ed77..a60825b91e77 100644 --- a/arch/mn10300/mm/cache-inv-by-reg.S +++ b/arch/mn10300/mm/cache-inv-by-reg.S | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/cache.h> | 15 | #include <asm/cache.h> |
16 | #include <asm/irqflags.h> | 16 | #include <asm/irqflags.h> |
17 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
18 | #include "cache.inc" | ||
18 | 19 | ||
19 | #define mn10300_local_dcache_inv_range_intr_interval \ | 20 | #define mn10300_local_dcache_inv_range_intr_interval \ |
20 | +((1 << MN10300_DCACHE_INV_RANGE_INTR_LOG2_INTERVAL) - 1) | 21 | +((1 << MN10300_DCACHE_INV_RANGE_INTR_LOG2_INTERVAL) - 1) |
@@ -62,10 +63,7 @@ mn10300_local_icache_inv: | |||
62 | btst CHCTR_ICEN,d0 | 63 | btst CHCTR_ICEN,d0 |
63 | beq mn10300_local_icache_inv_end | 64 | beq mn10300_local_icache_inv_end |
64 | 65 | ||
65 | # invalidate | 66 | invalidate_icache 1 |
66 | or CHCTR_ICINV,d0 | ||
67 | movhu d0,(a0) | ||
68 | movhu (a0),d0 | ||
69 | 67 | ||
70 | mn10300_local_icache_inv_end: | 68 | mn10300_local_icache_inv_end: |
71 | ret [],0 | 69 | ret [],0 |
@@ -87,11 +85,8 @@ mn10300_local_dcache_inv: | |||
87 | btst CHCTR_DCEN,d0 | 85 | btst CHCTR_DCEN,d0 |
88 | beq mn10300_local_dcache_inv_end | 86 | beq mn10300_local_dcache_inv_end |
89 | 87 | ||
90 | # invalidate | 88 | invalidate_dcache 1 |
91 | or CHCTR_DCINV,d0 | 89 | |
92 | movhu d0,(a0) | ||
93 | movhu (a0),d0 | ||
94 | |||
95 | mn10300_local_dcache_inv_end: | 90 | mn10300_local_dcache_inv_end: |
96 | ret [],0 | 91 | ret [],0 |
97 | .size mn10300_local_dcache_inv,.-mn10300_local_dcache_inv | 92 | .size mn10300_local_dcache_inv,.-mn10300_local_dcache_inv |
@@ -121,9 +116,9 @@ mn10300_local_dcache_inv_range: | |||
121 | # and if they're not cacheline-aligned, we must flush any bits outside | 116 | # and if they're not cacheline-aligned, we must flush any bits outside |
122 | # the range that share cachelines with stuff inside the range | 117 | # the range that share cachelines with stuff inside the range |
123 | #ifdef CONFIG_MN10300_CACHE_WBACK | 118 | #ifdef CONFIG_MN10300_CACHE_WBACK |
124 | btst ~(L1_CACHE_BYTES-1),d0 | 119 | btst ~L1_CACHE_TAG_MASK,d0 |
125 | bne 1f | 120 | bne 1f |
126 | btst ~(L1_CACHE_BYTES-1),d1 | 121 | btst ~L1_CACHE_TAG_MASK,d1 |
127 | beq 2f | 122 | beq 2f |
128 | 1: | 123 | 1: |
129 | bra mn10300_local_dcache_flush_inv_range | 124 | bra mn10300_local_dcache_flush_inv_range |
@@ -141,12 +136,11 @@ mn10300_local_dcache_inv_range: | |||
141 | # writeback mode, in which case we would be in flush and invalidate by | 136 | # writeback mode, in which case we would be in flush and invalidate by |
142 | # now | 137 | # now |
143 | #ifndef CONFIG_MN10300_CACHE_WBACK | 138 | #ifndef CONFIG_MN10300_CACHE_WBACK |
144 | and L1_CACHE_TAG_ADDRESS|L1_CACHE_TAG_ENTRY,d0 # round start | 139 | and L1_CACHE_TAG_MASK,d0 # round start addr down |
145 | # addr down | ||
146 | 140 | ||
147 | mov L1_CACHE_BYTES-1,d2 | 141 | mov L1_CACHE_BYTES-1,d2 |
148 | add d2,d1 | 142 | add d2,d1 |
149 | and L1_CACHE_TAG_ADDRESS|L1_CACHE_TAG_ENTRY,d1 # round end addr up | 143 | and L1_CACHE_TAG_MASK,d1 # round end addr up |
150 | #endif /* !CONFIG_MN10300_CACHE_WBACK */ | 144 | #endif /* !CONFIG_MN10300_CACHE_WBACK */ |
151 | 145 | ||
152 | sub d0,d1,d2 # calculate the total size | 146 | sub d0,d1,d2 # calculate the total size |