From: Ye.Li Date: Tue, 28 Oct 2014 17:40:36 +0800 Subject: [U-Boot] [PATCH v2 3/5] imx: mx6: Change the get_ipg_per_clk for OSC 24Mhz source In-Reply-To: <1414489238-3947-1-git-send-email-B37916@freescale.com> References: <1414489238-3947-1-git-send-email-B37916@freescale.com> Message-ID: <1414489238-3947-3-git-send-email-B37916@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes since v1: - None arch/arm/cpu/armv7/mx6/clock.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c index d200531..6c9c78c 100644 --- a/arch/arm/cpu/armv7/mx6/clock.c +++ b/arch/arm/cpu/armv7/mx6/clock.c @@ -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); -- 1.7.4.1