[Uboot-stm32] [PATCH] arm: stm32mp: Drop unnecessary BOARD_EARLY_INIT_F usage
Patrice CHOTARD
patrice.chotard at foss.st.com
Thu Apr 30 09:01:18 CEST 2026
On 3/26/26 10:42, Patrice CHOTARD wrote:
>
>
> On 3/25/26 20:00, Tom Rini wrote:
>> All of these platforms enable CONFIG_BOARD_EARLY_INIT_F and then have a
>> do-nothing board_early_init_f function. Change to not enabling the
>> option and so not needing an empty function.
>>
>> Signed-off-by: Tom Rini <trini at konsulko.com>
>> ---
>> Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
>> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
>> Cc: Jagan Teki <jagan at amarulasolutions.com>
>> Cc: Matteo Lisi <matteo.lisi at engicam.com>
>> Cc: Dillon Min <dillon.minfei at gmail.com>
>> Cc: uboot-stm32 at st-md-mailman.stormreply.com
>> ---
>> arch/arm/mach-stm32mp/stm32mp1/spl.c | 15 ++++++---------
>> board/engicam/stm32mp1/spl.c | 6 ------
>> board/st/stm32h750-art-pi/stm32h750-art-pi.c | 5 -----
>> configs/stm32h750-art-pi_defconfig | 1 -
>> 4 files changed, 6 insertions(+), 21 deletions(-)
>>
>> diff --git a/arch/arm/mach-stm32mp/stm32mp1/spl.c b/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> index e63bdaaf42fd..d2e41b8e65ff 100644
>> --- a/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> +++ b/arch/arm/mach-stm32mp/stm32mp1/spl.c
>> @@ -90,11 +90,6 @@ void spl_display_print(void)
>> }
>> #endif
>>
>> -__weak int board_early_init_f(void)
>> -{
>> - return 0;
>> -}
>> -
>> uint32_t stm32mp_get_dram_size(void)
>> {
>> struct ram_info ram;
>> @@ -204,10 +199,12 @@ void board_init_f(ulong dummy)
>> /* enable console uart printing */
>> preloader_console_init();
>>
>> - ret = board_early_init_f();
>> - if (ret) {
>> - log_debug("board_early_init_f() failed: %d\n", ret);
>> - hang();
>> + if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F)) {
>> + ret = board_early_init_f();
>> + if (ret) {
>> + log_debug("board_early_init_f() failed: %d\n", ret);
>> + hang();
>> + }
>> }
>>
>> ret = uclass_get_device(UCLASS_RAM, 0, &dev);
>> diff --git a/board/engicam/stm32mp1/spl.c b/board/engicam/stm32mp1/spl.c
>> index bb2bd446aa8c..19e5ab0180f9 100644
>> --- a/board/engicam/stm32mp1/spl.c
>> +++ b/board/engicam/stm32mp1/spl.c
>> @@ -15,9 +15,3 @@ void board_vddcore_init(u32 voltage_mv)
>> if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
>> opp_voltage_mv = voltage_mv;
>> }
>> -
>> -int board_early_init_f(void)
>> -{
>> - return 0;
>> -}
>> -
>> diff --git a/board/st/stm32h750-art-pi/stm32h750-art-pi.c b/board/st/stm32h750-art-pi/stm32h750-art-pi.c
>> index 244bb5eefb3a..8b1b23337790 100644
>> --- a/board/st/stm32h750-art-pi/stm32h750-art-pi.c
>> +++ b/board/st/stm32h750-art-pi/stm32h750-art-pi.c
>> @@ -32,11 +32,6 @@ int dram_init_banksize(void)
>> return 0;
>> }
>>
>> -int board_early_init_f(void)
>> -{
>> - return 0;
>> -}
>> -
>> int board_late_init(void)
>> {
>> return 0;
>> diff --git a/configs/stm32h750-art-pi_defconfig b/configs/stm32h750-art-pi_defconfig
>> index 971d5c00d88f..0d0dca2511b7 100644
>> --- a/configs/stm32h750-art-pi_defconfig
>> +++ b/configs/stm32h750-art-pi_defconfig
>> @@ -24,7 +24,6 @@ CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi"
>> CONFIG_SYS_CBSIZE=256
>> CONFIG_SYS_PBSIZE=282
>> # CONFIG_DISPLAY_CPUINFO is not set
>> -CONFIG_BOARD_EARLY_INIT_F=y
>> # CONFIG_BOARD_INIT is not set
>> CONFIG_BOARD_LATE_INIT=y
>> CONFIG_SYS_PROMPT="U-Boot > "
>
> Hi Tom
>
> Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
>
> Thanks
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32 at st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
Applied to u-boot-stm32/master
Thanks
Patrice
More information about the U-Boot
mailing list