From f08c91a7e4964adc56e29579f80abdb568dae8cc Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Fri, 20 Sep 2024 17:05:43 -0400 Subject: [PATCH] soc: stm32g4x/stm32l0x: fix soc hook calls Missed 2 places related to power management. Signed-off-by: Anas Nashif --- soc/st/stm32/stm32g4x/soc.c | 2 ++ soc/st/stm32/stm32l0x/power.c | 8 -------- soc/st/stm32/stm32l0x/soc.c | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) 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 }