Skip to contentSkip to conversation

PATCH Superseded Arınç ÜNAL 2 participants 12 messages Jan 24, 2022 – Jan 25, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

Hey everyone,

In preperation to mainline mt7621-dts; fix formatting, dtc warning on switch0@0 node and pinctrl properties for ethernet node on the mt7621.dtsi. Move the GB-PC2 specific external phy configuration on the main dtsi to GB-PC2's devicetree, gbpc2.dts.

Now that pinctrl properties are properly defined on the ethernet node, GMAC1 will start working.

Traffic flow on GMAC1 was tested on a mt7621a board with these modes:
External phy <-> GMAC1
PHY 0/4 <-> GMAC1

Cheers.
Arınç

[0]: https://lore.kernel.org/netdev/[email protected]/T/

Arınç ÜNAL (4):
staging: mt7621-dts: fix formatting
staging: mt7621-dts: fix switch0@0 warnings
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
staging: mt7621-dts: fix pinctrl properties for ethernet

 drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
 drivers/staging/mt7621-dts/mt7621.dtsi | 32 ++++++++++++++++----------------
 2 files changed, 27 insertions(+), 21 deletions(-)
#1 lore raw

PATCH 1/4 staging: mt7621-dts: fix formatting

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +12 -3
index 644a65d1a6a1..d120e5872165 100644
@@ -44,9 +44,9 @@ mmc_fixed_3v3: fixedregulator@0 {
 		regulator-max-microvolt = <3300000>;
 		enable-active-high;
 		regulator-always-on;
-	  };
+	};
 
