drivers/clock_control: stm32 common: Don't disable fixed clocks

Each clock should be configured individually by device tree,
don't disable them blindly.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-03-22 14:36:23 +01:00 committed by Carles Cufí
commit d04802283b
7 changed files with 0 additions and 69 deletions

View file

@ -463,18 +463,10 @@ int stm32_clock_control_init(const struct device *dev)
/* Switch to PLL with MSI as clock source */
LL_PLL_ConfigSystemClock_MSI(&s_PLLInitStruct, &s_ClkInitStruct);
/* Disable other clocks */
LL_RCC_HSI_Disable();
LL_RCC_HSE_Disable();
#elif STM32_PLL_SRC_HSI
/* Switch to PLL with HSI as clock source */
LL_PLL_ConfigSystemClock_HSI(&s_PLLInitStruct, &s_ClkInitStruct);
/* Disable other clocks */
LL_RCC_HSE_Disable();
LL_RCC_MSI_Disable();
#elif STM32_PLL_SRC_HSE
#ifndef CONFIG_SOC_SERIES_STM32WLX
@ -504,10 +496,6 @@ int stm32_clock_control_init(const struct device *dev)
&s_PLLInitStruct,
&s_ClkInitStruct);
/* Disable other clocks */
LL_RCC_HSI_Disable();
LL_RCC_MSI_Disable();
#endif /* STM32_PLL_SRC_* */
#elif STM32_SYSCLK_SRC_HSE
@ -594,11 +582,6 @@ int stm32_clock_control_init(const struct device *dev)
LL_SetFlashLatency(new_flash_freq);
}
/* Disable other clocks */
LL_RCC_HSI_Disable();
LL_RCC_MSI_Disable();
LL_RCC_PLL_Disable();
#elif STM32_SYSCLK_SRC_MSI
old_flash_freq = RCC_CALC_FLASH_FREQ(HAL_RCC_GetSysClockFreq(),
@ -677,11 +660,6 @@ int stm32_clock_control_init(const struct device *dev)
LL_SetFlashLatency(new_flash_freq);
}
/* Disable other clocks */
LL_RCC_HSE_Disable();
LL_RCC_HSI_Disable();
LL_RCC_PLL_Disable();
#elif STM32_SYSCLK_SRC_HSI
stm32_clock_switch_to_hsi(hclk_prescaler);
@ -710,10 +688,6 @@ int stm32_clock_control_init(const struct device *dev)
/* HSI used as SYSCLK, set latency to 0 */
LL_FLASH_SetLatency(LL_FLASH_LATENCY_0);
/* Disable other clocks */
LL_RCC_HSE_Disable();
LL_RCC_MSI_Disable();
LL_RCC_PLL_Disable();
#endif /* STM32_SYSCLK_SRC_... */