Skip to content

Commit db8a47a

Browse files
mathieuchopstmkartben
authored andcommitted
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 c6a0360) Update that series' initialization code to align it with all others. Signed-off-by: Mathieu Choplain <[email protected]>
1 parent c93a4b9 commit db8a47a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

soc/st/stm32/stm32wb0x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config SOC_SERIES_STM32WB0X
1010
select CPU_CORTEX_M_HAS_SYSTICK
1111
select CPU_HAS_ARM_MPU
1212
select HAS_STM32CUBE
13+
select SOC_EARLY_INIT_HOOK
1314
# WB0x has a ROM bootloader executed at reset,
1415
# which makes the following option required
1516
select INIT_ARCH_HW_AT_BOOT

soc/st/stm32/stm32wb0x/soc.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,9 @@ static void configure_smps(void)
146146
/**
147147
* @brief Perform basic hardware initialization at boot.
148148
*
149-
* This needs to be run from the very beginning,
150-
* so the init priority has to be 0 (zero).
151-
*
152-
* @return 0
149+
* This needs to be run from the very beginning.
153150
*/
154-
static int stm32wb0_init(void)
151+
void soc_early_init_hook(void)
155152
{
156153
/* Update CMSIS SystemCoreClock variable (CLK_SYS) */
157154
/* On reset, the 64MHz HSI is selected as input to
@@ -181,8 +178,4 @@ static int stm32wb0_init(void)
181178

182179
/* Configure SMPS step-down converter */
183180
configure_smps();
184-
185-
return 0;
186181
}
187-
188-
SYS_INIT(stm32wb0_init, PRE_KERNEL_1, 0);

0 commit comments

Comments
 (0)