[U-Boot] [PATCH 1/2] mpc512x: Fix PSC divisor calculation for baudrate setting

Stefan Roese sr at denx.de
Tue Jun 2 16:53:15 CEST 2009


The wrong input frequency was used in serial_setbrg(). This patch fixes
this by using ips_clk as input frequency for the PSC baudrate generator.

Signed-off-by: Stefan Roese <sr at denx.de>
---
 cpu/mpc512x/serial.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/mpc512x/serial.c b/cpu/mpc512x/serial.c
index 16ce770..d3ffff9 100644
--- a/cpu/mpc512x/serial.c
+++ b/cpu/mpc512x/serial.c
@@ -167,7 +167,7 @@ void serial_setbrg (void)
 	volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE];
 	unsigned long baseclk, div;
 
-	baseclk = (gd->csb_clk + 8) / 16;
+	baseclk = (gd->ips_clk + 8) / 16;
 	div = (baseclk + (gd->baudrate / 2)) / gd->baudrate;
 
 	out_8(&psc->ctur, (div >> 8) & 0xFF);
-- 
1.6.2.5



More information about the U-Boot mailing list