From: Alexandru Gagniuc Date: Wed, 17 Apr 2024 02:28:23 +0000 (-0500) Subject: realtek: engenius_ews2910p: support multiple hardware versions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5625fb4485b6e937fa52b4e47a60ec2a871e3c9;p=thirdparty%2Fopenwrt.git 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 Link: https://github.com/openwrt/openwrt/pull/15217 Signed-off-by: Robert Marko --- diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 16642c273a4..c3951b591e1 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -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 index 00000000000..72f9ea7a906 --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_engenius_ews2910p-v1.dts @@ -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>; +}; diff --git a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi similarity index 95% rename from target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts rename to target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi index b0f1e9b5389..e8cc9d7b60c 100644 --- a/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dts +++ b/target/linux/realtek/dts/rtl8380_engenius_ews2910p.dtsi @@ -7,9 +7,6 @@ #include / { - compatible = "engenius,ews2910p", "realtek,rtl838x-soc"; - model = "EnGenius EWS2910P"; - aliases { led-boot = &led_power; led-failsafe = &led_fault; @@ -165,13 +162,11 @@ 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>; }; diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk index e600b2347d7..d68915ea90b 100644 --- a/target/linux/realtek/image/common.mk +++ b/target/linux/realtek/image/common.mk @@ -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 diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index a090390a50d..6e43317148b 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -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)