diff options
Diffstat (limited to 'arch/arm/mm/cache-v6.S')
-rw-r--r-- | arch/arm/mm/cache-v6.S | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index 86aa689ef1aa..99fa688dfadd 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -21,18 +21,22 @@ | |||
21 | #define D_CACHE_LINE_SIZE 32 | 21 | #define D_CACHE_LINE_SIZE 32 |
22 | #define BTB_FLUSH_SIZE 8 | 22 | #define BTB_FLUSH_SIZE 8 |
23 | 23 | ||
24 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
25 | /* | 24 | /* |
26 | * Invalidate the entire I cache (this code is a workaround for the ARM1136 | 25 | * v6_flush_icache_all() |
27 | * erratum 411920 - Invalidate Instruction Cache operation can fail. This | 26 | * |
28 | * erratum is present in 1136, 1156 and 1176. It does not affect the MPCore. | 27 | * Flush the whole I-cache. |
29 | * | 28 | * |
30 | * Registers: | 29 | * ARM1136 erratum 411920 - Invalidate Instruction Cache operation can fail. |
31 | * r0 - set to 0 | 30 | * This erratum is present in 1136, 1156 and 1176. It does not affect the |
32 | * r1 - corrupted | 31 | * MPCore. |
32 | * | ||
33 | * Registers: | ||
34 | * r0 - set to 0 | ||
35 | * r1 - corrupted | ||
33 | */ | 36 | */ |
34 | ENTRY(v6_icache_inval_all) | 37 | ENTRY(v6_flush_icache_all) |
35 | mov r0, #0 | 38 | mov r0, #0 |
39 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
36 | mrs r1, cpsr | 40 | mrs r1, cpsr |
37 | cpsid ifa @ disable interrupts | 41 | cpsid ifa @ disable interrupts |
38 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | 42 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache |
@@ -43,8 +47,11 @@ ENTRY(v6_icache_inval_all) | |||
43 | .rept 11 @ ARM Ltd recommends at least | 47 | .rept 11 @ ARM Ltd recommends at least |
44 | nop @ 11 NOPs | 48 | nop @ 11 NOPs |
45 | .endr | 49 | .endr |
46 | mov pc, lr | 50 | #else |
51 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I-cache | ||
47 | #endif | 52 | #endif |
53 | mov pc, lr | ||
54 | ENDPROC(v6_flush_icache_all) | ||
48 | 55 | ||
49 | /* | 56 | /* |
50 | * v6_flush_cache_all() | 57 | * v6_flush_cache_all() |
@@ -60,7 +67,7 @@ ENTRY(v6_flush_kern_cache_all) | |||
60 | #ifndef CONFIG_ARM_ERRATA_411920 | 67 | #ifndef CONFIG_ARM_ERRATA_411920 |
61 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 68 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
62 | #else | 69 | #else |
63 | b v6_icache_inval_all | 70 | b v6_flush_icache_all |
64 | #endif | 71 | #endif |
65 | #else | 72 | #else |
66 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate | 73 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate |
@@ -138,7 +145,7 @@ ENTRY(v6_coherent_user_range) | |||
138 | #ifndef CONFIG_ARM_ERRATA_411920 | 145 | #ifndef CONFIG_ARM_ERRATA_411920 |
139 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 146 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
140 | #else | 147 | #else |
141 | b v6_icache_inval_all | 148 | b v6_flush_icache_all |
142 | #endif | 149 | #endif |
143 | #else | 150 | #else |
144 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB | 151 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB |
@@ -312,6 +319,7 @@ ENDPROC(v6_dma_unmap_area) | |||
312 | 319 | ||
313 | .type v6_cache_fns, #object | 320 | .type v6_cache_fns, #object |
314 | ENTRY(v6_cache_fns) | 321 | ENTRY(v6_cache_fns) |
322 | .long v6_flush_icache_all | ||
315 | .long v6_flush_kern_cache_all | 323 | .long v6_flush_kern_cache_all |
316 | .long v6_flush_user_cache_all | 324 | .long v6_flush_user_cache_all |
317 | .long v6_flush_user_cache_range | 325 | .long v6_flush_user_cache_range |