Skip to contentSkip to conversation

ARM: imx: armadillo5x0: Fix illegal register access

PATCH Superseded Fabio Estevam 2 participants 2 messages Sep 15, 2012

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 ARM: imx: armadillo5x0: Fix illegal register access

From: Fabio Estevam <[email protected]>

commit 0c8bad6a(Armadillo 500 add NAND flash device support (resend).) introduced an incorrect access to MXC_CCM_RCSR.

MXC_CCM_RCSR is an offset and in order to properly access this register, the mx3_ccm_base needs to be passed, otherwise an illegal access is done.

---
 arch/arm/mach-imx/mach-armadillo5x0.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mach-armadillo5x0.c +2 -1
index 2c6ab32..d22e8cc 100644
@@ -526,7 +526,8 @@ static void __init armadillo5x0_init(void)
 	imx31_add_mxc_nand(&armadillo5x0_nand_board_info);
 
 	/* set NAND page size to 2k if not configured via boot mode pins */
-	__raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
+	__raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) |
+						(1 << 30), MXC_CCM_RCSR);
 
 	/* RTC */
 	/* Get RTC IRQ and register the chip */
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: imx: armadillo5x0: Fix illegal register access

arch/arm/mach-imx/mach-armadillo5x0.c static void __init armadillo5x0_init(void) · line 532

Quoted 7 lines · Fabio Estevam
        /* set NAND page size to 2k if not configured via boot mode pins */
arch/arm/mach-imx/mach-armadillo5x0.c +2 -1
-       __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
+       __raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) |
+                                               (1 << 30), MXC_CCM_RCSR);
 
        /* RTC */

Shouldn't you change both the read and the write here, rather than just the read?

Arnd