ipq40xx: Convert openmesh,a62 to DSA
authorSven Eckelmann <sven@narfation.org>
Mon, 24 Oct 2022 16:55:44 +0000 (18:55 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 12 Nov 2022 17:15:55 +0000 (18:15 +0100)
* 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@gmail.com>
Tested-by: Michaƫl BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
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-a62.dts
target/linux/ipq40xx/image/generic.mk

index 6c6d04a9236bb4094b69cfeb492e2dc79d0e8285..b98c85decfb4c54a8b8b96ee46c13ac0b02c3308 100644 (file)
@@ -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
index 4ae410313120a175b3ec6271835506acd26e1e10..0d19c6bae0e1157188a39f9db25aefe65d83ca51 100644 (file)
@@ -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)
                ;;
index 799e3cb415de35b464954fb52ff3cff22efa5546..11d27ab339f2dfc45bbacfe06e7395443dd59415 100644 (file)
                        status = "okay";
                };
 
-               mdio@90000 {
-                       status = "okay";
-               };
-
                tcsr@194b000 {
                        /* select hostmode */
                        compatible = "qcom,tcsr";
        };
 };
 
+&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";
index 14a2745719c02a7a505e9a290507503e8285573e..95539316762f447cad24e64ecbd2269fef9f5713 100644 (file)
@@ -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)