[openwrt/openwrt] ath79: switch TP-Link RE355 v1, RE450 v1 and RE450 v2 to mtd-concat

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 20 15:04:16 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e768731dc8e9f38dd1145b564946591b873bafba

commit e768731dc8e9f38dd1145b564946591b873bafba
Author: Radek Dostál <rd at radekdostal.com>
AuthorDate: Sun Nov 9 18:31:47 2025 +0100

    ath79: switch TP-Link RE355 v1, RE450 v1 and RE450 v2 to mtd-concat
    
    This patch utilizes unused and empty flash space in the original partition
    layout and increase maximum image size by 1664 KiB.
    
    Tested on RE450v1 by running sysupgrade with build of size 5697 KiB and
    checking that df shows 1988 1K-blocks for "/overlay".
    
    Inspired by commit ebd5e5fb5359 ("ramips: switched TP-Link RE305 v1 to new
    partition layout").
    
    Signed-off-by: Radek Dostál <rd at radekdostal.com>
    Link: https://github.com/openwrt/openwrt/pull/20709
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi   | 25 +++++++++++++++++++---
 target/linux/ath79/dts/qca9563_tplink_re450-v2.dts | 25 +++++++++++++++++++---
 target/linux/ath79/image/tiny-tp-link.mk           | 12 +++++++++--
 .../tiny/base-files/etc/board.d/05_compat-version  |  5 +++++
 4 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi
index 8000459f24..ce203807a6 100644
--- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi
+++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi
@@ -98,6 +98,21 @@
 			reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	virtual_flash {
+		compatible = "mtd-concat";
+		devices = <&fwconcat0>, <&fwconcat1>;
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			partition at 0 {
+				compatible = "tplink,firmware";
+				label = "firmware";
+				reg = <0x0 0x0>;
+			};
+		};
+	};
 };
 
 &pcie0 {
@@ -130,9 +145,8 @@
 				read-only;
 			};
 
-			partition at 20000 {
-				compatible = "tplink,firmware";
-				label = "firmware";
+			fwconcat0: partition at 20000 {
+				label = "fwconcat0";
 				reg = <0x020000 0x5e0000>;
 			};
 
@@ -166,6 +180,11 @@
 				read-only;
 			};
 
+			fwconcat1: partition at 650000 {
+				label = "fwconcat1";
+				reg = <0x650000 0x1a0000>;
+			};
+
 			partition at 7f0000 {
 				label = "art";
 				reg = <0x7f0000 0x010000>;
diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts
index 43f9106a49..80de56672c 100644
--- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts
@@ -9,6 +9,21 @@
 	aliases {
 		label-mac-device = &eth0;
 	};
+
+	virtual_flash {
+		compatible = "mtd-concat";
+		devices = <&fwconcat0>, <&fwconcat1>;
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			partition at 0 {
+				compatible = "tplink,firmware";
+				label = "firmware";
+				reg = <0x0 0x0>;
+			};
+		};
+	};
 };
 
 &partitions {
@@ -18,9 +33,8 @@
 		read-only;
 	};
 
-	partition at 20000 {
-		compatible = "tplink,firmware";
-		label = "firmware";
+	fwconcat0: partition at 20000 {
+		compatible = "fwconcat0";
 		reg = <0x020000 0x5e0000>;
 	};
 
@@ -54,6 +68,11 @@
 		read-only;
 	};
 
+	fwconcat1: partition at 650000 {
+		label = "fwconcat1";
+		reg = <0x650000 0x1a0000>;
+	};
+
 	partition at 7f0000 {
 		label = "art";
 		reg = <0x7f0000 0x010000>;
diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk
index 9e5b74db8c..b736701946 100644
--- a/target/linux/ath79/image/tiny-tp-link.mk
+++ b/target/linux/ath79/image/tiny-tp-link.mk
@@ -3,8 +3,12 @@ include ./common-tp-link.mk
 define Device/tplink_rex5x-v1
   $(Device/tplink-safeloader)
   SOC := qca9558
-  IMAGE_SIZE := 6016k
+  IMAGE_SIZE := 7680k
+  KERNEL_SIZE := 6016k
   DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
+  DEVICE_COMPAT_VERSION := 2.0
+  DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
+    Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
   DEFAULT := n
 endef
 
@@ -29,10 +33,14 @@ TARGET_DEVICES += tplink_re450-v1
 define Device/tplink_re450-v2
   $(Device/tplink-safeloader)
   SOC := qca9563
-  IMAGE_SIZE := 6016k
+  IMAGE_SIZE := 7680k
+  KERNEL_SIZE := 6016k
   DEVICE_MODEL := RE450
   DEVICE_VARIANT := v2
   DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
+  DEVICE_COMPAT_VERSION := 2.0
+  DEVICE_COMPAT_MESSAGE := Partition layout has changed compared to older versions by utilizing unused flash. \
+    Upgrade via sysupgrade mechanism (-F) will only work if flashed image still fits to the size of old partition (6016 KiB).
   TPLINK_BOARD_ID := RE450-V2
   LOADER_TYPE := elf
   DEFAULT := n
diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version b/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version
index b6c2ae48f7..06a0b9f775 100644
--- a/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version
+++ b/target/linux/ath79/tiny/base-files/etc/board.d/05_compat-version
@@ -13,6 +13,11 @@ case "$(board_name)" in
 	tplink,tl-wpa8630p-v2.1-eu)
 		ucidef_set_compat_version "2.0"
 		;;
+	tplink,re355-v1|\
+	tplink,re450-v1|\
+	tplink,re450-v2)
+		ucidef_set_compat_version "2.0"
+		;;
 esac
 
 board_config_flush




More information about the lede-commits mailing list