From patchwork Thu Mar 23 00:18:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95874 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp497785qgd; Wed, 22 Mar 2017 17:36:14 -0700 (PDT) X-Received: by 10.98.72.147 with SMTP id q19mr49717506pfi.253.1490229374004; Wed, 22 Mar 2017 17:36:14 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id x21si3542775pgf.149.2017.03.22.17.36.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 17:36:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org 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=sWVNKqbP2Fwb9WH8ApDSzgUE7GCNp9iUxrkKSDh9YNU=; b=CfOQt3nWGVuAdz9XH/lkMMSqnI u46uCFAFrzlsSv5Dqj3SAE52dRSOA+mIGJ/BuyWHV9KNITnRaGFKJF2lUKFzMUz8T8WaA97BOBNyG 2+KHQMyhygDvKOotpSWlhcMlLI/vxVy865WwQ6ObubZIUobxZnwwI+Vgl1CTXHyHTjMQgbk+GVTm/ L6eAsSMjEIXsyvx3FnvErXli5PDB47L3yHkQSqCQQDtbNB2kkAlJgFfiZWUSAzl+9G1ZDBDTcDXQo bZA+ReUrZRph2J9rgjXk4b3nmoOv1a0MtMmQQJjeJCIcelIreM1J8fR2EaNVYcUzVlxfEZOvSuXkE agTwqi1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqqjY-0007MI-Fe; Thu, 23 Mar 2017 00:36:08 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqqj0-0005Jp-P6 for linux-mtd@bombadil.infradead.org; Thu, 23 Mar 2017 00:35:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pIQbbUEb5+E+8Bh2fuBTjN/4iXVfvYZnN7YeT3mo+YA=; b=mbPpAr1i8mc45AQu8Uqsz30si Zd/oRmZpGTK/yW/nGL38nZGV7/JFWxdlcyy/Ml6HPDhEs3qjNBTapQpHyfVJUV+8pfKnuHY7Ri5Zc E/iPJa2Cq5i1EcCjQDekPXWyz1E8VFSQN6IxR0CcAEQ1mcfVXN8Jr2PgjA1ulBqclAVVDXHLqFrlR EGJAjhl1jyl4N7gVwgrBPqnzN7a5VacY4hxGcWoOcpfWnelfB2BB/8XlbOZHciKzOXYD0EFPyjJbr hBjhiOml7tvVaDOqJW4xmqc/AduCHyk6qSO3wLSJdq8AJ4Wa2TZDQg9bB+29n7laM0+Vr2aDsnl3R ywY55FBcA==; Received: from conuserg-09.nifty.com ([210.131.2.76]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqqTT-0001GU-AE for linux-mtd@lists.infradead.org; Thu, 23 Mar 2017 00:19:35 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-09.nifty.com with ESMTP id v2N0I4c5008011; Thu, 23 Mar 2017 09:18:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v2N0I4c5008011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490228318; bh=pIQbbUEb5+E+8Bh2fuBTjN/4iXVfvYZnN7YeT3mo+YA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ss0gJciCc4sB2uasuNZjZ8+JlVH3vpn+UuqSDDC5o9m372JRZjGcSwKBLmb6gZMLe +KL65BIAHKmNt4Ru3t1IU9mc8mECHmEq5X+9erhwQiD3XmXqbuhNNQR6NBQM4Golyg i0dat/JD1AP7/0Am2m6gEHW0JuHUmrp9tY7seDDwm89eBiUPaGGuTfZDwSxcIQrfhF gcELYKGc6VZ0ZmRxBQhYJJ3eh7egepsEsBKFtPa41TlonTA8sQzqgerrXLe1vu5D7C 3RXGqobnALqP/LFl+Xzl9kGIuEYpM3ctW2n1+oUs3sY9K0Xi6fcG0ur3owcYarj/TZ QpIKneYS7Az5Q== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 53/53] mtd: nand: denali: enable bad block table scan Date: Thu, 23 Mar 2017 09:18:02 +0900 Message-Id: <1490228282-10805-27-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490228282-10805-1-git-send-email-yamada.masahiro@socionext.com> References: <1490228282-10805-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170323_001931_918369_CC296A4E X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 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: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Dinh Nguyen , Enrico Jorns , Artem Bityutskiy , Marek Vasut , Masahiro Yamada , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , David Woodhouse , Rob Herring , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Now this driver is ready to remove NAND_SKIP_BBTSCAN. The BBT descriptors in denali.c are equivalent to the ones in nand_bbt.c. There is no need to duplicate the equivalent structures. The with-oob decriptors do not work for this driver anyway. The bbt_pattern (offs = 8) and the version (veroffs = 12) area overlaps the ECC area. Set NAND_BBT_NO_OOB flag to use the no_oob variant of the BBT descriptors. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mtd/nand/denali.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 28622a9..9cfc374 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1207,29 +1207,6 @@ static const struct mtd_ooblayout_ops denali_ooblayout_ops = { .free = denali_ooblayout_free, }; -static uint8_t bbt_pattern[] = {'B', 'b', 't', '0' }; -static uint8_t mirror_pattern[] = {'1', 't', 'b', 'B' }; - -static struct nand_bbt_descr bbt_main_descr = { - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE - | NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP, - .offs = 8, - .len = 4, - .veroffs = 12, - .maxblocks = 4, - .pattern = bbt_pattern, -}; - -static struct nand_bbt_descr bbt_mirror_descr = { - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE - | NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP, - .offs = 8, - .len = 4, - .veroffs = 12, - .maxblocks = 4, - .pattern = mirror_pattern, -}; - /* initialize driver data structures */ static void denali_drv_init(struct denali_nand_info *denali) { @@ -1366,13 +1343,9 @@ int denali_init(struct denali_nand_info *denali) * bad block management. */ - /* Bad block management */ - chip->bbt_td = &bbt_main_descr; - chip->bbt_md = &bbt_mirror_descr; - - /* skip the scan for now until we have OOB read and write support */ chip->bbt_options |= NAND_BBT_USE_FLASH; - chip->options |= NAND_SKIP_BBTSCAN; + chip->bbt_options |= NAND_BBT_NO_OOB; + chip->ecc.mode = NAND_ECC_HW_SYNDROME; /* no subpage writes on denali */