From b8c1d6a54ff8195488b68e163de8ec31f1603496 Mon Sep 17 00:00:00 2001
From: Stefan Roese <sr@denx.de>
Date: Tue, 2 Jun 2009 16:53:15 +0200
Subject: [PATCH] mpc512x: Fix PSC divisor calculation for baudrate setting

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@denx.de>
---
 cpu/mpc512x/serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpu/mpc512x/serial.c b/cpu/mpc512x/serial.c
index 16ce7700f9..d3ffff9d7e 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);
-- 
GitLab