Patchwork [U-Boot] mx6: Add workaround for ARM errata

login
register
mail settings
Submitter Fabio Estevam
Date Jan. 5, 2013, 12:29 a.m.
Message ID <1357345761-26969-1-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/209580/
State Changes Requested
Headers show

Comments

Fabio Estevam - Jan. 5, 2013, 12:29 a.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

Add workaround for the following ARM errata: 743622 and 751472.

The motivation for this change is the following kernel commit 62e4d357a 
(ARM: 7609/1: disable errata work-arounds which access
secure registers), which removes the errata from multiplatform kernel.

Since imx has been converted to multiplatform in the kernel, we need to apply
such workaround into the bootloader.

Workaround code has been taken from arch/arm/mm/proc-v7.S from 3.7.1 kernel.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Following patch has been proposed into arm kernel mailing list:
http://www.spinics.net/lists/arm-kernel/msg214840.html

 arch/arm/cpu/armv7/mx6/lowlevel_init.S |   10 ++++++++++
 1 file changed, 10 insertions(+)

Patch

diff --git a/arch/arm/cpu/armv7/mx6/lowlevel_init.S b/arch/arm/cpu/armv7/mx6/lowlevel_init.S
index acadef2..bf06152 100644
--- a/arch/arm/cpu/armv7/mx6/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/mx6/lowlevel_init.S
@@ -20,6 +20,16 @@ 
 
 #include <linux/linkage.h>
 
+.macro init_arm_errata
+	/* ARM erratum ID #743622 */
+	mrceq	p15, 0, r10, c15, c0, 1		/* read diagnostic register */
+	orreq	r10, r10, #1 << 6		/* set bit #6 */
+	/* ARM erratum ID #751472 */
+	orrlt	r10, r10, #1 << 11		/* set bit #11 */
+	mcrlt	p15, 0, r10, c15, c0, 1		/* write diagnostic register */
+.endm
+
 ENTRY(lowlevel_init)
+	init_arm_errata
 	mov pc, lr
 ENDPROC(lowlevel_init)