-	  mmc_fixed_1v8_io: fixedregulator@1 {
+	mmc_fixed_1v8_io: fixedregulator@1 {
 		compatible = "regulator-fixed";
 		regulator-name = "mmc_io";
 		regulator-min-microvolt = <1800000>;
@@ -325,17 +325,18 @@ ethernet: ethernet@1e100000 {
 
 		mediatek,ethsys = <&sysc>;
 
-
 		gmac0: mac@0 {
 			compatible = "mediatek,eth-mac";
 			reg = <0>;
 			phy-mode = "rgmii";
+
 			fixed-link {
 				speed = <1000>;
 				full-duplex;
 				pause;
 			};
 		};
+
 		gmac1: mac@1 {
 			compatible = "mediatek,eth-mac";
 			reg = <1>;
@@ -343,6 +344,7 @@ gmac1: mac@1 {
 			phy-mode = "rgmii-rxid";
 			phy-handle = <&phy_external>;
 		};
+
 		mdio-bus {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -373,36 +375,43 @@ ports {
 					#address-cells = <1>;
 					#size-cells = <0>;
 					reg = <0>;
+
 					port@0 {
 						status = "off";
 						reg = <0>;
 						label = "lan0";
 					};
+
 					port@1 {
 						status = "off";
 						reg = <1>;
 						label = "lan1";
 					};
+
 					port@2 {
 						status = "off";
 						reg = <2>;
 						label = "lan2";
 					};
+
 					port@3 {
 						status = "off";
 						reg = <3>;
 						label = "lan3";
 					};
+
 					port@4 {
 						status = "off";
 						reg = <4>;
 						label = "lan4";
 					};
+
 					port@6 {
 						reg = <6>;
 						label = "cpu";
 						ethernet = <&gmac0>;
 						phy-mode = "trgmii";
+
 						fixed-link {
 							speed = <1000>;
 							full-duplex;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] staging: mt7621-dts: fix formatting

Hi Arinc,

Quoted 2 lines · Arınç ÜNAL

We need a body for the commit also and not only a short description for the commit.

Quoted 93 lines
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +12 -4
index 644a65d1a6a1..d120e5872165 100644
@@ -44,9 +44,9 @@ mmc_fixed_3v3: fixedregulator@0 {
                regulator-max-microvolt = <3300000>;
                enable-active-high;
                regulator-always-on;
-         };
+       };
 
-         mmc_fixed_1v8_io: fixedregulator@1 {
+       mmc_fixed_1v8_io: fixedregulator@1 {
                compatible = "regulator-fixed";
                regulator-name = "mmc_io";
                regulator-min-microvolt = <1800000>;
@@ -325,17 +325,18 @@ ethernet: ethernet@1e100000 {
 
                mediatek,ethsys = <&sysc>;
 
-
                gmac0: mac@0 {
                        compatible = "mediatek,eth-mac";
                        reg = <0>;
                        phy-mode = "rgmii";
+
                        fixed-link {
                                speed = <1000>;
                                full-duplex;
                                pause;
                        };
                };
+
                gmac1: mac@1 {
                        compatible = "mediatek,eth-mac";
                        reg = <1>;
@@ -343,6 +344,7 @@ gmac1: mac@1 {
                        phy-mode = "rgmii-rxid";
                        phy-handle = <&phy_external>;
                };
+
                mdio-bus {
                        #address-cells = <1>;
                        #size-cells = <0>;
@@ -373,36 +375,43 @@ ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        reg = <0>;
+
                                        port@0 {
                                                status = "off";
                                                reg = <0>;
                                                label = "lan0";
                                        };
+
                                        port@1 {
                                                status = "off";
                                                reg = <1>;
                                                label = "lan1";
                                        };
+
                                        port@2 {
                                                status = "off";
                                                reg = <2>;
                                                label = "lan2";
                                        };
+
                                        port@3 {
                                                status = "off";
                                                reg = <3>;
                                                label = "lan3";
                                        };
+
                                        port@4 {
                                                status = "off";
                                                reg = <4>;
                                                label = "lan4";
                                        };
+
                                        port@6 {
                                                reg = <6>;
                                                label = "cpu";
                                                ethernet = <&gmac0>;
                                                phy-mode = "trgmii";
+
                                                fixed-link {
                                                        speed = <1000>;
                                                        full-duplex;
--
Quoted 3 lines

2.25.1

Other than that, this looks good. So feel free to add my:

when submitting a new version of this series.

Best regards,
Sergio Paracuellos

#3 lore raw

PATCH 2/4 staging: mt7621-dts: fix switch0@0 warnings

In reply to Arınç ÜNAL

Remove reg property from ports node to fix this warning:

Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch0@0/ports: node has a reg or ranges property, but no unit name

Another warning surfaces afterwards. Remove #address-cells and #size-cells from switch0@0 node to fix this warning:

Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch0@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +0 -3
index d120e5872165..35f19d6ae4bd 100644
@@ -360,8 +360,6 @@ phy_external: ethernet-phy@5 {
 
 			switch0: switch0@0 {
 				compatible = "mediatek,mt7621";
-				#address-cells = <1>;
-				#size-cells = <0>;
 				reg = <0>;
 				mediatek,mcm;
 				resets = <&rstctrl 2>;
@@ -374,7 +372,6 @@ switch0: switch0@0 {
 				ports {
 					#address-cells = <1>;
 					#size-cells = <0>;
-					reg = <0>;
 
 					port@0 {
 						status = "off";
Signature · 1 line
2.25.1
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] staging: mt7621-dts: fix switch0@0 warnings

Quoted 37 lines · Arınç ÜNAL

Remove reg property from ports node to fix this warning:

Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch0@0/ports: node has a reg or ranges property, but no unit name

Another warning surfaces afterwards. Remove #address-cells and #size-cells from switch0@0 node to fix this warning:

Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch0@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +0 -4
index d120e5872165..35f19d6ae4bd 100644
@@ -360,8 +360,6 @@ phy_external: ethernet-phy@5 {
 
                        switch0: switch0@0 {
                                compatible = "mediatek,mt7621";
-                               #address-cells = <1>;
-                               #size-cells = <0>;
                                reg = <0>;
                                mediatek,mcm;
                                resets = <&rstctrl 2>;
@@ -374,7 +372,6 @@ switch0: switch0@0 {
                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
-                                       reg = <0>;
 
                                        port@0 {
                                                status = "off";
--
Quoted 3 lines

2.25.1

Looks good to me:

Thanks,
Sergio Paracuellos

#5 lore raw

PATCH 3/4 staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6

In reply to Arınç ÜNAL

Change phy-mode of gmac0 to trgmii to match the other side, port@6.

Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too.

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/mt7621-dts/mt7621.dtsi +2 -1
index 35f19d6ae4bd..489754f6ed77 100644
@@ -328,7 +328,7 @@ ethernet: ethernet@1e100000 {
 		gmac0: mac@0 {
 			compatible = "mediatek,eth-mac";
 			reg = <0>;
-			phy-mode = "rgmii";
+			phy-mode = "trgmii";
 
 			fixed-link {
 				speed = <1000>;
@@ -412,6 +412,7 @@ port@6 {
 						fixed-link {
 							speed = <1000>;
 							full-duplex;
+							pause;
 						};
 					};
 				};
Signature · 1 line
2.25.1
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH 3/4] staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6

Quoted 10 lines · Arınç ÜNAL

Change phy-mode of gmac0 to trgmii to match the other side, port@6.

Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too.

---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks,
Sergio Paracuellos

Quoted 25 lines
drivers/staging/mt7621-dts/mt7621.dtsi +2 -2
index 35f19d6ae4bd..489754f6ed77 100644
@@ -328,7 +328,7 @@ ethernet: ethernet@1e100000 {
                gmac0: mac@0 {
                        compatible = "mediatek,eth-mac";
                        reg = <0>;
-                       phy-mode = "rgmii";
+                       phy-mode = "trgmii";
 
                        fixed-link {
                                speed = <1000>;
@@ -412,6 +412,7 @@ port@6 {
                                                fixed-link {
                                                        speed = <1000>;
                                                        full-duplex;
+                                                       pause;
                                                };
                                        };
                                };
--

2.25.1

#7 lore raw

PATCH 4/4 staging: mt7621-dts: fix pinctrl properties for ethernet

In reply to Arınç ÜNAL

Add pinctrl properties with rgmii1 & mdio pins under ethernet node which was wrongfully put under an external phy node.
GMAC1 will start working with this fix.

Move GB-PC2 specific phy_external node to its own device tree.

---
 drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
 drivers/staging/mt7621-dts/mt7621.dtsi | 13 +++----------
 2 files changed, 14 insertions(+), 15 deletions(-)
drivers/staging/mt7621-dts/gbpc2.dts +11 -5
index 6fe603c7711d..03d6bb6735ac 100644
@@ -13,10 +13,16 @@ &default_gpio {
 	function = "gpio";
 };
 
-&gmac1 {
-	status = "ok";
-};
+&ethernet {
+	gmac1: mac@1 {
+		status = "ok";
+		phy-handle = <&phy_external>;
+	};
 
-&phy_external {
-	status = "ok";
+	mdio-bus {
+		phy_external: ethernet-phy@5 {
+			reg = <5>;
+			phy-mode = "rgmii-rxid";
+		};
+	};
 };
drivers/staging/mt7621-dts/mt7621.dtsi +3 -10
index 489754f6ed77..38ab6447756a 100644
@@ -325,6 +325,9 @@ ethernet: ethernet@1e100000 {
 
 		mediatek,ethsys = <&sysc>;
 
+		pinctrl-names = "default";
+		pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
 		gmac0: mac@0 {
 			compatible = "mediatek,eth-mac";
 			reg = <0>;
@@ -342,22 +345,12 @@ gmac1: mac@1 {
 			reg = <1>;
 			status = "off";
 			phy-mode = "rgmii-rxid";
-			phy-handle = <&phy_external>;
 		};
 
 		mdio-bus {
 			#address-cells = <1>;
 			#size-cells = <0>;
 
-			phy_external: ethernet-phy@5 {
-				status = "off";
-				reg = <5>;
-				phy-mode = "rgmii-rxid";
-
-				pinctrl-names = "default";
-				pinctrl-0 = <&rgmii2_pins>;
-			};
-
 			switch0: switch0@0 {
 				compatible = "mediatek,mt7621";
 				reg = <0>;
Signature · 1 line
2.25.1
Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH 4/4] staging: mt7621-dts: fix pinctrl properties for ethernet

Quoted 7 lines · Arınç ÜNAL

Add pinctrl properties with rgmii1 & mdio pins under ethernet node which was wrongfully put under an external phy node.
GMAC1 will start working with this fix.

Quoted 7 lines

Move GB-PC2 specific phy_external node to its own device tree.

---
 drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
 drivers/staging/mt7621-dts/mt7621.dtsi | 13 +++----------
 2 files changed, 14 insertions(+), 15 deletions(-)

Thanks,
Sergio Paracuellos

Quoted 67 lines
drivers/staging/mt7621-dts/gbpc2.dts +11 -5
index 6fe603c7711d..03d6bb6735ac 100644
@@ -13,10 +13,16 @@ &default_gpio {
        function = "gpio";
 };
 
-&gmac1 {
-       status = "ok";
-};
+&ethernet {
+       gmac1: mac@1 {
+               status = "ok";
+               phy-handle = <&phy_external>;
+       };
 
-&phy_external {
-       status = "ok";
+       mdio-bus {
+               phy_external: ethernet-phy@5 {
+                       reg = <5>;
+                       phy-mode = "rgmii-rxid";
+               };
+       };
 };
drivers/staging/mt7621-dts/mt7621.dtsi +3 -11
index 489754f6ed77..38ab6447756a 100644
@@ -325,6 +325,9 @@ ethernet: ethernet@1e100000 {
 
                mediatek,ethsys = <&sysc>;
 
+               pinctrl-names = "default";
+               pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
                gmac0: mac@0 {
                        compatible = "mediatek,eth-mac";
                        reg = <0>;
@@ -342,22 +345,12 @@ gmac1: mac@1 {
                        reg = <1>;
                        status = "off";
                        phy-mode = "rgmii-rxid";
-                       phy-handle = <&phy_external>;
                };
 
                mdio-bus {
                        #address-cells = <1>;
                        #size-cells = <0>;
 
-                       phy_external: ethernet-phy@5 {
-                               status = "off";
-                               reg = <5>;
-                               phy-mode = "rgmii-rxid";
-
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&rgmii2_pins>;
-                       };
-
                        switch0: switch0@0 {
                                compatible = "mediatek,mt7621";
                                reg = <0>;
--

2.25.1

#9 lore raw
In reply to Arınç ÜNAL

Hi Arinc!

Quoted 11 lines · Arınç ÜNAL

Hey everyone,

In preperation to mainline mt7621-dts; fix formatting, dtc warning on switch0@0 node and pinctrl properties for ethernet node on the mt7621.dtsi. Move the GB-PC2 specific external phy configuration on the main dtsi to GB-PC2's devicetree, gbpc2.dts.

Now that pinctrl properties are properly defined on the ethernet node, GMAC1 will start working.

Quoted 6 lines

Traffic flow on GMAC1 was tested on a mt7621a board with these modes:
External phy <-> GMAC1
PHY 0/4 <-> GMAC1

Cheers.
Arınç

Nitpick: next time try to put also a subject like "staging:
mt7621-dts: cleanups (or whatever)" in the cover letter of the series.

Quoted 9 lines

[0]: https://lore.kernel.org/netdev/[email protected]/T/

Arınç ÜNAL (4):
staging: mt7621-dts: fix formatting
staging: mt7621-dts: fix switch0@0 warnings
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
staging: mt7621-dts: fix pinctrl properties for ethernet

Quoted 5 lines
 drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
 drivers/staging/mt7621-dts/mt7621.dtsi | 32 ++++++++++++++++----------------
 2 files changed, 27 insertions(+), 21 deletions(-)

Thanks for doing this!

Best regards,
Sergio Paracuellos

#10 lore raw

Hey Sergio,

Quoted 18 lines · Sergio Paracuellos

Hi Arinc!

Quoted 15 lines · Arınç ÜNAL

Hey everyone,

In preperation to mainline mt7621-dts; fix formatting, dtc warning on switch0@0 node and pinctrl properties for ethernet node on the mt7621.dtsi. Move the GB-PC2 specific external phy configuration on the main dtsi to GB-PC2's devicetree, gbpc2.dts.

Now that pinctrl properties are properly defined on the ethernet node, GMAC1 will start working.

Traffic flow on GMAC1 was tested on a mt7621a board with these modes:
External phy <-> GMAC1
PHY 0/4 <-> GMAC1

Quoted 5 lines
Quoted 2 lines

Cheers.
Arınç

Nitpick: next time try to put also a subject like "staging:
mt7621-dts: cleanups (or whatever)" in the cover letter of the series.

I had already sent v2 with that. I'll send v3 with your input on the series, thanks!

Quoted 20 lines
Quoted 10 lines

[0]: https://lore.kernel.org/netdev/[email protected]/T/

Arınç ÜNAL (4):
staging: mt7621-dts: fix formatting
staging: mt7621-dts: fix switch0@0 warnings
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
staging: mt7621-dts: fix pinctrl properties for ethernet

Quoted 5 lines
  drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
  drivers/staging/mt7621-dts/mt7621.dtsi | 32 ++++++++++++++++----------------
  2 files changed, 27 insertions(+), 21 deletions(-)

Thanks for doing this!

Best regards,
Sergio Paracuellos

#11 lore raw
Quoted 22 lines · Arınç ÜNAL

Hey Sergio,

Quoted 18 lines · Sergio Paracuellos

Hi Arinc!

Quoted 15 lines · Arınç ÜNAL

Hey everyone,

In preperation to mainline mt7621-dts; fix formatting, dtc warning on switch0@0 node and pinctrl properties for ethernet node on the mt7621.dtsi. Move the GB-PC2 specific external phy configuration on the main dtsi to GB-PC2's devicetree, gbpc2.dts.

Now that pinctrl properties are properly defined on the ethernet node, GMAC1 will start working.

Traffic flow on GMAC1 was tested on a mt7621a board with these modes:
External phy <-> GMAC1
PHY 0/4 <-> GMAC1

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Cheers.
Arınç

Nitpick: next time try to put also a subject like "staging:
mt7621-dts: cleanups (or whatever)" in the cover letter of the series.

I had already sent v2 with that. I'll send v3 with your input on the series, thanks!

True, sorry I missed that!

Thanks,
Sergio Paracuellos

Quoted 21 lines
Quoted 21 lines
Quoted 11 lines

[0]: https://lore.kernel.org/netdev/[email protected]/T/

Arınç ÜNAL (4):
staging: mt7621-dts: fix formatting
staging: mt7621-dts: fix switch0@0 warnings
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
staging: mt7621-dts: fix pinctrl properties for ethernet

Quoted 5 lines
  drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
  drivers/staging/mt7621-dts/mt7621.dtsi | 32 ++++++++++++++++----------------
  2 files changed, 27 insertions(+), 21 deletions(-)

Thanks for doing this!

Best regards,
Sergio Paracuellos