summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2014-10-17 11:15:55 +0200
committerStefan Agner <stefan.agner@toradex.com>2014-10-23 11:11:04 +0200
commit403da198cd8c6e6874c614d0affc404c0c05751f (patch)
treed645a06eaa3ea464b697d4b2b9f063fbb5f81960
parent781895e999b05fb75d13650600ab12587841fd74 (diff)
arm: vf610: enable caches
Enables caches which provides a rather huge speedup of the boot loader. Also mark the on-chip RAM as cachable since this is the area U-Boot runs from.
-rw-r--r--arch/arm/cpu/armv7/vf610/generic.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c
index e1b3f4dc79..414cf17a23 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -320,3 +320,21 @@ int get_clocks(void)
#endif
return 0;
}
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
+ enum dcache_option option = DCACHE_WRITETHROUGH;
+#else
+ enum dcache_option option = DCACHE_WRITEBACK;
+#endif
+ dcache_enable();
+ icache_enable();
+
+ /* Enable caching on OCRAM */
+ mmu_set_region_dcache_behaviour(IRAM_BASE_ADDR,
+ IRAM_SIZE,
+ option);
+}
+#endif