Skip to contentSkip to conversation

clk: imx8m: Add GIC clock

PATCH Applied Leonard Crestez 3 participants 5 messages May 22, 2019 – May 23, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover clk: imx8m: Add GIC clock

Add gic clk and mark it as critical so that parents are not turned off by accident.

Changes since v1:
* Add imx8mq
* Split dt-bindings to separate patch
* Rebase on shawnguo/clk/imx
Link to v1: https://patchwork.kernel.org/patch/10940303/

Leonard Crestez (2):
dt-bindings: clock: imx8m: Add GIC clock
clk: imx8m: Add GIC clock

 drivers/clk/imx/clk-imx8mm.c             | 4 ++++
 drivers/clk/imx/clk-imx8mq.c             | 4 ++++
 include/dt-bindings/clock/imx8mm-clock.h | 4 +++-
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 4 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 dt-bindings: clock: imx8m: Add GIC clock

This should be defined in the clock tree so that parents are not shutdown by accident

---
 include/dt-bindings/clock/imx8mm-clock.h | 4 +++-
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
include/dt-bindings/clock/imx8mm-clock.h +3 -1
index fe47798f95df..5e8e32d18816 100644
@@ -243,8 +243,10 @@
 #define IMX8MM_CLK_GPIO2_ROOT			224
 #define IMX8MM_CLK_GPIO3_ROOT			225
 #define IMX8MM_CLK_GPIO4_ROOT			226
 #define IMX8MM_CLK_GPIO5_ROOT			227
 
-#define IMX8MM_CLK_END				228
+#define IMX8MM_CLK_GIC				228
+
+#define IMX8MM_CLK_END				229
 
 #endif
include/dt-bindings/clock/imx8mq-clock.h +3 -1
index 6677e920dc2d..7900a219f5fa 100644
@@ -398,7 +398,9 @@
 #define IMX8MQ_CLK_GPIO2_ROOT			260
 #define IMX8MQ_CLK_GPIO3_ROOT			261
 #define IMX8MQ_CLK_GPIO4_ROOT			262
 #define IMX8MQ_CLK_GPIO5_ROOT			263
 
-#define IMX8MQ_CLK_END				264
+#define IMX8MQ_CLK_GIC				264
+
+#define IMX8MQ_CLK_END				265
 #endif /* __DT_BINDINGS_CLOCK_IMX8MQ_H */
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/2 clk: imx8m: Add GIC clock

In reply to Leonard Crestez

This is documented in the reference manuals as GIC_CLK_ROOT.

In some out-of-tree DVFS scenarios the gic clock can end up as the only user of sys_pll2 so if we don't define the gic clk explicitly it might be turned off.

This applies to both 8mq and 8mm: same clk register but diffferent parents.

---
 drivers/clk/imx/clk-imx8mm.c | 4 ++++
 drivers/clk/imx/clk-imx8mq.c | 4 ++++
 2 files changed, 8 insertions(+)
drivers/clk/imx/clk-imx8mm.c +4 -0
index 2e2f8c210432..74112d3ef5bf 100644
@@ -286,10 +286,13 @@ static const char *imx8mm_usb_core_sels[] = {"osc_24m", "sys_pll1_100m", "sys_pl
 					     "sys_pll2_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", };
 
 static const char *imx8mm_usb_phy_sels[] = {"osc_24m", "sys_pll1_100m", "sys_pll1_40m", "sys_pll2_100m",
 					     "sys_pll2_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", };
 
+static const char *imx8mm_gic_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll2_100m",
+					"sys_pll1_800m", "clk_ext2", "clk_ext4", "audio_pll2_out" };
+
 static const char *imx8mm_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m",
 					   "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", };
 
 static const char *imx8mm_ecspi2_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m",
 					   "sys_pll1_800m", "sys_pll3_out", "sys_pll2_250m", "audio_pll2_out", };
@@ -556,10 +559,11 @@ static int __init imx8mm_clocks_init(struct device_node *ccm_node)
 	clks[IMX8MM_CLK_UART2] = imx8m_clk_composite("uart2", imx8mm_uart2_sels, base + 0xaf80);
 	clks[IMX8MM_CLK_UART3] = imx8m_clk_composite("uart3", imx8mm_uart3_sels, base + 0xb000);
 	clks[IMX8MM_CLK_UART4] = imx8m_clk_composite("uart4", imx8mm_uart4_sels, base + 0xb080);
 	clks[IMX8MM_CLK_USB_CORE_REF] = imx8m_clk_composite("usb_core_ref", imx8mm_usb_core_sels, base + 0xb100);
 	clks[IMX8MM_CLK_USB_PHY_REF] = imx8m_clk_composite("usb_phy_ref", imx8mm_usb_phy_sels, base + 0xb180);
