[openwrt/openwrt] ipq40xx: ZTE MF289F: convert to DSA

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 9 14:20:49 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/579ea6b97079cf57949892969064dbee3203d1f4

commit 579ea6b97079cf57949892969064dbee3203d1f4
Author: Dirk Buchwalder <buchwalder at posteo.de>
AuthorDate: Thu Oct 6 18:25:12 2022 +0200

    ipq40xx: ZTE MF289F: convert to DSA
    
    Convert ZTE MF289F device to DSA, re-order network ports to match the
    labels on the case and re-enable the device.
    
    Signed-off-by: Dirk Buchwalder <buchwalder at posteo.de>
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Reviewed-by: Lech Perczak <lech.perczak at gmail.com>
---
 .../ipq40xx/base-files/etc/board.d/02_network      |  8 ++----
 .../arch/arm/boot/dts/qcom-ipq4019-mf289f.dts      | 30 ++++++++++++----------
 target/linux/ipq40xx/image/generic.mk              |  3 +--
 3 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 163dcdcbc6..583b5c8fbd 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -33,7 +33,8 @@ ipq40xx_setup_interfaces()
 	glinet,gl-b2200|\
 	luma,wrtq-329acn|\
 	mikrotik,cap-ac|\
-	netgear,wac510)
+	netgear,wac510|\
+	zte,mf289f)
 		ucidef_set_interfaces_lan_wan "lan" "wan"
 		;;
 	aruba,ap-303|\
@@ -59,11 +60,6 @@ ipq40xx_setup_interfaces()
 	zte,mf286d)
 		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan"
 		;;
-	zte,mf289f)
-		ucidef_set_interfaces_lan_wan "eth0" "eth1"
-		ucidef_add_switch "switch0" \
-			"0u at eth0" "0u at eth1" "2:lan:1" "5:lan:2"
-		;;
 	*)
 		echo "Unsupported hardware. Network interfaces not initialized"
 		;;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts
index 2dac307990..ccb70dce87 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts
@@ -71,10 +71,6 @@
 	};
 
 	soc {
-		ess-psgmii at 98000 {
-			status = "okay";
-		};
-
 		tcsr at 1949000 {
 			compatible = "qcom,tcsr";
 			reg = <0x1949000 0x100>;
@@ -100,14 +96,6 @@
 			reg = <0x1957000 0x100>;
 			qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
 		};
-
-		ess-switch at c000000 {
-			status = "okay";
-		};
-
-		edma at c080000 {
-			status = "okay";
-		};
 	};
 };
 
@@ -319,17 +307,31 @@
 	status = "okay";
 };
 
-&gmac0 {
+&gmac {
+	status = "okay";
 	nvmem-cell-names = "mac-address";
 	nvmem-cells = <&macaddr_mac_0>;
 };
 
-&gmac1 {
+&switch {
+	status = "okay";
+};
+
+&swport2 {
+	status = "okay";
+
+	label = "wan";
+
 	nvmem-cell-names = "mac-address";
 	nvmem-cells = <&macaddr_mac_0>;
 	mac-address-increment = <1>;
 };
 
+&swport5 {
+	status = "okay";
+
+	label = "lan";
+};
 
 &qpic_bam {
 	status = "okay";
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 3c1cf67448..82c7464b87 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -1119,8 +1119,7 @@ define Device/zte_mf289f
 	DEVICE_MODEL := MF289F
 	DEVICE_PACKAGES += ipq-wifi-zte_mf289f ath10k-firmware-qca9984-ct
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += zte_mf289f
+TARGET_DEVICES += zte_mf289f
 
 define Device/zyxel_nbg6617
 	$(call Device/FitImageLzma)




More information about the lede-commits mailing list