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
commit 9631709ca4
2 changed files with 8 additions and 5 deletions

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