drivers: clock_control: add calibration for h7 pllx_hsi

This will calibrate the HSI's PLLX clocks if enabled
The value rcc_hsicalibartion_default is 0x40U for h7/h7rs.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
This commit is contained in:
Fabrice DJIATSA 2024-09-04 09:46:16 +02:00 committed by Fabio Baltieri
commit 6b167f2596

View file

@ -675,9 +675,18 @@ static void set_up_fixed_clock_sources(void)
}
if (IS_ENABLED(STM32_HSI_ENABLED)) {
/* Enable HSI oscillator */
LL_RCC_HSI_Enable();
while (LL_RCC_HSI_IsReady() != 1) {
if (IS_ENABLED(STM32_PLL_SRC_HSI) || IS_ENABLED(STM32_PLL2_SRC_HSI) ||
+ IS_ENABLED(STM32_PLL3_SRC_HSI)) {
/* HSI calibration */
LL_RCC_HSI_SetCalibTrimming(RCC_HSICALIBRATION_DEFAULT);
}
/* Enable HSI if not enabled */
if (LL_RCC_HSI_IsReady() != 1) {
/* Enable HSI oscillator */
LL_RCC_HSI_Enable();
while (LL_RCC_HSI_IsReady() != 1) {
/* Wait for HSI ready */
}
}
/* HSI divider configuration */
LL_RCC_HSI_SetDivider(hsi_divider(STM32_HSI_DIVISOR));