Skip to contentSkip to conversation

staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl

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

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl

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/

v2: add subject to the first mail

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 v2 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
maintainer
#2 lore raw

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

Quoted 97 lines · Arınç ÜNAL
---
 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

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#3 lore raw

PATCH v2 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
#4 lore raw

PATCH v2 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
#5 lore raw

PATCH v2 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