[PATCH 2/2] mips: dts: ralink: mt7621: add port at 5 as CPU port

arinc9.unal at gmail.com arinc9.unal at gmail.com
Sat Feb 11 02:49:15 PST 2023


From: Arınç ÜNAL <arinc.unal at arinc9.com>

On MT7621AT, MT7621DAT, and MT7621ST SoCs, port 5 of the MT7530 switch is
connected to the second MAC of the SoC as a CPU port. Add the port and set
up the second MAC on the bindings. Revert PHY muxing on GB-PC1.

There's an external PHY connected to the second MAC of the SoC on GB-PC2,
therefore, disable port at 5 for this device.

Signed-off-by: Arınç ÜNAL <arinc.unal at arinc9.com>
---
 .../boot/dts/ralink/mt7621-gnubee-gb-pc1.dts  | 16 +++++-----------
 .../boot/dts/ralink/mt7621-gnubee-gb-pc2.dts  |  9 ++++++++-
 arch/mips/boot/dts/ralink/mt7621.dtsi         | 19 ++++++++++++++++++-
 3 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
index 4314aee97e18..129b6710b699 100644
--- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
+++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts
@@ -91,22 +91,16 @@ &pcie {
 	status = "okay";
 };
 
-&gmac1 {
-	status = "okay";
-	phy-handle = <&ethphy4>;
-};
-
-&mdio {
-	ethphy4: ethernet-phy at 4 {
-		reg = <4>;
-	};
-};
-
 &switch0 {
 	ports {
 		port at 0 {
 			status = "okay";
 			label = "ethblack";
 		};
+
+		port at 4 {
+			status = "okay";
+			label = "ethblue";
+		};
 	};
 };
diff --git a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
index 3ebbf933f644..f810cd10f4f4 100644
--- a/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
+++ b/arch/mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts
@@ -112,9 +112,12 @@ &pcie {
 };
 
 &gmac1 {
-	status = "okay";
 	phy-mode = "rgmii-rxid";
 	phy-handle = <&ethphy5>;
+
+	fixed-link {
+		status = "disabled";
+	};
 };
 
 &mdio {
@@ -134,5 +137,9 @@ port at 4 {
 			status = "okay";
 			label = "ethblue";
 		};
+
+		port at 5 {
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
index aec85c779359..290d47fbcfbb 100644
--- a/arch/mips/boot/dts/ralink/mt7621.dtsi
+++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
@@ -332,8 +332,13 @@ fixed-link {
 		gmac1: mac at 1 {
 			compatible = "mediatek,eth-mac";
 			reg = <1>;
-			status = "disabled";
 			phy-mode = "rgmii";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+				pause;
+			};
 		};
 
 		mdio: mdio-bus {
@@ -384,6 +389,18 @@ port at 4 {
 						label = "swp4";
 					};
 
+					port at 5 {
+						reg = <5>;
+						ethernet = <&gmac1>;
+						phy-mode = "rgmii";
+
+						fixed-link {
+							speed = <1000>;
+							full-duplex;
+							pause;
+						};
+					};
+
 					port at 6 {
 						reg = <6>;
 						ethernet = <&gmac0>;
-- 
2.37.2




More information about the Linux-mediatek mailing list