diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2014-05-26 16:37:25 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-04-14 14:00:02 -0500 |
commit | 28b2e591b1f527cbaccccf4d80b5f71cb745e392 (patch) | |
tree | b06b2a3d91746270274d5e121e761266c97fed0f /arch/arm/mach-imx/clk.h | |
parent | 82fa86e3b032f2b84945bd062e530283d4f7defe (diff) |
ENGR00318063-5: ARM: imx: set CLK_SET_PARENT_GATE flag for glitchy mux clocks
The mux clocks found on imx6 SoCs are all glitchy ones except
pll1_sw_clk_sel, axi_sel, periph_clk_sel and periph2_clk_sel. When
switching parent clock of a glitchy mux without gating, a glitch could
be generated and propagated into the downstream divider, and hence locks
up the divider and results in no clock output.
To avoid the situation, the parent switching should happen only when
the clock is gated. Add CLK_SET_PARENT_GATE flag for i.MX mux clocks,
so that clock core will make that check during clk_set_parent() call.
Since glitchless clocks do not need this flag, we create
imx_clk_mux_glitchless() without this flag for them. The periph_clk_sel
and periph2_clk_sel are registered by imx_clk_busy_mux() which does not
set this flag anyway, so they need no change.
shawn.guo: cherry-pick commit 10bae51219b3 from imx_3.10.y
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/clk.h')
-rw-r--r-- | arch/arm/mach-imx/clk.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h index 74fa1ccfe25d..c7cb8c98014d 100644 --- a/arch/arm/mach-imx/clk.h +++ b/arch/arm/mach-imx/clk.h @@ -102,8 +102,8 @@ static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, int num_parents) { return clk_register_mux(NULL, name, parents, num_parents, - CLK_SET_RATE_NO_REPARENT, reg, shift, - width, 0, &imx_ccm_lock); + CLK_SET_RATE_NO_REPARENT | CLK_SET_PARENT_GATE, + reg, shift, width, 0, &imx_ccm_lock); } static inline struct clk *imx_clk_mux_flags(const char *name, @@ -111,7 +111,17 @@ static inline struct clk *imx_clk_mux_flags(const char *name, int num_parents, unsigned long flags) { return clk_register_mux(NULL, name, parents, num_parents, - flags, reg, shift, width, 0, &imx_ccm_lock); + flags | CLK_SET_PARENT_GATE, reg, shift, width, 0, + &imx_ccm_lock); +} + +static inline struct clk *imx_clk_mux_glitchless(const char *name, + void __iomem *reg, u8 shift, u8 width, const char **parents, + int num_parents) +{ + return clk_register_mux(NULL, name, parents, num_parents, + 0, reg, shift, + width, 0, &imx_ccm_lock); } static inline struct clk *imx_clk_fixed_factor(const char *name, |