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:
Erwan Gouriou 2020-01-31 10:34:01 +01:00 committed by Johan Hedberg
parent e63b6525bf
commit 9631709ca4
2 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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;
}