linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: imx: imx7d: move setting clk parent to dts
@ 2019-10-31 10:01 Peng Fan
  2019-10-31 10:01 ` [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks Peng Fan
  2019-10-31 10:02 ` [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent Peng Fan
  0 siblings, 2 replies; 6+ messages in thread
From: Peng Fan @ 2019-10-31 10:01 UTC (permalink / raw)
  To: sboyd, shawnguo, s.hauer, festevam, Abel Vesa
  Cc: kernel, dl-linux-imx, Anson Huang, Jacky Bai, linux-clk,
	linux-arm-kernel, linux-kernel, Leonard Crestez, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

This patchset is to move the clk_set_parent operation from driver
to dts, because assigned-clock-parents could do the job and we
could simplify the driver then.

Peng Fan (2):
  arm: dts: imx7s: ccm: add assigned-clocks
  clk: imx: imx7d: remove clk_set_parent

 arch/arm/boot/dts/imx7s.dtsi | 20 ++++++++++++++++++++
 drivers/clk/imx/clk-imx7d.c  | 12 ------------
 2 files changed, 20 insertions(+), 12 deletions(-)

-- 
2.16.4


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

* [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks
  2019-10-31 10:01 [PATCH 0/2] clk: imx: imx7d: move setting clk parent to dts Peng Fan
@ 2019-10-31 10:01 ` Peng Fan
  2019-10-31 12:09   ` Fabio Estevam
  2019-10-31 10:02 ` [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent Peng Fan
  1 sibling, 1 reply; 6+ messages in thread
From: Peng Fan @ 2019-10-31 10:01 UTC (permalink / raw)
  To: sboyd, shawnguo, s.hauer, festevam, Abel Vesa
  Cc: kernel, dl-linux-imx, Anson Huang, Jacky Bai, linux-clk,
	linux-arm-kernel, linux-kernel, Leonard Crestez, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Add assigned-clocks and assigned-clock-parents, then
we could remove the clk_set_parent code in clk-imx7d.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/boot/dts/imx7s.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 1b812f4e7453..36ae864d9b7c 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -625,6 +625,26 @@
 				#clock-cells = <1>;
 				clocks = <&ckil>, <&osc>;
 				clock-names = "ckil", "osc";
+				/*
+				 * gpt1 root clk must be twice as gpt
+				 * counter freq
+				 */
+				assigned-clocks = <&clks IMX7D_PLL_ARM_MAIN_BYPASS>,
+						<&clks IMX7D_PLL_DRAM_MAIN_BYPASS>,
+						<&clks IMX7D_PLL_SYS_MAIN_BYPASS>,
+						<&clks IMX7D_PLL_ENET_MAIN_BYPASS>,
+						<&clks IMX7D_PLL_AUDIO_MAIN_BYPASS>,
+						<&clks IMX7D_PLL_VIDEO_MAIN_BYPASS>,
+						<&clks IMX7D_MIPI_CSI_ROOT_SRC>,
+						<&clks IMX7D_GPT1_ROOT_SRC>;
+				assigned-clock-parents = <&clks IMX7D_PLL_ARM_MAIN>,
+							 <&clks IMX7D_PLL_DRAM_MAIN>,
+							 <&clks IMX7D_PLL_SYS_MAIN>,
+							 <&clks IMX7D_PLL_ENET_MAIN>,
+							 <&clks IMX7D_PLL_AUDIO_MAIN>,
+							 <&clks IMX7D_PLL_VIDEO_MAIN>,
+							 <&clks IMX7D_PLL_SYS_PFD3_CLK>,
+							 <&clks IMX7D_OSC_24M_CLK>;
 			};
 
 			src: src@30390000 {
-- 
2.16.4


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

* [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent
  2019-10-31 10:01 [PATCH 0/2] clk: imx: imx7d: move setting clk parent to dts Peng Fan
  2019-10-31 10:01 ` [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks Peng Fan
@ 2019-10-31 10:02 ` Peng Fan
  2019-10-31 12:07   ` Fabio Estevam
  1 sibling, 1 reply; 6+ messages in thread
From: Peng Fan @ 2019-10-31 10:02 UTC (permalink / raw)
  To: sboyd, shawnguo, s.hauer, festevam, Abel Vesa
  Cc: kernel, dl-linux-imx, Anson Huang, Jacky Bai, linux-clk,
	linux-arm-kernel, linux-kernel, Leonard Crestez, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Since the set parent could be done by assigned-clock-parents in
dts, so no need clk_set_parent in driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/imx/clk-imx7d.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
index 0c9f7adb41ae..b73e3e148497 100644
--- a/drivers/clk/imx/clk-imx7d.c
+++ b/drivers/clk/imx/clk-imx7d.c
@@ -878,18 +878,6 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 
 	of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
 
-	clk_set_parent(hws[IMX7D_PLL_ARM_MAIN_BYPASS]->clk, hws[IMX7D_PLL_ARM_MAIN]->clk);
-	clk_set_parent(hws[IMX7D_PLL_DRAM_MAIN_BYPASS]->clk, hws[IMX7D_PLL_DRAM_MAIN]->clk);
-	clk_set_parent(hws[IMX7D_PLL_SYS_MAIN_BYPASS]->clk, hws[IMX7D_PLL_SYS_MAIN]->clk);
-	clk_set_parent(hws[IMX7D_PLL_ENET_MAIN_BYPASS]->clk, hws[IMX7D_PLL_ENET_MAIN]->clk);
-	clk_set_parent(hws[IMX7D_PLL_AUDIO_MAIN_BYPASS]->clk, hws[IMX7D_PLL_AUDIO_MAIN]->clk);
-	clk_set_parent(hws[IMX7D_PLL_VIDEO_MAIN_BYPASS]->clk, hws[IMX7D_PLL_VIDEO_MAIN]->clk);
-
-	clk_set_parent(hws[IMX7D_MIPI_CSI_ROOT_SRC]->clk, hws[IMX7D_PLL_SYS_PFD3_CLK]->clk);
-
-	/* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */
-	clk_set_parent(hws[IMX7D_GPT1_ROOT_SRC]->clk, hws[IMX7D_OSC_24M_CLK]->clk);
-
 	/* Set clock rate for USBPHY, the USB_PLL at CCM is from USBOTG2 */
 	hws[IMX7D_USB1_MAIN_480M_CLK] = imx_clk_hw_fixed_factor("pll_usb1_main_clk", "osc", 20, 1);
 	hws[IMX7D_USB_MAIN_480M_CLK] = imx_clk_hw_fixed_factor("pll_usb_main_clk", "osc", 20, 1);
-- 
2.16.4


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

* Re: [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent
  2019-10-31 10:02 ` [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent Peng Fan
@ 2019-10-31 12:07   ` Fabio Estevam
  2019-11-01  1:28     ` Peng Fan
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2019-10-31 12:07 UTC (permalink / raw)
  To: Peng Fan
  Cc: sboyd, shawnguo, s.hauer, Abel Vesa, kernel, dl-linux-imx,
	Anson Huang, Jacky Bai, linux-clk, linux-arm-kernel,
	linux-kernel, Leonard Crestez

Hi Peng,

On Thu, Oct 31, 2019 at 7:02 AM Peng Fan <peng.fan@nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Since the set parent could be done by assigned-clock-parents in
> dts, so no need clk_set_parent in driver.

It looks like this will cause breakage if someone is using an old dtb, right?

We try not to break existing dtbs.

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

* Re: [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks
  2019-10-31 10:01 ` [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks Peng Fan
@ 2019-10-31 12:09   ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2019-10-31 12:09 UTC (permalink / raw)
  To: Peng Fan
  Cc: sboyd, shawnguo, s.hauer, Abel Vesa, kernel, dl-linux-imx,
	Anson Huang, Jacky Bai, linux-clk, linux-arm-kernel,
	linux-kernel, Leonard Crestez

Hi Peng,

On Thu, Oct 31, 2019 at 7:01 AM Peng Fan <peng.fan@nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Add assigned-clocks and assigned-clock-parents, then
> we could remove the clk_set_parent code in clk-imx7d.c.

Change itself looks good, but please do not mention the clock driver
in the commit log.

Devicetree should be OS agnostic.

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

* RE: [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent
  2019-10-31 12:07   ` Fabio Estevam
@ 2019-11-01  1:28     ` Peng Fan
  0 siblings, 0 replies; 6+ messages in thread
From: Peng Fan @ 2019-11-01  1:28 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: sboyd, shawnguo, s.hauer, Abel Vesa, kernel, dl-linux-imx,
	Anson Huang, Jacky Bai, linux-clk, linux-arm-kernel,
	linux-kernel, Leonard Crestez

> Subject: Re: [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent
> 
> Hi Peng,
> 
> On Thu, Oct 31, 2019 at 7:02 AM Peng Fan <peng.fan@nxp.com> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Since the set parent could be done by assigned-clock-parents in dts,
> > so no need clk_set_parent in driver.
> 
> It looks like this will cause breakage if someone is using an old dtb, right?

Yes.

> 
> We try not to break existing dtbs.

ok. Then there will be lots code in tree for compatibility.

Thanks,
Peng.

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

end of thread, other threads:[~2019-11-01  1:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 10:01 [PATCH 0/2] clk: imx: imx7d: move setting clk parent to dts Peng Fan
2019-10-31 10:01 ` [PATCH 1/2] arm: dts: imx7s: ccm: add assigned-clocks Peng Fan
2019-10-31 12:09   ` Fabio Estevam
2019-10-31 10:02 ` [PATCH 2/2] clk: imx: imx7d: remove clk_set_parent Peng Fan
2019-10-31 12:07   ` Fabio Estevam
2019-11-01  1:28     ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).