Skip to contentSkip to conversation

Add the fec node on i.MX8ULP platform

PATCH Superseded [email protected] 4 participants 9 messages Jul 18, 2022

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v3 cover Add the fec node on i.MX8ULP platform

From: Wei Fang <[email protected]>

Add the fec node on i.MX8ULP platfroms. And enable the fec support on i.MX8ULP EVK boards.

Wei Fang (3):
dt-bindings: net: fsl,fec: Add i.MX8ULP FEC items
arm64: dts: imx8ulp: Add the fec support
arm64: dts: imx8ulp-evk: Add the fec support

 .../devicetree/bindings/net/fsl,fec.yaml      |  5 ++
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57 +++++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi    | 11 ++++
 3 files changed, 73 insertions(+)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH v3 1/3 dt-bindings: net: fsl,fec: Add i.MX8ULP FEC items

From: Wei Fang <[email protected]>

Add fsl,imx8ulp-fec for i.MX8ULP platform.

---
V2 change:
Add fsl,imx6q-fec
V3 change:
No change.

---
 Documentation/devicetree/bindings/net/fsl,fec.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/net/fsl,fec.yaml +5 -0
index daa2f79a294f..4d2454ade3b6 100644
@@ -58,6 +58,11 @@ properties:
               - fsl,imx8qxp-fec
           - const: fsl,imx8qm-fec
           - const: fsl,imx6sx-fec
+      - items:
+          - enum:
+              - fsl,imx8ulp-fec
+          - const: fsl,imx6ul-fec
+          - const: fsl,imx6q-fec
 
   reg:
     maxItems: 1
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH V3 1/3] dt-bindings: net: fsl,fec: Add i.MX8ULP FEC items

Quoted 5 lines · On 18/07/2022 16:22, [email protected] wrote:

From: Wei Fang <[email protected]>

Add fsl,imx8ulp-fec for i.MX8ULP platform.

Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.

https://elixir.bootlin.com/linux/v5.17/source/Documentation/process/submitting-patches.rst#L540

If a tag was not added on purpose, please state why and what changed.

Best regards,
Krzysztof

author maintainer
#3 lore raw

RE: [PATCH V3 1/3] dt-bindings: net: fsl,fec: Add i.MX8ULP FEC items

Quoted 19 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: 2022年7月18日 21:40
To: Wei Fang <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; Peng Fan <[email protected]>; Jacky Bai <[email protected]>; [email protected]; [email protected]; Aisheng Dong <[email protected]>
Subject: Re: [PATCH V3 1/3] dt-bindings: net: fsl,fec: Add i.MX8ULP FEC items

Quoted 2 lines · On 18/07/2022 16:22, [email protected] wrote:

From: Wei Fang <[email protected]>

Quoted 8 lines
Quoted 3 lines

Add fsl,imx8ulp-fec for i.MX8ULP platform.

Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.

I'm very grateful for your instruction, it is very useful. And I'm so sorry that I did not add Acked-by tags for the new version. Can you sign the Acked-by/Reviewed-by tags again? I will be very appreciated.

Quoted 15 lines

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felixir.bo
otlin.com%2Flinux%2Fv5.17%2Fsource%2FDocumentation%2Fprocess%2Fsub mitting-patches.rst%23L540&amp;data=05%7C01%7Cwei.fang%40nxp.com%7 Cdd610ad40d334a733fc308da68c3068a%7C686ea1d3bc2b4c6fa92cd99c5c3 01635%7C0%7C0%7C637937484092274900%7CUnknown%7CTWFpbGZsb3d 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C3000%7C%7C%7C&amp;sdata=84RF0scrg8oqwRLfspH55pdbISLdd3La5D uhKuw0NqA%3D&amp;reserved=0

If a tag was not added on purpose, please state why and what changed.

Best regards,
Krzysztof

author maintainer
#4 lore raw

PATCH v3 2/3 arm64: dts: imx8ulp: Add the fec support

In reply to [email protected]

From: Wei Fang <[email protected]>

Add the fec support on i.MX8ULP platforms.

---
V2 change:
Remove the external clocks which is related to specific board. V3 change:
No change.

