Skip to contentSkip to conversation

mx6: Enable L2 cache support

PATCH Superseded Fabio Estevam 2 participants 2 messages Jan 28, 2014 Arm (32-bit)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mx6: Enable L2 cache support

Add L2 cache support and enable it by default.

---
Changes since v1:
- Fx typo in commit log

 arch/arm/cpu/armv7/mx6/soc.c | 22 ++++++++++++++++++++++
 include/configs/mx6_common.h |  5 +++++
 2 files changed, 27 insertions(+)
arch/arm/cpu/armv7/mx6/soc.c +22 -0
index 0208cba..5e1e5e9 100644
@@ -8,6 +8,8 @@
  */
 
 #include <common.h>
+#include <asm/armv7.h>
+#include <asm/pl310.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
@@ -336,3 +338,23 @@ void imx_setup_hdmi(void)
 	writel(reg, &mxc_ccm->chsccdr);
 }
 #endif
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define L2CACHE		1
+void v7_outer_cache_enable(void)
+{
+	struct pl310_regs *const pl310 =
+			(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	setbits_le32(&pl310->pl310_ctrl, L2CACHE);
+
+}
+
+void v7_outer_cache_disable(void)
+{
+	struct pl310_regs *const pl310 =
+			(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	clrbits_le32(&pl310->pl310_ctrl, L2CACHE);
+}
+#endif /* !CONFIG_SYS_L2CACHE_OFF */
include/configs/mx6_common.h +5 -0
index 514d634..993eca1 100644
@@ -22,4 +22,9 @@
 #define CONFIG_ARM_ERRATA_751472
 #define CONFIG_BOARD_POSTCLK_INIT
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define CONFIG_SYS_L2_PL310
+#define CONFIG_SYS_PL310_BASE          0x00A02000
+#endif
+
 #endif
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 mx6: Enable L2 cache support

Hi Fabio,

Quoted 53 lines · Fabio Estevam

Add L2 cache support and enable it by default.

---
Changes since v1:
- Fx typo in commit log

 arch/arm/cpu/armv7/mx6/soc.c | 22 ++++++++++++++++++++++
 include/configs/mx6_common.h |  5 +++++
 2 files changed, 27 insertions(+)
arch/arm/cpu/armv7/mx6/soc.c +22 -0
index 0208cba..5e1e5e9 100644
@@ -8,6 +8,8 @@
  */
 
 #include <common.h>
+#include <asm/armv7.h>
+#include <asm/pl310.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
@@ -336,3 +338,23 @@ void imx_setup_hdmi(void)
 	writel(reg, &mxc_ccm->chsccdr);
 }
 #endif
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define L2CACHE		1
+void v7_outer_cache_enable(void)
+{
+	struct pl310_regs *const pl310 =
+			(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	setbits_le32(&pl310->pl310_ctrl, L2CACHE);
+
+}
+
+void v7_outer_cache_disable(void)
+{
+	struct pl310_regs *const pl310 =
+			(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+	clrbits_le32(&pl310->pl310_ctrl, L2CACHE);
+}
+#endif /* !CONFIG_SYS_L2CACHE_OFF */
include/configs/mx6_common.h +0 -0
index 514d634..993eca1 100644

include/configs/mx6_common.h line 27

Quoted 6 lines
include/configs/mx6_common.h +3 -0
@@ -22,4 +22,9 @@
 #define CONFIG_ARM_ERRATA_751472
 #define CONFIG_BOARD_POSTCLK_INIT
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
+#define CONFIG_SYS_L2_PL310
+#define CONFIG_SYS_PL310_BASE          0x00A02000

Why is the address defined here nad not in imx_regs.h ?

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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
=====================================================================