Linux-Clk Archive on
 help / Atom feed
* [PATCH AUTOSEL 4.9 19/36] clk: imx6q: reset exclusive gates on init
       [not found] <>
@ 2019-01-08 19:33 ` Sasha Levin
  0 siblings, 0 replies; 1+ messages in thread
From: Sasha Levin @ 2019-01-08 19:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Lucas Stach, Stephen Boyd, Sasha Levin, linux-clk

From: Lucas Stach <>

[ Upstream commit f7542d817733f461258fd3a47d77da35b2d9fc81 ]

The exclusive gates may be set up in the wrong way by software running
before the clock driver comes up. In that case the exclusive setup is
locked in its initial state, as the complementary function can't be
activated without disabling the initial setup first.

To avoid this lock situation, reset the exclusive gates to the off
state and allow the kernel to provide the proper setup.

Signed-off-by: Lucas Stach <>
Reviewed-by: Dong Aisheng <>
Signed-off-by: Stephen Boyd <>
Signed-off-by: Sasha Levin <>
 drivers/clk/imx/clk-imx6q.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index 93a19667003d..14682df5d312 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -258,8 +258,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	 * lvds1_gate and lvds2_gate are pseudo-gates.  Both can be
 	 * independently configured as clock inputs or outputs.  We treat
 	 * the "output_enable" bit as a gate, even though it's really just
-	 * enabling clock output.
+	 * enabling clock output. Initially the gate bits are cleared, as
+	 * otherwise the exclusive configuration gets locked in the setup done
+	 * by software running before the clock driver, with no way to change
+	 * it.
+	writel(readl(base + 0x160) & ~0x3c00, base + 0x160);
 	clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
 	clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2019-01-08 19:33 ` [PATCH AUTOSEL 4.9 19/36] clk: imx6q: reset exclusive gates on init Sasha Levin

Linux-Clk Archive on

Archives are clonable:
	git clone --mirror linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ \
	public-inbox-index linux-clk

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox