Message ID | 20221229190906.6467-2-samuel@sholland.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2553383wrt; Thu, 29 Dec 2022 11:17:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvO4MRJ49FkwAoVtC06QdQLKdTqF3BbEB6ypcvGzPKAnt2VyGBiSMCSnUn7pl8dGulfP4S X-Received: by 2002:a17:907:a641:b0:7c1:4e8f:df2f with SMTP id vu1-20020a170907a64100b007c14e8fdf2fmr29566712ejc.17.1672341443274; Thu, 29 Dec 2022 11:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672341443; cv=none; d=google.com; s=arc-20160816; b=s0JtsbM4EX3lrnLItelW7QijbETJBEhJdo+HEbcGbUEHywxlEBcZ5WWGmXG+e8mCPz i3exevCaTExQu7p9JDvDV0ZcBdsDi3TXAW0F8liveWDly5Usyk/LqP3c40uXXNH7TQO+ dDRDBpVwI7GMd2LGCf9oLKy/oQDOeNuSTSfRj1cRTizsLEbOtbS0LNu246GfoT+NYr4w tBebY4u54O5kmPEIIuiu5XKR/N82qR3TmxzkcCwIq926vTWqIEDkXGX9jKW24piL5jg3 ph/ARsTyJFV4ZDv5Kwyi8Fddugujq05/iGKWj7S1STXtPcSZGbqLJ43uFSdz9BUGhul1 SbEA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=26OVl7pfPjUCuTagaZGOenKInbPyTJjQTgFy1rxtBYQ=; b=X5IGy53cJNNwZvOuwtnjDFb5YrWvSuT5I6mEkG9TlYEohpdEw1tWnaV9itfA87toyh OxfePSWz/nvJs9eOpBhrjRq4r+7kyWKE2egIqynZ7+C16lQbBPaEfEIKwOjcXTM0w63Z CaasSEw9X0Q41AXj6vSuccG9W+ftRYunR3ylXDJBhMPEmFPKUeLKbXiXALC/6VRPKOpL +IaQIFRocipcXL/5C5Wq0uDbq4KGGrWGZefuXB1iDmc8hXzDDxlLAMUOdx3oyb8BdYqS S3v290uw2v9IQHmJwchtNyUsEJV4zenBu7VR621heqsmzOFY3k1psCQ7NaFs2d/ykEGW QV/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=1rOqAIpm; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=oein5zp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b0078df24be362si16988369ejc.496.2022.12.29.11.16.57; Thu, 29 Dec 2022 11:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=1rOqAIpm; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=oein5zp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233930AbiL2TJV (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Thu, 29 Dec 2022 14:09:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233867AbiL2TJM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 29 Dec 2022 14:09:12 -0500 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B37C14D3F for <linux-kernel@vger.kernel.org>; Thu, 29 Dec 2022 11:09:11 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 91F0D3200786; Thu, 29 Dec 2022 14:09:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 29 Dec 2022 14:09:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1672340950; x=1672427350; bh=26 OVl7pfPjUCuTagaZGOenKInbPyTJjQTgFy1rxtBYQ=; b=1rOqAIpmu7OJxRRrWD Zg9QX/bWx2jqDmeTQg3mXE+S3f2iXjFA5VRSEYIAKhz3TqC1z26C4Ww69up8ZmPI sAFbYpTbj4XjE82+7HRPJmkrWsDAY7t9pWPGOi+hY7LPXwPadAX+hkjjl6U5g/YP C0B7LCvVGZYkNsGOdZN8ckXgmT2mBpC7wFKCTKE0ww04ERxhn/xhZNKQnzUFggkq 3hJ2CCCKCykSl+qCPV/zrRMrtO90oE5qdv/16rVX8NZCe2ZWNyi9DWVlT+3AF51b 1q283Y3XLHuT1p3igWKEJP6aR7oJJ12kkjFLJ1ca0ZOZIGYEwEnWlXKENOm0IRrx sXYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1672340950; x=1672427350; bh=26OVl7pfPjUCu TagaZGOenKInbPyTJjQTgFy1rxtBYQ=; b=oein5zp1XyEl9w8dNi+CcdsUJs+9s 4zovpuXNQAL3KwV+y3rdjurP34r7N2Ir6vaJxZ3FgxYIKhH3Rg99wFYM6dGwWLXl ZQytwE5bqCqUSVh9F6coLVSmSs5eJKnnL05mNDhfFcT/jmuIxcnQaDeBwHpWEzcl n+X1cjJL6WG4optJpEitcTzqSV/1y+USov9vX20L9p5TzXeJzyAU1D8+2DwQxluY uMUmwiR4gtrN+Y0/gfo0JJnJ45OCccYZnlUitU+A9H84ss2EqbfwzX779phnNvFQ 8zWQj6YHDTdcw+Tu6U4xY+FCAlY3olP78XbvJ0GkCf2nc9G4eBHhBCKVw== X-ME-Sender: <xms:1uWtY49K47hOBg76TsHofq8eOXNvYloJTFSejCTK6oMG6xnaV7Ha4Q> <xme:1uWtYwtVjfOSSYgNd85fTQOugYthDFcHi-QDU6sNf_Er9Xi9vw67DsCH1s9P_IZnH oO33jTaCAxK0rn5nA> X-ME-Received: <xmr:1uWtY-BvGZVbLcmhpf4Uk8B4yadL_C0BC6FC6Get9bV2EsGi3KdiddYq1jfwCrfIzlFgkBF2DZEJcwgxLT8pnEg_6wIxZMBoPtLN869dxN4JzXWWumkldVk_pKg0hnQIth0EGQ> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrieeggdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: <xmx:1uWtY4dOu_1Ly8xvK86jaB1BhT_cbkNaBn3SNi49Hd_xhG2SrypJsQ> <xmx:1uWtY9N9BQRB5abLsfiv3Kst0QPlXRY_nAyFxiXwiggCVCVUH-0pPQ> <xmx:1uWtYynBzB7xyjUvdR47EhenlAlFgGN6t1fLRk78aup1xZnYX3hCWw> <xmx:1uWtYyrZxoVvF0anYcK_dai54NaJmseOTa5bnOJt_vVB-H11K9wfsA> Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Dec 2022 14:09:09 -0500 (EST) From: Samuel Holland <samuel@sholland.org> To: Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com> Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Samuel Holland <samuel@sholland.org> Subject: [PATCH 1/3] mtd: rawnand: hynix: Add support for H27UCG8T2FTR-BC MLC NAND Date: Thu, 29 Dec 2022 13:09:03 -0600 Message-Id: <20221229190906.6467-2-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221229190906.6467-1-samuel@sholland.org> References: <20221229190906.6467-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLACK autolearn=no 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753577101334574499?= X-GMAIL-MSGID: =?utf-8?q?1753577101334574499?= |
Series |
mtd: rawnand: Add H27UCG8T2FTR-BC MLC NAND
|
|
Commit Message
Samuel Holland
Dec. 29, 2022, 7:09 p.m. UTC
H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but
reports a different ID.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/mtd/nand/raw/nand_hynix.c | 4 ++++
drivers/mtd/nand/raw/nand_ids.c | 4 ++++
2 files changed, 8 insertions(+)
Comments
Hi Samuel, samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: > H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but > reports a different ID. Can you provide a datasheet for this part? I am surprised by the page size. In general anyway, it's best to provide a link when adding support for a new component. Also, for your two series, no need to resend this time, but please use git-format-patch and git-send-email to create your series, so that all the patches are answers of the cover letter. It helps keeping all patches and answers in the series packed together. Thanks! Miquèl > Signed-off-by: Samuel Holland <samuel@sholland.org> > --- > > drivers/mtd/nand/raw/nand_hynix.c | 4 ++++ > drivers/mtd/nand/raw/nand_ids.c | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c > index 0d4d4bbfdece..836f152612ab 100644 > --- a/drivers/mtd/nand/raw/nand_hynix.c > +++ b/drivers/mtd/nand/raw/nand_hynix.c > @@ -721,6 +721,10 @@ static int hynix_nand_init(struct nand_chip *chip) > sizeof("H27UCG8T2ETR-BC") - 1)) > h27ucg8t2etrbc_init(chip); > > + if (!strncmp("H27UCG8T2FTR-BC", chip->parameters.model, > + sizeof("H27UCG8T2FTR-BC") - 1)) > + h27ucg8t2etrbc_init(chip); > + > ret = hynix_nand_rr_init(chip); > if (ret) > hynix_nand_cleanup(chip); > diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c > index dacc5529b3df..167183ccb9e9 100644 > --- a/drivers/mtd/nand/raw/nand_ids.c > +++ b/drivers/mtd/nand/raw/nand_ids.c > @@ -55,6 +55,10 @@ 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) }, > + {"H27UCG8T2FTR-BC 64G 3.3V 8-bit", > + { .id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a} }, > + SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664, > + NAND_ECC_INFO(40, SZ_1K) }, > {"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) },
Hi again, miquel.raynal@bootlin.com wrote on Fri, 30 Dec 2022 13:45:07 +0100: > Hi Samuel, > > samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: > > > H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but > > reports a different ID. > > Can you provide a datasheet for this part? I am surprised by the page > size. In general anyway, it's best to provide a link when adding > support for a new component. > > Also, for your two series, no need to resend this time, but please use > git-format-patch and git-send-email to create your series, so that all > the patches are answers of the cover letter. It helps keeping all > patches and answers in the series packed together. You can ignore this, I did momentarily change the display inadvertently on my side, your series are perfectly fine. Sorry for the noise. Miquèl
Hi Miquèl, On 12/30/22 06:45, Miquel Raynal wrote: > Hi Samuel, > > samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: > >> H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but >> reports a different ID. > > Can you provide a datasheet for this part? I am surprised by the page > size. In general anyway, it's best to provide a link when adding > support for a new component. I was unable to find a datasheet for specifically H27UCG8T2FTR-BC. The best datasheet I could find is for H27UCG8T2ETR-BC[0][1]. However, there are layout parameters for H27UCG8T2FTR-BC in some versions of the vendor NAND driver[2][3][4]. The Hynix chip is packaged as Essencore I3T-8GQ8T2H5TARC, as referenced in that NAND ID table, which is the actual package on the board I have. Regards, Samuel [0]: https://z3d9b7u8.stackpathcdn.com/pdf-down/H/2/7/H27UCG8T2ETR-BC-Hynix.pdf [1]: http://www.zsong.com.cn/userfiles/H27UC(D)G8T(U)2ETR-BC_Rev1.0_0826.pdf [2]: https://github.com/engSinteck/A133_Image/blob/main/longan/kernel/linux-4.9/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 [3]: https://github.com/launchfur/rg818-kernel/blob/master/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 [4]: Adding member names to that table entry: {.nand_id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a, 0xff, 0xff}, .die_cnt_per_chip = 1, .sect_cnt_per_page = 32, .page_cnt_per_blk = 256, .blk_cnt_per_die = 2112, #define NAND_MULTI_PROGRAM (1 << 3) #define NAND_RANDOM (1 << 7) #define NAND_READ_RETRY (1 << 8) #define NAND_LSB_PAGE_TYPE (0xff << 12) .operation_opt = 0x00002188, .valid_blk_ratio = 896, .access_freq = 40, .ecc_mode = 8, .read_retry_type = 0x050804, .ddr_type = 0, .option_phyisc_op_no = 14, .ddr_info_no = 0, .id_number = 0x010026, .max_blk_erase_times = 3000, .driver_no = 1, .access_high_freq = 40, .random_cmd2_send_flag = 0, .random_addr_num = 0, .nand_real_page_size = 16384 + 1664}, ".option_phyisc_op_no = 14" references this entry: { /* 14 */ .multi_plane_read_cmd = {0x60, 0x30}, .multi_plane_write_cmd = {0x11, 0x81}, .multi_plane_copy_read_cmd = {0x60, 0x60, 0x35}, .multi_plane_copy_write_cmd = {0x85, 0x11, 0x81}, .multi_plane_status_cmd = 0x78, .inter_bnk0_status_cmd = 0x78, .inter_bnk1_status_cmd = 0x78, .bad_block_flag_position = 0x00, .multi_plane_block_offset = 1024, },
Hi Samuel, samuel@sholland.org wrote on Fri, 30 Dec 2022 10:08:13 -0600: > Hi Miquèl, > > On 12/30/22 06:45, Miquel Raynal wrote: > > Hi Samuel, > > > > samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: > > > >> H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but > >> reports a different ID. > > > > Can you provide a datasheet for this part? I am surprised by the page > > size. In general anyway, it's best to provide a link when adding > > support for a new component. > > I was unable to find a datasheet for specifically H27UCG8T2FTR-BC. The > best datasheet I could find is for H27UCG8T2ETR-BC[0][1]. However, there > are layout parameters for H27UCG8T2FTR-BC in some versions of the vendor > NAND driver[2][3][4]. The Hynix chip is packaged as Essencore > I3T-8GQ8T2H5TARC, as referenced in that NAND ID table, which is the > actual package on the board I have. > > Regards, > Samuel > > [0]: > https://z3d9b7u8.stackpathcdn.com/pdf-down/H/2/7/H27UCG8T2ETR-BC-Hynix.pdf Pointing to [0] or [1] in the commit log would be nice at least, even though we cannot get our hands on the real datasheet... > [1]: http://www.zsong.com.cn/userfiles/H27UC(D)G8T(U)2ETR-BC_Rev1.0_0826.pdf > [2]: > https://github.com/engSinteck/A133_Image/blob/main/longan/kernel/linux-4.9/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 > [3]: > https://github.com/launchfur/rg818-kernel/blob/master/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 > [4]: Adding member names to that table entry: > > {.nand_id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a, > 0xff, 0xff}, > .die_cnt_per_chip = 1, > .sect_cnt_per_page = 32, > .page_cnt_per_blk = 256, > .blk_cnt_per_die = 2112, > #define NAND_MULTI_PROGRAM (1 << 3) > #define NAND_RANDOM (1 << 7) > #define NAND_READ_RETRY (1 << 8) > #define NAND_LSB_PAGE_TYPE (0xff << 12) > .operation_opt = 0x00002188, > .valid_blk_ratio = 896, > .access_freq = 40, > .ecc_mode = 8, > .read_retry_type = 0x050804, > .ddr_type = 0, > .option_phyisc_op_no = 14, > .ddr_info_no = 0, > .id_number = 0x010026, > .max_blk_erase_times = 3000, > .driver_no = 1, > .access_high_freq = 40, > .random_cmd2_send_flag = 0, > .random_addr_num = 0, > .nand_real_page_size = 16384 + 1664}, This and what is displayed in the two datasheets pointed above looks very much like out-of-band data to me, I don't get why we should treat this part of the array differently? The OOB area is not only supposed to be used for ECC bytes (even though that's how UBI make use of it), you can store all the data you want there (but it's not necessarily protected by the ECC engine, which, in general, matters a lot. I don't see how this datasheet would be different than the others. They don't detail the geometry, I would have expected them to do it if the page size was anything different than the standard? > ".option_phyisc_op_no = 14" references this entry: > { > /* 14 */ > .multi_plane_read_cmd = {0x60, 0x30}, > .multi_plane_write_cmd = {0x11, 0x81}, > .multi_plane_copy_read_cmd = {0x60, 0x60, 0x35}, > .multi_plane_copy_write_cmd = {0x85, 0x11, 0x81}, > .multi_plane_status_cmd = 0x78, > .inter_bnk0_status_cmd = 0x78, > .inter_bnk1_status_cmd = 0x78, > .bad_block_flag_position = 0x00, > .multi_plane_block_offset = 1024, > }, > Thanks, Miquèl
On 1/2/23 04:06, Miquel Raynal wrote: > Hi Samuel, > > samuel@sholland.org wrote on Fri, 30 Dec 2022 10:08:13 -0600: > >> Hi Miquèl, >> >> On 12/30/22 06:45, Miquel Raynal wrote: >>> Hi Samuel, >>> >>> samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: >>> >>>> H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but >>>> reports a different ID. >>> >>> Can you provide a datasheet for this part? I am surprised by the page >>> size. In general anyway, it's best to provide a link when adding >>> support for a new component. >> >> I was unable to find a datasheet for specifically H27UCG8T2FTR-BC. The >> best datasheet I could find is for H27UCG8T2ETR-BC[0][1]. However, there >> are layout parameters for H27UCG8T2FTR-BC in some versions of the vendor >> NAND driver[2][3][4]. The Hynix chip is packaged as Essencore >> I3T-8GQ8T2H5TARC, as referenced in that NAND ID table, which is the >> actual package on the board I have. >> >> Regards, >> Samuel >> >> [0]: >> https://z3d9b7u8.stackpathcdn.com/pdf-down/H/2/7/H27UCG8T2ETR-BC-Hynix.pdf > > Pointing to [0] or [1] in the commit log would be nice at least, even > though we cannot get our hands on the real datasheet... OK, I will do that for v2. >> [1]: http://www.zsong.com.cn/userfiles/H27UC(D)G8T(U)2ETR-BC_Rev1.0_0826.pdf >> [2]: >> https://github.com/engSinteck/A133_Image/blob/main/longan/kernel/linux-4.9/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 >> [3]: >> https://github.com/launchfur/rg818-kernel/blob/master/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 >> [4]: Adding member names to that table entry: >> >> {.nand_id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a, >> 0xff, 0xff}, >> .die_cnt_per_chip = 1, >> .sect_cnt_per_page = 32, >> .page_cnt_per_blk = 256, >> .blk_cnt_per_die = 2112, >> #define NAND_MULTI_PROGRAM (1 << 3) >> #define NAND_RANDOM (1 << 7) >> #define NAND_READ_RETRY (1 << 8) >> #define NAND_LSB_PAGE_TYPE (0xff << 12) >> .operation_opt = 0x00002188, >> .valid_blk_ratio = 896, >> .access_freq = 40, >> .ecc_mode = 8, >> .read_retry_type = 0x050804, >> .ddr_type = 0, >> .option_phyisc_op_no = 14, >> .ddr_info_no = 0, >> .id_number = 0x010026, >> .max_blk_erase_times = 3000, >> .driver_no = 1, >> .access_high_freq = 40, >> .random_cmd2_send_flag = 0, >> .random_addr_num = 0, >> .nand_real_page_size = 16384 + 1664}, > > This and what is displayed in the two datasheets pointed above looks > very much like out-of-band data to me, I don't get why we should treat > this part of the array differently? The OOB area is not only supposed to > be used for ECC bytes (even though that's how UBI make use of it), you > can store all the data you want there (but it's not necessarily > protected by the ECC engine, which, in general, matters a lot. > > I don't see how this datasheet would be different than the others. They > don't detail the geometry, I would have expected them to do it if the > page size was anything different than the standard? Maybe we are misunderstanding each other. The page size I have declared in the table is SZ_16K, which I believe is a standard value. The non-power-of-two chip size comes from the number of blocks in the chip; the ".blk_cnt_per_die = 2112" above corresponds to the "8448" in patch 3. For H27UCG8T2ETR this is described in the datasheet on page 3 as "1,060 blocks x 2 plane" and "(1,024 blocks + 36 block)/1plane". These extra blocks are separate from the OOB area inside each page. Regards, Samuel >> ".option_phyisc_op_no = 14" references this entry: >> { >> /* 14 */ >> .multi_plane_read_cmd = {0x60, 0x30}, >> .multi_plane_write_cmd = {0x11, 0x81}, >> .multi_plane_copy_read_cmd = {0x60, 0x60, 0x35}, >> .multi_plane_copy_write_cmd = {0x85, 0x11, 0x81}, >> .multi_plane_status_cmd = 0x78, >> .inter_bnk0_status_cmd = 0x78, >> .inter_bnk1_status_cmd = 0x78, >> .bad_block_flag_position = 0x00, >> .multi_plane_block_offset = 1024, >> }, >> > > Thanks, > Miquèl
Hi Samuel, samuel@sholland.org wrote on Mon, 2 Jan 2023 09:50:21 -0600: > On 1/2/23 04:06, Miquel Raynal wrote: > > Hi Samuel, > > > > samuel@sholland.org wrote on Fri, 30 Dec 2022 10:08:13 -0600: > > > >> Hi Miquèl, > >> > >> On 12/30/22 06:45, Miquel Raynal wrote: > >>> Hi Samuel, > >>> > >>> samuel@sholland.org wrote on Thu, 29 Dec 2022 13:09:03 -0600: > >>> > >>>> H27UCG8T2FTR-BC is similar to the already-supported H27UCG8T2ETR-BC, but > >>>> reports a different ID. > >>> > >>> Can you provide a datasheet for this part? I am surprised by the page > >>> size. In general anyway, it's best to provide a link when adding > >>> support for a new component. > >> > >> I was unable to find a datasheet for specifically H27UCG8T2FTR-BC. The > >> best datasheet I could find is for H27UCG8T2ETR-BC[0][1]. However, there > >> are layout parameters for H27UCG8T2FTR-BC in some versions of the vendor > >> NAND driver[2][3][4]. The Hynix chip is packaged as Essencore > >> I3T-8GQ8T2H5TARC, as referenced in that NAND ID table, which is the > >> actual package on the board I have. > >> > >> Regards, > >> Samuel > >> > >> [0]: > >> https://z3d9b7u8.stackpathcdn.com/pdf-down/H/2/7/H27UCG8T2ETR-BC-Hynix.pdf > > > > Pointing to [0] or [1] in the commit log would be nice at least, even > > though we cannot get our hands on the real datasheet... > > OK, I will do that for v2. > > >> [1]: http://www.zsong.com.cn/userfiles/H27UC(D)G8T(U)2ETR-BC_Rev1.0_0826.pdf > >> [2]: > >> https://github.com/engSinteck/A133_Image/blob/main/longan/kernel/linux-4.9/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 > >> [3]: > >> https://github.com/launchfur/rg818-kernel/blob/master/modules/nand/sun8iw15p1/phy-nand/physic_v2/nand_id2.c#L1592 > >> [4]: Adding member names to that table entry: > >> > >> {.nand_id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a, > >> 0xff, 0xff}, > >> .die_cnt_per_chip = 1, > >> .sect_cnt_per_page = 32, > >> .page_cnt_per_blk = 256, > >> .blk_cnt_per_die = 2112, > >> #define NAND_MULTI_PROGRAM (1 << 3) > >> #define NAND_RANDOM (1 << 7) > >> #define NAND_READ_RETRY (1 << 8) > >> #define NAND_LSB_PAGE_TYPE (0xff << 12) > >> .operation_opt = 0x00002188, > >> .valid_blk_ratio = 896, > >> .access_freq = 40, > >> .ecc_mode = 8, > >> .read_retry_type = 0x050804, > >> .ddr_type = 0, > >> .option_phyisc_op_no = 14, > >> .ddr_info_no = 0, > >> .id_number = 0x010026, > >> .max_blk_erase_times = 3000, > >> .driver_no = 1, > >> .access_high_freq = 40, > >> .random_cmd2_send_flag = 0, > >> .random_addr_num = 0, > >> .nand_real_page_size = 16384 + 1664}, > > > > This and what is displayed in the two datasheets pointed above looks > > very much like out-of-band data to me, I don't get why we should treat > > this part of the array differently? The OOB area is not only supposed to > > be used for ECC bytes (even though that's how UBI make use of it), you > > can store all the data you want there (but it's not necessarily > > protected by the ECC engine, which, in general, matters a lot. > > > > I don't see how this datasheet would be different than the others. They > > don't detail the geometry, I would have expected them to do it if the > > page size was anything different than the standard? > > Maybe we are misunderstanding each other. The page size I have declared > in the table is SZ_16K, which I believe is a standard value. The > non-power-of-two chip size comes from the number of blocks in the chip; > the ".blk_cnt_per_die = 2112" above corresponds to the "8448" in patch 3. > > For H27UCG8T2ETR this is described in the datasheet on page 3 as "1,060 > blocks x 2 plane" and "(1,024 blocks + 36 block)/1plane". These extra > blocks are separate from the OOB area inside each page. Oh right, sorry I messed things up in my mind. So yes it's a real situation. If we grep chip_shift and pagemask there are a number of users (controller drivers) which might actually be impacted. We need to be careful. Right now I am not sure we should we should play with the core to support these extra blocks... Thanks, Miquèl
diff --git a/drivers/mtd/nand/raw/nand_hynix.c b/drivers/mtd/nand/raw/nand_hynix.c index 0d4d4bbfdece..836f152612ab 100644 --- a/drivers/mtd/nand/raw/nand_hynix.c +++ b/drivers/mtd/nand/raw/nand_hynix.c @@ -721,6 +721,10 @@ static int hynix_nand_init(struct nand_chip *chip) sizeof("H27UCG8T2ETR-BC") - 1)) h27ucg8t2etrbc_init(chip); + if (!strncmp("H27UCG8T2FTR-BC", chip->parameters.model, + sizeof("H27UCG8T2FTR-BC") - 1)) + h27ucg8t2etrbc_init(chip); + ret = hynix_nand_rr_init(chip); if (ret) hynix_nand_cleanup(chip); diff --git a/drivers/mtd/nand/raw/nand_ids.c b/drivers/mtd/nand/raw/nand_ids.c index dacc5529b3df..167183ccb9e9 100644 --- a/drivers/mtd/nand/raw/nand_ids.c +++ b/drivers/mtd/nand/raw/nand_ids.c @@ -55,6 +55,10 @@ 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) }, + {"H27UCG8T2FTR-BC 64G 3.3V 8-bit", + { .id = {0xad, 0xde, 0x14, 0xab, 0x42, 0x4a} }, + SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664, + NAND_ECC_INFO(40, SZ_1K) }, {"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) },