public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Origen: Correct equation to calculate PLL output frequency
@ 2013-07-01  7:42 Rajeshwari Shinde
  2013-07-01  8:26 ` Minkyu Kang
  0 siblings, 1 reply; 4+ messages in thread
From: Rajeshwari Shinde @ 2013-07-01  7:42 UTC (permalink / raw)
  To: u-boot

EXYNOS4 user manual equation for calculating PLL output is
FOUT= MDIV x FIN/(PDIV x 2^(SDIV -1))
hence updating accordingly.

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
---
 arch/arm/cpu/armv7/exynos/clock.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index e1c4246..af0fa5b 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -116,8 +116,15 @@ static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
 		/* FOUT = (MDIV + K / 1024) * FIN / (PDIV * 2^SDIV) */
 		fout = (m + k / 1024) * (freq / (p * (1 << s)));
 	} else {
-		/* FOUT = MDIV * FIN / (PDIV * 2^SDIV) */
-		fout = m * (freq / (p * (1 << s)));
+		if (cpu_is_exynos4()) {
+			if (s < 1)
+				s = 1;
+			/* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
+			fout = m * (freq / (p * (1 << (s - 1))));
+		} else {
+			/* FOUT = MDIV * FIN / (PDIV * 2^SDIV) */
+			fout = m * (freq / (p * (1 << s)));
+		}
 	}
 
 	return fout;
-- 
1.7.4.4

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

end of thread, other threads:[~2013-07-02  6:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-01  7:42 [U-Boot] [PATCH] Origen: Correct equation to calculate PLL output frequency Rajeshwari Shinde
2013-07-01  8:26 ` Minkyu Kang
2013-07-01  8:41   ` Rajeshwari Birje
2013-07-02  6:45     ` Minkyu Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox