]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: engenius_ews2910p: support multiple hardware versions
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>
Wed, 17 Apr 2024 02:28:23 +0000 (21:28 -0500)
committerRobert Marko <robimarko@gmail.com>
Sat, 31 May 2025 21:19:01 +0000 (23:19 +0200)
When the Engenius EWS-2910P was added, only v1 was known. Move the
common parts to a dtsi, and split up the support to acccount for the
hardware version.

On v3, for example, the root partition uses a different uImage magic.

Add a "engenius,ews2910p-v1" compatible, while leaving the legacy
"engenius,ews2910p" to also mean v1.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15217
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/base-files/etc/board.d/02_network
target/linux/realtek/dts/rtl8380_engenius_ews2910p-v1.dts [new file with mode: 0644]
target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi [moved from target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts with 95% similarity]
target/linux/realtek/image/common.mk
target/linux/realtek/image/rtl838x.mk

index 16642c273a4f54f7d8a78d30709add926f8e0785..c3951b591e1aaf71157bac455684fcec4d332268 100644 (file)
@@ -91,7 +91,7 @@ d-link,dgs-1210-28p-f)
        ucidef_set_poe 193 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
                        lan22 lan21 lan20 lan19 lan18 lan17"
        ;;
-engenius,ews2910p)
+engenius,ews2910p-v1)
        ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
        ;;
 hpe,1920-8g-poe-65w)
diff --git a/target/linux/realtek/dts/rtl8380_engenius_ews2910p-v1.dts b/target/linux/realtek/dts/rtl8380_engenius_ews2910p-v1.dts
new file mode 100644 (file)
index 0000000..72f9ea7
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "rtl8380_engenius_ews2910p.dtsi"
+
+/ {
+       compatible = "engenius,ews2910p-v1", "realtek,rtl838x-soc";
+       model = "EnGenius EWS2910P v1";
+};
+
+&firmware_partition_1 {
+       compatible = "openwrt,uimage";
+       openwrt,ih-magic = <0x03802910>;
+};
similarity index 95%
rename from target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts
rename to target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi
index b0f1e9b53899b95f27c1a490b687efa6906fcfc4..e8cc9d7b60ca5fbd78acbebb4ad18a52eab7e9b4 100644 (file)
@@ -7,9 +7,6 @@
 #include <dt-bindings/gpio/gpio.h>
 
 / {
-       compatible = "engenius,ews2910p", "realtek,rtl838x-soc";
-       model = "EnGenius EWS2910P";
-
        aliases {
                led-boot = &led_power;
                led-failsafe = &led_fault;
                                label = "jffs2-log";
                                reg = <0xe00000 0x200000>;
                        };
-                       partition@1000000 {
-                               compatible = "openwrt,uimage";
+                       firmware_partition_1: partition@1000000 {
                                label = "firmware";
                                reg = <0x1000000 0x800000>;
-                               openwrt,ih-magic = <0x03802910>;
                        };
-                       partition@1800000 {
+                       firmware_partition_2: partition@1800000 {
                                label = "firmware2";
                                reg = <0x1800000 0x800000>;
                        };
index e600b2347d71fc4ec6eba6aa1ca60ffc78c2afa7..d68915ea90b43e9bf95cf46f951574a7bb0d5c59 100644 (file)
@@ -31,6 +31,18 @@ define Device/d-link_dgs-1210
   CAMEO_BOARD_VERSION := 32
 endef
 
+# The "IMG-" uImage name allows flashing the iniramfs from the vendor Web UI.
+# Avoided for sysupgrade, as the vendor FW would do an incomplete flash.
+define Device/engenius_ews2910p
+  IMAGE_SIZE := 8192k
+  DEVICE_VENDOR := EnGenius
+  KERNEL_INITRAMFS := \
+       kernel-bin | \
+       append-dtb | \
+       libdeflate-gzip | \
+       uImage gzip -n 'IMG-0.00.00-c0.0.00'
+endef
+
 define Device/hpe_1920
   DEVICE_VENDOR := HPE
   IMAGE_SIZE := 29632k
index a090390a50d3ad93a381579076d1cf00b319f85f..6e43317148b1b36f02abb84524e65a4166fa47d7 100644 (file)
@@ -91,22 +91,16 @@ define Device/d-link_dgs-1210-28p-f
 endef
 TARGET_DEVICES += d-link_dgs-1210-28p-f
 
-# The "IMG-" uImage name allows flashing the iniramfs from the vendor Web UI.
-# Avoided for sysupgrade, as the vendor FW would do an incomplete flash.
-define Device/engenius_ews2910p
+define Device/engenius_ews2910p-v1
+  $(Device/engenius_ews2910p)
   SOC := rtl8380
-  IMAGE_SIZE := 8192k
-  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EWS2910P
+  DEVICE_VARIANT := v1
   DEVICE_PACKAGES += realtek-poe
   UIMAGE_MAGIC := 0x03802910
-  KERNEL_INITRAMFS := \
-       kernel-bin | \
-       append-dtb | \
-       libdeflate-gzip | \
-       uImage gzip -n 'IMG-0.00.00-c0.0.00'
+  SUPPORTED_DEVICES += engenius,ews2910p
 endef
-TARGET_DEVICES += engenius_ews2910p
+TARGET_DEVICES += engenius_ews2910p-v1
 
 define Device/hpe_1920-8g
   $(Device/hpe_1920)