Skip to contentSkip to conversation

arm64: dts: imx8mq: Add DT node for the Mixel MIPI D-PHY

PATCH In review Guido Günther 4 participants 8 messages Jul 15, 2019 – Jul 23, 2019

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

v2 cover arm64: dts: imx8mq: Add DT node for the Mixel MIPI D-PHY

Now that the driver is in linux-next as of 20190624 let's have a DT node for the i.MX8MQ and enable it on the Librem 5 devkit.

Changes from v1:
- Add Acked-by: form Angus, thanks!

Guido Günther (2):
arm64: dts: imx8mq: Add MIPI D-PHY
arm64: dts: imx8mq-librem5: Enable MIPI D-PHY

 .../boot/dts/freescale/imx8mq-librem5-devkit.dts    |  4 ++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi           | 13 +++++++++++++
 2 files changed, 17 insertions(+)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/2 arm64: dts: imx8mq: Add MIPI D-PHY

Add a node for the Mixel MIPI D-PHY, "disabled" by default.

---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +13 -0
index d09b808eff87..891ee7578c2d 100644
@@ -728,6 +728,19 @@
 				status = "disabled";
 			};
 
+			dphy: dphy@30a00300 {
+				compatible = "fsl,imx8mq-mipi-dphy";
+				reg = <0x30a00300 0x100>;
+				clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				clock-names = "phy_ref";
+				assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				assigned-clock-parents = <&clk IMX8MQ_VIDEO_PLL1_OUT>;
+				assigned-clock-rates = <24000000>;
+				#phy-cells = <0>;
+				power-domains = <&pgc_mipi>;
+				status = "disabled";
+			};
+
 			i2c1: i2c@30a20000 {
 				compatible = "fsl,imx8mq-i2c", "fsl,imx21-i2c";
 				reg = <0x30a20000 0x10000>;
Signature · 1 line
2.20.1
#5 lore raw

PATCH v2 2/2 arm64: dts: imx8mq-librem5: Enable MIPI D-PHY

In reply to Guido Günther

This enables the Mixel MIPI D-PHY on the Librem 5 devkit

---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +4 -0
index 5179e22f5126..683a11035643 100644
@@ -174,6 +174,10 @@
 	assigned-clock-rates = <786432000>, <722534400>;
 };
 
+&dphy {
+	status = "okay";
+};
+
 &fec1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_fec1>;
Signature · 1 line
2.20.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] arm64: dts: imx8mq: Add MIPI D-PHY

In reply to Guido Günther

Am Montag, den 15.07.2019, 12:43 +0200 schrieb Guido Günther:

Quoted 4 lines

Add a node for the Mixel MIPI D-PHY, "disabled" by default.

Quoted 28 lines

---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 13 +++++++++++++

 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +0 -0
index d09b808eff87..891ee7578c2d 100644
@@ -728,6 +728,19 @@
  				status = "disabled";
  			};

arch/arm64/boot/dts/freescale/imx8mq.dtsi +13 -0
+			dphy: dphy@30a00300 {
+				compatible = "fsl,imx8mq-mipi-dphy";
+				reg = <0x30a00300 0x100>;
+				clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				clock-names = "phy_ref";
+				assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				assigned-clock-parents = <&clk IMX8MQ_VIDEO_PLL1_OUT>;
+				assigned-clock-rates = <24000000>;
+				#phy-cells = <0>;
+				power-domains = <&pgc_mipi>;
+				status = "disabled";
+			};
+

  i2c1: i2c@30a20000 {
  compatible = "fsl,imx8mq-i2c", "fsl,imx21-i2c"; reg = <0x30a20000 0x10000>;

Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] arm64: dts: imx8mq-librem5: Enable MIPI D-PHY

In reply to Guido Günther

Am Montag, den 15.07.2019, 12:43 +0200 schrieb Guido Günther:

Quoted 4 lines

This enables the Mixel MIPI D-PHY on the Librem 5 devkit

Quoted 20 lines

---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 4 ++++

 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +0 -0
