diff mbox series

[next,3/5] rockchip: tpl: allow to call board/SoC-specific code before DRAM init

Message ID 20241105-rk3399-sysreset-gpio-tpl-v1-3-12caff07a4e4@cherry.de
State New
Headers show
Series rockchip: rk3399: allow to trigger sysreset in TPL | expand

Commit Message

Quentin Schulz Nov. 5, 2024, 3:36 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

This defines a weak tpl_board_init function that can be used for running
board/SoC-specific code before the DRAM init happens, similarly to
spl_board_init() for SPL.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 arch/arm/mach-rockchip/tpl.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Paul Kocialkowski Nov. 5, 2024, 6:37 p.m. UTC | #1
Hi,

Le Tue 05 Nov 24, 16:36, Quentin Schulz a écrit :
> From: Quentin Schulz <quentin.schulz@cherry.de>
> 
> This defines a weak tpl_board_init function that can be used for running
> board/SoC-specific code before the DRAM init happens, similarly to
> spl_board_init() for SPL.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>

Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>

Cheers,

Paul

> ---
>  arch/arm/mach-rockchip/tpl.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
> index bbb9329e725af79ea4c4049aa7890a4a143e7df5..6b880f19f84e57e7bc0c93b16b188bc56267827e 100644
> --- a/arch/arm/mach-rockchip/tpl.c
> +++ b/arch/arm/mach-rockchip/tpl.c
> @@ -21,6 +21,10 @@
>  #include <timestamp.h>
>  #endif
>  
> +__weak void tpl_board_init(void)
> +{
> +}
> +
>  void board_init_f(ulong dummy)
>  {
>  	struct udevice *dev;
> @@ -54,6 +58,8 @@ void board_init_f(ulong dummy)
>  	if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
>  		timer_init();
>  
> +	tpl_board_init();
> +
>  	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
>  	if (ret) {
>  		printf("DRAM init failed: %d\n", ret);
> 
> -- 
> 2.47.0
>
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index bbb9329e725af79ea4c4049aa7890a4a143e7df5..6b880f19f84e57e7bc0c93b16b188bc56267827e 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -21,6 +21,10 @@ 
 #include <timestamp.h>
 #endif
 
+__weak void tpl_board_init(void)
+{
+}
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
@@ -54,6 +58,8 @@  void board_init_f(ulong dummy)
 	if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
 		timer_init();
 
+	tpl_board_init();
+
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
 		printf("DRAM init failed: %d\n", ret);