stm32l1:rcc: allow pll source to be HSE.

The existing rcc_clock_setup_pll only allowed HSI as the clock source, even
though the existing clock structure contains pll source variables.

Check this value, and switch to the corresponding clock source, rather than
blindly assuming that we are tryign to operate from HSI.
This commit is contained in:
FrancoisFinfe 2014-06-21 20:17:12 +02:00 committed by Karl Palsson
parent a2af34d0e1
commit 7b29caed1a

View File

@ -498,9 +498,14 @@ void rcc_clock_setup_hsi(const clock_scale_t *clock)
void rcc_clock_setup_pll(const clock_scale_t *clock) void rcc_clock_setup_pll(const clock_scale_t *clock)
{ {
/* Enable internal high-speed oscillator. */ /* Turn on the appropriate source for the PLL */
rcc_osc_on(HSI); if (clock->pll_source == RCC_CFGR_PLLSRC_HSE_CLK) {
rcc_wait_for_osc_ready(HSI); rcc_osc_on(HSE);
rcc_wait_for_osc_ready(HSE);
} else {
rcc_osc_on(HSI);
rcc_wait_for_osc_ready(HSI);
}
/* /*
* Set prescalers for AHB, ADC, ABP1, ABP2. * Set prescalers for AHB, ADC, ABP1, ABP2.