Skip to contentSkip to conversation

ppc4xx: Fix 405EZ uart base baud calculation

PATCH New Stefan Roese 1 participant 2 messages Sep 11, 2009 – Sep 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4xx: Fix 405EZ uart base baud calculation

With this fix, Linux correctly configures the baudrate when booting with FDT passed from U-Boot to Linux.

---
 cpu/ppc4xx/speed.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
cpu/ppc4xx/speed.c +5 -1
index 1f75137..9c4bc09 100644
@@ -914,6 +914,7 @@ void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
 	unsigned long sysClkPeriodPs = ONE_BILLION / (CONFIG_SYS_CLK_FREQ/1000);
 	unsigned long primad_cpudv;
 	unsigned long m;
+	unsigned long plloutb;
 
 	/*
 	 * Read PLL Mode registers
@@ -999,7 +1000,10 @@ void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
 	sysInfo->freqEBC = (CONFIG_SYS_CLK_FREQ * sysInfo->pllFbkDiv) /
 		sysInfo->pllExtBusDiv;
 
-	sysInfo->freqUART = sysInfo->freqVCOHz;
+	plloutb = ((CONFIG_SYS_CLK_FREQ * ((cpr_pllc & PLLC_SRC_MASK) ?
+		sysInfo->pllFwdDivB : sysInfo->pllFwdDiv) * sysInfo->pllFbkDiv) /
+		sysInfo->pllFwdDivB);
+	sysInfo->freqUART = plloutb;
 }
 
 /********************************************
Signature · 1 line
1.6.4.1
author Applied
#1 lore raw

PATCH 1/1 ppc4xx: Fix 405EZ uart base baud calculation

Quoted 4 lines · On Friday 11 September 2009 17:21:38 Stefan Roese wrote:

With this fix, Linux correctly configures the baudrate when booting with FDT passed from U-Boot to Linux.

Applied to ppc4xx/master. Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de