]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: vf610: Enable caches
authorStefan Agner <stefan@agner.ch>
Wed, 15 Apr 2015 10:54:25 +0000 (16:24 +0530)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:43:51 +0000 (14:43 +0200)
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.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
arch/arm/cpu/armv7/vf610/generic.c

index 3bdc2211e7953c6e74a4ce6de98da71261ed984e..1bb9b8ed1d0ae7fb0409b516b146441812be177f 100644 (file)
@@ -342,3 +342,19 @@ 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