All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] lpc32xx: fix calculation of HCLK PLL output clock
@ 2015-10-04 22:18 Vladimir Zapolskiy
  2015-10-12 15:16 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2015-10-04 22:18 UTC (permalink / raw)
  To: u-boot

Execution branches on feedback mode are swapped, this has no effect
if default direct mode is on (then p_div is equal to 1 and Fout equals
to Fcco), that's why the problem remained unnoticed for a long time.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 arch/arm/cpu/arm926ejs/lpc32xx/clk.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clk.c b/arch/arm/cpu/arm926ejs/lpc32xx/clk.c
index 1ef8a36..f5e2103 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/clk.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/clk.c
@@ -54,12 +54,12 @@ unsigned int get_hclk_pll_rate(void)
 	if (fref > 27000000ULL || fref < 1000000ULL)
 		return 0;
 
-	fout = fref * m_div;
-	if (val & CLK_HCLK_PLL_FEEDBACK) {
-		fcco = fout;
+	fcco = fref * m_div;
+	fout = fcco;
+	if (val & CLK_HCLK_PLL_FEEDBACK)
+		fcco *= p_div;
+	else
 		do_div(fout, p_div);
-	} else
-		fcco = fout * p_div;
 
 	if (fcco > 320000000ULL || fcco < 156000000ULL)
 		return 0;
-- 
2.1.4

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

* [U-Boot] lpc32xx: fix calculation of HCLK PLL output clock
  2015-10-04 22:18 [U-Boot] [PATCH] lpc32xx: fix calculation of HCLK PLL output clock Vladimir Zapolskiy
@ 2015-10-12 15:16 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2015-10-12 15:16 UTC (permalink / raw)
  To: u-boot

On Sun, Oct 04, 2015 at 11:18:45PM +0100, Vladimir Zapolskiy wrote:

> Execution branches on feedback mode are swapped, this has no effect
> if default direct mode is on (then p_div is equal to 1 and Fout equals
> to Fcco), that's why the problem remained unnoticed for a long time.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151012/2affe43d/attachment.sig>

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

end of thread, other threads:[~2015-10-12 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-04 22:18 [U-Boot] [PATCH] lpc32xx: fix calculation of HCLK PLL output clock Vladimir Zapolskiy
2015-10-12 15:16 ` [U-Boot] " Tom Rini

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.