From patchwork Thu Jun 21 10:33:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 932670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=alliedtelesis.co.nz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Sq0XBCes"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="ovdQLAGX"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41BJ3t6NTvz9s01 for ; Thu, 21 Jun 2018 20:34:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=21weETudh1pJlSOB2Lr5VG0EQhgFv7KHU61PLXGmw4M=; b=Sq0 XBCes2YUp/DnMaVsaRmGIRNRo2b/5nE5+/Aegff/sXTQhC8FFm70FTUs0A55I4IHmpPMKiHbHWa+A ML1Sput1BaYWVyXWG/TMPfhqiicNq8Jm8jOB+TW9LC+224qir6avbQAOxYDV70WUO/03/7EMNvoQF qu+vCKWvZ2jEHljT09P10hb30u9KyO05LHKu/sVJJ3Ptcj6hVKRFbzUXHmqlRieTF8qPNOsQT6JOV YoHrrH/32yCVRJnSc1coWXkGeszO6yaikTZK3shRcQzqJjpxeK0sS/kf+FvSxnZI9ecWagbWW9hjV WMtem/0SJIzLOMXxN8U8pDk027wxtrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVwvI-00040d-4k; Thu, 21 Jun 2018 10:34:40 +0000 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVwut-0003lT-RZ for linux-mtd@lists.infradead.org; Thu, 21 Jun 2018 10:34:18 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 45FAC800E6; Thu, 21 Jun 2018 22:33:41 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1529577221; bh=W5lAAWhemFmVfH4OsO2jqt6kU9l944OgDtcJqAd2h3A=; h=From:To:Cc:Subject:Date; b=ovdQLAGXW4k31tHtAi7ZwwNh6bS2kRRxwVg2Xra0FFnJB0FegDcWlLZBAvbmnm6us KeAx/oSmfd55ZpWv/D6UQVICYp7aFjFV1tp9xWFOw3sgerXUo6+NF9BFON+A1jCaSz CQDPQYDZYIpEx/EZPFbeyzGmu3af1I0u1yHS06ZI= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Thu, 21 Jun 2018 22:33:41 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 00F5113EEAD; Thu, 21 Jun 2018 22:33:40 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id BC6511E2626; Thu, 21 Jun 2018 22:33:36 +1200 (NZST) From: Chris Packham To: miquel.raynal@bootlin.com, boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, linux-mtd@lists.infradead.org Subject: [PATCH v4 0/6] mtd: rawnand: support MT29F1G08ABAFAWP-ITE:F Date: Thu, 21 Jun 2018 22:33:22 +1200 Message-Id: <20180621103328.28206-1-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180621_033416_259580_8CD7BA02 X-CRM114-Status: GOOD ( 12.63 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [202.36.163.20 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_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_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Packham , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi, I'm looking at adding support for the Micron MT29F1G08ABAFAWP-ITE:F chip to one of our boards which uses the Marvell NFCv2 controller. This particular chip is a bit odd in that the datasheet states support for ONFI 1.0 but the revision number field is 00 00. It also is marked ABAFA but reports internally as ABAGA. Finally it has internal 8-bit ECC which cannot be disabled. The existing test in micron_supports_on_die_ecc() determines that on-die ECC is supported but not mandatory but I know for this chip it is mandatory despite what set_features returns. In order for this to work I need to set nand-ecc-mode = "on-die" in my dts. Ideally I'd like it to be automatic based on what the hardware can support but that may be asking too much at the moment. Here's a dump of the parameter page from the chip I have 00000000: 4f 4e 46 49 00 00 18 00 3f 00 00 00 00 00 00 00 ONFI....?....... 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000020: 4d 49 43 52 4f 4e 20 20 20 20 20 20 4d 54 32 39 MICRON MT29 00000030: 46 31 47 30 38 41 42 41 47 41 57 50 20 20 20 20 F1G08ABAGAWP 00000040: 2c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ,............... 00000050: 00 08 00 00 80 00 00 02 00 00 20 00 40 00 00 00 .......... .@... 00000060: 00 04 00 00 01 22 01 14 00 01 05 08 00 00 04 00 .....".......... 00000070: 08 01 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000080: 08 3f 00 3f 00 58 02 10 27 46 00 64 00 00 00 00 .?.?.X..'F.d.... 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000000a0: 00 00 00 00 01 00 00 00 00 02 04 80 01 81 04 03 ................ 000000b0: 02 01 1e 90 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 85 a6 ................ Series changes in v3: - No longer RFC - dropped "mtd: rawnand: micron: add ONFI_FEATURE_ON_DIE_ECC to supported features" which Boris has already picked up - dropped "mtd: rawnand: marvell: Support page size of 2048 with 8-bit ECC" since I can't test it. Series changes in v4: - based on top of http://patchwork.ozlabs.org/patch/932006/ Chris Packham (6): mtd: rawnand: marvell: Handle on-die ECC mtd: rawnand: add manufacturer fixup for ONFI parameter page mtd: rawnand: add defines for ONFI version bits mtd: rawnand: micron: add fixup for ONFI revision mtd: rawnand: micron: support 8/512 on-die ECC mtd: rawnand: micron: detect forced on-die ECC drivers/mtd/nand/raw/marvell_nand.c | 1 + drivers/mtd/nand/raw/nand_base.c | 14 +++-- drivers/mtd/nand/raw/nand_micron.c | 98 ++++++++++++++++++++++------- include/linux/mtd/rawnand.h | 14 +++++ 4 files changed, 98 insertions(+), 29 deletions(-)