From: Liu Ying Date: Wed, 3 Jul 2013 02:51:36 +0000 (+0800) Subject: ENGR00269449 mx6q/sdl clk:Correct register writing for aclk_podf X-Git-Tag: v3.0.35-fsl_4.1.0~66 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d0578d383039e50e58c4511b8414e43bd903e171;p=karo-tx-linux.git ENGR00269449 mx6q/sdl clk:Correct register writing for aclk_podf We need to pay attention to writing the 'CCM Serial Clock Multiplexer Register 1' register since the write value/divider map and the read value/divider for aclk_podf field are different. In order to keep the divider value unchanged when writing the other fields of the register, we need to fixup the write value. Signed-off-by: Liu Ying --- diff --git a/arch/arm/mach-mx6/clock.c b/arch/arm/mach-mx6/clock.c index 43003ddf3d9e..6b4fcea4b760 100644 --- a/arch/arm/mach-mx6/clock.c +++ b/arch/arm/mach-mx6/clock.c @@ -1864,6 +1864,8 @@ static int _clk_ipg_perclk_set_rate(struct clk *clk, unsigned long rate) reg = __raw_readl(MXC_CCM_CSCMR1); reg &= ~MXC_CCM_CSCMR1_PERCLK_PODF_MASK; reg |= (div - 1) << MXC_CCM_CSCMR1_PERCLK_PODF_OFFSET; + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -2395,6 +2397,9 @@ static int _clk_usdhc1_set_parent(struct clk *clk, struct clk *parent) if (parent == &pll2_pfd_352M) reg |= (MXC_CCM_CSCMR1_USDHC1_CLK_SEL); + /* aclk_podf fixup */ + reg ^= 0x00600000; + __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -2452,6 +2457,9 @@ static int _clk_usdhc2_set_parent(struct clk *clk, struct clk *parent) if (parent == &pll2_pfd_352M) reg |= (MXC_CCM_CSCMR1_USDHC2_CLK_SEL); + /* aclk_podf fixup */ + reg ^= 0x00600000; + __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -2509,6 +2517,9 @@ static int _clk_usdhc3_set_parent(struct clk *clk, struct clk *parent) if (parent == &pll2_pfd_352M) reg |= (MXC_CCM_CSCMR1_USDHC3_CLK_SEL); + /* aclk_podf fixup */ + reg ^= 0x00600000; + __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -2567,6 +2578,9 @@ static int _clk_usdhc4_set_parent(struct clk *clk, struct clk *parent) if (parent == &pll2_pfd_352M) reg |= (MXC_CCM_CSCMR1_USDHC4_CLK_SEL); + /* aclk_podf fixup */ + reg ^= 0x00600000; + __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -2682,6 +2696,8 @@ static int _clk_ssi1_set_parent(struct clk *clk, struct clk *parent) mux = _get_mux6(parent, &pll3_pfd_508M, &pll3_pfd_454M, &pll4_audio_main_clk, NULL, NULL, NULL); reg |= (mux << MXC_CCM_CSCMR1_SSI1_CLK_SEL_OFFSET); + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); @@ -2756,6 +2772,8 @@ static int _clk_ssi2_set_parent(struct clk *clk, struct clk *parent) mux = _get_mux6(parent, &pll3_pfd_508M, &pll3_pfd_454M, &pll4_audio_main_clk, NULL, NULL, NULL); reg |= (mux << MXC_CCM_CSCMR1_SSI2_CLK_SEL_OFFSET); + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); @@ -2829,6 +2847,8 @@ static int _clk_ssi3_set_parent(struct clk *clk, struct clk *parent) mux = _get_mux6(parent, &pll3_pfd_508M, &pll3_pfd_454M, &pll4_audio_main_clk, NULL, NULL, NULL); reg |= (mux << MXC_CCM_CSCMR1_SSI3_CLK_SEL_OFFSET); + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); @@ -3847,6 +3867,8 @@ static int _clk_emi_slow_set_parent(struct clk *clk, struct clk *parent) mux = _get_mux6(parent, &axi_clk, &pll3_usb_otg_main_clk, &pll2_pfd_400M, &pll2_pfd_352M, NULL, NULL); reg |= (mux << MXC_CCM_CSCMR1_ACLK_EMI_SLOW_OFFSET); + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -3877,6 +3899,8 @@ static int _clk_emi_slow_set_rate(struct clk *clk, unsigned long rate) reg = __raw_readl(MXC_CCM_CSCMR1); reg &= ~MXC_CCM_CSCMR1_ACLK_EMI_SLOW_PODF_MASK; reg |= (div - 1) << MXC_CCM_CSCMR1_ACLK_EMI_SLOW_PODF_OFFSET; + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); return 0; @@ -3924,6 +3948,8 @@ static int _clk_emi_set_parent(struct clk *clk, struct clk *parent) mux = _get_mux6(parent, &pll2_pfd_400M, &pll3_usb_otg_main_clk, &axi_clk, &pll2_pfd_352M, NULL, NULL); reg |= (mux << MXC_CCM_CSCMR1_ACLK_EMI_OFFSET); + /* aclk_podf fixup */ + reg ^= 0x00600000; __raw_writel(reg, MXC_CCM_CSCMR1); return 0;