realtek: use vendor-specific magic for ZyXEL
authorBjørn Mork <bjorn@mork.no>
Sat, 23 Jan 2021 10:08:11 +0000 (11:08 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 24 Jan 2021 17:12:34 +0000 (18:12 +0100)
The stock firmware of the ZyXEL GS1900 series use a non-standard
u-image magic.  This is not enforced by the stock u-boot, which is
why we could boot images with the default magic.  The flash
management application of the stock firmware will however verify
the magic, and refuse any image with another value.

Convert to vendor-specific value to get flash management support
in stock firmware, including the ability to upgrade to OpenWrt
directly from stock web UI.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
target/linux/realtek/image/Makefile

index 5f06339d13bfe7be9aa54f2a2850dbc723583218..c4441ec30eef3224eee97d31cc2f388c8aa37c83 100644 (file)
@@ -92,7 +92,8 @@
                        partition@b260000 {
                                label = "firmware";
                                reg = <0x260000 0x6d0000>;
-                               compatible = "denx,uimage";
+                               compatible = "openwrt,uimage", "denx,uimage";
+                               openwrt,ih-magic = <0x83800000>;
                        };
                        partition@930000 {
                                label = "runtime2";
index 87c616c3f20ab341ee44c380435d73419d543719..c05c504ec4065cda915284bf5301d353a64a00f1 100644 (file)
@@ -69,6 +69,7 @@ define Device/zyxel_gs1900-10hp
   IMAGE_SIZE := 6976k
   DEVICE_VENDOR := ZyXEL
   DEVICE_MODEL := GS1900-10HP
+  UIMAGE_MAGIC := 0x83800000
 endef
 TARGET_DEVICES += zyxel_gs1900-10hp
 
@@ -79,6 +80,7 @@ define Device/zyxel_gs1900-8hp-v1
   DEVICE_MODEL := GS1900-8HP
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES += lua-rs232
+  UIMAGE_MAGIC := 0x83800000
 endef
 TARGET_DEVICES += zyxel_gs1900-8hp-v1
 
@@ -89,6 +91,7 @@ define Device/zyxel_gs1900-8hp-v2
   DEVICE_MODEL := GS1900-8HP
   DEVICE_VARIANT := v2
   DEVICE_PACKAGES += lua-rs232
+  UIMAGE_MAGIC := 0x83800000
 endef
 TARGET_DEVICES += zyxel_gs1900-8hp-v2