All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200
@ 2008-05-28 18:05 Tsi-Chung.Liew
  2008-05-28 18:45 ` Jerry Van Baren
  0 siblings, 1 reply; 7+ messages in thread
From: Tsi-Chung.Liew @ 2008-05-28 18:05 UTC (permalink / raw)
  To: u-boot

From: TsiChung Liew <Tsi-Chung.Liew@freescale.com>

If bus frequency is larger than 133MHz, the UART cannot
output baudrate at 115200 correctly.

Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
---
 drivers/serial/mcfuart.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c
index 88f3eb1..fca76bd 100644
--- a/drivers/serial/mcfuart.c
+++ b/drivers/serial/mcfuart.c
@@ -64,7 +64,10 @@ int serial_init(void)
 
 	/* Setting up BaudRate */
 	counter = (u32) (gd->bus_clk / (gd->baudrate));
-	counter >>= 5;
+	counter = (counter + 31) >> 5;
+
+	if ((gd->bus_clk > 133333333) && (gd->baudrate >= 115200))
+		counter++;
 
 	/* write to CTUR: divide counter upper byte */
 	uart->ubg1 = (u8) ((counter & 0xff00) >> 8);
-- 
1.5.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-29 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 18:05 [U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200 Tsi-Chung.Liew
2008-05-28 18:45 ` Jerry Van Baren
2008-05-28 20:05   ` Liew Tsi Chung
2008-05-28 21:29     ` Jerry Van Baren
2008-05-28 23:35       ` Liew Tsi Chung
2008-05-29  3:56         ` Jerry Van Baren
2008-05-29 16:45           ` Liew Tsi Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.