[openwrt/openwrt] ipq40xx: Convert plasmacloud,pa1200 to DSA

LEDE Commits lede-commits at lists.infradead.org
Sun Nov 13 06:41:31 PST 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/539a5fd62490c22fdd29ddbc2ccfb2fd25cba610

commit 539a5fd62490c22fdd29ddbc2ccfb2fd25cba610
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Mon Oct 24 18:55:44 2022 +0200

    ipq40xx: Convert plasmacloud,pa1200 to DSA
    
    * 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 at narfation.org>
---
 .../ipq40xx/base-files/etc/board.d/02_network      |  3 ++
 .../arch/arm/boot/dts/qcom-ipq4018-pa1200.dts      | 33 +++++++++++++++++++---
 target/linux/ipq40xx/image/generic.mk              |  3 +-
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index e682a0fb15..dc111044e8 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -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"
 		;;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts
index dac4adbd5f..af4a7b196b 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts
@@ -17,10 +17,6 @@
 			status = "okay";
 		};
 
-		mdio at 90000 {
-			status = "okay";
-		};
-
 		tcsr at 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 {
@@ -183,6 +180,34 @@
 	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";
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 9553931676..8b2851f83e 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -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)




More information about the lede-commits mailing list