drivers/clock_control: stm32: msi: Enable MSI range config in PLL mode
When MSI clock is used a source of PLL, it should be possible to select its frequency range. Fix this. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
6d31b1075a
commit
c4d9de1850
2 changed files with 7 additions and 1 deletions
|
@ -65,7 +65,7 @@ config CLOCK_STM32_HSE_CLOCK
|
||||||
|
|
||||||
config CLOCK_STM32_MSI_RANGE
|
config CLOCK_STM32_MSI_RANGE
|
||||||
int "MSI frequency range"
|
int "MSI frequency range"
|
||||||
depends on CLOCK_STM32_SYSCLK_SRC_MSI
|
depends on CLOCK_STM32_SYSCLK_SRC_MSI || CLOCK_STM32_PLL_SRC_MSI
|
||||||
default 8
|
default 8
|
||||||
help
|
help
|
||||||
Frequency range of MSI when MSI range is provided in RCC_CR register
|
Frequency range of MSI when MSI range is provided in RCC_CR register
|
||||||
|
|
|
@ -329,6 +329,12 @@ static int stm32_clock_control_init(struct device *dev)
|
||||||
|
|
||||||
#ifdef CONFIG_CLOCK_STM32_PLL_SRC_MSI
|
#ifdef CONFIG_CLOCK_STM32_PLL_SRC_MSI
|
||||||
|
|
||||||
|
/* Set MSI Range */
|
||||||
|
LL_RCC_MSI_EnableRangeSelection();
|
||||||
|
LL_RCC_MSI_SetRange(CONFIG_CLOCK_STM32_MSI_RANGE
|
||||||
|
<< RCC_CR_MSIRANGE_Pos);
|
||||||
|
LL_RCC_MSI_SetCalibTrimming(0);
|
||||||
|
|
||||||
#ifdef CONFIG_CLOCK_STM32_MSI_PLL_MODE
|
#ifdef CONFIG_CLOCK_STM32_MSI_PLL_MODE
|
||||||
/* Enable MSI hardware auto calibration */
|
/* Enable MSI hardware auto calibration */
|
||||||
LL_RCC_MSI_EnablePLLMode();
|
LL_RCC_MSI_EnablePLLMode();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue