]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/cpu.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / arch / arm / cpu / armv7 / cpu.c
index 0b0e5003cc3c390e9cb86fe13d8426e5840ae731..44f27572674f61f2208be233972a1b2383a456b1 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2008 Texas Insturments
  *
@@ -7,8 +8,6 @@
  *
  * (C) Copyright 2002
  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -36,12 +35,6 @@ int cleanup_before_linux_select(int flags)
        disable_interrupts();
 #endif
 
-       /*
-        * Turn off I-cache and invalidate it
-        */
-       icache_disable();
-       invalidate_icache_all();
-
        if (flags & CBL_DISABLE_CACHES) {
                /*
                * turn off D-cache
@@ -61,7 +54,16 @@ int cleanup_before_linux_select(int flags)
                * to avoid coherency problems for kernel
                */
                invalidate_dcache_all();
+
+               icache_disable();
+               invalidate_icache_all();
        } else {
+               /*
+                * Turn off I-cache and invalidate it
+                */
+               icache_disable();
+               invalidate_icache_all();
+
                flush_dcache_all();
                invalidate_icache_all();
                icache_enable();