ipq40xx: convert some boards to DSA
authorRobert Marko <robert.marko@sartura.hr>
Tue, 14 Dec 2021 00:00:00 +0000 (01:00 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sun, 2 Oct 2022 21:04:39 +0000 (23:04 +0200)
Convert IPQ40xx boards to DSA setup.

Signed-off-by: Leon M. George <leon@georgemail.eu>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: ChunAm See <z1250747241@gmail.com>
Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Andrew Sim <andrewsimz@gmail.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
32 files changed:
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/etc/board.d/05_compat-version [new file with mode: 0644]
target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh [deleted file]
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cap-ac.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-nbg6617.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzbox-7530.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-map-ac2200.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi
target/linux/ipq40xx/image/Makefile

index 4b9522af924bfa58a5854bf2b89c29ba40350952..74f31e778f291504adcf231ee065267bad87a0e9 100644 (file)
@@ -10,7 +10,7 @@ board=$(board_name)
 
 case "$board" in
 alfa-network,ap120c-ac)
-       ucidef_set_led_netdev "wan" "WAN" "amber:wan" "eth1"
+       ucidef_set_led_netdev "wan" "WAN" "amber:wan" "wan"
        ;;
 asus,rt-ac42u)
        ucidef_set_led_switch "lan1" "LAN1" "blue:lan-1" "switch0" "0x02"
@@ -24,7 +24,7 @@ asus,rt-ac58u)
        ;;
 avm,fritzbox-4040)
        ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt"
-       ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
+       ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
        ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e"
        ;;
 avm,fritzbox-7530 |\
@@ -58,17 +58,17 @@ glinet,gl-ap1300)
 mikrotik,cap-ac)
        ucidef_set_led_default "power" "POWER" "blue:power" "1"
        ucidef_set_led_default "user" "USER" "green:user" "0"
-       ucidef_set_led_switch "eth1" "ETH1" "green:eth1" "switch0" "0x20"
-       ucidef_set_led_switch "eth2" "ETH2" "green:eth2" "switch0" "0x10"
+       ucidef_set_led_netdev "eth1" "ETH1" "green:eth1" "wan"
+       ucidef_set_led_netdev "eth2" "ETH2" "green:eth2" "lan"
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt"
        ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt"
        ;;
 mikrotik,hap-ac3)
-       ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
-       ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10"
-       ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08"
-       ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04"
-       ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"
+       ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
+       ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "lan1"
+       ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "lan2"
+       ucidef_set_led_netdev "lan3" "LAN3" "green:lan3" "lan3"
+       ucidef_set_led_netdev "lan4" "LAN4" "green:lan4" "lan4"
        ucidef_set_led_gpio "poe" "POE" "red:poe" "452" "0"
        ;;
 mikrotik,sxtsq-5-ac)
index d13d21334c55e5ef2c356ca302497d84d5edc2bf..f57e3fd5d22c633fe4fb6735265a986b5e28ca84 100644 (file)
@@ -12,28 +12,58 @@ ipq40xx_setup_interfaces()
 
        case "$board" in
        8dev,habanero-dvk|\
+       avm,fritzbox-4040|\
+       asus,rt-ac58u|\
+       linksys,ea6350v3|\
+       linksys,ea8300|\
+       linksys,mr8300|\
+       mikrotik,hap-ac2|\
+       mikrotik,hap-ac3|\
+       p2w,r619ac-64m|\
+       p2w,r619ac-128m|\
+       zyxel,nbg6617)
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+               ;;
        8dev,jalapeno|\
        alfa-network,ap120c-ac|\
+       asus,map-ac2200|\
+       cilab,meshpoint-one|\
+       edgecore,ecw5211|\
+       glinet,gl-b2200|\
+       mikrotik,cap-ac|\
+       netgear,wac510)
+               ucidef_set_interfaces_lan_wan "lan" "wan"
+               ;;
+       aruba,ap-303|\
+       avm,fritzrepeater-1200|\
+       meraki,mr33|\
+       meraki,mr74|\
+       mikrotik,lhgg-60ad|\
+       mikrotik,sxtsq-5-ac)
+               ucidef_set_interface_lan "lan"
+               ;;
+       avm,fritzbox-7530)
+               ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
+               ;;
+       cellc,rtl30vw)
+               ucidef_set_interface_lan "lan1 lan2"
+               ;;
+       glinet,gl-b1300)
+               ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+               ;;
        engenius,emr3500|\
        engenius,ens620ext|\
        luma,wrtq-329acn|\
