]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3288: add arch_cpu_init in spl
authorKever Yang <kever.yang@rock-chips.com>
Tue, 9 Jul 2019 13:58:43 +0000 (21:58 +0800)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 20 Jul 2019 15:59:44 +0000 (23:59 +0800)
Add arch_cpu_init() in SPL for soc related init, and
move configure_l2ctlr() into it.
The arch_cpu_init() only need to run once, so no need
to run in TPL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288-board-tpl.c
arch/arm/mach-rockchip/rk3288/rk3288.c

index b7fab63acfd442a0159faaffb71fb0efb95fb149..3869de91193ed353cf8b584e2ce0ad4ef71f6865 100644 (file)
@@ -103,6 +103,11 @@ static int phycore_init(void)
 }
 #endif
 
+__weak int arch_cpu_init(void)
+{
+       return 0;
+}
+
 void board_init_f(ulong dummy)
 {
        struct udevice *dev;
@@ -127,7 +132,7 @@ void board_init_f(ulong dummy)
        }
 
        rockchip_timer_init();
-       configure_l2ctlr();
+       arch_cpu_init();
 
        ret = rockchip_get_clk(&dev);
        if (ret) {
index 787129bbaeaf1f4f8f3be7047c4baa17243a8cdd..5adbe921852c215dfce43c32f0ef709885125e9f 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/sys_proto.h>
 #include <asm/arch-rockchip/timer.h>
 
 void board_init_f(ulong dummy)
@@ -38,7 +37,6 @@ void board_init_f(ulong dummy)
        }
 
        rockchip_timer_init();
-       configure_l2ctlr();
 
        ret = rockchip_get_clk(&dev);
        if (ret) {
index 7941ca68a641e2c134d8527ef116bb1eca7e1f21..5300650e1910173f6bd125ce03b2a7807919e0de 100644 (file)
 
 int arch_cpu_init(void)
 {
+#ifdef CONFIG_SPL_BUILD
+       configure_l2ctlr();
+#else
        /* We do some SoC one time setting here. */
        struct rk3288_grf * const grf = (void *)GRF_BASE;
 
        /* Use rkpwm by default */
        rk_setreg(&grf->soc_con2, 1 << 0);
+#endif
 
        return 0;
 }