From patchwork Sat Jan 23 10:08:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 1430659 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=eLgy4MeV; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.a=rsa-sha256 header.s=b header.b=jD5d7Kn1; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DNBh6511jz9rx8 for ; Sat, 23 Jan 2021 21:09:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O/t63UVVEYUeJhmUPyrtdtxQR4BPNwfkZc7VCoq19jI=; b=eLgy4MeVuiVJZhLa0rocky0ko hBvVE7JQRuL89BULOO1ditcblhUnK+yDLcd8+Skg3sgGYNYChfQtz3P0pFwDwYzZdsHYOW5Ka8blX KXia2t2mYqdYEcaIWkBKEVXrfvnMYu0oHRd2JFIJrjQRhJQN6oWpfDKEQFVK7gtpPOqOivaJaexvW aHbyHe/zzGFAEH542izN15wpWJ9MAlm3iCjD8gq2mgNKBKdIR/TfalkcvCX8MQw8KiHPlpdaePtG6 hGX2xIPAhzHK7pQy4p65+DJAFPJz79rUs8bGDwgvbfRBdW7gSq7+NuCT7k70CALuEx2wySe3gpD2e TYU/JCPMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3FqC-0001E8-NH; Sat, 23 Jan 2021 10:08:24 +0000 Received: from canardo.mork.no ([2001:4641::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3Fq7-0001Bn-Ey for openwrt-devel@lists.openwrt.org; Sat, 23 Jan 2021 10:08:20 +0000 Received: from canardo.mork.no (ip6-localhost [IPv6:0:0:0:0:0:0:0:1]) by canardo.mork.no (8.15.2/8.15.2) with ESMTPS id 10NA8FQS005214 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sat, 23 Jan 2021 11:08:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1611396495; bh=3EsMl2L3k/rs5md2jqlednqU5SSqoXQDqJdza6FmJNw=; h=From:To:Cc:Subject:Date:Message-Id:References:From; b=jD5d7Kn1Y78RbVm+uJhYlM7PtsfyIoLlgwOCfxVTsZzcuzQVodqV2J3eGeVR7G4+7 yjnWydXD8qXaxIj8FS6QhLgefLJgSi8EUa2Zi9StMHYT1sOuzwMMQiBfTZ4RrDuEky sZ9go2ROTiuTJMmg4W607dH+7vjALXZoVsJIWFBw= Received: (from bjorn@localhost) by canardo.mork.no (8.15.2/8.15.2/Submit) id 10NA8FPH005206; Sat, 23 Jan 2021 11:08:15 +0100 From: =?utf-8?q?Bj=C3=B8rn_Mork?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] realtek: use vendor-specific magic for ZyXEL Date: Sat, 23 Jan 2021 11:08:11 +0100 Message-Id: <20210123100812.5158-2-bjorn@mork.no> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210123100812.5158-1-bjorn@mork.no> References: <20210123100812.5158-1-bjorn@mork.no> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on canardo.mork.no X-Virus-Scanned: clamav-milter 0.102.4 at canardo X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210123_050819_827652_3422C844 X-CRM114-Status: GOOD ( 11.22 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:4641:0:0:0:0:0:1 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Bj=C3=B8rn_Mork?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 --- target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi | 3 ++- target/linux/realtek/image/Makefile | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi index 5f06339d13bf..c4441ec30eef 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi @@ -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"; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 1251b47c933d..c0ae8be36d98 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -70,6 +70,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 @@ -80,6 +81,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 @@ -90,6 +92,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