imx: mx6: Change the get_ipg_per_clk for OSC 24Mhz source
authorYe.Li <B37916@freescale.com>
Thu, 30 Oct 2014 10:20:57 +0000 (18:20 +0800)
committerStefano Babic <sbabic@denx.de>
Mon, 3 Nov 2014 10:21:49 +0000 (11:21 +0100)
For MX6SL and MX6SX, the perclk can come from OSC 24Mhz source. Fix
the get_ipg_per_clk function to support it.

Signed-off-by: Ye.Li <B37916@freescale.com>
arch/arm/cpu/armv7/mx6/clock.c

index d200531030e730301574f27943757ec50ab4f763..6c9c78c11a11ea24f9d494e96630dc0bf238f333 100644 (file)
@@ -312,6 +312,10 @@ static u32 get_ipg_per_clk(void)
        u32 reg, perclk_podf;
 
        reg = __raw_readl(&imx_ccm->cscmr1);
+#if (defined(CONFIG_MX6SL) || defined(CONFIG_MX6SX))
+       if (reg & MXC_CCM_CSCMR1_PER_CLK_SEL_MASK)
+               return MXC_HCLK; /* OSC 24Mhz */
+#endif
        perclk_podf = reg & MXC_CCM_CSCMR1_PERCLK_PODF_MASK;
 
        return get_ipg_clk() / (perclk_podf + 1);