From b98fff1d6acc57cc54f01740028535ac095237cd Mon Sep 17 00:00:00 2001 From: wdenk Date: Mon, 9 Feb 2004 20:51:26 +0000 Subject: * Patch by Rahul Shanbhag, 28 Jan 2004: Fix flash protection/locking handling for OMAP1610 innovator board. * Patch by Rolf Peukert, 28 Jan 2004: fix flash write problems on CSB226 board (write with 32 bit bus width) * Patches by Mark Jonas, 16 Jan 2004: - fix rounding error when calculating baudrates for MPC5200 PSCs - make sure CFG_RAMBOOT and CFG_LOWBOOT are not enabled at the same time which is not supported --- cpu/mpc5xxx/serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cpu/mpc5xxx/serial.c') diff --git a/cpu/mpc5xxx/serial.c b/cpu/mpc5xxx/serial.c index 54ecf5be17..f463d2cf07 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 */ -- cgit