mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
ARM: atmel: spl: make initialization more stable
We need to make sure the main clock ready field in MCFR is set after switch to main crystal oscillator. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
This commit is contained in:
parent
59158ba39d
commit
a5f35d63f2
1 changed files with 4 additions and 0 deletions
|
@ -50,6 +50,10 @@ static void switch_to_main_crystal_osc(void)
|
||||||
while (!(readl(&pmc->sr) & AT91_PMC_IXR_MOSCSELS))
|
while (!(readl(&pmc->sr) & AT91_PMC_IXR_MOSCSELS))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/* Wait until MAINRDY field is set to make sure main clock is stable */
|
||||||
|
while (!(readl(&pmc->mcfr) & AT91_PMC_MAINRDY))
|
||||||
|
;
|
||||||
|
|
||||||
tmp = readl(&pmc->mor);
|
tmp = readl(&pmc->mor);
|
||||||
tmp &= ~AT91_PMC_MOR_MOSCRCEN;
|
tmp &= ~AT91_PMC_MOR_MOSCRCEN;
|
||||||
tmp &= ~AT91_PMC_MOR_KEY(0xff);
|
tmp &= ~AT91_PMC_MOR_KEY(0xff);
|
||||||
|
|
Loading…
Add table
Reference in a new issue