summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mpc5xxx/serial.c8
-rw-r--r--cpu/mpc5xxx/start.S3
2 files changed, 7 insertions, 4 deletions
diff --git a/cpu/mpc5xxx/serial.c b/cpu/mpc5xxx/serial.c
index 54ecf5b..f463d2c 100644
--- a/cpu/mpc5xxx/serial.c
+++ b/cpu/mpc5xxx/serial.c
@@ -67,10 +67,10 @@ int serial_init (void)
/* select clock sources */
#if defined(CONFIG_MGT5100)
psc->psc_clock_select = 0xdd00;
- baseclk = CFG_MPC5XXX_CLKIN / 32;
+ baseclk = (CFG_MPC5XXX_CLKIN + 16) / 32;
#elif defined(CONFIG_MPC5200)
psc->psc_clock_select = 0;
- baseclk = gd->ipb_clk / 32;
+ baseclk = (gd->ipb_clk + 16) / 32;
#endif
/* switch to UART mode */
@@ -85,8 +85,8 @@ int serial_init (void)
psc->mode = PSC_MODE_ONE_STOP;
/* set up UART divisor */
- div = baseclk / gd->baudrate;
- psc->ctur = div >> 8;
+ div = (baseclk + (gd->baudrate/2)) / gd->baudrate;
+ psc->ctur = (div >> 8) & 0xff;
psc->ctlr = div & 0xff;
/* disable all interrupts */
diff --git a/cpu/mpc5xxx/start.S b/cpu/mpc5xxx/start.S
index a001e1c..26811e1 100644
--- a/cpu/mpc5xxx/start.S
+++ b/cpu/mpc5xxx/start.S
@@ -104,6 +104,9 @@ boot_warm:
mfmsr r5 /* save msr contents */
#if defined(CFG_LOWBOOT)
+#if defined(CFG_RAMBOOT)
+#error CFG_LOWBOOT is incompatible with CFG_RAMBOOT
+#endif /* CFG_RAMBOOT */
lis r4, CFG_DEFAULT_MBAR@h
lis r3, 0x0000FF00@h
ori r3, r3, 0x0000FF00@l