index 5179e22f5126..683a11035643 100644
@@ -174,6 +174,10 @@
  	assigned-clock-rates = <786432000>, <722534400>;
  };


+&dphy {

arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +3 -0
+	status = "okay";
+};
+

 &fec1 {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_fec1>;

#3 lore raw

Re: [PATCH v2 1/2] arm64: dts: imx8mq: Add MIPI D-PHY

In reply to Guido Günther
Quoted 14 lines · Guido Günther

Add a node for the Mixel MIPI D-PHY, "disabled" by default.

---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +0 -0
index d09b808eff87..891ee7578c2d 100644
@@ -728,6 +728,19 @@
 				status = "disabled";

arch/arm64/boot/dts/freescale/imx8mq.dtsi line 738

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq.dtsi +8 -0
 			};
 
+			dphy: dphy@30a00300 {
+				compatible = "fsl,imx8mq-mipi-dphy";
+				reg = <0x30a00300 0x100>;
+				clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				clock-names = "phy_ref";
+				assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				assigned-clock-parents = <&clk IMX8MQ_VIDEO_PLL1_OUT>;
+				assigned-clock-rates = <24000000>;

We have the following in the clk-imx8mq in the vendor tree:

	clk_set_parent(clks[IMX8MQ_VIDEO_PLL1_BYPASS], clks[IMX8MQ_VIDEO_PLL1]);

This unbypasses the video pll 1. And then we also have this:

	/* config video_pll1 clock */
	clk_set_parent(clks[IMX8MQ_VIDEO_PLL1_REF_SEL], clks[IMX8MQ_CLK_27M]);
	clk_set_rate(clks[IMX8MQ_VIDEO_PLL1], 593999999);

But none of that is acceptable upstream since the clock provider should not use clock consumer API.

So please update the assigned-clock* properties to something like this:

				assigned-clocks = <&clk IMX8MQ_VIDEO_PLL1_REF_SEL>,
						  <&clk IMX8MQ_VIDEO_PLL1_BYPASS>,
						  <&clk IMX8MQ_CLK_DSI_PHY_REF>,
						  <&clk IMX8MQ_VIDEO_PLL1>;
				assigned-clock-parents = <&clk IMX8MQ_CLK_27M>,
							 <&clk IMX8MQ_VIDEO_PLL1>,
							 <&clk IMX8MQ_VIDEO_PLL1_OUT>
							 <0>;
				assigned-clock-rates = <0>,
						       <0>,
						       <24000000>,             
						       <593999999>;

I've written this without testing, so please do test it on your setup.

Quoted 11 lines
arch/arm64/boot/dts/freescale/imx8mq.dtsi +5 -0
+				#phy-cells = <0>;
+				power-domains = <&pgc_mipi>;
+				status = "disabled";
+			};
+
 			i2c1: i2c@30a20000 {
 				compatible = "fsl,imx8mq-i2c", "fsl,imx21-i2c";
 				reg = <0x30a20000 0x10000>;
Signature · 1 line
2.20.1
#4 lore raw

Re: [PATCH v2 1/2] arm64: dts: imx8mq: Add MIPI D-PHY

Hi Abel,

Quoted 28 lines · Abel Vesa
Quoted 14 lines · Guido Günther

Add a node for the Mixel MIPI D-PHY, "disabled" by default.

---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq.dtsi +0 -0
index d09b808eff87..891ee7578c2d 100644
@@ -728,6 +728,19 @@
 				status = "disabled";

arch/arm64/boot/dts/freescale/imx8mq.dtsi line 738

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mq.dtsi +8 -0
 			};
 
