]> git.sur5r.net Git - u-boot/commit
ColdFire: Fix UART baudrate formula
authorTsiChung Liew <Tsi-Chung.Liew@freescale.com>
Thu, 29 May 2008 17:21:54 +0000 (12:21 -0500)
committerJohn Rigby <jrigby@freescale.com>
Fri, 11 Jul 2008 16:45:56 +0000 (10:45 -0600)
commit81cc32322acb1b3225ee45606ced48e2a14824dc
tree27484e115603a42a3f470d0ac471157ff8329e79
parent9b55a2536919f4de1bb1044e6eb8262c2f53bc96
ColdFire: Fix UART baudrate formula

The formula "counter = (u32) (gd->bus_clk / gd->baudrate) / 32"
can generate the wrong divisor due to integer division truncation.
Round the calculated divisor value by adding 1/2 the baudrate
before dividing by the baudrate.

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
drivers/serial/mcfuart.c