aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-v7.S
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-01 07:50:33 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-02 17:36:20 -0400
commit1946d6ef9d7bd4ba97094fe6eb68a9b877bde6b7 (patch)
treed6cb6a56623d39021e30bb6d1892bfda7edb123a /arch/arm/mm/proc-v7.S
parenteb5f4ca9536ba297c98721ecbbdf41ec5b987bd5 (diff)
[ARM] ARMv7 errata: only apply fixes when running on applicable CPU
Currently, whenever an erratum workaround is enabled, it will be applied whether or not the erratum is relevent for the CPU. This patch changes this - we check the variant and revision fields in the main ID register to determine which errata to apply. We also avoid re-applying erratum 460075 if it has already been applied. Applying this fix in non-secure mode results in the kernel failing to boot (or even do anything.) This fixes booting on some ARMv7 based platforms which otherwise silently fail. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r--arch/arm/mm/proc-v7.S36
1 files changed, 25 insertions, 11 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 3397f1e64d76..a08d9d2380d3 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -184,23 +184,37 @@ __v7_setup:
184 stmia r12, {r0-r5, r7, r9, r11, lr} 184 stmia r12, {r0-r5, r7, r9, r11, lr}
185 bl v7_flush_dcache_all 185 bl v7_flush_dcache_all
186 ldmia r12, {r0-r5, r7, r9, r11, lr} 186 ldmia r12, {r0-r5, r7, r9, r11, lr}
187
188 mrc p15, 0, r0, c0, c0, 0 @ read main ID register
189 and r10, r0, #0xff000000 @ ARM?
190 teq r10, #0x41000000
191 bne 2f
192 and r5, r0, #0x00f00000 @ variant
193 and r6, r0, #0x0000000f @ revision
194 orr r0, r6, r5, lsr #20-4 @ combine variant and revision
195
187#ifdef CONFIG_ARM_ERRATA_430973 196#ifdef CONFIG_ARM_ERRATA_430973
188 mrc p15, 0, r10, c1, c0, 1 @ read aux control register 197 teq r5, #0x00100000 @ only present in r1p*
189 orr r10, r10, #(1 << 6) @ set IBE to 1 198 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register
190 mcr p15, 0, r10, c1, c0, 1 @ write aux control register 199 orreq r10, r10, #(1 << 6) @ set IBE to 1
200 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register
191#endif 201#endif
192#ifdef CONFIG_ARM_ERRATA_458693 202#ifdef CONFIG_ARM_ERRATA_458693
193 mrc p15, 0, r10, c1, c0, 1 @ read aux control register 203 teq r0, #0x20 @ only present in r2p0
194 orr r10, r10, #(1 << 5) @ set L1NEON to 1 204 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register
195 orr r10, r10, #(1 << 9) @ set PLDNOP to 1 205 orreq r10, r10, #(1 << 5) @ set L1NEON to 1
196 mcr p15, 0, r10, c1, c0, 1 @ write aux control register 206 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1
207 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register
197#endif 208#endif
198#ifdef CONFIG_ARM_ERRATA_460075 209#ifdef CONFIG_ARM_ERRATA_460075
199 mrc p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register 210 teq r0, #0x20 @ only present in r2p0
200 orr r10, r10, #(1 << 22) @ set the Write Allocate disable bit 211 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register
201 mcr p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register 212 tsteq r10, #1 << 22
213 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit
214 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register
202#endif 215#endif
203 mov r10, #0 216
2172: mov r10, #0
204#ifdef HARVARD_CACHE 218#ifdef HARVARD_CACHE
205 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate 219 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
206#endif 220#endif