[PATCH RESEND 1/6] clk: imx6ul: disable gpmi_io clock before changing parent clock
From: Christian Eggers
Date: Tue Jan 25 2022 - 09:50:19 EST
gpmi_io clock may have been enabled by the boot loader. All children of
enfc_clk_root must be gated in order to prevent glitches during parent
change.
Signed-off-by: Christian Eggers <ceggers@xxxxxxx>
---
drivers/clk/imx/clk-imx6ul.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c
index 520b100bff4b..f599ae50dd9f 100644
--- a/drivers/clk/imx/clk-imx6ul.c
+++ b/drivers/clk/imx/clk-imx6ul.c
@@ -514,6 +514,15 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node)
else if (clk_on_imx6ull())
clk_set_parent(hws[IMX6ULL_CLK_EPDC_PRE_SEL]->clk, hws[IMX6UL_CLK_PLL3_PFD2]->clk);
+ /*
+ * gpmi_io clock may have been enabled by the boot loader. All children of
+ * enfc_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[IMX6UL_CLK_GPMI_IO])) {
+ clk_prepare_enable(hws[IMX6UL_CLK_GPMI_IO]->clk);
+ clk_disable_unprepare(hws[IMX6UL_CLK_GPMI_IO]->clk);
+ }
clk_set_parent(hws[IMX6UL_CLK_ENFC_SEL]->clk, hws[IMX6UL_CLK_PLL2_PFD2]->clk);
}
--
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