]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3188: Fix back to BROM boot
authorAlexander Kochetkov <al.kochet@gmail.com>
Mon, 22 Jun 2020 13:19:25 +0000 (16:19 +0300)
committerKever Yang <kever.yang@rock-chips.com>
Sat, 27 Jun 2020 14:12:34 +0000 (22:12 +0800)
Move the setting for noc remap out of SPL code. Changing
noc remap inside SPL results in breaking back to BROM
boot.

Fixes commit c14fe2a8e192 ("rockchip: rk3188: Move SoC
one time setting into arch_cpu_init()").

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3188/rk3188.c

index ef57dfd7619f691aa621c72fc8c3599b69eaccbb..1b2f4a4757191e5ad996385b67c8436e3beed219 100644 (file)
@@ -77,15 +77,32 @@ int arch_cpu_init(void)
                     BYPASSSEL_MASK | BYPASSDMEN_MASK,
                     1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT);
 #endif
+       return 0;
+}
+#endif
+
+__weak int rk3188_board_late_init(void)
+{
+       return 0;
+}
+
+int rk_board_late_init(void)
+{
+       struct rk3188_grf *grf;
+
+       grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+       if (IS_ERR(grf)) {
+               pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
+               return 0;
+       }
 
        /* enable noc remap to mimic legacy loaders */
        rk_clrsetreg(&grf->soc_con0,
                     NOC_REMAP_MASK << NOC_REMAP_SHIFT,
                     NOC_REMAP_MASK << NOC_REMAP_SHIFT);
 
-       return 0;
+       return rk3188_board_late_init();
 }
-#endif
 
 #ifdef CONFIG_SPL_BUILD
 static int setup_led(void)