From patchwork Tue Jun 13 05:04:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 103696 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp236124qgd; Mon, 12 Jun 2017 22:07:35 -0700 (PDT) X-Received: by 10.84.218.134 with SMTP id r6mr60540642pli.288.1497330454973; Mon, 12 Jun 2017 22:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497330454; cv=none; d=google.com; s=arc-20160816; b=fWibhN0ekoieuujHTorsS7/B518KpDqYK4RO4ctj0lJL4X/0NxcMj0c+MGCwWhFct1 lYUNTiR+WTuCtv3Bb3IEMIUhA7+ojPNQjRtqqKOayb7tpN7XHv+vqFrXSUDoI8cw9u3c Y1HuhrTkVjGR/GgLTFMa9oJMDZvd2OnUUhN3+PEheLldNHyd1zF4Mr/epSsZl988/6Cn fzskc838MM2o7TV38gyGdxg7Z6ziTCaDI7VjJvdokUBYjGB0WnlQA5FIaCBNlHCi+Fmt IW+16D6B8edGKwwyFcohUfePTy1bwWjylUFBnC/5LjPqAvoV8U0KTS+2yecS9u3Aq7kb 24fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=blxYdIg4H1+O3T/OAy1KBhvJkZRzdVvCH70HiChkKYo=; b=KwZyCcZ66sWo6H2JPEWhBMR0jJveHz03lUgSIhKYWYX4sTlbV++WbY/dwQQg48hZKn yI8pVQ5nSJb6SJRIBp5zugksTjZIk9+9YuoprGayMWeQO307+hPAXvn41yvvJDxAIBcm 7CutB6yHW5AH+Au3zX1XizgmO4oztq9aodHAY6UnyTDn17P1fUlE/H0QHd+uHspr/vMP 720yB8mGzv7WLjP1uLGgzkIu8575fVcwdwAKPF+WQAuKXjSDT/61T1ywwBU4sv66zy9S NsKj6iOsZXPW+18VVbchKSkcRSYf8f+DldHEmnRL0oD4RqwszGvdY+P5HYdi0s+BjnPF 7fcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si8488967pli.110.2017.06.12.22.07.34; Mon, 12 Jun 2017 22:07:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbdFMFHU (ORCPT + 25 others); Tue, 13 Jun 2017 01:07:20 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:47054 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbdFMFHR (ORCPT ); Tue, 13 Jun 2017 01:07:17 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id v5D54ENv023096; Tue, 13 Jun 2017 14:04:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v5D54ENv023096 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1497330275; bh=blxYdIg4H1+O3T/OAy1KBhvJkZRzdVvCH70HiChkKYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmDmK/+AEvIWZmqfMgk5PByhOSiYaNqZAq284HOuycQa3014+BOpqO2RJe1RvXXWn 3GVxs7Z/da59pJ06ivlmuTqZBTZG0R+KJDNK5jcsaR/9QUJ5l/+oduQFbgbJQrkXUc HbeFV6g1+Y+FQm7NEtgickC4srTS0QDI+6UfnkWdKi3F5GwD8YAlGajjzI8amn5bqc C5/XIvFNV0qAijPZ9K3CWPRgqZR4dhHDIecE6S0/A1Jya3DkqsY18aiwgkOivBMwGC /Wnre2iRxhGcY1kl+4a58FxzV65AkM4FtCPIY63itKbAZQw/sWU7VDtk7GcSeJS5Pj 80HK1J+Zb7W2Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Cc: Enrico Jorns , Artem Bityutskiy , Dinh Nguyen , Boris Brezillon , Marek Vasut , David Woodhouse , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Masahiro Yamada , Cyrille Pitchen , linux-kernel@vger.kernel.org, Brian Norris , Richard Weinberger Subject: [PATCH v6 17/18] mtd: nand: denali: enable bad block table scan Date: Tue, 13 Jun 2017 14:04:09 +0900 Message-Id: <1497330250-17348-18-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497330250-17348-1-git-send-email-yamada.masahiro@socionext.com> References: <1497330250-17348-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - Newly added drivers/mtd/nand/denali.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) -- 2.7.4 diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index d37fb82f39ed..3bcc886579c8 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1203,29 +1203,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) { @@ -1369,13 +1346,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 */