-       netgear,wac510|\
        plasmacloud,pa1200|\
        plasmacloud,pa2200|\
        sony,ncp-hg100-cellular)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
-       aruba,ap-303|\
        aruba,ap-365|\
-       avm,fritzrepeater-1200|\
        dlink,dap-2610 |\
        engenius,eap1300|\
        engenius,emd1|\
        extreme-networks,ws-ap3915i|\
-       meraki,mr33|\
-       meraki,mr74|\
-       mikrotik,lhgg-60ad|\
-       mikrotik,sxtsq-5-ac|\
        netgear,ex6100v2|\
        netgear,ex6150v2|\
        zyxel,wre6606)
@@ -45,8 +75,6 @@ ipq40xx_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
                ;;
-       asus,map-ac2200|\
-       cilab,meshpoint-one|\
        edgecore,ecw5211|\
        edgecore,oap100|\
        google,wifi|\
@@ -54,34 +82,8 @@ ipq40xx_setup_interfaces()
        openmesh,a62)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
                ;;
-       mikrotik,cap-ac)
-               ucidef_add_switch "switch0" \
-                       "0t@eth0" "4:lan" "5:wan"
-               ;;
-       asus,rt-ac42u|\
-       asus,rt-ac58u|\
-       mikrotik,hap-ac2|\
-       mikrotik,hap-ac3|\
-       p2w,r619ac-64m|\
-       p2w,r619ac-128m|\
-       zyxel,nbg6617)
-               ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
-               ;;
-       avm,fritzbox-4040|\
-       linksys,ea6350v3|\
-       linksys,ea8300)
-               ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
-               ;;
-       linksys,mr8300)
+       asus,rt-ac42u)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
-               ;;
-       avm,fritzbox-7530)
                ucidef_add_switch "switch0" \
                        "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
                ;;
@@ -101,10 +103,8 @@ ipq40xx_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
                ;;
-       cellc,rtl30vw)
-               ucidef_set_interface_lan "eth0"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "3:lan" "4:lan"
+       compex,wpj428)
+               ucidef_set_interface_lan "lan1 lan2"
                ;;
        devolo,magic-2-wifi-next)
                ucidef_set_interface_lan "eth0 eth1 eth2"
@@ -115,17 +115,11 @@ ipq40xx_setup_interfaces()
                        "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan"
                ;;
        glinet,gl-ap1300 |\
-       glinet,gl-b1300 |\
        glinet,gl-s1300)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ucidef_add_switch "switch0" \
                        "0u@eth0" "3:lan" "4:lan"
                ;;
-       glinet,gl-b2200)
-               ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "1:lan" "2:lan" "3:lan" "5:lan" "0u@eth1" "4:wan"
-               ;;
        mobipromo,cm520-79f)
                ucidef_add_switch "switch0" \
                        "0u@eth0" "3:lan:2" "4:lan:1"
@@ -157,9 +151,7 @@ ipq40xx_setup_interfaces()
                        "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
                ;;
        zte,mf286d)
-               ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ucidef_add_switch "switch0" \
-                       "0u@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "0u@eth1" "5:wan"
+               ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan"
                ;;
        zte,mf289f)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
@@ -216,7 +208,9 @@ ipq40xx_setup_macs()
        ezviz,cs-w3-wd1200g-eup)
                label_mac=$(mtd_get_mac_binary "ART" 0x6)
                ;;
-       linksys,ea6350v3)
+       linksys,ea6350v3|\
+       linksys,ea8300  |\
+       linksys,mr8300)
                wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                lan_mac=$(macaddr_add "$wan_mac" 1)
                ;;
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/05_compat-version b/target/linux/ipq40xx/base-files/etc/board.d/05_compat-version
new file mode 100644 (file)
index 0000000..70272f9
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2022 OpenWrt.org
+#
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+       *)
+               ucidef_set_compat_version "1.1"
+               ;;
+esac
+
+board_config_flush
+
+exit 0
index 940af0528d513f2f5c7ac1b32b922793ef441592..3c247ae6aa184e1bc6ddee49ea7e07f05026b3cc 100644 (file)
@@ -21,8 +21,8 @@ preinit_set_mac_address() {
        linksys,ea8300|\
        linksys,mr8300)
                base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-               ip link set dev eth0 address "$base_mac"
