Message ID | 20231021150212.20509-1-amadeus@jmu.edu.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp341463vqx; Sat, 21 Oct 2023 08:08:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEc9E4c5O69XtTxRLI6UTFKrkKWTxY7b9pFxwFICOafXfO48jKhUJgOs2W+CRSu5fBJWJF5 X-Received: by 2002:a05:6a21:a103:b0:16b:abad:87c5 with SMTP id aq3-20020a056a21a10300b0016babad87c5mr3551758pzc.10.1697900934929; Sat, 21 Oct 2023 08:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697900934; cv=none; d=google.com; s=arc-20160816; b=BEuKaUZeICT+dsTNP/h0vme4dmCBrNYFvRqGsEizt+6FK6uG/7uFiTTarKp6NDjW1D t4wpOy9BEruN4vL6F8CfKoYJ1HjlGQPgEm4pRiYu6I5mwI7lo7U6V3zYQ+R1K+Wm8M3U ZsvN2of7ZkrkoQ+q07P/14qKDvPUruF9fz4e94N1DGlHxoxhHKUssfdp9QOXzSEyiK8c yJWIr9qWo7fa22ptoCqNRt/44t8VcpopH9xhhvQTguXC9/qqF5ekQs/YrdJv6WglZflF 5E5Co2TZO5xWHqfzmvxDbeHsts3FRI0ZU9xnlHg9VaKcDDN8lul0nm7C5/fwxdcNPPEq 48UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=4VuYS+aCqMRiqr9YKdMsndRTz9z+AbSpOtmlz4Iyquw=; fh=WMadBWVWyG2ERyPzTwoW9FDaB3/4COSTkuG6x+dZcss=; b=rN3pMbkPt+2gF8M4ycvwEMAjCjVh+2fV7lUQPpAQlM9aVQT3KrY1a4GqV1n4QXPt3v Q/E90Hm3mhqgPO2BZYBtHImvd2x1cWoRPxR0jMSguxcKABp/X7yU/pZIh0vZ1kC3zSIX finRIqKjC3Hfqkdbq0HcdpUIizDWHyd4CyZ26AVFLFSH5oC6xRoC8ylDczsQ1VZD2PHt aEVYI6/MtFKUh2Fggrj7dre2QvdPbrTAwavlHXsuPpSAeDm8WwkJS0+jdk/0xD+gdQyI R+JY3Vft153C/7KsNKh3t1KbWU0OLtbXXuFUnAMddIfxlG109sdhD19fJHp6KeDYs4n9 qRwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=jmu.edu.cn Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w14-20020a17090a780e00b002791bfc67bdsi3629034pjk.41.2023.10.21.08.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 08:08:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=jmu.edu.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 77C388043931; Sat, 21 Oct 2023 08:08:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231550AbjJUPIk (ORCPT <rfc822;a1648639935@gmail.com> + 26 others); Sat, 21 Oct 2023 11:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbjJUPIj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 21 Oct 2023 11:08:39 -0400 X-Greylist: delayed 331 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 21 Oct 2023 08:08:34 PDT Received: from mail-m155101.qiye.163.com (mail-m155101.qiye.163.com [101.71.155.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B3DE3 for <linux-kernel@vger.kernel.org>; Sat, 21 Oct 2023 08:08:34 -0700 (PDT) Received: from Vostro-3710.lan (unknown [58.61.140.248]) by mail-m121145.qiye.163.com (Hmail) with ESMTPA id 3D042800015; Sat, 21 Oct 2023 23:02:16 +0800 (CST) From: Chukun Pan <amadeus@jmu.edu.cn> To: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Chukun Pan <amadeus@jmu.edu.cn> Subject: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash Date: Sat, 21 Oct 2023 23:02:12 +0800 Message-Id: <20231021150212.20509-1-amadeus@jmu.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlCGE5LVk8ZGExJHRgZGEIfHlUTARMWGhIXJBQOD1 lXWRgSC1lBWU5DVU1KVUpPS1VJT0NZV1kWGg8SFR0UWUFZT0tIVUpKS0hKQ1VKS0tVS1kG X-HM-Tid: 0a8b52c2226db03akuuu3d042800015 X-HM-MType: 10 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PSo6KSo*IjwxGEM1HzNICzgU DiEwCQtVSlVKTUJMQktLTkhNQk9IVTMWGhIXVRoWGh8eDgg7ERYOVR4fDlUYFUVZV1kSC1lBWU5D VU1KVUpPS1VJT0NZV1kIAVlBSkJCSDcG X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 21 Oct 2023 08:08:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780378170957105794 X-GMAIL-MSGID: 1780378170957105794 |
Series |
[1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash
|
|
Commit Message
Chukun Pan
Oct. 21, 2023, 3:02 p.m. UTC
The Toshiba TH58NYG3S0HBAI4 is detected with 128 byte OOB while the flash
has 256 bytes OOB. This adds a static NAND ID entry to correct this.
Tested on Arcadyan AW1000 flashed with OpenWrt.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
drivers/mtd/nand/raw/nand_ids.c | 3 +++
1 file changed, 3 insertions(+)
Comments
Hi Chukun, amadeus@jmu.edu.cn wrote on Sat, 21 Oct 2023 23:02:12 +0800: > The Toshiba TH58NYG3S0HBAI4 is detected with 128 byte OOB while the flash > has 256 bytes OOB. This adds a static NAND ID entry to correct this. Any way you can detect this and fix the parameter page at run time instead? > Tested on Arcadyan AW1000 flashed with OpenWrt. > > Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> > --- > drivers/mtd/nand/raw/nand_ids.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c > index 650351c62af6..2b871dfd1d09 100644 > --- a/drivers/mtd/nand/raw/nand_ids.c > +++ b/drivers/mtd/nand/raw/nand_ids.c > @@ -58,6 +58,9 @@ struct nand_flash_dev nand_flash_ids[] = { > { .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} }, > SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664, > NAND_ECC_INFO(40, SZ_1K) }, > + {"TH58NYG3S0HBAI4 8G 1.8V 8-bit", > + { .id = {0x98, 0xa3, 0x91, 0x26, 0x76} }, > + SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) }, > {"TH58NVG2S3HBAI4 4G 3.3V 8-bit", > { .id = {0x98, 0xdc, 0x91, 0x15, 0x76} }, > SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) }, Thanks, Miquèl
Hi Miquel, > Any way you can detect this and fix the parameter page at run time > instead? Sorry but I don't know, I know very little about this. Thanks, Chukun
Hi Chukun, amadeus@jmu.edu.cn wrote on Sun, 29 Oct 2023 15:20:05 +0800: > Hi Miquel, > > > Any way you can detect this and fix the parameter page at run time > > instead? > > Sorry but I don't know, I know very little about this. > > Thanks, > Chukun > It's more like a request than a question. Please fix the parameter page at run time by registering a ->.fixup_onfi_param_page() hook in Toshiba's nand_manufacturer_ops structure. Thanks, Miquèl
Hi Miquel, > It's more like a request than a question. Please fix the parameter page > at run time by registering a ->.fixup_onfi_param_page() hook in > Toshiba's nand_manufacturer_ops structure. Sorry for the late reply. This flash is not ONFI compliant NAND, so onfi fixup can't work. Datasheet available at: https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf Thanks, Chukun
However, the NAND ID of this flash is {0x98, 0xa3, 0x91, 0x26}, the last ID bytes is missing. Maybe this patch should be put in OpenWrt as a hack. Thanks, Chukun
Hi Chukun, amadeus@jmu.edu.cn wrote on Tue, 14 Nov 2023 20:30:08 +0800: > Hi Miquel, > > > It's more like a request than a question. Please fix the parameter page > > at run time by registering a ->.fixup_onfi_param_page() hook in > > Toshiba's nand_manufacturer_ops structure. > > Sorry for the late reply. This flash is not ONFI compliant NAND, > so onfi fixup can't work. Datasheet available at: > https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf You said in your commit log that this flash was detected with a smaller (or bigger, I don't remember) OOB size than it really has. This number comes from somewhere? Is it an existing ID? Is it an auto-discovery mechanism? If it's an ID then why not adding a new entry. Otherwise you can I guess make some changes in the device geometry in the manufacturer init operation as well if the fixup-onfi hook does no apply. Thanks, Miquèl
diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c index 650351c62af6..2b871dfd1d09 100644 --- a/drivers/mtd/nand/raw/nand_ids.c +++ b/drivers/mtd/nand/raw/nand_ids.c @@ -58,6 +58,9 @@ struct nand_flash_dev nand_flash_ids[] = { { .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} }, SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664, NAND_ECC_INFO(40, SZ_1K) }, + {"TH58NYG3S0HBAI4 8G 1.8V 8-bit", + { .id = {0x98, 0xa3, 0x91, 0x26, 0x76} }, + SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) }, {"TH58NVG2S3HBAI4 4G 3.3V 8-bit", { .id = {0x98, 0xdc, 0x91, 0x15, 0x76} }, SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) },