+			dphy: dphy@30a00300 {
+				compatible = "fsl,imx8mq-mipi-dphy";
+				reg = <0x30a00300 0x100>;
+				clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				clock-names = "phy_ref";
+				assigned-clocks = <&clk IMX8MQ_CLK_DSI_PHY_REF>;
+				assigned-clock-parents = <&clk IMX8MQ_VIDEO_PLL1_OUT>;
+				assigned-clock-rates = <24000000>;

We have the following in the clk-imx8mq in the vendor tree:

Quoted 7 lines
	clk_set_parent(clks[IMX8MQ_VIDEO_PLL1_BYPASS], clks[IMX8MQ_VIDEO_PLL1]);

This unbypasses the video pll 1. And then we also have this:

	/* config video_pll1 clock */
	clk_set_parent(clks[IMX8MQ_VIDEO_PLL1_REF_SEL], clks[IMX8MQ_CLK_27M]);
	clk_set_rate(clks[IMX8MQ_VIDEO_PLL1], 593999999);

We don't have anything like this in our tree. This is our current clock tree in that area which is setup by either the lcdif or dcss DT:

 osc_25m                             10       12        0    25000000          0     0  50000
    video_pll1_ref_sel                1        1        0    25000000          0     0  50000
       video_pll1_ref_div             1        1        0     5000000          0     0  50000
          video_pll1                  1        1        0   593999998          0     0  50000
             video_pll1_bypass        1        1        0   593999998          0     0  50000
                video_pll1_out        2        2        0   593999998          0     0  50000
                   dsi_phy_ref        1        1        0    23760000          0     0  50000

e.g. for lcdif we have:

	lcdif: lcdif@30320000 {
		...
		clock-names = "pix";
		assigned-clocks = <&clk IMX8MQ_VIDEO_PLL1_REF_SEL>,
				  <&clk IMX8MQ_VIDEO_PLL1_BYPASS>,
				  <&clk IMX8MQ_CLK_LCDIF_PIXEL>,
				  <&clk IMX8MQ_VIDEO_PLL1>;
		assigned-clock-parents = <&clk IMX8MQ_CLK_25M>,
				  <&clk IMX8MQ_VIDEO_PLL1>,
				  <&clk IMX8MQ_VIDEO_PLL1_OUT>;
		assigned-clock-rates = <0>, <0>, <0>, <594000000>;
		...
	};

Do we want to add this add for dphy and lcdif?
Cheers,
-- Guido

Quoted 31 lines

But none of that is acceptable upstream since the clock provider should not use clock consumer API.

So please update the assigned-clock* properties to something like this:

				assigned-clocks = <&clk IMX8MQ_VIDEO_PLL1_REF_SEL>,
						  <&clk IMX8MQ_VIDEO_PLL1_BYPASS>,
						  <&clk IMX8MQ_CLK_DSI_PHY_REF>,
						  <&clk IMX8MQ_VIDEO_PLL1>;
				assigned-clock-parents = <&clk IMX8MQ_CLK_27M>,
							 <&clk IMX8MQ_VIDEO_PLL1>,
							 <&clk IMX8MQ_VIDEO_PLL1_OUT>
							 <0>;
				assigned-clock-rates = <0>,
						       <0>,
						       <24000000>,             
						       <593999999>;

I've written this without testing, so please do test it on your setup.

Quoted 11 lines
arch/arm64/boot/dts/freescale/imx8mq.dtsi +5 -0
+				#phy-cells = <0>;
+				power-domains = <&pgc_mipi>;
+				status = "disabled";
+			};
+
 			i2c1: i2c@30a20000 {
 				compatible = "fsl,imx8mq-i2c", "fsl,imx21-i2c";
 				reg = <0x30a20000 0x10000>;
Signature · 1 line
2.20.1
#7 lore raw
In reply to Guido Günther
Quoted 5 lines · Guido G�nther

Now that the driver is in linux-next as of 20190624 let's have a DT node for the i.MX8MQ and enable it on the Librem 5 devkit.

Changes from v1:
- Add Acked-by: form Angus, thanks!

You do not need to send a new version for just collecting ack/review tags. I did that when applying v1.

Shawn

Quoted 12 lines

Guido G�nther (2):
arm64: dts: imx8mq: Add MIPI D-PHY
arm64: dts: imx8mq-librem5: Enable MIPI D-PHY

 .../boot/dts/freescale/imx8mq-librem5-devkit.dts    |  4 ++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi           | 13 +++++++++++++
 2 files changed, 17 insertions(+)
Signature · 1 line
2.20.1