From patchwork Mon Jun 18 04:52:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 930683 X-Patchwork-Delegate: miquel.raynal@bootlin.com 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="G17krsyD"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="g/l8Iy8D"; 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 418JfB1zYgz9s19 for ; Mon, 18 Jun 2018 14:54:10 +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: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=ex+FAfmriPmPnEmwgPwcNLyPO9x2jh08QX5b3PSGh8A=; b=G17krsyDFI6OmbvFMFDg0oZk2O fR69FIwJT9lBCb91U2701A9zrIgCFbD6TKEQit64LN6kkuf9Jwi3JKJzgz0E/PtJpwv0pBGcsjBbp hHuaIXmtPkStULCJottEueVw0F/rTNQ2LACAAG42FYjjbFRwJN2si/V80UMsThZeHdmsV+OxsoSRa Lhkp427WITEkj/CXUNBcuKQh1KrM8CED3oDdo19p2sxcinWpyt6to5X0qhP1JnyEPhFooILaEOsBG 2JZ7I8vuQ+FeKaE0u4pvj3oWU8vHN0tfF2UduMyGQAerIjA2CZvip1echypJLOQX4/fK43f3VNxMn aWSVnxug==; 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 1fUmAx-0003gM-FJ; Mon, 18 Jun 2018 04:53:59 +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 1fUmAY-0003Ri-U9 for linux-mtd@lists.infradead.org; Mon, 18 Jun 2018 04:53:37 +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 2241D800E6; Mon, 18 Jun 2018 16:53:07 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1529297587; bh=UlAY+e3cK3Ui1RBOrDe7i2oJrA7T6AjIQSnNt6o87tI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g/l8Iy8DyG7QhpwUHCmu0wf5S5iutavF/rwHwr8joT4bO2sl6uuZSXQKFqjD5qWa+ Fqh3kYtEF/jXeTO0JTMIifpShmOV0gZZg7vz+PTSs5HriseYwX21GqI5qUURgrneBH fMdjzY8YfU18VrF3wV0iDG3gjmxCZpuJq0vYb2kw= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 18 Jun 2018 16:53:06 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 02DE613EED3; Mon, 18 Jun 2018 16:53:10 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id DFA6F1E2626; Mon, 18 Jun 2018 16:53:06 +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: [RFC PATCH 1/2] mtd: rawnand: handle ONFI revision number field being 0 Date: Mon, 18 Jun 2018 16:52:54 +1200 Message-Id: <20180618045255.8015-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> References: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180617_215335_175812_CD7F0498 X-CRM114-Status: GOOD ( 11.94 ) 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Richard Weinberger , Chris Packham , linux-kernel@vger.kernel.org, Marek Vasut MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some Micron NAND chips (MT29F1G08ABAFAWP-ITE:F) report 00 00 for the revision number field of the ONFI parameter page. Rather than rejecting these outright assume ONFI version 1.0 if the revision number is 00 00. Signed-off-by: Chris Packham --- At the moment I haven't qualified this check on anything, I should probably at least include vendor == MICRON. As far as I can tell revision number == 0 is not permitted by the ONFI spec but this wouldn't be the first time a vendor has ignored a spec. On the other hand maybe I'm reading the spec wrong and someone here will say "oh 0 means ...". drivers/mtd/nand/raw/nand_base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 0cd3e216b95c..1691c7005ae4 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5184,6 +5184,8 @@ static int nand_flash_detect_onfi(struct nand_chip *chip) chip->parameters.onfi.version = 20; else if (val & (1 << 1)) chip->parameters.onfi.version = 10; + else if (val == 0) + chip->parameters.onfi.version = 10; if (!chip->parameters.onfi.version) { pr_info("unsupported ONFI version: %d\n", val); From patchwork Mon Jun 18 04:52:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 930688 X-Patchwork-Delegate: miquel.raynal@bootlin.com 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="Nab55a5p"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="fdVSfxE1"; 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 418Jfl44KLz9s19 for ; Mon, 18 Jun 2018 14:54:39 +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: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=K5TunY+yvkT8UwW9/vi2MZUCm2/WrlW0zGAPtpSxUgY=; b=Nab55a5p0scGMQMr1pQsq1TvWM BohM65lje+8VGpirDrqDOf6uv1nqr8EH3ZzzMdNWO7URsbpA+QELQmV4aMDzTSr0DZ1RNER84jYFN gmz0rTO4OO/eCEIVOvxkRBP76wUanVa54lwpGwgMhLPP84JGQdXSsHUve9bCYYf3Zs4jDATa92j58 AoT2Fnz4OkFXWUMRjuSv/rLoJq5qsMKTACJIhIDkrIzxQhc/tBL/s5DHRhSn7QCJSlFQkpo9+V5Ez 4Xg90daDW8CVDca93LrYPHnsqDd29lV3nQ6h4Am+hlykfAaQ3vGpUdHoGx+kvFu8RcVmFeVnhu5kv fuieGg3A==; 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 1fUmBP-0003x9-8A; Mon, 18 Jun 2018 04:54:27 +0000 Received: from gate2.alliedtelesis.co.nz ([2001:df5:b000:5::4]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUmAY-0003Rj-Tt for linux-mtd@lists.infradead.org; Mon, 18 Jun 2018 04:53:39 +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 B71B48365B; Mon, 18 Jun 2018 16:53:09 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1529297589; bh=MsHRKkmMBU8yiP7oseOrcgnrCHuxg5q8zeQjSqwVdy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fdVSfxE1pR9q1xc1WqEiXz6X2kf7EaWJqSCF3gzML+bQzC2HhQq/tzjjbkMnHiSsY +YsrtLWHJl7Iy96BHGypNVxGFBhswihYnPHkyYx8oBAHzZUQBZLxwkPmSXsRShSZq1 Nf0gAteMJ8cMg2pdNVQzgcPJcxWjKtOlZb0cm8bY= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 18 Jun 2018 16:53:08 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 2E8D613EED3; Mon, 18 Jun 2018 16:53:12 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 1881B1E2626; Mon, 18 Jun 2018 16:53:09 +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: [RFC PATCH 2/2] mtd: rawnand: marvell: Support page size of 2048 with 8-bit ECC Date: Mon, 18 Jun 2018 16:52:55 +1200 Message-Id: <20180618045255.8015-3-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> References: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180617_215335_182971_8E9462D8 X-CRM114-Status: GOOD ( 10.62 ) 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 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_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 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: Richard Weinberger , Chris Packham , linux-kernel@vger.kernel.org, Marek Vasut MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The MT29F1G08ABAFAWP-ITE:F chip has 2048 byte pages and requires a minimum ECC strength of 8-bits. Allow for this combination of requirements using the marvell_nand controller. Signed-off-by: Chris Packham --- I've tried to follow the recommended AN-379 from Marvell. They do seem to have information that covers this particular set of chip requirements but I'm not confident I've translated their code correctly into the current marvell_nand implementation. This is enough to make the nand_scan work but ubi/ubifs fails to initialise and/or mount so I may have something completely wrong. This may also be because this chip has internal ECC enabled which cannot be disabled. I turned up an old thread on this from April last year[1] but I didn't see anything resulting from this. Can this combination of ECC implementations even co-exist? [1] - http://lists.infradead.org/pipermail/linux-mtd/2017-April/073370.html drivers/mtd/nand/raw/marvell_nand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c index ebb1d141b900..5712df553a8e 100644 --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c @@ -217,6 +217,7 @@ static const struct marvell_hw_ecc_layout marvell_nfc_layouts[] = { MARVELL_LAYOUT( 512, 512, 1, 1, 1, 512, 8, 8, 0, 0, 0), MARVELL_LAYOUT( 2048, 512, 1, 1, 1, 2048, 40, 24, 0, 0, 0), MARVELL_LAYOUT( 2048, 512, 4, 1, 1, 2048, 32, 30, 0, 0, 0), + MARVELL_LAYOUT( 2048, 512, 8, 1, 1, 1024, 0, 30, 1024, 32, 30), MARVELL_LAYOUT( 4096, 512, 4, 2, 2, 2048, 32, 30, 0, 0, 0), MARVELL_LAYOUT( 4096, 512, 8, 5, 4, 1024, 0, 30, 0, 64, 30), };