summaryrefslogtreecommitdiff
path: root/cpu/mpc8xx/serial.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-01-31 20:06:54 +0000
committerwdenk <wdenk>2004-01-31 20:06:54 +0000
commit75d1ea7f6aa00c280c495a1ff6502f091c4244fe (patch)
treebb1ee058f8886ae42cb85a6b2c82f3d6b18661bf /cpu/mpc8xx/serial.c
parent6876609446980c3055bbd32c195a63330e21d8e6 (diff)
downloadu-boot-imx-75d1ea7f6aa00c280c495a1ff6502f091c4244fe.zip
u-boot-imx-75d1ea7f6aa00c280c495a1ff6502f091c4244fe.tar.gz
u-boot-imx-75d1ea7f6aa00c280c495a1ff6502f091c4244fe.tar.bz2
Fix variable CPU clock for MPC859/866 systems for low CPU clocks
Diffstat (limited to 'cpu/mpc8xx/serial.c')
-rw-r--r--cpu/mpc8xx/serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpu/mpc8xx/serial.c b/cpu/mpc8xx/serial.c
index a875963..71f3ae1 100644
--- a/cpu/mpc8xx/serial.c
+++ b/cpu/mpc8xx/serial.c
@@ -71,11 +71,11 @@
static void serial_setdivisor(volatile cpm8xx_t *cp)
{
DECLARE_GLOBAL_DATA_PTR;
- int divisor=gd->cpu_clk/16/gd->baudrate;
+ int divisor=(gd->cpu_clk + 8*gd->baudrate)/16/gd->baudrate;
if(divisor/16>0x1000) {
/* bad divisor, assume 50Mhz clock and 9600 baud */
- divisor=(50*1000*1000)/16/9600;
+ divisor=(50*1000*1000 + 8*9600)/16/9600;
}
#ifdef CFG_BRGCLK_PRESCALE