Skip to contentSkip to conversation

imx6: cache: disable L2 before touching Auxiliary Control Register

PATCH New Peng Fan 2 participants 2 messages May 4, 2016

Subsystems (2)
lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 imx6: cache: disable L2 before touching Auxiliary Control Register

From: Peng Fan <[email protected]>

According PL310 TRM, Auxiliary Control Register
"
The register must be written to using a secure access, and it can be read using either a secure or a NS access. If you write to this register with a NS access, it results in a write response with a DECERR response, and the register is not updated. Writing to this register with the L2 cache enabled, that is, bit[0] of L2 Control Register set to 1, results in a SLVERR.
"

So If L2 cache is already enabled by ROM, chaning value of ACR will cause SLVERR and uboot hang.

Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/imx-common/cache.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm/imx-common/cache.c +6 -3
index 54b021c..b775488 100644
@@ -43,6 +43,12 @@ void v7_outer_cache_enable(void)
 
 
 	/*
+	 * Must disable the L2 before changing the latency parameters
+	 * and auxiliary control register.
+	 */
+	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+
+	/*
 	 * Set bit 22 in the auxiliary control register. If this bit
 	 * is cleared, PL310 treats Normal Shared Non-cacheable
 	 * accesses as Cacheable no-allocate.
@@ -59,9 +65,6 @@ void v7_outer_cache_enable(void)
 	}
 #endif
 
-	/* Must disable the L2 before changing the latency parameters */
-	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
-
 	writel(0x132, &pl310->pl310_tag_latency_ctrl);
 	writel(0x132, &pl310->pl310_data_latency_ctrl);
 
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 imx6: cache: disable L2 before touching Auxiliary Control Register

Hi Peng,

Quoted 41 lines · Peng Fan

From: Peng Fan <[email protected]>

According PL310 TRM, Auxiliary Control Register
"
The register must be written to using a secure access, and it can be read using either a secure or a NS access. If you write to this register with a NS access, it results in a write response with a DECERR response, and the register is not updated. Writing to this register with the L2 cache enabled, that is, bit[0] of L2 Control Register set to 1, results in a SLVERR.
"

So If L2 cache is already enabled by ROM, chaning value of ACR will cause SLVERR and uboot hang.

Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/imx-common/cache.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/arm/imx-common/cache.c +6 -0
index 54b021c..b775488 100644
@@ -43,6 +43,12 @@ void v7_outer_cache_enable(void)
 
 
 	/*
+	 * Must disable the L2 before changing the latency parameters
+	 * and auxiliary control register.
+	 */
+	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+
+	/*
 	 * Set bit 22 in the auxiliary control register. If this bit
 	 * is cleared, PL310 treats Normal Shared Non-cacheable
 	 * accesses as Cacheable no-allocate.

arch/arm/imx-common/cache.c void v7_outer_cache_enable(void) · line 70

Quoted 9 lines
arch/arm/imx-common/cache.c +0 -3
@@ -59,9 +65,6 @@ void v7_outer_cache_enable(void)
 	}
 #endif
 
-	/* Must disable the L2 before changing the latency parameters */
-	clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
-
 	writel(0x132, &pl310->pl310_tag_latency_ctrl);
 	writel(0x132, &pl310->pl310_data_latency_ctrl);
 

It should be fine to have in release, I think.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================