stm32: pll: disable before configuring

This commit is contained in:
Alfred Klomp 2018-11-09 18:51:57 +01:00
parent 8b13977ea0
commit f0e5c73d98
4 changed files with 16 additions and 0 deletions

View File

@ -355,6 +355,10 @@ void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock)
rcc_set_ppre1(clock->ppre1);
rcc_set_ppre2(clock->ppre2);
/* Disable PLL oscillator before changing its configuration. */
rcc_osc_off(RCC_PLL);
/* Configure the PLL oscillator. */
rcc_set_main_pll_hse(clock->pllm, clock->plln,
clock->pllp, clock->pllq);

View File

@ -709,6 +709,10 @@ void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock)
rcc_set_ppre1(clock->ppre1);
rcc_set_ppre2(clock->ppre2);
/* Disable PLL oscillator before changing its configuration. */
rcc_osc_off(RCC_PLL);
/* Configure the PLL oscillator. */
rcc_set_main_pll_hse(clock->pllm, clock->plln,
clock->pllp, clock->pllq, clock->pllr);

View File

@ -392,6 +392,10 @@ void rcc_clock_setup_hse(const struct rcc_clock_scale *clock, uint32_t hse_mhz)
rcc_set_ppre1(clock->ppre1);
rcc_set_ppre2(clock->ppre2);
/* Disable PLL oscillator before changing its configuration. */
rcc_osc_off(RCC_PLL);
/* Configure the PLL oscillator. */
rcc_set_main_pll_hse(pllm, clock->plln,
clock->pllp, clock->pllq);

View File

@ -535,6 +535,10 @@ void rcc_clock_setup_pll(const struct rcc_clock_scale *clock)
flash_prefetch_enable();
flash_set_ws(clock->flash_waitstates);
/* Disable PLL oscillator before changing its configuration. */
rcc_osc_off(RCC_PLL);
/* Configure the PLL oscillator. */
rcc_set_pll_configuration(clock->pll_source, clock->pll_mul,
clock->pll_div);