Skip to contentSkip to conversation

arm64: dts: imx8mp-venice-gw74xx: add PCIe support

PATCH Applied Tim Harvey 3 participants 5 messages Sep 8, 2022 – Sep 16, 2022

Subsystems (2)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 arm64: dts: imx8mp-venice-gw74xx: add PCIe support

Add PCIe support on the Gateworks GW74xx board. While at it, fix the related gpio line names from the previous incorrect values.

---
 .../dts/freescale/imx8mp-venice-gw74xx.dts    | 40 +++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +37 -3
index e0fe356b662d..7644db61d631 100644
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mp.dtsi"
 
@@ -100,6 +101,12 @@ led-1 {
 		};
 	};
 
+	pcie0_refclk: pcie0-refclk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <100000000>;
+	};
+
 	pps {
 		compatible = "pps-gpio";
 		pinctrl-names = "default";
@@ -215,8 +222,8 @@ &gpio1 {
 &gpio2 {
 	gpio-line-names =
 		"", "", "", "", "", "", "", "",
-		"", "", "", "", "", "", "", "",
-		"pcie3_wdis#", "", "", "pcie1_wdis@", "pcie2_wdis#", "", "", "",
+		"", "", "", "", "", "", "pcie3_wdis#", "",
+		"", "", "pcie2_wdis#", "", "", "", "", "",
 		"", "", "", "", "", "", "", "";
 };
 
@@ -562,6 +569,28 @@ &i2c4 {
 	status = "okay";
 };
 
+&pcie_phy {
+	fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+	fsl,clkreq-unsupported;
+	clocks = <&pcie0_refclk>;
+	clock-names = "ref";
+	status = "okay";
+};
+
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie0>;
+	reset-gpio = <&gpio2 17 GPIO_ACTIVE_LOW>;
+	clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+		 <&clk IMX8MP_CLK_PCIE_ROOT>,
+		 <&clk IMX8MP_CLK_HSIO_AXI>;
+	clock-names = "pcie", "pcie_aux", "pcie_bus";
+	assigned-clocks = <&clk IMX8MP_CLK_PCIE_AUX>;
+	assigned-clock-rates = <10000000>;
+	assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_50M>;
+	status = "okay";
+};
+
 /* GPS / off-board header */
 &uart1 {
 	pinctrl-names = "default";
@@ -694,7 +723,6 @@ pinctrl_hog: hoggrp {
 			MX8MP_IOMUXC_GPIO1_IO09__GPIO1_IO09	0x40000040 /* DIO0 */
 			MX8MP_IOMUXC_GPIO1_IO11__GPIO1_IO11	0x40000040 /* DIO1 */
 			MX8MP_IOMUXC_NAND_DQS__GPIO3_IO14	0x40000040 /* M2SKT_OFF# */
-			MX8MP_IOMUXC_SD2_DATA2__GPIO2_IO17	0x40000150 /* PCIE1_WDIS# */
 			MX8MP_IOMUXC_SD2_DATA3__GPIO2_IO18	0x40000150 /* PCIE2_WDIS# */
 			MX8MP_IOMUXC_SD2_CMD__GPIO2_IO14	0x40000150 /* PCIE3_WDIS# */
 			MX8MP_IOMUXC_NAND_DATA00__GPIO3_IO06	0x40000040 /* M2SKT_RST# */
@@ -807,6 +835,12 @@ MX8MP_IOMUXC_SD2_DATA1__GPIO2_IO16	0x10
 		>;
 	};
 
+	pinctrl_pcie0: pciegrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_SD2_DATA2__GPIO2_IO17	0x110
+		>;
+	};
+
 	pinctrl_pmic: pmicgrp {
 		fsl,pins = <
 			MX8MP_IOMUXC_NAND_DATA01__GPIO3_IO07	0x140
Signature · 1 line
2.25.1
#1 lore raw

Hi Tim,

Am Donnerstag, 8. September 2022, 17:49:03 CEST schrieb Tim Harvey:

Quoted 35 lines

Add PCIe support on the Gateworks GW74xx board. While at it, fix the related gpio line names from the previous incorrect values.

---
 .../dts/freescale/imx8mp-venice-gw74xx.dts    | 40 +++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts index e0fe356b662d..7644db61d631 100644

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +7 -0
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mp.dtsi"
 
@@ -100,6 +101,12 @@ led-1 {
 		};
 	};
 
+	pcie0_refclk: pcie0-refclk {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <100000000>;
+	};
+
 	pps {
 		compatible = "pps-gpio";
 		pinctrl-names = "default";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &gpio1 { · line 219

Quoted 5 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -2
@@ -215,8 +222,8 @@ &gpio1 {
 &gpio2 {
 	gpio-line-names =
 		"", "", "", "", "", "", "", "",
-		"", "", "", "", "", "", "", "",
-		"pcie3_wdis#", "", "", "pcie1_wdis@", "pcie2_wdis#", "", 

"", "",

Quoted 15 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +8 -0
+		"", "", "", "", "", "", "pcie3_wdis#", "",
+		"", "", "pcie2_wdis#", "", "", "", "", "",
 		"", "", "", "", "", "", "", "";
 };
 
@@ -562,6 +569,28 @@ &i2c4 {
 	status = "okay";
 };
 
+&pcie_phy {
+	fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+	fsl,clkreq-unsupported;
+	clocks = <&pcie0_refclk>;
+	clock-names = "ref";
+	status = "okay";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &i2c4 { · line 587

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +10 -0
+};
+
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie0>;
+	reset-gpio = <&gpio2 17 GPIO_ACTIVE_LOW>;
+	clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+		 <&clk IMX8MP_CLK_PCIE_ROOT>,
+		 <&clk IMX8MP_CLK_HSIO_AXI>;
+	clock-names = "pcie", "pcie_aux", "pcie_bus";

With the still pending dt-binding patch at [1] the clock order shall be "pcie", "pcie_bus", "pcie_phy".

Best regards,
Alexander

[1] https://lore.kernel.org/lkml/[email protected]/

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 723

Quoted 11 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +6 -0
+	assigned-clocks = <&clk IMX8MP_CLK_PCIE_AUX>;
+	assigned-clock-rates = <10000000>;
+	assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_50M>;
+	status = "okay";
+};
+
 /* GPS / off-board header */
 &uart1 {
 	pinctrl-names = "default";
@@ -694,7 +723,6 @@ pinctrl_hog: hoggrp {
 			MX8MP_IOMUXC_GPIO1_IO09__GPIO1_IO09	

0x40000040 /* DIO0 */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 724

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 			MX8MP_IOMUXC_GPIO1_IO11__GPIO1_IO11	

0x40000040 /* DIO1 */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 725

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 			MX8MP_IOMUXC_NAND_DQS__GPIO3_IO14	0x40000040 /

* M2SKT_OFF# */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 697

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -1
-			MX8MP_IOMUXC_SD2_DATA2__GPIO2_IO17	

0x40000150 /* PCIE1_WDIS# */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 726

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 			MX8MP_IOMUXC_SD2_DATA3__GPIO2_IO18	

0x40000150 /* PCIE2_WDIS# */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 727

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 			MX8MP_IOMUXC_SD2_CMD__GPIO2_IO14	0x40000150 /

* PCIE3_WDIS# */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts pinctrl_hog: hoggrp { · line 728

Quoted 1 line
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 			MX8MP_IOMUXC_NAND_DATA00__GPIO3_IO06	

0x40000040 /* M2SKT_RST# */

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts MX8MP_IOMUXC_SD2_DATA1__GPIO2_IO16 0x10 · line 842

Quoted 9 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +3 -0
@@ -807,6 +835,12 @@ MX8MP_IOMUXC_SD2_DATA1__GPIO2_IO16	0x10
 
 		>;
 
 	};
 
+	pinctrl_pcie0: pciegrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_SD2_DATA2__GPIO2_IO17	

0x110

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts

Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +3 -0
+		>;
+	};
+
 	pinctrl_pmic: pmicgrp {
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -0
 		fsl,pins = <
 			MX8MP_IOMUXC_NAND_DATA01__GPIO3_IO07	

0x140

author
#2 lore raw
Quoted 74 lines · Alexander Stein

Hi Tim,

Am Donnerstag, 8. September 2022, 17:49:03 CEST schrieb Tim Harvey:

Quoted 35 lines

Add PCIe support on the Gateworks GW74xx board. While at it, fix the related gpio line names from the previous incorrect values.

---
 .../dts/freescale/imx8mp-venice-gw74xx.dts    | 40 +++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts index e0fe356b662d..7644db61d631 100644

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +7 -0
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mp.dtsi"
 
@@ -100,6 +101,12 @@ led-1 {
              };
      };
 
+     pcie0_refclk: pcie0-refclk {
+             compatible = "fixed-clock";
+             #clock-cells = <0>;
+             clock-frequency = <100000000>;
+     };
+
      pps {
              compatible = "pps-gpio";
              pinctrl-names = "default";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &gpio1 { · line 219

Quoted 5 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -2
@@ -215,8 +222,8 @@ &gpio1 {
 &gpio2 {
      gpio-line-names =
              "", "", "", "", "", "", "", "",
-             "", "", "", "", "", "", "", "",
-             "pcie3_wdis#", "", "", "pcie1_wdis@", "pcie2_wdis#", "",

"", "",

Quoted 15 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +8 -0
+             "", "", "", "", "", "", "pcie3_wdis#", "",
+             "", "", "pcie2_wdis#", "", "", "", "", "",
              "", "", "", "", "", "", "", "";
 };
 
@@ -562,6 +569,28 @@ &i2c4 {
      status = "okay";
 };
 
+&pcie_phy {
+     fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+     fsl,clkreq-unsupported;
+     clocks = <&pcie0_refclk>;
+     clock-names = "ref";
+     status = "okay";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &i2c4 { · line 587

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +10 -0
+};
+
+&pcie {
+     pinctrl-names = "default";
+     pinctrl-0 = <&pinctrl_pcie0>;
+     reset-gpio = <&gpio2 17 GPIO_ACTIVE_LOW>;
+     clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+              <&clk IMX8MP_CLK_PCIE_ROOT>,
+              <&clk IMX8MP_CLK_HSIO_AXI>;
+     clock-names = "pcie", "pcie_aux", "pcie_bus";

With the still pending dt-binding patch at [1] the clock order shall be "pcie", "pcie_bus", "pcie_phy".

Quoted 5 lines

Best regards,
Alexander

[1] https://lore.kernel.org/lkml/[email protected]/

Alexander,

Interesting... the imx8pm-evk PCIe patch was accepted with the bindings I used which are current. So I suppose if/when the patch you pointed to gets accepted some existing bindings will need to change to be compliant.

Best Regards,

Tim

author
#3 lore raw
Quoted 85 lines · Tim Harvey
Quoted 74 lines · Alexander Stein

Hi Tim,

Am Donnerstag, 8. September 2022, 17:49:03 CEST schrieb Tim Harvey:

Quoted 35 lines

Add PCIe support on the Gateworks GW74xx board. While at it, fix the related gpio line names from the previous incorrect values.

---
 .../dts/freescale/imx8mp-venice-gw74xx.dts    | 40 +++++++++++++++++--
 1 file changed, 37 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts index e0fe356b662d..7644db61d631 100644

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +7 -0
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
 
 #include "imx8mp.dtsi"
 
@@ -100,6 +101,12 @@ led-1 {
              };
      };
 
+     pcie0_refclk: pcie0-refclk {
+             compatible = "fixed-clock";
+             #clock-cells = <0>;
+             clock-frequency = <100000000>;
+     };
+
      pps {
              compatible = "pps-gpio";
              pinctrl-names = "default";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &gpio1 { · line 219

Quoted 5 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +0 -2
@@ -215,8 +222,8 @@ &gpio1 {
 &gpio2 {
      gpio-line-names =
              "", "", "", "", "", "", "", "",
-             "", "", "", "", "", "", "", "",
-             "pcie3_wdis#", "", "", "pcie1_wdis@", "pcie2_wdis#", "",

"", "",

Quoted 15 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +8 -0
+             "", "", "", "", "", "", "pcie3_wdis#", "",
+             "", "", "pcie2_wdis#", "", "", "", "", "",
              "", "", "", "", "", "", "", "";
 };
 
@@ -562,6 +569,28 @@ &i2c4 {
      status = "okay";
 };
 
+&pcie_phy {
+     fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
+     fsl,clkreq-unsupported;
+     clocks = <&pcie0_refclk>;
+     clock-names = "ref";
+     status = "okay";

arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts &i2c4 { · line 587

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts +10 -0
+};
+
+&pcie {
+     pinctrl-names = "default";
+     pinctrl-0 = <&pinctrl_pcie0>;
+     reset-gpio = <&gpio2 17 GPIO_ACTIVE_LOW>;
+     clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+              <&clk IMX8MP_CLK_PCIE_ROOT>,
+              <&clk IMX8MP_CLK_HSIO_AXI>;
+     clock-names = "pcie", "pcie_aux", "pcie_bus";

With the still pending dt-binding patch at [1] the clock order shall be "pcie", "pcie_bus", "pcie_phy".

Quoted 5 lines

Best regards,
Alexander

[1] https://lore.kernel.org/lkml/[email protected]/

Alexander,

Quoted 8 lines

Interesting... the imx8pm-evk PCIe patch was accepted with the bindings I used which are current. So I suppose if/when the patch you pointed to gets accepted some existing bindings will need to change to be compliant.

Best Regards,

Tim

Shawn,

I'm unclear if this patch needs to change. I believe the patch adheres to the current bindings and if the bindings change it would require all the imx8m boards to have their bindings updated to agree with it. I'm also unclear if the order of the clocks really makes any difference here.

Best Regards,

Tim