+	clks[IMX8MM_CLK_GIC] = imx8m_clk_composite_critical("gic", imx8mm_gic_sels, base + 0xb200);
 	clks[IMX8MM_CLK_ECSPI1] = imx8m_clk_composite("ecspi1", imx8mm_ecspi1_sels, base + 0xb280);
 	clks[IMX8MM_CLK_ECSPI2] = imx8m_clk_composite("ecspi2", imx8mm_ecspi2_sels, base + 0xb300);
 	clks[IMX8MM_CLK_PWM1] = imx8m_clk_composite("pwm1", imx8mm_pwm1_sels, base + 0xb380);
 	clks[IMX8MM_CLK_PWM2] = imx8m_clk_composite("pwm2", imx8mm_pwm2_sels, base + 0xb400);
 	clks[IMX8MM_CLK_PWM3] = imx8m_clk_composite("pwm3", imx8mm_pwm3_sels, base + 0xb480);
drivers/clk/imx/clk-imx8mq.c +4 -0
index daf1841b2adb..b2b2c8956cb7 100644
@@ -190,10 +190,13 @@ static const char * const imx8mq_usb_core_sels[] = {"osc_25m", "sys1_pll_100m",
 					     "sys2_pll_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", };
 
 static const char * const imx8mq_usb_phy_sels[] = {"osc_25m", "sys1_pll_100m", "sys1_pll_40m", "sys2_pll_100m",
 					     "sys2_pll_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", };
 
+static const char * const imx8mq_gic_sels[] = {"osc_25m", "sys2_pll_200m", "sys1_pll_40m", "sys2_pll_100m",
+					       "sys2_pll_200m", "clk_ext2", "clk_ext3", "audio_pll2_out" };
+
 static const char * const imx8mq_ecspi1_sels[] = {"osc_25m", "sys2_pll_200m", "sys1_pll_40m", "sys1_pll_160m",
 					   "sys1_pll_800m", "sys3_pll2_out", "sys2_pll_250m", "audio_pll2_out", };
 
 static const char * const imx8mq_ecspi2_sels[] = {"osc_25m", "sys2_pll_200m", "sys1_pll_40m", "sys1_pll_160m",
 					   "sys1_pll_800m", "sys3_pll2_out", "sys2_pll_250m", "audio_pll2_out", };
@@ -440,10 +443,11 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
 	clks[IMX8MQ_CLK_UART2] = imx8m_clk_composite("uart2", imx8mq_uart2_sels, base + 0xaf80);
 	clks[IMX8MQ_CLK_UART3] = imx8m_clk_composite("uart3", imx8mq_uart3_sels, base + 0xb000);
 	clks[IMX8MQ_CLK_UART4] = imx8m_clk_composite("uart4", imx8mq_uart4_sels, base + 0xb080);
 	clks[IMX8MQ_CLK_USB_CORE_REF] = imx8m_clk_composite("usb_core_ref", imx8mq_usb_core_sels, base + 0xb100);
 	clks[IMX8MQ_CLK_USB_PHY_REF] = imx8m_clk_composite("usb_phy_ref", imx8mq_usb_phy_sels, base + 0xb180);
+	clks[IMX8MQ_CLK_GIC] = imx8m_clk_composite_critical("gic", imx8mq_gic_sels, base + 0xb200);
 	clks[IMX8MQ_CLK_ECSPI1] = imx8m_clk_composite("ecspi1", imx8mq_ecspi1_sels, base + 0xb280);
 	clks[IMX8MQ_CLK_ECSPI2] = imx8m_clk_composite("ecspi2", imx8mq_ecspi2_sels, base + 0xb300);
 	clks[IMX8MQ_CLK_PWM1] = imx8m_clk_composite("pwm1", imx8mq_pwm1_sels, base + 0xb380);
 	clks[IMX8MQ_CLK_PWM2] = imx8m_clk_composite("pwm2", imx8mq_pwm2_sels, base + 0xb400);
 	clks[IMX8MQ_CLK_PWM3] = imx8m_clk_composite("pwm3", imx8mq_pwm3_sels, base + 0xb480);
Signature · 1 line
2.17.1
Reviewed-by on the v2 series
#3 lore raw
In reply to Leonard Crestez
Quoted 9 lines · Leonard Crestez

Add gic clk and mark it as critical so that parents are not turned off by accident.

Changes since v1:
* Add imx8mq
* Split dt-bindings to separate patch
* Rebase on shawnguo/clk/imx
Link to v1: https://patchwork.kernel.org/patch/10940303/

For the entire series.

Quoted 13 lines

Leonard Crestez (2):
dt-bindings: clock: imx8m: Add GIC clock
clk: imx8m: Add GIC clock

 drivers/clk/imx/clk-imx8mm.c             | 4 ++++
 drivers/clk/imx/clk-imx8mq.c             | 4 ++++
 include/dt-bindings/clock/imx8mm-clock.h | 4 +++-
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 4 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
Applied
#4 lore raw
In reply to Leonard Crestez
Quoted 9 lines · Leonard Crestez

Add gic clk and mark it as critical so that parents are not turned off by accident.

Changes since v1:
* Add imx8mq
* Split dt-bindings to separate patch
* Rebase on shawnguo/clk/imx
Link to v1: https://patchwork.kernel.org/patch/10940303/

Quoted 3 lines

Leonard Crestez (2):
dt-bindings: clock: imx8m: Add GIC clock
clk: imx8m: Add GIC clock

Applied both, thanks.