---
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/freescale/imx8ulp.dtsi +11 -0
index 60c1b018bf03..3e8a1e4f0fc2 100644
@@ -16,6 +16,7 @@ / {
 	#size-cells = <2>;
 
 	aliases {
+		ethernet0 = &fec;
 		gpio0 = &gpiod;
 		gpio1 = &gpioe;
 		gpio2 = &gpiof;
@@ -365,6 +366,16 @@ usdhc2: mmc@298f0000 {
 				bus-width = <4>;
 				status = "disabled";
 			};
+
+			fec: ethernet@29950000 {
+				compatible = "fsl,imx8ulp-fec", "fsl,imx6ul-fec", "fsl,imx6q-fec";
+				reg = <0x29950000 0x10000>;
+				interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+				interrupt-names = "int0";
+				fsl,num-tx-queues = <1>;
+				fsl,num-rx-queues = <1>;
+				status = "disabled";
+			};
 		};
 
 		gpioe: gpio@2d000080 {
Signature · 1 line
2.25.1
Reviewed-by on v3 2/3
#5 lore raw

Re: [PATCH V3 2/3] arm64: dts: imx8ulp: Add the fec support

Quoted 5 lines · On 18.07.22 16:22, [email protected] wrote:

From: Wei Fang <[email protected]>

Add the fec support on i.MX8ULP platforms.

Quoted 38 lines

---
V2 change:
Remove the external clocks which is related to specific board. V3 change:
No change.

---
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/freescale/imx8ulp.dtsi +11 -0
index 60c1b018bf03..3e8a1e4f0fc2 100644
@@ -16,6 +16,7 @@ / {
 	#size-cells = <2>;
 
 	aliases {
+		ethernet0 = &fec;
 		gpio0 = &gpiod;
 		gpio1 = &gpioe;
 		gpio2 = &gpiof;
@@ -365,6 +366,16 @@ usdhc2: mmc@298f0000 {
 				bus-width = <4>;
 				status = "disabled";
 			};
+
+			fec: ethernet@29950000 {
+				compatible = "fsl,imx8ulp-fec", "fsl,imx6ul-fec", "fsl,imx6q-fec";
+				reg = <0x29950000 0x10000>;
+				interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+				interrupt-names = "int0";
+				fsl,num-tx-queues = <1>;
+				fsl,num-rx-queues = <1>;
+				status = "disabled";
+			};
 		};
 
 		gpioe: gpio@2d000080 {
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author maintainer
#6 lore raw

PATCH v3 3/3 arm64: dts: imx8ulp-evk: Add the fec support

In reply to [email protected]

From: Wei Fang <[email protected]>

Enable the fec on i.MX8ULP EVK board.

---
V2 change:
Add clock_ext_rmii and clock_ext_ts. They are both related to EVK board. V3 change:
No change.

---
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +57 -0
index 33e84c4e9ed8..ebce716b10e6 100644
@@ -19,6 +19,21 @@ memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0 0x80000000>;
 	};
+
+	clock_ext_rmii: clock-ext-rmii {
+		compatible = "fixed-clock";
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_rmii_clk";
+		#clock-cells = <0>;
+	};
+
+	clock_ext_ts: clock-ext-ts {
+		compatible = "fixed-clock";
+		/* External ts clock is 50MHZ from PHY on EVK board. */
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_ts_clk";
+		#clock-cells = <0>;
+	};
 };
 
 &lpuart5 {
@@ -38,7 +53,49 @@ &usdhc0 {
 	status = "okay";
 };
 
+&fec {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&pinctrl_enet>;
+	pinctrl-1 = <&pinctrl_enet>;
+	clocks = <&cgc1 IMX8ULP_CLK_XBAR_DIVBUS>,
+		 <&pcc4 IMX8ULP_CLK_ENET>,
+		 <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>,
+		 <&clock_ext_rmii>;
+	clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
+	assigned-clocks = <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>;
+	assigned-clock-parents = <&clock_ext_ts>;
+	phy-mode = "rmii";
+	phy-handle = <&ethphy>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy: ethernet-phy {
+			reg = <1>;
+			micrel,led-mode = <1>;
+		};
+	};
+};
+
 &iomuxc1 {
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX8ULP_PAD_PTE15__ENET0_MDC     0x43
+			MX8ULP_PAD_PTE14__ENET0_MDIO    0x43
+			MX8ULP_PAD_PTE17__ENET0_RXER    0x43
+			MX8ULP_PAD_PTE18__ENET0_CRS_DV  0x43
+			MX8ULP_PAD_PTF1__ENET0_RXD0     0x43
+			MX8ULP_PAD_PTE20__ENET0_RXD1    0x43
+			MX8ULP_PAD_PTE16__ENET0_TXEN    0x43
+			MX8ULP_PAD_PTE23__ENET0_TXD0    0x43
+			MX8ULP_PAD_PTE22__ENET0_TXD1    0x43
+			MX8ULP_PAD_PTE19__ENET0_REFCLK  0x43
+			MX8ULP_PAD_PTF10__ENET0_1588_CLKIN 0x43
+		>;
+	};
+
 	pinctrl_lpuart5: lpuart5grp {
 		fsl,pins = <
 			MX8ULP_PAD_PTF14__LPUART5_TX	0x3
Signature · 1 line
2.25.1
#7 lore raw

Re: [PATCH V3 3/3] arm64: dts: imx8ulp-evk: Add the fec support

Quoted 54 lines · On 18.07.22 16:22, [email protected] wrote:

From: Wei Fang <[email protected]>

Enable the fec on i.MX8ULP EVK board.

---
V2 change:
Add clock_ext_rmii and clock_ext_ts. They are both related to EVK board. V3 change:
No change.

---
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +25 -0
index 33e84c4e9ed8..ebce716b10e6 100644
@@ -19,6 +19,21 @@ memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0 0x80000000>;
 	};
+
+	clock_ext_rmii: clock-ext-rmii {
+		compatible = "fixed-clock";
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_rmii_clk";
+		#clock-cells = <0>;
+	};
+
+	clock_ext_ts: clock-ext-ts {
+		compatible = "fixed-clock";
+		/* External ts clock is 50MHZ from PHY on EVK board. */
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_ts_clk";
+		#clock-cells = <0>;
+	};
 };
 
 &lpuart5 {
@@ -38,7 +53,49 @@ &usdhc0 {
 	status = "okay";
 };
 
+&fec {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&pinctrl_enet>;
+	pinctrl-1 = <&pinctrl_enet>;
+	clocks = <&cgc1 IMX8ULP_CLK_XBAR_DIVBUS>,
+		 <&pcc4 IMX8ULP_CLK_ENET>,
+		 <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>,
+		 <&clock_ext_rmii>;
+	clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
+	assigned-clocks = <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>;

arch/arm64/boot/dts/freescale/imx8ulp-evk.dts &usdhc0 { · line 75

Quoted 10 lines
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +10 -0
+	assigned-clock-parents = <&clock_ext_ts>;
+	phy-mode = "rmii";
+	phy-handle = <&ethphy>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy: ethernet-phy {

@1

Quoted 26 lines
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +22 -0
+			reg = <1>;
+			micrel,led-mode = <1>;
+		};
+	};
+};
+
 &iomuxc1 {
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX8ULP_PAD_PTE15__ENET0_MDC     0x43
+			MX8ULP_PAD_PTE14__ENET0_MDIO    0x43
+			MX8ULP_PAD_PTE17__ENET0_RXER    0x43
+			MX8ULP_PAD_PTE18__ENET0_CRS_DV  0x43
+			MX8ULP_PAD_PTF1__ENET0_RXD0     0x43
+			MX8ULP_PAD_PTE20__ENET0_RXD1    0x43
+			MX8ULP_PAD_PTE16__ENET0_TXEN    0x43
+			MX8ULP_PAD_PTE23__ENET0_TXD0    0x43
+			MX8ULP_PAD_PTE22__ENET0_TXD1    0x43
+			MX8ULP_PAD_PTE19__ENET0_REFCLK  0x43
+			MX8ULP_PAD_PTF10__ENET0_1588_CLKIN 0x43
+		>;
+	};
+
 	pinctrl_lpuart5: lpuart5grp {
 		fsl,pins = <
 			MX8ULP_PAD_PTF14__LPUART5_TX	0x3
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw

Re: [PATCH V3 3/3] arm64: dts: imx8ulp-evk: Add the fec support

Quoted 7 lines

arch/arm64/boot/dts/freescale/imx8ulp-evk.dts &usdhc0 { · line 75

Quoted 5 lines
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +5 -0
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy: ethernet-phy {

@1

The DT tools should of warned about this as well. So maybe the build testing needs extending to run all the DT tools?

Andrew