realtek: engenius_ews2910p: support multiple hardware versions

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>
This commit is contained in:
Alexandru Gagniuc 2024-04-16 21:28:23 -05:00 committed by Robert Marko
parent 2a32d215ba
commit e5625fb448
5 changed files with 33 additions and 19 deletions

View 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 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" lan22 lan21 lan20 lan19 lan18 lan17"
;; ;;
engenius,ews2910p) engenius,ews2910p-v1)
ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")" ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
;; ;;
hpe,1920-8g-poe-65w) hpe,1920-8g-poe-65w)

View file

@ -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>;
};

View file

@ -7,9 +7,6 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
compatible = "engenius,ews2910p", "realtek,rtl838x-soc";
model = "EnGenius EWS2910P";
aliases { aliases {
led-boot = &led_power; led-boot = &led_power;
led-failsafe = &led_fault; led-failsafe = &led_fault;
@ -165,13 +162,11 @@
label = "jffs2-log"; label = "jffs2-log";
reg = <0xe00000 0x200000>; reg = <0xe00000 0x200000>;
}; };
partition@1000000 { firmware_partition_1: partition@1000000 {
compatible = "openwrt,uimage";
label = "firmware"; label = "firmware";
reg = <0x1000000 0x800000>; reg = <0x1000000 0x800000>;
openwrt,ih-magic = <0x03802910>;
}; };
partition@1800000 { firmware_partition_2: partition@1800000 {
label = "firmware2"; label = "firmware2";
reg = <0x1800000 0x800000>; reg = <0x1800000 0x800000>;
}; };

View file

@ -31,6 +31,18 @@ define Device/d-link_dgs-1210
CAMEO_BOARD_VERSION := 32 CAMEO_BOARD_VERSION := 32
endef 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 define Device/hpe_1920
DEVICE_VENDOR := HPE DEVICE_VENDOR := HPE
IMAGE_SIZE := 29632k IMAGE_SIZE := 29632k

View file

@ -91,22 +91,16 @@ define Device/d-link_dgs-1210-28p-f
endef endef
TARGET_DEVICES += d-link_dgs-1210-28p-f TARGET_DEVICES += d-link_dgs-1210-28p-f
# The "IMG-" uImage name allows flashing the iniramfs from the vendor Web UI. define Device/engenius_ews2910p-v1
# Avoided for sysupgrade, as the vendor FW would do an incomplete flash. $(Device/engenius_ews2910p)
define Device/engenius_ews2910p
SOC := rtl8380 SOC := rtl8380
IMAGE_SIZE := 8192k
DEVICE_VENDOR := EnGenius
DEVICE_MODEL := EWS2910P DEVICE_MODEL := EWS2910P
DEVICE_VARIANT := v1
DEVICE_PACKAGES += realtek-poe DEVICE_PACKAGES += realtek-poe
UIMAGE_MAGIC := 0x03802910 UIMAGE_MAGIC := 0x03802910
KERNEL_INITRAMFS := \ SUPPORTED_DEVICES += engenius,ews2910p
kernel-bin | \
append-dtb | \
libdeflate-gzip | \
uImage gzip -n 'IMG-0.00.00-c0.0.00'
endef endef
TARGET_DEVICES += engenius_ews2910p TARGET_DEVICES += engenius_ews2910p-v1
define Device/hpe_1920-8g define Device/hpe_1920-8g
$(Device/hpe_1920) $(Device/hpe_1920)