From: Christian Eggers <ceggers@arri.de>
To: Abel Vesa <abel.vesa@nxp.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>, <linux-clk@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Stefan Riedmueller <s.riedmueller@phytec.de>,
Christian Eggers <ceggers@arri.de>
Subject: [PATCH 5/6] clk: imx6sx: disable gpmi_io clock before changing parent clock
Date: Tue, 25 Jan 2022 09:54:39 +0100 [thread overview]
Message-ID: <20220125085440.8768-1-ceggers@arri.de> (raw)
In-Reply-To: <20220125085206.8508-1-ceggers@arri.de>
gpmi_io clocks may have been enabled by the boot loader. All children of
qspi2_clk_root must be gated in order to prevent glitches during parent
change.
Signed-off-by: Christian Eggers <ceggers@arri.de>
---
drivers/clk/imx/clk-imx6sx.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
index fc1bd23d4583..cf1c1fad45f9 100644
--- a/drivers/clk/imx/clk-imx6sx.c
+++ b/drivers/clk/imx/clk-imx6sx.c
@@ -546,8 +546,19 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
clk_set_parent(hws[IMX6SX_CLK_GPU_AXI_SEL]->clk, hws[IMX6SX_CLK_PLL3_PFD0]->clk);
clk_set_parent(hws[IMX6SX_CLK_QSPI1_SEL]->clk, hws[IMX6SX_CLK_PLL2_BUS]->clk);
- clk_set_parent(hws[IMX6SX_CLK_QSPI2_SEL]->clk, hws[IMX6SX_CLK_PLL2_BUS]->clk);
imx_register_uart_clocks(2);
+
+ /*
+ * gpmi_io clock may have been enabled by the boot loader. All children
+ * of qspi2_clk_root must be gated in order to prevent glitches during
+ * parent change. The task of re-enabling is left to the gpmi-nand
+ * driver.
+ */
+ if (clk_hw_is_enabled(hws[IMX6SX_CLK_GPMI_IO])) {
+ clk_prepare_enable(hws[IMX6SX_CLK_GPMI_IO]->clk);
+ clk_disable_unprepare(hws[IMX6SX_CLK_GPMI_IO]->clk);
+ }
+ clk_set_parent(hws[IMX6SX_CLK_QSPI2_SEL]->clk, hws[IMX6SX_CLK_PLL2_BUS]->clk);
}
CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init);
--
Christian Eggers
Embedded software developer
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
next prev parent reply other threads:[~2022-01-25 9:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 8:52 [PATCH 0/6] clk: imx6*: avoid GPMI clock glitches on reparenting/divider change Christian Eggers
2022-01-25 8:52 ` [PATCH 1/6] clk: imx6ul: disable gpmi_io clock before changing parent clock Christian Eggers
2022-01-25 13:11 ` Fabio Estevam
2022-01-25 8:52 ` [PATCH 2/6] clk: imx6ul: enforce gating of gpmi_io clock Christian Eggers
2022-01-25 8:52 ` [PATCH 3/6] clk: imx6q: disable gpmi_io and ipt_io clocks before changing parent Christian Eggers
2022-01-25 8:52 ` [PATCH 4/6] clk: imx6q: enforce gating of gpmi_io clock Christian Eggers
2022-01-25 8:54 ` Christian Eggers [this message]
2022-01-25 8:54 ` [PATCH 6/6] clk: imx6sx: " Christian Eggers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220125085440.8768-1-ceggers@arri.de \
--to=ceggers@arri.de \
--cc=abel.vesa@nxp.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=s.hauer@pengutronix.de \
--cc=s.riedmueller@phytec.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®