diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2014-05-28 01:26:33 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-06-25 09:17:20 -0400 |
commit | c7b8e407591afb7d8976bb9fc3128f921282b7c6 (patch) | |
tree | 69ac912afd1e85198f9341fc76171c2258870a57 | |
parent | 44e694116235a6f69d9e3391f2d6b561708d93c7 (diff) |
ENGR00318063-3: ARM: imx6sx: fix ocram_sels mux setting
The current imx6sx clock driver combines two mux clocks ocram_alt_sel
and ocram_sel into one, while ocram_alt_sel is a glitchy mux and
ocram_sel is a glitchless one. Fix it to match the clock tree in
Reference Manual.
One thing clk API clients need to take care is that clk_set_parent()
can be called on glitchy ocram_alt_sel only when ocram_sel selects the
other path, i.e. periph. Otherwise, a glitch could be generated on
ocram_alt_sel and get propagated into the divider ocram_podf. In that
case, ocram_podf gets locked up and ocram clock has no output.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
-rw-r--r-- | arch/arm/mach-imx/clk-imx6sx.c | 6 | ||||
-rw-r--r-- | include/dt-bindings/clock/imx6sx-clock.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index 0844e5ce2f32..e65fb6f58c6a 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c | |||
@@ -36,7 +36,8 @@ static const char *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", }; | |||
36 | static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "osc", }; | 36 | static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "osc", }; |
37 | static const char *periph_sels[] = { "periph_pre", "periph_clk2", }; | 37 | static const char *periph_sels[] = { "periph_pre", "periph_clk2", }; |
38 | static const char *periph2_sels[] = { "periph2_pre", "periph2_clk2", }; | 38 | static const char *periph2_sels[] = { "periph2_pre", "periph2_clk2", }; |
39 | static const char *ocram_sels[] = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", }; | 39 | static const char *ocram_alt_sels[] = { "pll2_pfd2_396m", "pll3_pfd1_540m", }; |
40 | static const char *ocram_sels[] = { "periph", "ocram_alt_sel", }; | ||
40 | static const char *audio_sels[] = { "pll4_audio_div", "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", }; | 41 | static const char *audio_sels[] = { "pll4_audio_div", "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", }; |
41 | static const char *gpu_axi_sels[] = { "pll2_pfd2_396m", "pll3_pfd0_720m", "pll3_pfd1_540m", "pll2_bus", }; | 42 | static const char *gpu_axi_sels[] = { "pll2_pfd2_396m", "pll3_pfd0_720m", "pll3_pfd1_540m", "pll2_bus", }; |
42 | static const char *gpu_core_sels[] = { "pll3_pfd1_540m", "pll3_pfd0_720m", "pll2_bus", "pll2_pfd2_396m", }; | 43 | static const char *gpu_core_sels[] = { "pll3_pfd1_540m", "pll3_pfd0_720m", "pll2_bus", "pll2_pfd2_396m", }; |
@@ -224,7 +225,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) | |||
224 | /* name reg shift width parent_names num_parents */ | 225 | /* name reg shift width parent_names num_parents */ |
225 | clks[IMX6SX_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels)); | 226 | clks[IMX6SX_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels)); |
226 | clks[IMX6SX_CLK_PLL1_SW] = imx_clk_mux("pll1_sw", base + 0xc, 2, 1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels)); | 227 | clks[IMX6SX_CLK_PLL1_SW] = imx_clk_mux("pll1_sw", base + 0xc, 2, 1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels)); |
227 | clks[IMX6SX_CLK_OCRAM_SEL] = imx_clk_mux("ocram_sel", base + 0x14, 6, 2, ocram_sels, ARRAY_SIZE(ocram_sels)); | 228 | clks[IMX6SX_CLK_OCRAM_ALT_SEL] = imx_clk_mux("ocram_alt_sel", base + 0x14, 7, 1, ocram_alt_sels, ARRAY_SIZE(ocram_alt_sels)); |
229 | clks[IMX6SX_CLK_OCRAM_SEL] = imx_clk_mux("ocram_sel", base + 0x14, 6, 1, ocram_sels, ARRAY_SIZE(ocram_sels)); | ||
228 | clks[IMX6SX_CLK_PERIPH_PRE] = imx_clk_mux("periph_pre", base + 0x18, 18, 2, periph_pre_sels, ARRAY_SIZE(periph_pre_sels)); | 230 | clks[IMX6SX_CLK_PERIPH_PRE] = imx_clk_mux("periph_pre", base + 0x18, 18, 2, periph_pre_sels, ARRAY_SIZE(periph_pre_sels)); |
229 | clks[IMX6SX_CLK_PERIPH2_PRE] = imx_clk_mux("periph2_pre", base + 0x18, 21, 2, periph2_pre_sels, ARRAY_SIZE(periph2_pre_sels)); | 231 | clks[IMX6SX_CLK_PERIPH2_PRE] = imx_clk_mux("periph2_pre", base + 0x18, 21, 2, periph2_pre_sels, ARRAY_SIZE(periph2_pre_sels)); |
230 | clks[IMX6SX_CLK_PERIPH_CLK2_SEL] = imx_clk_mux("periph_clk2_sel", base + 0x18, 12, 2, periph_clk2_sels, ARRAY_SIZE(periph_clk2_sels)); | 232 | clks[IMX6SX_CLK_PERIPH_CLK2_SEL] = imx_clk_mux("periph_clk2_sel", base + 0x18, 12, 2, periph_clk2_sels, ARRAY_SIZE(periph_clk2_sels)); |
diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h index 421d8bb76f2f..0e3710cdd5f6 100644 --- a/include/dt-bindings/clock/imx6sx-clock.h +++ b/include/dt-bindings/clock/imx6sx-clock.h | |||
@@ -251,6 +251,7 @@ | |||
251 | #define IMX6SX_CLK_SAI2_IPG 238 | 251 | #define IMX6SX_CLK_SAI2_IPG 238 |
252 | #define IMX6SX_CLK_ESAI_IPG 239 | 252 | #define IMX6SX_CLK_ESAI_IPG 239 |
253 | #define IMX6SX_CLK_ESAI_MEM 240 | 253 | #define IMX6SX_CLK_ESAI_MEM 240 |
254 | #define IMX6SX_CLK_CLK_END 241 | 254 | #define IMX6SX_CLK_OCRAM_ALT_SEL 241 |
255 | #define IMX6SX_CLK_CLK_END 242 | ||
255 | 256 | ||
256 | #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */ | 257 | #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */ |