drivers: clock_control: set voltage scaling before PLL

Move the call to prepare_regulator_voltage_scale()
before PLL setup in clock_stm32_ll_h7.c.

This ensures the voltage regulator is configured
to the appropriate voltage scale before increasing
the system clock frequency via PLLs.
Without this change, the system configuration
may be out of spec.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
This commit is contained in:
IBEN EL HADJ MESSAOUD Marwa 2025-06-30 09:04:33 +02:00 committed by Daniel DeGrasse
parent 553fc84e77
commit e1248eff82

View File

@ -1011,15 +1011,15 @@ int stm32_clock_control_init(const struct device *dev)
/* Set up individual enabled clocks */
set_up_fixed_clock_sources();
/* Configure Voltage scale to comply with the desired system frequency */
prepare_regulator_voltage_scale();
/* Set up PLLs */
r = set_up_plls();
if (r < 0) {
return r;
}
/* Configure Voltage scale to comply with the desired system frequency */
prepare_regulator_voltage_scale();
/* Current hclk value */
old_hclk_freq = get_hclk_frequency();
/* AHB is HCLK clock to configure */