]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm: Add ARM ERRATA 782773 workaround
authorKouei Abe <kouei.abe.cp@rms.renesas.com>
Fri, 31 Aug 2012 06:18:40 +0000 (15:18 +0900)
committerSimon Horman <horms@verge.net.au>
Fri, 28 Sep 2012 01:01:05 +0000 (10:01 +0900)
This is a workaround for Errata 782773 which effects all r0, r2 and r3
revisions.

The work-around avoids the possibility of an MMU exception in the case
where a page table walk occurs immediately after a page table update
that hasn't been flushed from the L1 data cache.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Kouei Abe <kouei.abe.cp@rms.renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---

v2
* Reword Kconfig description
* Add some details to changelog entry

arch/arm/Kconfig
arch/arm/mm/proc-v7-2level.S

index 48c19d44be9a4a9ef4db74ffadd6f0132c459546..2b76164ca269968bfa171019b6a29c7a31389be5 100644 (file)
@@ -1423,6 +1423,15 @@ config ARM_ERRATA_775420
         to deadlock. This workaround puts DSB before executing ISB if
         an abort may occur on cache maintenance.
 
+config ARM_ERRATA_782773
+       bool "ARM errata: Updating a translation entry might cause an unexpected translation fault"
+       depends on CPU_V7
+       help
+         This option enables the workaround for the 782773 Cortex-A9 (all r0,
+         r2 and r3 revisions) erratum. It might cause MMU exception in case
+         page table walk happens just after updating the existing
+         with setting page table in L1 data cache.
+
 endmenu
 
 source "arch/arm/common/Kconfig"
index fd045e706390dc0ddafb0560d2be66b1568cd69f..9207b9f6807af7bf864512796ae73cf3d5ffd038 100644 (file)
@@ -103,9 +103,17 @@ ENTRY(cpu_v7_set_pte_ext)
        tstne   r1, #L_PTE_PRESENT
        moveq   r3, #0
 
+#ifdef CONFIG_ARM_ERRATA_782773
+       mrs     r2, cpsr                        @ save cpsr
+       cpsid   if                              @ disable interrupts
+       mcr     p15, 0, r0, c7, c14, 1          @ clean & invalidate D line
+#endif
  ARM(  str     r3, [r0, #2048]! )
  THUMB(        add     r0, r0, #2048 )
  THUMB(        str     r3, [r0] )
+#ifdef CONFIG_ARM_ERRATA_782773
+       msr     cpsr_c, r2                      @ load cpsr
+#endif
        mcr     p15, 0, r0, c7, c10, 1          @ flush_pte
 #endif
        mov     pc, lr