All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl
@ 2022-01-25 15:38 Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 1/4] staging: mt7621-dts: fix formatting Arınç ÜNAL
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arınç ÜNAL @ 2022-01-25 15:38 UTC (permalink / raw)
  To: Greg KH, Sergio Paracuellos, NeilBrown, DENG Qingfang,
	Andrew Lunn, Luiz Angelo Daros de Luca, erkin.bozoglu
  Cc: linux-staging

Hey everyone,

In preperation to mainline mt7621-dts; fix formatting, dtc warning on
switch0@0 node, phy-mode, flow control 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/83a35aa3-6cb8-2bc4-2ff4-64278bbcd8c8@arinc9.com/T/

v3: add body to the first patch and add Sergio's Reviewed by: tag
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(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/4] staging: mt7621-dts: fix formatting
  2022-01-25 15:38 [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl Arınç ÜNAL
@ 2022-01-25 15:39 ` Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 2/4] staging: mt7621-dts: fix switch0@0 warnings Arınç ÜNAL
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Arınç ÜNAL @ 2022-01-25 15:39 UTC (permalink / raw)
  To: Greg KH, Sergio Paracuellos, NeilBrown, DENG Qingfang,
	Andrew Lunn, Luiz Angelo Daros de Luca, erkin.bozoglu
  Cc: linux-staging, Arınç ÜNAL

Fix formatting on mt7621.dtsi.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index 644a65d1a6a1..d120e5872165 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/4] staging: mt7621-dts: fix switch0@0 warnings
  2022-01-25 15:38 [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 1/4] staging: mt7621-dts: fix formatting Arınç ÜNAL
@ 2022-01-25 15:39 ` Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 3/4] staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6 Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 4/4] staging: mt7621-dts: fix pinctrl properties for ethernet Arınç ÜNAL
  3 siblings, 0 replies; 5+ messages in thread
From: Arınç ÜNAL @ 2022-01-25 15:39 UTC (permalink / raw)
  To: Greg KH, Sergio Paracuellos, NeilBrown, DENG Qingfang,
	Andrew Lunn, Luiz Angelo Daros de Luca, erkin.bozoglu
  Cc: linux-staging, 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

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index d120e5872165..35f19d6ae4bd 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -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";
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 3/4] staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
  2022-01-25 15:38 [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 1/4] staging: mt7621-dts: fix formatting Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 2/4] staging: mt7621-dts: fix switch0@0 warnings Arınç ÜNAL
@ 2022-01-25 15:39 ` Arınç ÜNAL
  2022-01-25 15:39 ` [PATCH v3 4/4] staging: mt7621-dts: fix pinctrl properties for ethernet Arınç ÜNAL
  3 siblings, 0 replies; 5+ messages in thread
From: Arınç ÜNAL @ 2022-01-25 15:39 UTC (permalink / raw)
  To: Greg KH, Sergio Paracuellos, NeilBrown, DENG Qingfang,
	Andrew Lunn, Luiz Angelo Daros de Luca, erkin.bozoglu
  Cc: linux-staging, 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.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index 35f19d6ae4bd..489754f6ed77 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 4/4] staging: mt7621-dts: fix pinctrl properties for ethernet
  2022-01-25 15:38 [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl Arınç ÜNAL
                   ` (2 preceding siblings ...)
  2022-01-25 15:39 ` [PATCH v3 3/4] staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6 Arınç ÜNAL
@ 2022-01-25 15:39 ` Arınç ÜNAL
  3 siblings, 0 replies; 5+ messages in thread
From: Arınç ÜNAL @ 2022-01-25 15:39 UTC (permalink / raw)
  To: Greg KH, Sergio Paracuellos, NeilBrown, DENG Qingfang,
	Andrew Lunn, Luiz Angelo Daros de Luca, erkin.bozoglu
  Cc: linux-staging, 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.

Link: https://lore.kernel.org/netdev/02ecce91-7aad-4392-c9d7-f45ca1b31e0b@arinc9.com/T/

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

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/gbpc2.dts   | 16 +++++++++++-----
 drivers/staging/mt7621-dts/mt7621.dtsi | 13 +++----------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/mt7621-dts/gbpc2.dts b/drivers/staging/mt7621-dts/gbpc2.dts
index 6fe603c7711d..03d6bb6735ac 100644
--- a/drivers/staging/mt7621-dts/gbpc2.dts
+++ b/drivers/staging/mt7621-dts/gbpc2.dts
@@ -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";
+		};
+	};
 };
diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index 489754f6ed77..38ab6447756a 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-25 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 15:38 [PATCH v3 0/4] staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl Arınç ÜNAL
2022-01-25 15:39 ` [PATCH v3 1/4] staging: mt7621-dts: fix formatting Arınç ÜNAL
2022-01-25 15:39 ` [PATCH v3 2/4] staging: mt7621-dts: fix switch0@0 warnings Arınç ÜNAL
2022-01-25 15:39 ` [PATCH v3 3/4] staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6 Arınç ÜNAL
2022-01-25 15:39 ` [PATCH v3 4/4] staging: mt7621-dts: fix pinctrl properties for ethernet Arınç ÜNAL

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.