-               ip link set dev eth1 address $(macaddr_add "$base_mac" 1)
+               ip link set dev lan1 address $(macaddr_add "$base_mac" 1)
+               ip link set dev eth0 address $(macaddr_setbit "$base_mac" 7)
                ;;
        meraki,mr33|\
        meraki,mr74)
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/06_set_preinit_iface_ipq40xx.sh
deleted file mode 100644 (file)
index a8a4469..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-set_preinit_iface() {
-       . /lib/functions.sh
-
-       case $(board_name) in
-       aruba,ap-303| \
-       asus,rt-ac42u| \
-       asus,rt-ac58u| \
-       avm,fritzbox-4040| \
-       ezviz,cs-w3-wd1200g-eup| \
-       glinet,gl-b1300| \
-       linksys,ea8300| \
-       linksys,mr8300| \
-       meraki,mr33| \
-       meraki,mr74| \
-       zyxel,nbg6617)
-               ifname=eth0
-               ;;
-       devolo,magic-2-wifi-next)
-               ifname=eth1
-               ;;
-       esac
-}
-
-boot_hook_add preinit_main set_preinit_iface
index def355b465b98f34b344688618c0cef33e8928d5..def0401ac5c9f358e8a7d36bce55447655149e32 100644 (file)
@@ -14,6 +14,7 @@
                led-failsafe = &status;
                led-running = &status;
                led-upgrade = &status;
