aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Longchamp <valentin.longchamp@epfl.ch>2009-05-28 10:46:21 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-05-28 11:20:53 -0400
commit0573cb5f45f1b98b74348c3f1ed4f26e56e774e5 (patch)
treeef40e424244a8da7de2713e8bb5023cdcb7e6fa2
parent0b0ef442958d74e5749c460b0ae68606e317fe01 (diff)
mx31: correct csi_clk parent (v2)
changes since v1: we now check if the parent configuration bit was changed since reset and change the parent when needed. csi_clk parent was defined with ahb_clk. However, according to the m31 reference manual, it should be serial_pll_clk. Guennadi always used a 20 MHz clock that was by chance changed to a 45 MHz that fits in the mt9t031 spec. Now the clocks are computed and output correctly (measured on oscillo). Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/clock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 28bd11dc89b8..217d114b177a 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -483,7 +483,7 @@ DEFINE_CLOCK(i2c3_clk, 2, MXC_CCM_CGR0, 30, NULL, NULL, &perclk_clk);
483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk); 483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk);
484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk); 484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk);
485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk); 485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk);
486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &ahb_clk); 486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &serial_pll_clk);
487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk); 487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk);
488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk); 488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk);
489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk); 489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk);
@@ -571,6 +571,13 @@ int __init mx31_clocks_init(unsigned long fref)
571 for (i = 0; i < ARRAY_SIZE(lookups); i++) 571 for (i = 0; i < ARRAY_SIZE(lookups); i++)
572 clkdev_add(&lookups[i]); 572 clkdev_add(&lookups[i]);
573 573
574 /* change the csi_clk parent if necessary */
575 reg = __raw_readl(MXC_CCM_CCMR);
576 if (!(reg & MXC_CCM_CCMR_CSCS))
577 if (clk_set_parent(&csi_clk, &usb_pll_clk))
578 pr_err("%s: error changing csi_clk parent\n", __func__);
579
580
574 /* Turn off all possible clocks */ 581 /* Turn off all possible clocks */
575 __raw_writel((3 << 4), MXC_CCM_CGR0); 582 __raw_writel((3 << 4), MXC_CCM_CGR0);
576 __raw_writel(0, MXC_CCM_CGR1); 583 __raw_writel(0, MXC_CCM_CGR1);