]> git.sur5r.net Git - u-boot/commitdiff
arm: socfpga: Move cache_enable to CPU code
authorMarek Vasut <marex@denx.de>
Sun, 21 Sep 2014 11:57:40 +0000 (13:57 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:46:51 +0000 (17:46 +0200)
Move icache_enable() and dcache_enable() function calls from
board code into the CPU code and into the enable_caches()
function. This is how the cache enabling code was designed
to work.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Pavel Machek <pavel@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>
arch/arm/cpu/armv7/socfpga/misc.c
board/altera/socfpga/socfpga_cyclone5.c

index 76186c511b5c20670253ee21c2d91284ea38e55d..7f9d7f01337d219310a049d9e5e925aa7dcbc5b5 100644 (file)
@@ -33,6 +33,16 @@ int dram_init(void)
        return 0;
 }
 
+void enable_caches(void)
+{
+#ifndef CONFIG_SYS_ICACHE_OFF
+       icache_enable();
+#endif
+#ifndef CONFIG_SYS_DCACHE_OFF
+       dcache_enable();
+#endif
+}
+
 /*
  * DesignWare Ethernet initialization
  */
index 6b982778be0780146a5cebc6f5137a4579d2dc65..0f81d899a6cf873f37b952bedfb79130752084a9 100644 (file)
@@ -34,9 +34,6 @@ int board_early_init_f(void)
  */
 int board_init(void)
 {
-       icache_enable();
-       dcache_enable();
-
        /* Address of boot parameters for ATAG (if ATAG is used) */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;