soc: stm32wb0: replace SYS_INIT with early init hook

STM32WB0 series was missed when SoC initialization code was migrated
from SYS_INIT routines to the new soc_early_init_hook method
(c.f. commit c6a03606c2)

Update that series' initialization code to align it with all others.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This commit is contained in:
Mathieu Choplain 2025-01-07 14:17:56 +01:00 committed by Benjamin Cabé
commit db8a47a2ec
2 changed files with 3 additions and 9 deletions

View file

@ -10,6 +10,7 @@ config SOC_SERIES_STM32WB0X
select CPU_CORTEX_M_HAS_SYSTICK select CPU_CORTEX_M_HAS_SYSTICK
select CPU_HAS_ARM_MPU select CPU_HAS_ARM_MPU
select HAS_STM32CUBE select HAS_STM32CUBE
select SOC_EARLY_INIT_HOOK
# WB0x has a ROM bootloader executed at reset, # WB0x has a ROM bootloader executed at reset,
# which makes the following option required # which makes the following option required
select INIT_ARCH_HW_AT_BOOT select INIT_ARCH_HW_AT_BOOT

View file

@ -146,12 +146,9 @@ static void configure_smps(void)
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
* This needs to be run from the very beginning, * This needs to be run from the very beginning.
* so the init priority has to be 0 (zero).
*
* @return 0
*/ */
static int stm32wb0_init(void) void soc_early_init_hook(void)
{ {
/* Update CMSIS SystemCoreClock variable (CLK_SYS) */ /* Update CMSIS SystemCoreClock variable (CLK_SYS) */
/* On reset, the 64MHz HSI is selected as input to /* On reset, the 64MHz HSI is selected as input to
@ -181,8 +178,4 @@ static int stm32wb0_init(void)
/* Configure SMPS step-down converter */ /* Configure SMPS step-down converter */
configure_smps(); configure_smps();
return 0;
} }
SYS_INIT(stm32wb0_init, PRE_KERNEL_1, 0);