Linux-ARM-Kernel Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2 0/2] clk: imx8m: Add GIC clock
@ 2019-05-22  9:48 Leonard Crestez
  2019-05-22  9:48 ` [PATCH v2 1/2] dt-bindings: clock: " Leonard Crestez
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Leonard Crestez @ 2019-05-22  9:48 UTC (permalink / raw)
  To: Shawn Guo, Stephen Boyd
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, Michael Turquette,
	dl-linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

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(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 1/2] dt-bindings: clock: imx8m: Add GIC clock
  2019-05-22  9:48 [PATCH v2 0/2] clk: imx8m: Add GIC clock Leonard Crestez
@ 2019-05-22  9:48 ` " Leonard Crestez
  2019-05-22  9:48 ` [PATCH v2 2/2] clk: " Leonard Crestez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Leonard Crestez @ 2019-05-22  9:48 UTC (permalink / raw)
  To: Shawn Guo, Stephen Boyd
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, Michael Turquette,
	dl-linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

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

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 include/dt-bindings/clock/imx8mm-clock.h | 4 +++-
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/dt-bindings/clock/imx8mm-clock.h b/include/dt-bindings/clock/imx8mm-clock.h
index fe47798f95df..5e8e32d18816 100644
--- a/include/dt-bindings/clock/imx8mm-clock.h
+++ b/include/dt-bindings/clock/imx8mm-clock.h
@@ -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
diff --git a/include/dt-bindings/clock/imx8mq-clock.h b/include/dt-bindings/clock/imx8mq-clock.h
index 6677e920dc2d..7900a219f5fa 100644
--- a/include/dt-bindings/clock/imx8mq-clock.h
+++ b/include/dt-bindings/clock/imx8mq-clock.h
@@ -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 */
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 2/2] clk: imx8m: Add GIC clock
  2019-05-22  9:48 [PATCH v2 0/2] clk: imx8m: Add GIC clock Leonard Crestez
  2019-05-22  9:48 ` [PATCH v2 1/2] dt-bindings: clock: " Leonard Crestez
@ 2019-05-22  9:48 ` " Leonard Crestez
  2019-05-22 10:56 ` [PATCH v2 0/2] " Abel Vesa
  2019-05-23 13:12 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Leonard Crestez @ 2019-05-22  9:48 UTC (permalink / raw)
  To: Shawn Guo, Stephen Boyd
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, Michael Turquette,
	dl-linux-imx, kernel, Fabio Estevam, linux-clk, linux-arm-kernel,
	Abel Vesa

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.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
---
 drivers/clk/imx/clk-imx8mm.c | 4 ++++
 drivers/clk/imx/clk-imx8mq.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index 2e2f8c210432..74112d3ef5bf 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -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);
diff --git a/drivers/clk/imx/clk-imx8mq.c b/drivers/clk/imx/clk-imx8mq.c
index daf1841b2adb..b2b2c8956cb7 100644
--- a/drivers/clk/imx/clk-imx8mq.c
+++ b/drivers/clk/imx/clk-imx8mq.c
@@ -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);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 0/2] clk: imx8m: Add GIC clock
  2019-05-22  9:48 [PATCH v2 0/2] clk: imx8m: Add GIC clock Leonard Crestez
  2019-05-22  9:48 ` [PATCH v2 1/2] dt-bindings: clock: " Leonard Crestez
  2019-05-22  9:48 ` [PATCH v2 2/2] clk: " Leonard Crestez
@ 2019-05-22 10:56 ` " Abel Vesa
  2019-05-23 13:12 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Abel Vesa @ 2019-05-22 10:56 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, Stephen Boyd,
	Michael Turquette, dl-linux-imx, kernel, Fabio Estevam,
	Shawn Guo, linux-clk, linux-arm-kernel

On 19-05-22 09:48:28, Leonard Crestez wrote:
> 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.

Reviewed-by: Abel Vesa <abel.vesa@nxp.com> 

> 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(-)
> 
> -- 
> 2.17.1
> 
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 0/2] clk: imx8m: Add GIC clock
  2019-05-22  9:48 [PATCH v2 0/2] clk: imx8m: Add GIC clock Leonard Crestez
                   ` (2 preceding siblings ...)
  2019-05-22 10:56 ` [PATCH v2 0/2] " Abel Vesa
@ 2019-05-23 13:12 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2019-05-23 13:12 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, Stephen Boyd,
	Michael Turquette, dl-linux-imx, kernel, Fabio Estevam,
	linux-clk, linux-arm-kernel, Abel Vesa

On Wed, May 22, 2019 at 09:48:28AM +0000, Leonard Crestez wrote:
> 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

Applied both, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  9:48 [PATCH v2 0/2] clk: imx8m: Add GIC clock Leonard Crestez
2019-05-22  9:48 ` [PATCH v2 1/2] dt-bindings: clock: " Leonard Crestez
2019-05-22  9:48 ` [PATCH v2 2/2] clk: " Leonard Crestez
2019-05-22 10:56 ` [PATCH v2 0/2] " Abel Vesa
2019-05-23 13:12 ` Shawn Guo

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.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-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox