soc: stm32h7: Move PWR init code in soc init function
Move PWR init code out of clock control driver and put SMPS related function under SMPS condition as it is not supported by all soc variants of the series. Fixes #22363 Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
e63b6525bf
commit
9631709ca4
|
@ -217,11 +217,6 @@ static int stm32_clock_control_init(struct device *dev)
|
|||
#if !defined(CONFIG_CPU_CORTEX_M4)
|
||||
|
||||
#ifdef CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL
|
||||
/* Power Configuration */
|
||||
LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY);
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
while (LL_PWR_IsActiveFlag_VOS() == 0) {
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CLOCK_STM32_PLL_SRC_HSE
|
||||
|
||||
|
|
|
@ -85,6 +85,14 @@ static int stm32h7_init(struct device *arg)
|
|||
/* At reset, system core clock is set to 64 MHz from HSI */
|
||||
SystemCoreClock = 64000000;
|
||||
|
||||
/* Power Configuration */
|
||||
#ifdef SMPS
|
||||
LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY);
|
||||
#endif
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
while (LL_PWR_IsActiveFlag_VOS() == 0) {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue