diff mbox

[v3] ARM: imx: armadillo5x0: Fix illegal register access

Message ID 1347845315-16565-1-git-send-email-festevam@gmail.com
State New
Headers show

Commit Message

Fabio Estevam Sept. 17, 2012, 1:28 a.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

Since commit eb92044eb (ARM i.MX3: Make ccm base address a variable )
it is necessary to pass the CCM register base as a variable.

Fix the CCM register access in mach-armadillo5x0 by passing mx3_ccm_base and 
avoid illegal accesses.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Indicate the correct commit that caused the issue
Changes since v1:
- Also fixes the write part.

 arch/arm/mach-imx/mach-armadillo5x0.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Arnd Bergmann Sept. 17, 2012, 2:50 p.m. UTC | #1
On Monday 17 September 2012, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Since commit eb92044eb (ARM i.MX3: Make ccm base address a variable )
> it is necessary to pass the CCM register base as a variable.
> 
> Fix the CCM register access in mach-armadillo5x0 by passing mx3_ccm_base and 
> avoid illegal accesses.
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

I think you should probably add a "Cc: stable@vger.kernel.org" tag as
well to ensure it gets applied on longterm kernels, and it would be
good to mention how far back it needs to be applied (v3.4, v3.5, v3.6?)
so we don't accidentally get it on an older kernel that breaks from
this patch.

	Arnd
diff mbox

Patch

diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 2c6ab32..9f39f7e 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -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), mx3_ccm_base + MXC_CCM_RCSR);
 
 	/* RTC */
 	/* Get RTC IRQ and register the chip */