summaryrefslogtreecommitdiff
path: root/cpu/mcf5227x/speed.c
diff options
context:
space:
mode:
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>2008-10-21 15:37:02 +0000
committerJohn Rigby <jrigby@freescale.com>2008-11-03 09:45:58 -0700
commita21d0c2cc9add8894d971ab791f4032f077db817 (patch)
treeeaddbc5fea591e99652a4b2c08221c88d1e48e85 /cpu/mcf5227x/speed.c
parentb202816c61042c183fe67d097a5893b0f2dafba0 (diff)
downloadu-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.zip
u-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.tar.gz
u-boot-imx-a21d0c2cc9add8894d971ab791f4032f077db817.tar.bz2
ColdFire: Add SBF support for M52277EVB
Add serial boot support Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Diffstat (limited to 'cpu/mcf5227x/speed.c')
-rw-r--r--cpu/mcf5227x/speed.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/cpu/mcf5227x/speed.c b/cpu/mcf5227x/speed.c
index 74b9059..7e385d3 100644
--- a/cpu/mcf5227x/speed.c
+++ b/cpu/mcf5227x/speed.c
@@ -90,17 +90,33 @@ int get_clocks(void)
int vco, temp, pcrvalue, pfdr;
u8 bootmode;
- bootmode = (ccm->ccr & 0x000C) >> 2;
-
pcrvalue = pll->pcr & 0xFF0F0FFF;
pfdr = pcrvalue >> 24;
- if (pfdr != 0x1E) {
+ if (pfdr == 0x1E)
+ bootmode = 0; /* Normal Mode */
+
+#ifdef CONFIG_CF_SBF
+ bootmode = 3; /* Serial Mode */
+#endif
+
+ if (bootmode == 0) {
+ /* Normal mode */
+ vco = ((pll->pcr & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
+ if ((vco < CLOCK_PLL_FVCO_MIN) || (vco > CLOCK_PLL_FVCO_MAX)) {
+ /* Default value */
+ pcrvalue = (pll->pcr & 0x00FFFFFF);
+ pcrvalue |= 0x1E << 24;
+ pll->pcr = pcrvalue;
+ vco =
+ ((pll->pcr & 0xFF000000) >> 24) *
+ CONFIG_SYS_INPUT_CLKSRC;
+ }
+ gd->vco_clk = vco; /* Vco clock */
+ } else if (bootmode == 3) {
/* serial mode */
- } else {
- /* Normal Mode */
- vco = pfdr * CONFIG_SYS_INPUT_CLKSRC;
- gd->vco_clk = vco;
+ vco = ((pll->pcr & 0xFF000000) >> 24) * CONFIG_SYS_INPUT_CLKSRC;
+ gd->vco_clk = vco; /* Vco clock */
}
if ((ccm->ccr & CCM_MISCCR_LIMP) == CCM_MISCCR_LIMP) {