summaryrefslogtreecommitdiff
path: root/cpu/mpc5xxx/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/mpc5xxx/serial.c')
-rw-r--r--cpu/mpc5xxx/serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpu/mpc5xxx/serial.c b/cpu/mpc5xxx/serial.c
index f463d2c..1e9628c 100644
--- a/cpu/mpc5xxx/serial.c
+++ b/cpu/mpc5xxx/serial.c
@@ -154,11 +154,11 @@ serial_setbrg(void)
#if defined(CONFIG_MGT5100)
baseclk = CFG_MPC5XXX_CLKIN / 32;
#elif defined(CONFIG_MPC5200)
- baseclk = gd->ipb_clk / 32;
+ baseclk = (gd->ipb_clk + 16) / 32;
#endif
/* set up UART divisor */
- div = baseclk / gd->baudrate;
+ div = (baseclk + (gd->baudrate/2)) / gd->baudrate;
psc->ctur = div >> 8;
psc->ctlr = div & 0xff;
}