]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: fix Zyxel XMG1915-10E partition layout
authorJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 28 Apr 2026 21:00:24 +0000 (21:00 +0000)
committerRobert Marko <robimarko@gmail.com>
Mon, 11 May 2026 08:34:53 +0000 (10:34 +0200)
When support for this device was added, the partition layout was defined
in a way that doesn't use space as intended and wastes quite a lot of
it.

(1) firmware partition starts at offset 0x1260000. This is the second
    partition/B partition in the A/B scheme used by Zyxel. While the
    commit mentions the image is written to A, the firmware partition
    is defined in the B space.
(2) firmware partition only ~16MB in size. The device has a total of
    32MB of flash. The vendor uses an A/B scheme but OpenWrt doesn't use
    it. Thus, OpenWrt can make use of the full available space.
(3) loader partition too big. Other devices using rt-loader explicitly
    in a partition use a size of 0x10000. This is more than enough
    already. The device here uses 0x30000 which is mostly wasted.

Those issues are fixed accordingly. While at it, move partitions 'loader'
and 'firmware' into a parent partition 'factory'. This is a preparation
for adding web upgrade support for this device.

Fixes: 94607d6285cc ("realtek: add support for Zyxel XMG1915-10E")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23218
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/dts/rtl9302_zyxel_xmg1915-10e.dts
target/linux/realtek/image/rtl930x.mk

index 25a73e1ec787be6ec4dce8cf34610cb2d7381fa9..9d646ea1a61bc0b487878653e0bc0c580829b16a 100644 (file)
 
                        partition@80000 {
                                label = "reserved";
-                               reg = <0x80000 0xf80000>;
+                               reg = <0x80000 0x1e0000>;
                                read-only;
                        };
 
-                       partition@1260000 {
-                               label = "loader";
-                               reg = <0x1260000 0x30000>;
-                       };
+                       partition@260000 {
+                               label = "factory";
+                               reg = <0x260000 0x1da0000>;
+
+                               compatible = "fixed-partitions";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
 
-                       partition@1290000 {
-                               label = "firmware";
-                               reg = <0x1290000 0xd70000>;
-                               compatible = "openwrt,uimage", "denx,uimage";
+                               partition@0 {
+                                       label = "loader";
+                                       reg = <0x0 0x10000>;
+                               };
+                               partition@10000 {
+                                       label = "firmware";
+                                       reg = <0x10000 0x1d90000>;
+                                       compatible = "openwrt,uimage", "denx,uimage";
+                               };
                        };
                };
        };
index 20f96c3ae40cb6a82f785c76df9e73bb9b950148..df5c16c6e321d69680ff51bbec34d9dee96a173d 100644 (file)
@@ -231,7 +231,7 @@ define Device/zyxel_xmg1915-10e
   ZYXEL_VERS := ABWE
   DEVICE_VENDOR := Zyxel
   DEVICE_MODEL := XMG1915-10E
-  FLASH_ADDR := 0xb5290000
+  FLASH_ADDR := 0xb4270000
 ifeq ($(IB),)
   ARTIFACTS := loader.bin
   ARTIFACT/loader.bin := \
@@ -239,6 +239,6 @@ ifeq ($(IB),)
     zynsig
 endif
   $(Device/rt-loader-bootbase)
-  IMAGE_SIZE := 13760k
+  IMAGE_SIZE := 30336k
 endef
 TARGET_DEVICES += zyxel_xmg1915-10e