ipq40xx: convert ASUS RT-AC58U to DSA
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 9 Mar 2019 17:08:27 +0000 (18:08 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Tue, 11 Aug 2020 17:10:13 +0000 (19:10 +0200)
This patch converts the ASUS RT-AC58U to ipqess ethernet + qca8k's DSA.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
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-ipq4018-rt-ac58u.dts

index 61d02a17bcc935a55cd80022f4c2abfe0d0eba15..13588d8af8a5add4807b1a5b20c743beb1447a99 100755 (executable)
@@ -42,7 +42,9 @@ ipq40xx_setup_interfaces()
        openmesh,a62)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
                ;;
-       asus,rt-ac58u|\
+       asus,rt-ac58u)
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+               ;;
        zyxel,nbg6617)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ucidef_add_switch "switch0" \
@@ -121,9 +123,7 @@ ipq40xx_setup_macs()
                ;;
        asus,rt-ac58u)
                CI_UBIPART=UBI_DEV
-               wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
-               lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
-               label_mac=$wan_mac
+               label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
                ;;
        cilab,meshpoint-one)
                label_mac=$(mtd_get_mac_binary "ART" 0x1006)
index 4d8113698efcefb72cf348030355874b4a902ecb..66c815ba19c7bef50c89f17e4b6b914d8601ec85 100644 (file)
@@ -1,6 +1,10 @@
 . /lib/functions.sh
 
 preinit_set_mac_address() {
+       local wan_mac
+       local lan14_mac
+       local lan_mac
+
        case $(board_name) in
        asus,map-ac2200)
                base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
@@ -11,6 +15,11 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6)
                ip link set dev eth1 address $(mtd_get_mac_binary "ART" 0x0)
                ;;
+       asus,rt-ac58u)
+               CI_UBIPART=UBI_DEV
+               wan_mac=$(mtd_get_mac_binary_ubi Factory 20486)
+               lan14_mac=$(mtd_get_mac_binary_ubi Factory 4102)
+               ;;
        engenius,eap2200)
                base_mac=$(cat /sys/class/net/eth0/address)
                ip link set dev eth1 address $(macaddr_add "${base_mac}" +1)
@@ -29,6 +38,15 @@ preinit_set_mac_address() {
                ip link set dev eth0 address $(macaddr_add "$base_mac" +2)
                ip link set dev eth1 address $(macaddr_add "$base_mac" +3)
        esac
+
+       [ -n "$lan_mac" ] && ip link set dev lan address "$lan_mac"
+       [ -n "$wan_mac" ] && ip link set dev wan address "$wan_mac"
+       [ -n "$lan14_mac" ] && {
+               ip link set dev lan1 address "$lan14_mac"
+               ip link set dev lan2 address "$lan14_mac"
+               ip link set dev lan3 address "$lan14_mac"
+               ip link set dev lan4 address "$lan14_mac"
+       }
 }
 
 boot_hook_add preinit_main preinit_set_mac_address
index a0030f77ce60bb550274c21bf6b4b20a68b21234..82317faf6145b41db310e0f544baa72e2ed7e89b 100644 (file)
@@ -19,6 +19,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
+               ethernet0 = &gmac;
        };
 
        chosen {
                        status = "okay";
                };
 
-               mdio@90000 {
-                       status = "okay";
-               };
-
-               ess-psgmii@98000 {
-                       status = "okay";
-               };
-
                tcsr@1949000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1949000 0x100>;
                        qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
                };
 
-               ess_tcsr@1953000 {
-                       compatible = "qcom,tcsr";
-                       reg = <0x1953000 0x1000>;
-                       qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
-               };
-
                tcsr@1957000 {
                        compatible = "qcom,tcsr";
                        reg = <0x1957000 0x100>;
                watchdog@b017000 {
                        status = "okay";
                };
-
-               ess-switch@c000000 {
-                       status = "okay";
-               };
-
-               edma@c080000 {
-                       status = "okay";
-               };
        };
 
        keys {
        status = "okay";
 };
 
+&mdio {
+       status = "okay";
+};
+
+&psgmii_phy {
+       status = "okay";
+};
+
+&ess {
+       status = "okay";
+};
+
+&gmac {
+       status = "okay";
+};
+
+&essport1 {
+       label = "lan4";
+};
+
+&essport2 {
+       label = "lan3";
+};
+
+&essport3 {
+       label = "lan2";
+};
+
+&essport4 {
+       label = "lan1";
+};
+
 &blsp_dma {
        status = "okay";
 };