* [PATCH] rockchip: rk3188: Fix back to BROM boot
@ 2020-06-22 13:19 Alexander Kochetkov
2020-06-27 14:12 ` Kever Yang
2020-06-27 14:12 ` Kever Yang
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Kochetkov @ 2020-06-22 13:19 UTC (permalink / raw)
To: u-boot
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>
---
arch/arm/mach-rockchip/rk3188/rk3188.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
index 1b012f7f67..4115f95d77 100644
--- a/arch/arm/mach-rockchip/rk3188/rk3188.c
+++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
@@ -73,15 +73,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)
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] rockchip: rk3188: Fix back to BROM boot
2020-06-22 13:19 [PATCH] rockchip: rk3188: Fix back to BROM boot Alexander Kochetkov
@ 2020-06-27 14:12 ` Kever Yang
2020-06-27 14:12 ` Kever Yang
1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2020-06-27 14:12 UTC (permalink / raw)
To: u-boot
On 2020/6/22 ??9:19, Alexander Kochetkov wrote:
> 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>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/rk3188/rk3188.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
> index 1b012f7f67..4115f95d77 100644
> --- a/arch/arm/mach-rockchip/rk3188/rk3188.c
> +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
> @@ -73,15 +73,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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] rockchip: rk3188: Fix back to BROM boot
2020-06-22 13:19 [PATCH] rockchip: rk3188: Fix back to BROM boot Alexander Kochetkov
2020-06-27 14:12 ` Kever Yang
@ 2020-06-27 14:12 ` Kever Yang
1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2020-06-27 14:12 UTC (permalink / raw)
To: u-boot
On 2020/6/22 ??9:19, Alexander Kochetkov wrote:
> 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>
Applied to u-boot-rockchip master branch.
> ---
> arch/arm/mach-rockchip/rk3188/rk3188.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c
> index 1b012f7f67..4115f95d77 100644
> --- a/arch/arm/mach-rockchip/rk3188/rk3188.c
> +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c
> @@ -73,15 +73,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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-27 14:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-22 13:19 [PATCH] rockchip: rk3188: Fix back to BROM boot Alexander Kochetkov
2020-06-27 14:12 ` Kever Yang
2020-06-27 14:12 ` Kever Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox