ipq40xx: Convert plasmacloud,pa1200 to DSA
authorSven Eckelmann <sven@narfation.org>
Mon, 24 Oct 2022 16:55:44 +0000 (18:55 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 13 Nov 2022 14:26:34 +0000 (15:26 +0100)
* ethernet1:

  - physical port label "Ethernet 1"
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"
  - can be used to power the device

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 2" port was used in the past
for "WAN" functionality in OpenWrt.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts
target/linux/ipq40xx/image/generic.mk

index e682a0fb15700362e6972749e67d3287d12fbfd6..dc111044e84c8731963363396a7e5b3027c87234 100644 (file)
@@ -77,6 +77,9 @@ ipq40xx_setup_interfaces()
        openmesh,a62)
                ucidef_set_interfaces_lan_wan "ethernet2" "ethernet1"
                ;;
+       plasmacloud,pa1200)
+               ucidef_set_interfaces_lan_wan "ethernet1" "ethernet2"
+               ;;
        zte,mf286d)
                ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" "wan"
                ;;
index dac4adbd5fc7d3b620c6ca2ab8b2cb52f46ae785..af4a7b196ba002306375b783071a61097dc3d5bb 100644 (file)
                        status = "okay";
                };
 
-               mdio@90000 {
-                       status = "okay";
-               };
-
                tcsr@194b000 {
                        /* select hostmode */
                        compatible = "qcom,tcsr";
@@ -75,6 +71,7 @@
                led-failsafe = &led_status_yellow;
                led-running = &led_status_cyan;
                led-upgrade = &led_status_yellow;
+               label-mac-device = &swport5;
        };
 
        leds {
        status = "okay";
 };
 
+&mdio {
+       status = "okay";
+};
+
+&gmac {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
+&swport4 {
+       status = "okay";
+       label = "ethernet2";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac1>;
+};
+
+&swport5 {
+       status = "okay";
+       label = "ethernet1";
+
+       nvmem-cell-names = "mac-address";
+       nvmem-cells = <&macaddr_gmac0>;
+};
+
 &wifi0 {
        status = "okay";
        qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200";
index 95539316762f447cad24e64ecbd2269fef9f5713..8b2851f83ec2370fe14cd34faee64319dd4fdcb8 100644 (file)
@@ -958,8 +958,7 @@ define Device/plasmacloud_pa1200
        IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
 endef
-# Missing DSA Setup
-#TARGET_DEVICES += plasmacloud_pa1200
+TARGET_DEVICES += plasmacloud_pa1200
 
 define Device/plasmacloud_pa2200
        $(call Device/FitImageLzma)