dm: wdt: arm: Move tnetv107x into drivers/watchdog/
[oweals/u-boot.git] / arch / arm / cpu / armv7 / cpu.c
index def9ced64faffdf744f65f673ee8002cb8c8c40f..39a80237cd1edf08f23497cc36580aa782701877 100644 (file)
@@ -36,6 +36,9 @@
 #include <asm/system.h>
 #include <asm/cache.h>
 #include <asm/armv7.h>
+#include <linux/compiler.h>
+
+void __weak cpu_cache_initialization(void){}
 
 int cleanup_before_linux(void)
 {
@@ -45,7 +48,9 @@ int cleanup_before_linux(void)
         *
         * we turn off caches etc ...
         */
+#ifndef CONFIG_SPL_BUILD
        disable_interrupts();
+#endif
 
        /*
         * Turn off I-cache and invalidate it
@@ -58,6 +63,7 @@ int cleanup_before_linux(void)
         * dcache_disable() in turn flushes the d-cache and disables MMU
         */
        dcache_disable();
+       v7_outer_cache_disable();
 
        /*
         * After D-cache is flushed and before it is disabled there may
@@ -71,5 +77,10 @@ int cleanup_before_linux(void)
         */
        invalidate_dcache_all();
 
+       /*
+        * Some CPU need more cache attention before starting the kernel.
+        */
+       cpu_cache_initialization();
+
        return 0;
 }