All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ppc4xx: Fix 405EZ uart base baud calculation
Date: Fri, 11 Sep 2009 17:21:38 +0200	[thread overview]
Message-ID: <1252682498-23708-1-git-send-email-sr@denx.de> (raw)

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

Signed-off-by: Stefan Roese <sr@denx.de>
---
 cpu/ppc4xx/speed.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index 1f75137..9c4bc09 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -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;
 }
 
 /********************************************
-- 
1.6.4.1

             reply	other threads:[~2009-09-11 15:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 15:21 Stefan Roese [this message]
2009-09-17 12:06 ` [U-Boot] [PATCH] ppc4xx: Fix 405EZ uart base baud calculation Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252682498-23708-1-git-send-email-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.