[PATCH] cache:L2: Provide *_cache_{enable|disable} function calls

Lukasz Majewski l.majewski at samsung.com
Thu Aug 9 16:29:31 CEST 2012


It seems like L2 is enabled, but more investigation on its configuration
is needed

Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
---
 arch/arm/cpu/armv7/exynos/soc.c |   12 ++++++++++++
 arch/arm/include/asm/pl310.h    |    2 ++
 arch/arm/lib/cache-pl310.c      |   12 ++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/soc.c b/arch/arm/cpu/armv7/exynos/soc.c
index ab65b8d..9e8705f 100644
--- a/arch/arm/cpu/armv7/exynos/soc.c
+++ b/arch/arm/cpu/armv7/exynos/soc.c
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include <asm/pl310.h>
 
 void reset_cpu(ulong addr)
 {
@@ -36,3 +37,14 @@ void enable_caches(void)
 	dcache_enable();
 }
 #endif
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+void v7_outer_cache_enable(void)
+{
+	pl310_enable();
+}
+void v7_outer_cache_disable(void)
+{
+	pl310_disable();
+}
+#endif
diff --git a/arch/arm/include/asm/pl310.h b/arch/arm/include/asm/pl310.h
index fb506e6..6a10b43 100644
--- a/arch/arm/include/asm/pl310.h
+++ b/arch/arm/include/asm/pl310.h
@@ -65,6 +65,8 @@ struct pl310_regs {
 	u32 pl310_clean_inv_way;
 };
 
+void pl310_enable(void);
+void pl310_disable(void);
 void pl310_inval_all(void);
 void pl310_clean_inval_all(void);
 void pl310_inval_range(u32 start, u32 end);
diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
index 21d13f7..76d60cf 100644
--- a/arch/arm/lib/cache-pl310.c
+++ b/arch/arm/lib/cache-pl310.c
@@ -116,3 +116,15 @@ void v7_outer_cache_inval_range(u32 start, u32 stop)
 
 	pl310_cache_sync();
 }
+
+void pl310_enable(void)
+{
+	writel(1, &pl310->pl310_ctrl);
+	printf("p310_ctrl: 0x%x p310_aux_ctrl: 0x%x\n",
+	       readl(&pl310->pl310_ctrl), readl(&pl310->pl310_aux_ctrl));
+}
+
+void pl310_disable(void)
+{
+	writel(0, &pl310->pl310_ctrl);
+}
-- 
1.7.2.3


--MP_/7OT0hlOE0TLvqj8kABCHwi2
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0001-cache-wip-Test-program-to-evaluate-if-L2-is-working.patch



More information about the U-Boot mailing list