ipq40xx: convert to DSA and enable asus,rt-ac42u
authorChen Minqiang <ptpt52@gmail.com>
Mon, 3 Oct 2022 01:41:31 +0000 (09:41 +0800)
committerChen Minqiang <ptpt52@gmail.com>
Sat, 22 Oct 2022 12:09:58 +0000 (20:09 +0800)
This convert board asus,rt-ac42u to DSA and re-enable it

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
target/linux/ipq40xx/base-files/etc/board.d/01_leds
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts
target/linux/ipq40xx/image/generic.mk

index cd68ed32c01e4a778d9954e871a4d7dbbd43d45c..748b6f5b82ca3c4adf414d254948f6a8103904db 100644 (file)
@@ -13,10 +13,11 @@ alfa-network,ap120c-ac)
        ucidef_set_led_netdev "wan" "WAN" "amber:wan" "wan"
        ;;
 asus,rt-ac42u)
-       ucidef_set_led_switch "lan1" "LAN1" "blue:lan-1" "switch0" "0x02"
-       ucidef_set_led_switch "lan2" "LAN2" "blue:lan-2" "switch0" "0x04"
-       ucidef_set_led_switch "lan3" "LAN3" "blue:lan-3" "switch0" "0x08"
-       ucidef_set_led_switch "lan4" "LAN4" "blue:lan-4" "switch0" "0x10"
+       ucidef_set_led_netdev "lan1" "LAN1" "blue:lan-1" "lan1"
+       ucidef_set_led_netdev "lan2" "LAN2" "blue:lan-2" "lan2"
+       ucidef_set_led_netdev "lan3" "LAN3" "blue:lan-3" "lan3"
+       ucidef_set_led_netdev "lan4" "LAN4" "blue:lan-4" "lan4"
+       ucidef_set_led_netdev "wan" "WAN" "blue:wan" "wan"
        ;;
 asus,rt-ac58u)
        ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
index 36f1f7c24a55088e0b2dd6bebd7a8055a8ea1424..56d38bd6a7ebafd0569aa65bfa6a94ee0f0473f4 100644 (file)
@@ -13,6 +13,7 @@ ipq40xx_setup_interfaces()
        case "$board" in
        8dev,habanero-dvk|\
        avm,fritzbox-4040|\
+       asus,rt-ac42u|\
        asus,rt-ac58u|\
        linksys,ea6350v3|\
        linksys,ea8300|\
@@ -81,6 +82,9 @@ ipq40xx_setup_macs()
        8dev,habanero-dvk)
                label_mac=$(mtd_get_mac_binary "ART" 0x1006)
                ;;
+       asus,rt-ac42u)
+               label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
+               ;;
        asus,rt-ac58u)
                wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
                lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
index e4a5eb3e895f41d4eafacd2e9b971633bb7579c0..ddfef1ab2d42b8d858efff17e50625742f840e49 100644 (file)
@@ -8,8 +8,13 @@ preinit_set_mac_address() {
                ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
                ;;
        asus,rt-ac42u)
-               ip link set dev eth0 address $(mtd_get_mac_binary_ubi Factory 0x1006)
-               ip link set dev eth1 address $(mtd_get_mac_binary_ubi Factory 0x9006)
+               base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
+               ip link set dev eth0 address $base_mac
+               ip link set dev lan1 address $base_mac
+               ip link set dev lan2 address $base_mac
+               ip link set dev lan3 address $base_mac
+               ip link set dev lan4 address $base_mac
+               ip link set dev wan address $(mtd_get_mac_binary_ubi Factory 0x9006)
                ;;
        engenius,eap2200)
                base_mac=$(cat /sys/class/net/eth0/address)
index 3d58eac09ed3b3b9bfb797ac51953f29453b7cc9..f746acfbb950dbc35c14b5fb07654feb93bd7430 100644 (file)
                        status = "okay";
                };
 
-               ess-psgmii@98000 {
-                       status = "okay";
-               };
-
                tcsr@1949000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1949000 0x100>;
                watchdog@b017000 {
                        status = "okay";
                };
-
-               ess-switch@c000000 {
-                       status = "okay";
-               };
-
-               edma@c080000 {
-                       status = "okay";
-               };
        };
 
        keys {
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+};
+
+&swport2 {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        qcom,ath10k-calibration-variant = "ASUS-RT-AC42U";
index 68ce31c20582274154d3b4756809b9bc77370ba5..0a7fee159db3aa5e2cf5f41693504e31ff8e8fde 100644 (file)
@@ -228,8 +228,7 @@ define Device/asus_rt-ac42u
        UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U')
        DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-usb-ledtrig-usbport
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += asus_rt-ac42u
+TARGET_DEVICES += asus_rt-ac42u
 
 define Device/asus_rt-ac58u
        $(call Device/FitImageLzma)