diff --git a/soc/st/stm32/stm32g4x/soc.c b/soc/st/stm32/stm32g4x/soc.c index f21906f397c..870f6e784f3 100644 --- a/soc/st/stm32/stm32g4x/soc.c +++ b/soc/st/stm32/stm32g4x/soc.c @@ -20,6 +20,8 @@ #include #endif /* PWR_CR3_UCPD_DBDIS */ +extern void stm32_power_init(void); + /** * @brief Perform basic hardware initialization at boot. * diff --git a/soc/st/stm32/stm32l0x/power.c b/soc/st/stm32/stm32l0x/power.c index 45d353472c0..aa3dd1caf8a 100644 --- a/soc/st/stm32/stm32l0x/power.c +++ b/soc/st/stm32/stm32l0x/power.c @@ -72,11 +72,3 @@ void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id) */ irq_unlock(0); } - -/* Initialize STM32 Power */ -void soc_early_init_hook(void) -{ - - /* Enable Power clock */ - LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); -} diff --git a/soc/st/stm32/stm32l0x/soc.c b/soc/st/stm32/stm32l0x/soc.c index 174ae67514d..17a9d0cd1c0 100644 --- a/soc/st/stm32/stm32l0x/soc.c +++ b/soc/st/stm32/stm32l0x/soc.c @@ -40,4 +40,8 @@ void soc_early_init_hook(void) * https://github.com/zephyrproject-rtos/zephyr/issues/#34324 ) */ LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMA1); +#ifdef CONFIG_PM + /* Enable Power clock */ + LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); +#endif }