From patchwork Wed Jan 20 14:35:23 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: 1429212 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=b51ZFCN9; 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=JknCUMSg; 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 4DLSmW3nN1z9sB4 for ; Thu, 21 Jan 2021 01:37:47 +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=RwivgTRkwaNouLjxchzt7bFMF5PlxkvtDKt6of+adXY=; b=b51ZFCN9Yfs42HC2nQfaBmg+K 99oogUCJBoMazV5wDTF8sGlYVyRg2oqMVDdC2+tdm+rYzxJq+70nJngdJWxqBMzkawBhaRJqHqNxu Lefsmj7MrGoRTqlQhBSl/bsgcF0PopI21htPe/yQizLRejuDRFmI2VqYbQFXSptF5pMahABMpZJ54 Z1/raUPVDp9VKYbKCHw23fS0FpE9xGsR9isP+ii+3QOcOcFsx91KBzSIO2uO/JEJOVGJ/Sh3z48h9 Ik+luSp3s5NqIkUXKobGETTsAGnVHnPheq28mrjarKNEfiNZnLWzHGl2eqPj5LNNiVU0l1+JaEhIE r+Pu7ugrw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2EaO-0005qq-Pb; Wed, 20 Jan 2021 14:35:52 +0000 Received: from canardo.mork.no ([2001:4641::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2EaD-0005l8-OA for openwrt-devel@lists.openwrt.org; Wed, 20 Jan 2021 14:35:44 +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 10KEZZLL014544 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Wed, 20 Jan 2021 15:35:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1611153335; bh=Wobof2gp1ijSPUhr+bfRSBDVbYsolGVMcqpM+kWG8kw=; h=From:To:Cc:Subject:Date:Message-Id:References:From; b=JknCUMSggc0cysw8/i77tzq1snI2knQAfO5oblH0eJZN8Wf29uZ4PH3WJGiWu9Atq c1zZzF2aRliIjLwK5qGzSWLBjR0D5P4apF2JeL/XOOFtmEBl0Jg3fh8hpcQhkjBIar COHqiTitQaSCa2nTu4k/DUDfIXAwlHw5Tw7LtbkA= Received: (from bjorn@localhost) by canardo.mork.no (8.15.2/8.15.2/Submit) id 10KEZZkG014537; Wed, 20 Jan 2021 15:35:35 +0100 From: =?utf-8?q?Bj=C3=B8rn_Mork?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v3 06/10] kernel: mtdsplit_uimage: replace "allnet, uimage" parser Date: Wed, 20 Jan 2021 15:35:23 +0100 Message-Id: <20210120143527.14434-7-bjorn@mork.no> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120143527.14434-1-bjorn@mork.no> References: <20210120143527.14434-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-20210120_093542_364830_303D1629 X-CRM114-Status: GOOD ( 13.49 ) 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_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Convert users to the generic "openwrt,uimage" using device specific "openwrt,ih-magic" properties, and remove "allnet,uimage". Signed-off-by: Bjørn Mork --- .../drivers/mtd/mtdsplit/mtdsplit_uimage.c | 49 ------------------- .../dts/rtl8382_allnet_all-sg8208m.dts | 3 +- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c index 32c027d3e979..55eaca9946a0 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c @@ -333,54 +333,6 @@ static struct mtd_part_parser uimage_netgear_parser = { }; - -/************************************************** - * ALLNET - **************************************************/ - -#define FW_MAGIC_SG8208M 0x00000006 -#define FW_MAGIC_SG8310PM 0x83000006 - -static ssize_t uimage_verify_allnet(u_char *buf, size_t len, u32 ih_magic) -{ - struct uimage_header *header = (struct uimage_header *)buf; - - switch (be32_to_cpu(header->ih_magic)) { - case FW_MAGIC_SG8208M: - case FW_MAGIC_SG8310PM: - break; - default: - return -EINVAL; - } - - if (header->ih_os != IH_OS_LINUX) - return -EINVAL; - - return 0; -} - -static int -mtdsplit_uimage_parse_allnet(struct mtd_info *master, - const struct mtd_partition **pparts, - struct mtd_part_parser_data *data) -{ - return __mtdsplit_parse_uimage(master, pparts, data, - uimage_verify_allnet); -} - -static const struct of_device_id mtdsplit_uimage_allnet_of_match_table[] = { - { .compatible = "allnet,uimage" }, - {}, -}; - -static struct mtd_part_parser uimage_allnet_parser = { - .owner = THIS_MODULE, - .name = "allnet-fw", - .of_match_table = mtdsplit_uimage_allnet_of_match_table, - .parse_fn = mtdsplit_uimage_parse_allnet, -}; - - /************************************************** * Edimax **************************************************/ @@ -438,7 +390,6 @@ static int __init mtdsplit_uimage_init(void) { register_mtd_parser(&uimage_generic_parser); register_mtd_parser(&uimage_netgear_parser); - register_mtd_parser(&uimage_allnet_parser); register_mtd_parser(&uimage_edimax_parser); return 0; diff --git a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts index 28c4fd2970ba..681d699e8a32 100644 --- a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts @@ -95,7 +95,8 @@ partition@2a0000 { label = "firmware"; reg = <0x2a0000 0xd60000>; - compatible = "allnet,uimage"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = <0x00000006>; }; }; };