[PATCH 1/2] i.MX35: Fix arm/ahb clock calculation

Sascha Hauer s.hauer at pengutronix.de
Fri Apr 23 03:40:25 EDT 2010


The correct divider for the reference clock if arm_sel is 1 is
3/4 and not 2/3. Also, the ahb clock is also affected by this divider.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-mx3/clock-imx35.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index 9f3e943..5c87338 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -155,7 +155,7 @@ static unsigned long get_rate_arm(void)
 
 	aad = &clk_consumer[(pdr0 >> 16) & 0xf];
 	if (aad->sel)
-		fref = fref * 2 / 3;
+		fref = fref * 3 / 4;
 
 	return fref / aad->arm;
 }
@@ -167,6 +167,8 @@ static unsigned long get_rate_ahb(struct clk *clk)
 	unsigned long fref = get_rate_mpll();
 
 	aad = &clk_consumer[(pdr0 >> 16) & 0xf];
+	if (aad->sel)
+		fref = fref * 3 / 4;
 
 	return fref / aad->ahb;
 }
-- 
1.7.0




More information about the linux-arm-kernel mailing list