From 52ef6a9cb88f3202871d14e68980ad102d9dc492 Mon Sep 17 00:00:00 2001 From: Lukas Funke Date: Wed, 27 Mar 2024 13:11:52 +0100 Subject: spl: Introduce SoC specific init function Some architectures use spl_board_init() in their SoC specific implementation. Board developers should be able to add board specific implementation via spl_board_init(). Hence, introduce a spl_soc_init() method which is called right before spl_board_init() for SoC specific implementation. Signed-off-by: Lukas Funke Reviewed-by: Devarsh Thakkar Link: https://lore.kernel.org/r/20240327121153.2455126-2-lukas.funke-oss@weidmueller.com Signed-off-by: Michal Simek --- common/spl/Kconfig | 7 +++++++ common/spl/spl.c | 3 +++ 2 files changed, 10 insertions(+) (limited to 'common') diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 46bacad2d81..0f7797b3a6a 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -272,6 +272,13 @@ config SPL_TEXT_BASE help The address in memory that SPL will be running from. +config SPL_SOC_INIT + bool "Call SoC-specific initialization in SPL" + help + If this option is enabled, U-Boot will call the function + spl_soc_init() from board_init_r(). This function should be + provided by the SoC vendor. + config SPL_BOARD_INIT bool "Call board-specific initialization in SPL" help diff --git a/common/spl/spl.c b/common/spl/spl.c index 9a879e9fb10..7794ddccade 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -710,6 +710,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) } } + if (CONFIG_IS_ENABLED(SOC_INIT)) + spl_soc_init(); + if (CONFIG_IS_ENABLED(BOARD_INIT)) spl_board_init(); -- cgit v1.3.1