+               ethernet1 = &swport5;
        };
 
        keys {
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index 515d71b456e94146dff0e15b7c17fdd5b1371a6f..0609324310888d3cf2ec4c7c02d9726ebba14919 100644 (file)
        #gpio-cells = <2>;
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
 
index 0fd9654111bf20fdf69f0dd8a520dd7a210a9682..75b556a7f92f0fa3a5b2be0468127fb49b913376 100644 (file)
        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";
        nvmem-cell-names = "pre-calibration";
index df2ef37f179ef2897a7d9b255b53a9f0900a685e..3060b7bd1c803c6ea84382546c306f3ad4414f97 100644 (file)
@@ -14,6 +14,8 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
+               ethernet0 = &swport5;
+               ethernet1 = &gmac;
        };
 
        chosen {
        pinctrl-names = "default";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index d962ca58fa3114ae948049a0a638fa0fe33c87b8..e448206c369e2264e22da3de755f24ee111eb6f2 100644 (file)
        #gpio-cells = <2>;
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+};
+
+&swport2 {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &usb3_ss_phy {
        status = "okay";
 };
index ee174a29d1a30b855940af61a712a9fcfad4a943..c8868d8b301c973df957b717b1e9cbc948544bd6 100644 (file)
        qcom,single-led-10;
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+       label = "lan4";
+};
+
+&swport2 {
+       status = "okay";
+       label = "lan3";
+};
+
+&swport3 {
+       status = "okay";
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+       label = "lan1";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
 
index ee94a15c004cb3fc401804956a42e012ea471bd5..4d09e86dd66fe23f0eef911e7c1f88a9744c09f2 100644 (file)
@@ -7,6 +7,10 @@
 #include <dt-bindings/soc/qcom,tcsr.h>
 
 / {
+       aliases {
+               ethernet1 = &swport5;
+       };
+
        soc {
                rng@22000 {
                        status = "okay";
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index 492293869292d57e85320b1d5bf8cfaf3b656487..ff7252d696ecfee919e0286198c03f24a7d8dd10 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+
+       label = "lan4";
+};
+
+&swport2 {
+       status = "okay";
+
+       label = "lan3";
+};
+
+&swport3 {
+       status = "okay";
+
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan1";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        qcom,ath10k-calibration-variant = "ZyXEL-NBG6617";
index 1d860627b5e0098594bfe0706e90a0ac44253dd4..87705e5f6074346df66c85c7d6e52cdd971f4f20 100644 (file)
        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 = "RT-AC58U";
index 415bec5a8fdfb3f10d98f14ebd3d0793544188e2..07fa80742ee79146a731499c71f346c41ae18f6a 100644 (file)
 &mdio {
        status = "okay";
 };
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+
+       /delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+       phy-mode = "rgmii";
+};
index aa54f43e8514015a52e8c4a63c805f0e652463bf..2dbfaa086ef84654fc61f3f6d3929c73487999ff 100644 (file)
@@ -16,6 +16,7 @@
                led-failsafe = &led_power_amber;
                led-running = &led_power_green;
                led-upgrade = &led_power_amber;
+               ethernet1 = &swport5;
        };
 
        chosen {
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &mdio {
        status = "okay";
 
index af79020121ac332fa9126b2cce79576e077dc800..a0ceb299b4942941480f8f4b559b43fc698ef778 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+};
+
+&swport2 {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        qcom,ath10k-calibration-variant = "AVM-FRITZBox-7530";
index 20b981a372e4294920d90ef7a6947e684e86d4ec..723f2161c614729c617f4cb3a97a2bc7f0b7cd8a 100644 (file)
                        status = "okay";
                        pinctrl-0 = <&mdio_pins>;
                        pinctrl-names = "default";
+
+                       ethphy: ethernet-phy@0 {
+                               reg = <0x0>;
+                       };
                };
 
                tcsr@1949000 {
        status = "okay";
 };
 
-&ethphy0 {
-       status = "disabled";
+&wifi0 {
+       status = "okay";
+       qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200";
+};
+
+&wifi1 {
+       status = "okay";
+       qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200";
+};
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+
+       /delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+       phy-handle = <&ethphy>;
+       phy-mode = "rgmii-id";
 };
 
 &ethphy1 {
 &psgmiiphy {
        status = "disabled";
 };
-
-&wifi0 {
-       status = "okay";
-       qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200";
-};
-
-&wifi1 {
-       status = "okay";
-       qcom,ath10k-calibration-variant = "AVM-FRITZRepeater-1200";
-};
index 6fdc361ee70e247a902286cafb26dda7a691b0fd..e17609ff6fbfa9279dd21343a9bdbca9685f8744 100644 (file)
                bootargs-append = " root=/dev/mmcblk0p2 rw rootwait clk_ignore_unused";
        };
 
+       aliases {
+               ethernet1 = &swport4;
+       };
+
        soc {
                rng@22000 {
                        status = "okay";
        };
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "wan";
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index c467d850491b0d7046a8af2fdf17eb26ee679735..23a654dcff5a05ff3590dba87e3cfa6eaeb06682 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_status;
                led-running = &led_status;
                led-upgrade = &led_upgrade;
+               ethernet1 = &swport5;
        };
 
        soc {
        };
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+};
+
+&swport2 {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index c03762eac179f7be3840b217b7136d998dab0ecd..35c4c26a2cb4bb1827d3d855f77337f3cfab63d1 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+       label = "lan4";
+};
+
+&swport2 {
+       status = "okay";
+       label = "lan3";
+};
+
+&swport3 {
+       status = "okay";
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+       label = "lan1";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
 
index c208bf33eed54d1ebe6f2bd0fb5e5b3e56fd7c80..38bacfa2bafb6a201be3da0e9482f9ef085813be 100644 (file)
 &psgmiiphy {
        status = "disabled";
 };
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+
+       /delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+       phy-handle = <&ethphy0>;
+       phy-mode = "rgmii-id";
+};
index 94e94beb81e28df9eb15e18779714ec074db269a..32f0473fb169aefe6c220e444351174daf238128 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_red0;
                led-running = &led_blue0;
                led-upgrade = &led_red0;
+               ethernet1 = &swport4;
        };
 
        soc {
        pinctrl-names = "default";
        status = "okay";
 };
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "wan";
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+};
index d2a010055c9bc5b7a79ec8ecbe6f20eb3df6fbe8..a832e2392a673fa5725a74e1cb08b90734decd9c 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_config_0>;
+};
+
 &nand {
        pinctrl-0 = <&nand_pins>;
        pinctrl-names = "default";
        status = "okay";
 };
 
