diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-02 19:40:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-02 19:40:20 -0400 |
commit | 2142babac999a5ba169348892a8e3ac222bec7a4 (patch) | |
tree | eb862396a9864b34e2335b7cc0c6114c56f9ec1a /arch/arm/mm | |
parent | bb402c4fb5bba4edf5b8c72b3db8760e60df4876 (diff) | |
parent | 0516e4643cd22fc9f535aef02ad1de66c382c93b (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: (45 commits)
[ARM] 5489/1: ARM errata: Data written to the L2 cache can be overwritten with stale data
[ARM] 5490/1: ARM errata: Processor deadlock when a false hazard is created
[ARM] 5487/1: ARM errata: Stale prediction on replaced interworking branch
[ARM] 5488/1: ARM errata: Invalidation of the Instruction Cache operation can fail
davinci: DM644x: NAND: update partitioning
davinci: update DM644x support in preparation for more SoCs
davinci: DM644x: rename board file
davinci: update pin-multiplexing support
davinci: serial: generalize for more SoCs
davinci: DM355 IRQ Definitions
davinci: DM646x: add interrupt number and priorities
davinci: PSC: Clear bits in MDCTL reg before setting new bits
davinci: gpio bugfixes
davinci: add EDMA driver
davinci: timers: use clk_get_rate()
[ARM] pxa/littleton: add missing da9034 touchscreen support
[ARM] pxa/zylonite: configure GPIO18/19 correctly, used by 2 GPIO expanders
[ARM] pxa/zylonite: fix the issue of unused SDATA_IN_1 pin get AC97 not working
[ARM] pxa: make ads7846 on corgi and spitz to sync on HSYNC
[ARM] pxa: remove unused CPU_FREQ_PXA Kconfig symbol
...
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/cache-v6.S | 33 | ||||
-rw-r--r-- | arch/arm/mm/flush.c | 23 | ||||
-rw-r--r-- | arch/arm/mm/proc-v7.S | 19 |
3 files changed, 73 insertions, 2 deletions
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index 2c6c2a7c05a0..8f5c13f4c936 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -20,6 +20,31 @@ | |||
20 | #define D_CACHE_LINE_SIZE 32 | 20 | #define D_CACHE_LINE_SIZE 32 |
21 | #define BTB_FLUSH_SIZE 8 | 21 | #define BTB_FLUSH_SIZE 8 |
22 | 22 | ||
23 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
24 | /* | ||
25 | * Invalidate the entire I cache (this code is a workaround for the ARM1136 | ||
26 | * erratum 411920 - Invalidate Instruction Cache operation can fail. This | ||
27 | * erratum is present in 1136, 1156 and 1176. It does not affect the MPCore. | ||
28 | * | ||
29 | * Registers: | ||
30 | * r0 - set to 0 | ||
31 | * r1 - corrupted | ||
32 | */ | ||
33 | ENTRY(v6_icache_inval_all) | ||
34 | mov r0, #0 | ||
35 | mrs r1, cpsr | ||
36 | cpsid ifa @ disable interrupts | ||
37 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
38 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
39 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
40 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
41 | msr cpsr_cx, r1 @ restore interrupts | ||
42 | .rept 11 @ ARM Ltd recommends at least | ||
43 | nop @ 11 NOPs | ||
44 | .endr | ||
45 | mov pc, lr | ||
46 | #endif | ||
47 | |||
23 | /* | 48 | /* |
24 | * v6_flush_cache_all() | 49 | * v6_flush_cache_all() |
25 | * | 50 | * |
@@ -31,8 +56,12 @@ ENTRY(v6_flush_kern_cache_all) | |||
31 | mov r0, #0 | 56 | mov r0, #0 |
32 | #ifdef HARVARD_CACHE | 57 | #ifdef HARVARD_CACHE |
33 | mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate | 58 | mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate |
59 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
34 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 60 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
35 | #else | 61 | #else |
62 | b v6_icache_inval_all | ||
63 | #endif | ||
64 | #else | ||
36 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate | 65 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate |
37 | #endif | 66 | #endif |
38 | mov pc, lr | 67 | mov pc, lr |
@@ -103,8 +132,12 @@ ENTRY(v6_coherent_user_range) | |||
103 | mov r0, #0 | 132 | mov r0, #0 |
104 | #ifdef HARVARD_CACHE | 133 | #ifdef HARVARD_CACHE |
105 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 134 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
135 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
106 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 136 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
107 | #else | 137 | #else |
138 | b v6_icache_inval_all | ||
139 | #endif | ||
140 | #else | ||
108 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB | 141 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB |
109 | #endif | 142 | #endif |
110 | mov pc, lr | 143 | mov pc, lr |
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 4e283481cee1..c07222eb5ce0 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c | |||
@@ -18,6 +18,10 @@ | |||
18 | 18 | ||
19 | #include "mm.h" | 19 | #include "mm.h" |
20 | 20 | ||
21 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
22 | extern void v6_icache_inval_all(void); | ||
23 | #endif | ||
24 | |||
21 | #ifdef CONFIG_CPU_CACHE_VIPT | 25 | #ifdef CONFIG_CPU_CACHE_VIPT |
22 | 26 | ||
23 | #define ALIAS_FLUSH_START 0xffff4000 | 27 | #define ALIAS_FLUSH_START 0xffff4000 |
@@ -32,10 +36,15 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr) | |||
32 | 36 | ||
33 | asm( "mcrr p15, 0, %1, %0, c14\n" | 37 | asm( "mcrr p15, 0, %1, %0, c14\n" |
34 | " mcr p15, 0, %2, c7, c10, 4\n" | 38 | " mcr p15, 0, %2, c7, c10, 4\n" |
39 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
35 | " mcr p15, 0, %2, c7, c5, 0\n" | 40 | " mcr p15, 0, %2, c7, c5, 0\n" |
41 | #endif | ||
36 | : | 42 | : |
37 | : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) | 43 | : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) |
38 | : "cc"); | 44 | : "cc"); |
45 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
46 | v6_icache_inval_all(); | ||
47 | #endif | ||
39 | } | 48 | } |
40 | 49 | ||
41 | void flush_cache_mm(struct mm_struct *mm) | 50 | void flush_cache_mm(struct mm_struct *mm) |
@@ -48,11 +57,16 @@ void flush_cache_mm(struct mm_struct *mm) | |||
48 | 57 | ||
49 | if (cache_is_vipt_aliasing()) { | 58 | if (cache_is_vipt_aliasing()) { |
50 | asm( "mcr p15, 0, %0, c7, c14, 0\n" | 59 | asm( "mcr p15, 0, %0, c7, c14, 0\n" |
60 | " mcr p15, 0, %0, c7, c10, 4\n" | ||
61 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
51 | " mcr p15, 0, %0, c7, c5, 0\n" | 62 | " mcr p15, 0, %0, c7, c5, 0\n" |
52 | " mcr p15, 0, %0, c7, c10, 4" | 63 | #endif |
53 | : | 64 | : |
54 | : "r" (0) | 65 | : "r" (0) |
55 | : "cc"); | 66 | : "cc"); |
67 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
68 | v6_icache_inval_all(); | ||
69 | #endif | ||
56 | } | 70 | } |
57 | } | 71 | } |
58 | 72 | ||
@@ -67,11 +81,16 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned | |||
67 | 81 | ||
68 | if (cache_is_vipt_aliasing()) { | 82 | if (cache_is_vipt_aliasing()) { |
69 | asm( "mcr p15, 0, %0, c7, c14, 0\n" | 83 | asm( "mcr p15, 0, %0, c7, c14, 0\n" |
84 | " mcr p15, 0, %0, c7, c10, 4\n" | ||
85 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
70 | " mcr p15, 0, %0, c7, c5, 0\n" | 86 | " mcr p15, 0, %0, c7, c5, 0\n" |
71 | " mcr p15, 0, %0, c7, c10, 4" | 87 | #endif |
72 | : | 88 | : |
73 | : "r" (0) | 89 | : "r" (0) |
74 | : "cc"); | 90 | : "cc"); |
91 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
92 | v6_icache_inval_all(); | ||
93 | #endif | ||
75 | } | 94 | } |
76 | } | 95 | } |
77 | 96 | ||
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index c221e26ac1d3..3397f1e64d76 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -96,6 +96,9 @@ ENTRY(cpu_v7_switch_mm) | |||
96 | mov r2, #0 | 96 | mov r2, #0 |
97 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id | 97 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id |
98 | orr r0, r0, #TTB_FLAGS | 98 | orr r0, r0, #TTB_FLAGS |
99 | #ifdef CONFIG_ARM_ERRATA_430973 | ||
100 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB | ||
101 | #endif | ||
99 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | 102 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID |
100 | isb | 103 | isb |
101 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 104 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
@@ -181,6 +184,22 @@ __v7_setup: | |||
181 | stmia r12, {r0-r5, r7, r9, r11, lr} | 184 | stmia r12, {r0-r5, r7, r9, r11, lr} |
182 | bl v7_flush_dcache_all | 185 | bl v7_flush_dcache_all |
183 | ldmia r12, {r0-r5, r7, r9, r11, lr} | 186 | ldmia r12, {r0-r5, r7, r9, r11, lr} |
187 | #ifdef CONFIG_ARM_ERRATA_430973 | ||
188 | mrc p15, 0, r10, c1, c0, 1 @ read aux control register | ||
189 | orr r10, r10, #(1 << 6) @ set IBE to 1 | ||
190 | mcr p15, 0, r10, c1, c0, 1 @ write aux control register | ||
191 | #endif | ||
192 | #ifdef CONFIG_ARM_ERRATA_458693 | ||
193 | mrc p15, 0, r10, c1, c0, 1 @ read aux control register | ||
194 | orr r10, r10, #(1 << 5) @ set L1NEON to 1 | ||
195 | orr r10, r10, #(1 << 9) @ set PLDNOP to 1 | ||
196 | mcr p15, 0, r10, c1, c0, 1 @ write aux control register | ||
197 | #endif | ||
198 | #ifdef CONFIG_ARM_ERRATA_460075 | ||
199 | mrc p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register | ||
200 | orr r10, r10, #(1 << 22) @ set the Write Allocate disable bit | ||
201 | mcr p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register | ||
202 | #endif | ||
184 | mov r10, #0 | 203 | mov r10, #0 |
185 | #ifdef HARVARD_CACHE | 204 | #ifdef HARVARD_CACHE |
186 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 205 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |