summaryrefslogtreecommitdiffstats
path: root/cpu/mcf52x2/cpu_init.c
diff options
context:
space:
mode:
authorRichard Retanubun <RichardRetanubun@RuggedCom.com>2009-01-29 14:36:06 -0500
committerJohn Rigby <jrigby@freescale.com>2009-02-06 14:54:47 -0700
commite0db344fabfeb4f9649846f94838f51172f6a1f6 (patch)
tree6c30ca2295619fba33e47ddf63474b209ed6d5df /cpu/mcf52x2/cpu_init.c
parentd1ef25dd81c79dcfad5c2ff0162b1bea21d04bc3 (diff)
downloadtalos-obmc-uboot-e0db344fabfeb4f9649846f94838f51172f6a1f6.tar.gz
talos-obmc-uboot-e0db344fabfeb4f9649846f94838f51172f6a1f6.zip
Coldfire: M5271: Allow board header file to specify clock multiplier
M5271 dynamic clock multiplier. It is currently fixed at 100MHz. Allow the board header file to set their own multiplier and divider. Added the #define for the multiplier and divider to the cpu header file. Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Diffstat (limited to 'cpu/mcf52x2/cpu_init.c')
-rw-r--r--cpu/mcf52x2/cpu_init.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpu/mcf52x2/cpu_init.c b/cpu/mcf52x2/cpu_init.c
index d88acc5e9b..11f70b0dbf 100644
--- a/cpu/mcf52x2/cpu_init.c
+++ b/cpu/mcf52x2/cpu_init.c
@@ -181,9 +181,14 @@ void cpu_init_f(void)
/* FlexBus Chipselect */
init_fbcs();
+#ifdef CONFIG_SYS_MCF_SYNCR
+ /* Set clockspeed according to board header file */
+ mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR);
+#else
/* Set clockspeed to 100MHz */
- mbar_writeShort(MCF_FMPLL_SYNCR,
+ mbar_writeLong(MCF_FMPLL_SYNCR,
MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
+#endif
while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ;
}
OpenPOWER on IntegriCloud