+&switch {
+       status = "okay";
+};
+
+&swport2 {
+       status = "okay";
+
+       label = "lan4";
+};
+
+&swport3 {
+       status = "okay";
+
+       label = "lan3";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan2";
+};
+
+&swport5 {
+       status = "okay";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_config_0>;
+       mac-address-increment = <1>;
+};
+
 &tlmm {
        i2c_0_pins: i2c_0_pinmux {
                mux {
index f66c9c86ea39f6448df6aefc20581143bc2193f0..d7a987f98dbc112a8976416b9be8ebf4a7569f09 100644 (file)
        qcom,single-led-10;
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport1 {
+       status = "okay";
+
+       label = "lan4";
+};
+
+&swport2 {
+       status = "okay";
+
+       label = "lan3";
+};
+
+&swport3 {
+       status = "okay";
+
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan1";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &usb3_ss_phy {
        status = "okay";
 };
index 8db7226ce10f29e7a20e206af09f5ac7611fa004..3205b7d56405ebf79a3d29c4ab43034f2abdff57 100644 (file)
        status = "okay";
        qcom,ath10k-calibration-variant = "cellc,rtl30vw";
 };
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan1";
+};
index 8c9d1c7f03a05c20752c68d76bb3fedc07c9c369..4f2cf1f516ba7b9fcbea2d165ba71fa41c40dffb 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * Device Tree Source for Linksys xx8300 (Dallas)
  *
- * Copyright (C) 2019 Jeff Kletsky
+ * Copyright (C) 2019, 2022 Jeff Kletsky
  * Updated 2020 Hans Geiblinger
  *
  */
 &usb3_ss_phy {
        status = "okay";
 };
+
+&gmac {
+      status = "okay";
+};
+
+&switch {
+      status = "okay";
+};
+
+&swport1 {
+      status = "okay";
+};
+
+&swport2 {
+      status = "okay";
+};
+
+&swport3 {
+      status = "okay";
+};
+
+&swport4 {
+      status = "okay";
+};
+
+&swport5 {
+      status = "okay";
+};
index b6ce8c027f24dc19df0c2df46e4da84ba28a563f..48b5cd53d80bd4d270760a79f49eb9fe0bf56c2b 100644 (file)
                                precal_art_5000: precal@5000 {
                                        reg = <0x5000 0x2f20>;
                                };
+
+                               macaddr_art_e010: mac-address@e010 {
+                                       reg = <0xe010 0x6>;
+                               };
+
+                               macaddr_art_e018: mac-address@e018 {
+                                       reg = <0xe018 0x6>;
+                               };
                        };
                        partition6@180000 {
                                compatible = "denx,fit";
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+       label = "lan1";
+
+       nvmem-cells = <&macaddr_art_e018>;
+       nvmem-cell-names = "mac-address";
+};
+
+&swport5 {
+       status = "okay";
+       label = "lan2";
+
+       nvmem-cells = <&macaddr_art_e010>;
+       nvmem-cell-names = "mac-address";
+};
+
 &usb3_ss_phy {
        status = "okay";
 };
index 0925561ed0fc9799e072d2bca6a4b9caa1ffe5a1..41de6bb218b925a73e3aeb5e2298194d24153d73 100644 (file)
@@ -21,7 +21,7 @@
                        pinctrl-0 = <&mdio_pins>;
                        pinctrl-names = "default";
 
-                       ethernet-phy@5 {
+                       ethphy: ethernet-phy@5 {
                                reg = <0x5>;
                        };
                };
        };
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+
+       /delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+       phy-handle = <&ethphy>;
+       phy-mode = "rgmii-id";
+};
+
 &ethphy0 {
        status = "disabled";
 };
index e8a14c9dee2e7fedf6b1bf1fdb74b6e29360edd0..9e465554809bd26df71d257636cccf4877ceb042 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport3 {
+       status = "okay";
+
+       label = "lan2";
+};
+
+&swport4 {
+       status = "okay";
+
+       label = "lan1";
+};
+
+&swport5 {
+       status = "okay";
+};
+
 &wifi0 {
        status = "okay";
        nvmem-cell-names = "pre-calibration";
index fa755b387361e8ee8d61f7538796c1810cd426c8..bc385d330e4841891f36feef64f108b8d3325ddc 100644 (file)
        status = "okay";
        qcom,ath10k-calibration-variant = "Meraki-MR33";
 };
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+
+       /delete-property/ psgmii-ethphy;
+};
+
+&swport5 {
+       status = "okay";
+
+       label = "lan";
+       phy-handle = <&ethphy1>;
+       phy-mode = "rgmii-rxid";
+};
+
+&ethphy0 {
+       status = "disabled";
+};
+
+&ethphy2 {
+       status = "disabled";
+};
+
+&ethphy3 {
+       status = "disabled";
+};
+
+&ethphy4 {
+       status = "disabled";
+};
+
+&psgmiiphy {
+       status = "disabled";
+};
index 5851b298753680c9e0cb14b00971c0ee06539bdf..2ba4c779a0576c87d8dbc9f9346ae5bbf7194d5f 100644 (file)
@@ -10,6 +10,8 @@ define Device/Default
        IMAGES := sysupgrade.bin
        IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
        IMAGE/sysupgrade.bin/squashfs :=
+       DEVICE_COMPAT_VERSION := 1.1
+       DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
 endef
 
 include $(SUBTARGET).mk