[openwrt/openwrt] ipq40xx: Convert openmesh,a62 to DSA

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 12 09:30:24 PST 2022


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

commit c6bef1b83a75d2f69a4d8904882800405df1a7b8
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Mon Oct 24 18:55:44 2022 +0200

    ipq40xx: Convert openmesh,a62 to DSA
    
    * ethernet1:
    
      - physical port label "Ethernet 1"
      - can be used to power the device
      - its mac address is printed on the device label
    
    * ethernet2:
    
      - physical port label "Ethernet 2"
    
    Both ports are not marked by there role (because the vendor firmware
    automatically detects roles) but the "Ethernet 1" port was used in the past
    for "WAN" functionality in OpenWrt.
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Tested-by: Michaël BILCOT <michael.bilcot at gmail.com>
    Signed-off-by: Sven Eckelmann <sven at narfation.org>
---
 .../ipq40xx/base-files/etc/board.d/02_network      |  6 +++--
 .../lib/preinit/05_set_iface_mac_ipq40xx.sh        |  3 ++-
 .../files/arch/arm/boot/dts/qcom-ipq4019-a62.dts   | 26 ++++++++++++++++++----
 target/linux/ipq40xx/image/generic.mk              |  3 +--
 4 files changed, 29 insertions(+), 9 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 6c6d04a923..b98c85decf 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -73,7 +73,8 @@ ipq40xx_setup_interfaces()
 	netgear,srs60)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
-	openmesh,a42)
+	openmesh,a42|\
+	openmesh,a62)
 		ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1"
 		;;
 	zte,mf286d)
@@ -162,7 +163,8 @@ ipq40xx_setup_macs()
 	pakedge,wr-1)
 		wan_mac=$(macaddr_add $(get_mac_label) 1)
 		;;
-	openmesh,a42)
+	openmesh,a42|\
+	openmesh,a62)
 		label_mac="$(mtd_get_mac_binary "0:ART" 0x0)"
 		;;
 	esac
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
index 4ae4103131..0d19c6bae0 100644
--- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
+++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
@@ -29,7 +29,8 @@ preinit_set_mac_address() {
 		ip link set dev lan1 address $(macaddr_add "$base_mac" 1)
 		ip link set dev eth0 address $(macaddr_setbit "$base_mac" 7)
 		;;
-	openmesh,a42)
+	openmesh,a42|\
+	openmesh,a62)
 		ip link set dev ethernet1 address $(mtd_get_mac_binary "0:ART" 0x0)
 		ip link set dev ethernet2 address $(mtd_get_mac_binary "0:ART" 0x6)
 		;;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts
index 799e3cb415..11d27ab339 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts
@@ -17,10 +17,6 @@
 			status = "okay";
 		};
 
-		mdio at 90000 {
-			status = "okay";
-		};
-
 		tcsr at 194b000 {
 			/* select hostmode */
 			compatible = "qcom,tcsr";
@@ -194,6 +190,28 @@
 	};
 };
 
+&mdio {
+	status = "okay";
+};
+
+&gmac {
+	status = "okay";
+};
+
+&switch {
+	status = "okay";
+};
+
+&swport4 {
+	status = "okay";
+	label = "ethernet1";
+};
+
+&swport5 {
+	status = "okay";
+	label = "ethernet2";
+};
+
 &wifi0 {
 	status = "okay";
 	qcom,ath10k-calibration-variant = "OM-A62";
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 14a2745719..9553931676 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -904,8 +904,7 @@ define Device/openmesh_a62
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
 	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += openmesh_a62
+TARGET_DEVICES += openmesh_a62
 
 define Device/p2w_r619ac
 	$(call Device/FitzImage)




More information about the lede-commits mailing list