From patchwork Sat Jul 8 13:46:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiji Yang X-Patchwork-Id: 1805192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uJz9cQhe; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.a=rsa-sha256 header.s=selector1 header.b=j4VE2SE1; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qys9N4PSWz20bl for ; Sat, 8 Jul 2023 23:50:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pQuIbxGyN8XoqfxgnHwRw0SYxMAd4AcGYiTHqxgLA7s=; b=uJz9cQhefIJlRC HJMxzCTamh3OTzYINNoVqsPDMlf6FuQ1q6WgUsjtF8ke51tBe69Gk6CoSraq2vF3f3e0rT0krzRI+ jYrq8oh+9Ai3uhh4+PnNfxXUOReYFMH1q9pmrOqGCFMvoYXKLL0vj4QlATdRGtnBIrNHyRCmd8Vs0 W0mv3k4CkQBukKsd3Ns4M/9O4IBH4FkmTv7JMp9risnJfsw5LO0SY5NErBICK4lP+Mp9x83z0Lj7g htetwchVAgvSsM+rfhabYl1oMwrI2GG8OdgJUUsR+Lho0GuKgNQv8QrBkpIxT6TiyuZcJ/t34t0ge RQc9WRfV08F8UnVV5eQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qI8Hn-007LK1-1s; Sat, 08 Jul 2023 13:47:43 +0000 Received: from mail-os0jpn01olkn20802.outbound.protection.outlook.com ([2a01:111:f403:700c::802] helo=JPN01-OS0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qI8Hk-007LHM-1y for openwrt-devel@lists.openwrt.org; Sat, 08 Jul 2023 13:47:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hY/PhUKldRnFd3NdjX/KZHHotzYf4J1t2gnw2mJdgCH8Jrl5TxnrnO/Uc1i84/lKZ0lQpizR/otdo4zat3FgimSG4+/earNA4yJtFheJzCUU8mWgeVMaO6ZdKF9KjyNrVumCwsBtSAvrgOVBcc8C1NAkH9Av+wehSgQMkyEToPgUrhmqz6jc6IYt1xRXGLwPd7hQZ1hcaLpUbpxPfmJbZs/9qsAJ8nYaMHXOrvLuIynlNGfwf11fDe6V0phbhKB78CKhvgimPWy1cRtsSx/LBn9wFuUZr4IiIj7Y6C7MJ6cwANIriZhJTv3bgwKIPpTCShbMu/DJbE7Ur02biesZNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lIyIxkjf9R1Aq0NdyCYe/Ovf8lkaZ8ja16jVnjyKer4=; b=cjv0yGTMYr4A+NdG3m1/J0GKyT50Ulk1xZK5jK+gAtkn4cHvE0ktgk3476Pf/tQQ5p+JmtszkuogBVbpwfXkPto7vT9ETQw3xlL2ae92GlBXvwt9wPX+1hhP3cCelrKNQHMpnVnWb0ZNko9DdeAkpQRAPmXqCr9W2TOa/VE9102wK9OuS68aw9FE339lm5QM5xpjby2gc8FSscV4H6N4VaQSU7BeyqbiWjAPdfC8Qgvz9kSOYwIrpKrvTRt1+PuYxtUWgjtkH74IrNF5PkhTYZeRYfOMOHkcjQyEYZSNFKiODnafW6NtxJwlj1tm/OY/7H/AVxxd189zICfkRq625A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lIyIxkjf9R1Aq0NdyCYe/Ovf8lkaZ8ja16jVnjyKer4=; b=j4VE2SE1PTHMTSJ/QxdHa1S/wjPdLC4p5ukwyR+4lUTMcRVGWTZUlEoOWWzNHYhNCekbDfqF2VMP/LYNCyKPHxQn/MzY3zSRhr8tVqYmghIY1mxDnFXzKZbDRZt8Eq+CkDj7QPOmwfYkkygD1P0JImm5G60IkMbykEmpfLjhscDUgxzgy8Ce03FzWzVOYV9OSpwhQ5TRZQrgJFkaRe7y2dTNJ+Gk21ob+2MG4afMgbv/fU+TgoBvEKU+gnrGxZqgRN/kQDfhrMy2O75Sjz4pIIWqV98MZv+56bu6tufYoskGe+kQsED7kqAUA8f9O9HsDBOwAyqOsUeNOaNfgIENXA== Received: from OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:93::10) by TYTP286MB3609.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:399::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Sat, 8 Jul 2023 13:47:27 +0000 Received: from OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM ([fe80::4879:5bc2:d533:bc74]) by OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM ([fe80::4879:5bc2:d533:bc74%4]) with mapi id 15.20.6565.026; Sat, 8 Jul 2023 13:47:27 +0000 From: Shiji Yang To: openwrt-devel@lists.openwrt.org Cc: Shiji Yang , Yousaf Subject: [PATCH 2/2] ath79: fix second boot failure issue on Netgear WNDR4300 v2 and WNDR4500 v3 Date: Sat, 8 Jul 2023 21:46:59 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230708134659.13623-1-yangshiji66@outlook.com> References: <20230708134659.13623-1-yangshiji66@outlook.com> X-TMN: [hefN8NVxlijgNcO4Qr0AvSTPsxfu/lBG6hN/YTBh3pY=] X-ClientProxiedBy: TYCPR01CA0110.jpnprd01.prod.outlook.com (2603:1096:405:4::26) To OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:93::10) X-Microsoft-Original-Message-ID: <20230708134659.13623-3-yangshiji66@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OSYP286MB0312:EE_|TYTP286MB3609:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dbdb2dd-fc6e-4b8d-677b-08db7fb9de12 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lQZoEQiMDVm6L/8c0OfYrul+oIqQ/VfhVS81SrXSzbHlvVoLcebWDxx1XqhBqIiCiMOFpZGm+m8KBSPdc7ADEcXdZmYm9bt74BV84rv7VjtuIxD6HGtJVXCyLnrI8YqSy3lMY1C5CtufYuzWXXZ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NHLEKScTXShQhq3uKWowFlYoSy6Q7ANw8lWXA+4og8u3IM3knShFUHjdOdTC1qbW4n7oF4F0nwD4bhWY6advI8k+UPRXGBkasMdp3evKBsMWVyQJksI/4SfDDZRd12sZEZADWm7nvGlSBSGpmRUH4Q1tEeEzSiCtnrngL8E2FdskPF7CTNI/CxVz7IFsDFIrCIB8NHxwiV6X/c18NZYnedBbz6mWUQiJtkEFg1Ikol9WbBV7hJtc75ajRj6gvaveO5oQCeuOnPUE+GLpJsUP6MdhWYnjMOG1gMA4sIRChd9pgMDXusJJdFjp4LlnvDy7TMFnhlp1QLnA9uAOk+47PBXX9tP5wBQixjg0VsTQNBpE/u+75nYm9/SHvJjEvV+DuQaveHJxZpaqvggPo5Ux0anak7Z0d0pgwSqYFlTLo6yhSm87+KngCeGyD0wABpJspHycXwyJ3syzuiRGGTObM9JlRxGEW3K4gCHhaNVlREAWlFPbXLiWkkNTkJF6YYOeQ4A35T71t40wGUz/DyVL1sqdbAE7qJ/J0QCgQXyU6uqijbsZ8RkL+7kY8YorsKR0BQpHZuUQuqdoJBmnZsvm7xFjoQW1TMgfr2CqypUCywwSYEr7AHtby6hWGeBKa8Yd5Fnq1SghmwPguTk1CX90= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dbdb2dd-fc6e-4b8d-677b-08db7fb9de12 X-MS-Exchange-CrossTenant-AuthSource: OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2023 13:47:27.7780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYTP286MB3609 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230708_064740_654421_CF8931BF X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Shiji Yang From the Netgear u-boot GPL code[1]. Bootloader always unconditionally marks block 768, 1020 - 1023 as bad blocks on each boot. This may lead to conflicts with the OpenWrt nand driver since these bloc [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yangshiji66[at]outlook.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [yangshiji66[at]outlook.com] -0.0 SPF_HELO_PASS SPF: HELO 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.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Shiji Yang From the Netgear u-boot GPL code[1]. Bootloader always unconditionally marks block 768, 1020 - 1023 as bad blocks on each boot. This may lead to conflicts with the OpenWrt nand driver since these blocks may be good blocks. In this case, U-boot will override the oob of these blocks so that break the ubi volume. The system will be damaged on the second boot. To avoid this issue, manually skip these blocks by using "mtd-concat". [1] https://www.downloads.netgear.com/files/GPL/EX7300v2series-V1.0.0.146_gpl_src.tar.bz2.zip Fixes: https://github.com/openwrt/openwrt/issues/8878 Tested-by: Yousaf Signed-off-by: Shiji Yang --- .../linux/ath79/dts/qca9563_netgear_wndr.dtsi | 32 +++++++++++++++++-- target/linux/ath79/image/nand.mk | 6 ++++ .../base-files/etc/board.d/05_compat-version | 15 +++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/nand/base-files/etc/board.d/05_compat-version diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index a51fb1964b..9e075e46e0 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -90,6 +90,22 @@ linux,default-trigger = "phy1tpt"; }; }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubiconcat0 &ubiconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x0>; + }; + }; + }; }; &spi { @@ -165,10 +181,20 @@ reg = <0x0 0x400000>; }; - partition@400000 { - label = "ubi"; - reg = <0x400000 0x7c00000>; + ubiconcat0: partition@400000 { + label = "ubiconcat0"; + reg = <0x400000 0x5c00000>; + }; + + ubiconcat1: partition@6020000 { + label = "ubiconcat1"; + reg = <0x6020000 0x1f60000>; }; + /* + * U-boot always unconditionally marks block 768, 1020 - 1023 as + * bad blocks on each boot. To avoid conflicts with the nand + * driver, Manually skip them. + */ }; }; }; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 7a3f478281..160394aa45 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -374,6 +374,9 @@ TARGET_DEVICES += netgear_wndr4300tn define Device/netgear_wndr4300-v2 SOC := qca9563 + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Partition table has changed to fix the first \ + boot issue. Please reflash factory image with nmrp or tftp. DEVICE_MODEL := WNDR4300 DEVICE_VARIANT := v2 UIMAGE_MAGIC := 0x27051956 @@ -385,6 +388,9 @@ TARGET_DEVICES += netgear_wndr4300-v2 define Device/netgear_wndr4500-v3 SOC := qca9563 + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Partition table has changed to fix the first \ + boot issue. Please reflash factory image with nmrp or tftp. DEVICE_MODEL := WNDR4500 DEVICE_VARIANT := v3 UIMAGE_MAGIC := 0x27051956 diff --git a/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version b/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version new file mode 100644 index 0000000000..238927aa7b --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version @@ -0,0 +1,15 @@ +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + netgear,wndr4300-v2|\ + netgear,wndr4500-v3) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0