summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Weitzel <J.Weitzel@phytec.de>2009-04-14 17:08:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-04-14 17:10:12 +0200
commit82a4cf29b2d5204d2051d89d0b0bc930f7135573 (patch)
tree40c4022d86410d2111c892efea82149625a3e301
parentdcb35fbaf12ff652f0d88c02f7f04b514c8bc993 (diff)
downloadbarebox-82a4cf29b2d5204d2051d89d0b0bc930f7135573.tar.gz
barebox-82a4cf29b2d5204d2051d89d0b0bc930f7135573.tar.xz
pcm038: Fix PLL settings
We had some imx27 modules not starting through u-boot. The patch adds some delay between switching the powerlevel up and changing the pll settings. Please add the patch to the next release. Signed-off-by: Jan Weitzel <J.Weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--board/pcm038/pcm038.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/board/pcm038/pcm038.c b/board/pcm038/pcm038.c
index 1ccdf23bb8..626a73568e 100644
--- a/board/pcm038/pcm038.c
+++ b/board/pcm038/pcm038.c
@@ -1,4 +1,4 @@
- /*
+/*
* Copyright (C) 2007 Sascha Hauer, Pengutronix
*
* This program is free software; you can redistribute it and/or
@@ -238,17 +238,23 @@ static int pcm038_power_init(void)
if (ret)
goto out;
+ CSCR |= CSCR_UPDATE_DIS;
+
MPCTL0 = IMX_PLL_PD(0) |
IMX_PLL_MFD(51) |
IMX_PLL_MFI(7) |
IMX_PLL_MFN(35);
- CSCR |= CSCR_MPLL_RESTART;
-
- while (i++ < 1000) {
+ /* wait for good power level */
+ while (i++ < 128) {
while (CCSR & CCSR_32K_SR);
while (!(CCSR & CCSR_32K_SR));
}
+ i = 0;
+
+ CSCR |= CSCR_MPLL_RESTART;
+
+ while (!(MPCTL1 & MPCTL1_LF));
PCDR1 = 0x09030911;