Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / cpu.c
index e37e87b68d14d394dfdb9980cbca40345f5ccc52..93d7a02ed4c212aaa8dc9a549b789943efaaef6b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2002
  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
@@ -5,8 +6,6 @@
  *
  * (C) Copyright 2002
  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -15,6 +14,9 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
+#include <irq_func.h>
+#include <asm/cache.h>
 #include <asm/system.h>
 
 static void cache_flush(void);
@@ -28,7 +30,7 @@ int cleanup_before_linux (void)
         * we turn off caches etc ...
         */
 
-       disable_interrupts ();
+       disable_interrupts();
 
 
        /* turn off I/D-cache */
@@ -45,7 +47,9 @@ int cleanup_before_linux (void)
 /* flush I/D-cache */
 static void cache_flush (void)
 {
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
        unsigned long i = 0;
 
        asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));
+#endif
 }