[openwrt/openwrt] ramips: add wan2 support for MQmaker WiTi

LEDE Commits lede-commits at lists.infradead.org
Tue Jul 9 00:35:58 PDT 2024


rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/b20da12ecadf70ae03a880ed4aed73d984d01876

commit b20da12ecadf70ae03a880ed4aed73d984d01876
Author: Arınç ÜNAL <arinc.unal at arinc9.com>
AuthorDate: Sat Jun 17 21:59:26 2023 +0300

    ramips: add wan2 support for MQmaker WiTi
    
    The PHY of the wan2 port on MQmaker WiTi is wired to the second MAC of the
    SoC. Rename the wan interface to wan1 and define it under the switch node,
    effectively disabling the PHY muxing of the MT7530 switch's phy4.
    
    Define the PHY of the wan2 port and adjust the gmac1 node accordingly. Now
    that the PHY muxing feature is not being used anymore, the wan2 port can be
    used to achieve 2 Gbps total bandwidth to the CPU.
    
    Tested-by: Demetris Ierokipides <ierokipides.dem at gmail.com>
    Signed-off-by: Arınç ÜNAL <arinc.unal at arinc9.com>
    (cherry picked from commit 8bf9a8a5e6e35afcb8b7aaebfea6fb91e76c9d81)
---
 target/linux/ramips/dts/mt7621_mqmaker_witi.dts        | 18 ++++++++++++++----
 .../ramips/mt7621/base-files/etc/board.d/02_network    |  3 +++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts
index 16cebbad74..d785d741b1 100644
--- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts
+++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts
@@ -102,8 +102,9 @@
 
 &gmac1 {
 	status = "okay";
-	label = "wan";
-	phy-handle = <&ethphy4>;
+	label = "wan2";
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&ethphy5>;
 
 	nvmem-cells = <&macaddr_factory_e000>;
 	nvmem-cell-names = "mac-address";
@@ -111,8 +112,8 @@
 };
 
 &mdio {
-	ethphy4: ethernet-phy at 4 {
-		reg = <4>;
+	ethphy5: ethernet-phy at 5 {
+		reg = <5>;
 	};
 };
 
@@ -137,6 +138,15 @@
 			status = "okay";
 			label = "lan4";
 		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan1";
+
+			nvmem-cells = <&macaddr_factory_e000>;
+			nvmem-cell-names = "mac-address";
+			mac-address-increment = <1>;
+		};
 	};
 };
 
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 8aabf41928..9f7cc3510c 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -115,6 +115,9 @@ ramips_setup_interfaces()
 	mikrotik,routerboard-760igs)
 		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp"
 		;;
+	mqmaker,witi)
+		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan1 wan2"
+		;;
 	tozed,zlt-s12-pro)
 		ucidef_set_interface_lan "lan1 lan2 lan3 wan"
 		ucidef_set_interface "wwan" device "/dev/ttyUSB0" protocol "ncm"




More information about the lede-commits mailing list