drivers: clock: stm32: h7: remove power supply config
The power supply configuration is already set during the early H7 soc init. Let the clock initialization handle the voltage scaling. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
This commit is contained in:
parent
b2b6b9be7e
commit
1989bef5e3
@ -249,27 +249,6 @@ static uint32_t get_hclk_frequency(void)
|
||||
|
||||
static int32_t prepare_regulator_voltage_scale(void)
|
||||
{
|
||||
/* Apply system power supply configuration */
|
||||
#if defined(SMPS) && defined(CONFIG_POWER_SUPPLY_DIRECT_SMPS)
|
||||
LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT_AND_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT_AND_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_EXT);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_EXT);
|
||||
#elif defined(CONFIG_POWER_SUPPLY_EXTERNAL_SOURCE)
|
||||
LL_PWR_ConfigSupply(LL_PWR_EXTERNAL_SOURCE_SUPPLY);
|
||||
#else
|
||||
LL_PWR_ConfigSupply(LL_PWR_LDO_SUPPLY);
|
||||
#endif
|
||||
|
||||
/* Make sure to put the CPU in highest Voltage scale during clock configuration */
|
||||
/* Highest voltage is SCALE0 */
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE0);
|
||||
@ -279,6 +258,7 @@ static int32_t prepare_regulator_voltage_scale(void)
|
||||
while (LL_PWR_IsActiveFlag_VOS() == 0) {
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -292,25 +272,6 @@ static int32_t optimize_regulator_voltage_scale(uint32_t sysclk_freq)
|
||||
/* LL_PWR_REGULATOR_SCALE3 is lowest power consumption */
|
||||
/* Must be done in accordance to the Maximum allowed frequency vs VOS*/
|
||||
/* See RM0433 page 352 for more details */
|
||||
#if defined(SMPS) && defined(CONFIG_POWER_SUPPLY_DIRECT_SMPS)
|
||||
LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT_AND_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT_AND_LDO)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_1V8_SUPPLIES_EXT);
|
||||
#elif defined(SMPS) && defined(CONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT)
|
||||
LL_PWR_ConfigSupply(LL_PWR_SMPS_2V5_SUPPLIES_EXT);
|
||||
#elif defined(CONFIG_POWER_SUPPLY_EXTERNAL_SOURCE)
|
||||
LL_PWR_ConfigSupply(LL_PWR_EXTERNAL_SOURCE_SUPPLY);
|
||||
#else
|
||||
LL_PWR_ConfigSupply(LL_PWR_LDO_SUPPLY);
|
||||
#endif
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE0);
|
||||
#if defined(CONFIG_SOC_SERIES_STM32H7RSX)
|
||||
while (LL_PWR_IsActiveFlag_VOSRDY() == 0) {
|
||||
@ -318,6 +279,7 @@ static int32_t optimize_regulator_voltage_scale(uint32_t sysclk_freq)
|
||||
while (LL_PWR_IsActiveFlag_VOS() == 0) {
|
||||
#endif
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user