From 4729793b915e585800a3334f8d22639e2e6a3512 Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Wed, 22 Apr 2026 22:38:51 -0700 Subject: [PATCH] uboot-airoha: increase the size of reserved_bmt partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" For the backport to OpenWrt 25.12, the device support has not yet been committed, so revising the compat_version in this commit is not needed; and instead will be handled by revising the pending device support commit. Reported-by: Loïc Yhuel Signed-off-by: Russell Senior Link: https://github.com/openwrt/openwrt/pull/23061 (cherry picked from commit ee771d3dd01c811d2a28eab09a700cefdafd05af) Link: https://github.com/openwrt/openwrt/pull/22294 Signed-off-by: Robert Marko --- .../uboot-airoha/patches/999-airoha-add-gemtek-w1700k.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-airoha/patches/999-airoha-add-gemtek-w1700k.patch b/package/boot/uboot-airoha/patches/999-airoha-add-gemtek-w1700k.patch index c346499ded..4c13fe3264 100644 --- a/package/boot/uboot-airoha/patches/999-airoha-add-gemtek-w1700k.patch +++ b/package/boot/uboot-airoha/patches/999-airoha-add-gemtek-w1700k.patch @@ -276,13 +276,13 @@ Signed-off-by: Kenneth Kasilag + + ubi@700000 { + label = "ubi"; -+ reg = <0x00700000 0x1f700000>; ++ reg = <0x00700000 0x1b700000>; + }; + + /* reserved for bad block table */ -+ reserved_bmt@1fe00000 { ++ reserved_bmt@1be00000 { + label = "reserved_bmt"; -+ reg = <0x1fe00000 0x00200000>; ++ reg = <0x1be00000 0x04200000>; + read-only; + }; + };