summaryrefslogtreecommitdiff
path: root/drivers/serial/mcfuart.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2008-07-14 10:45:47 +0200
committerStefan Roese <sr@denx.de>2008-07-14 10:45:47 +0200
commit4b326101d6cfaeab8250988bc4c7f51e6c92d719 (patch)
treed04632af08591263f5cd6fc8a5c6ba8ac3d6d246 /drivers/serial/mcfuart.c
parent69e2c6d0d13d7c8cf1612ac090bdc4c59ba6858e (diff)
parentd5996dd555edf52721b7691a4c59de016251ed39 (diff)
downloadu-boot-imx-4b326101d6cfaeab8250988bc4c7f51e6c92d719.zip
u-boot-imx-4b326101d6cfaeab8250988bc4c7f51e6c92d719.tar.gz
u-boot-imx-4b326101d6cfaeab8250988bc4c7f51e6c92d719.tar.bz2
Merge branch 'master' of /home/stefan/git/u-boot/u-boot into next
Diffstat (limited to 'drivers/serial/mcfuart.c')
-rw-r--r--drivers/serial/mcfuart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c
index 88f3eb1..5eb4f45 100644
--- a/drivers/serial/mcfuart.c
+++ b/drivers/serial/mcfuart.c
@@ -63,8 +63,8 @@ int serial_init(void)
uart->umr = UART_UMR_SB_STOP_BITS_1;
/* Setting up BaudRate */
- counter = (u32) (gd->bus_clk / (gd->baudrate));
- counter >>= 5;
+ counter = (u32) ((gd->bus_clk / 32) + (gd->baudrate / 2));
+ counter = counter / gd->baudrate;
/* write to CTUR: divide counter upper byte */
uart->ubg1 = (u8) ((counter & 0xff00) >> 8);