Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-exynos / lowlevel_init.c
index 37746078487eda5b6339b6321754bbaafae30d37..97d6ca8fc2a09b94418dd05d62e05ba4886639b5 100644 (file)
@@ -26,6 +26,8 @@
 #include <common.h>
 #include <config.h>
 #include <debug_uart.h>
+#include <asm/system.h>
+#include <init.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/dmc.h>
 #include <asm/arch/power.h>
@@ -175,7 +177,7 @@ int do_lowlevel_init(void)
 
        arch_cpu_init();
 
-#ifndef CONFIG_SYS_L2CACHE_OFF
+#if !defined(CONFIG_SYS_L2CACHE_OFF) && defined(CONFIG_EXYNOS5420)
        /*
         * Init L2 cache parameters here for use by boot and resume
         *
@@ -188,9 +190,7 @@ int do_lowlevel_init(void)
        configure_l2_actlr();
        dsb();
        isb();
-#endif
 
-#ifdef CONFIG_EXYNOS5420
        relocate_wait_code();
 
        /* Reconfigure secondary cores */
@@ -218,8 +218,11 @@ int do_lowlevel_init(void)
        if (actions & DO_CLOCKS) {
                system_clock_init();
 #ifdef CONFIG_DEBUG_UART
+#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_SERIAL_SUPPORT)) || \
+    !defined(CONFIG_SPL_BUILD)
                exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
                debug_uart_init();
+#endif
 #endif
                mem_ctrl_init(actions & DO_MEM_RESET);
                tzpc_init();