]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
clock-imx35: correct arm and ahb clock calculation
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 16 Aug 2010 13:54:06 +0000 (15:54 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Tue, 17 Aug 2010 07:23:54 +0000 (09:23 +0200)
According to the Datasheet:
"i.MX35 (MCIMX35) Multimedia Applications Processor Reference Manual,
Rev. 2" "Figure 14-24. Clock Control And Gating"
change the result of get_rate_ahb based on the frequency returned
by get_rate_arm to calculate the proper rate.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mx3/clock-imx35.c

index e582ceb6e0c1d50317c192ef5bde9b36aa5026cf..1d311b77b40e5346f36173e5b3245bfa8e175dd2 100644 (file)
@@ -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;
 }
@@ -164,7 +164,7 @@ static unsigned long get_rate_ahb(struct clk *clk)
 {
        unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
        struct arm_ahb_div *aad;
-       unsigned long fref = get_rate_mpll();
+       unsigned long fref = get_rate_arm();
 
        aad = &clk_consumer[(pdr0 >> 16) & 0xf];