From patchwork Wed Jun 7 11:52:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 103234 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1714804obh; Wed, 7 Jun 2017 04:55:42 -0700 (PDT) X-Received: by 10.84.237.9 with SMTP id s9mr27177355plk.255.1496836542500; Wed, 07 Jun 2017 04:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496836542; cv=none; d=google.com; s=arc-20160816; b=brB2egr3wj/T1mNV2reb6mUYSR9nWwNDOaESaK+CrWMUuowbEVRVcZodmraIUcYKRo dDAagw5j0TKwqz5+5q6DBwwA+OA4NM/MOU2t07ezaAvMziU6iHMBrfZPJs3Nbqj4LVCD j7YRHWKyw08TCO9xGoh3HmBetm0ZNOHLgyv4JRJ/26Otdqpo9VHEByiYxiOrT7Yan5v6 njlqoAArgF8Dz+XEkGewufdoRDjbZeWYaM54wkTbNadkrsdoH4VX5AYslaJ3KTTKWxS9 6mvXqPhG5SNHJFLXvZK22zgw2nYvDJixfAltCWc++l1sNRnH3NyjzrMWZZX5hxnaTpd2 taHA== 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=yUEF1Bi2JCjOEu2HXa97CPrt7xX5wVWrvRlJrmNsWlk=; b=lMNoLvmmsbBsUict0dqyr+wZ0EWjrY0TlRN35Y3h6vrhc3tFI8diYbKnfXK6TnmOEj fygGCJM2mmrA4C181S3yZNLGFAZDCtZ4U+XOs2DBYmz4Ghw/DksjSFTusgY/+xx/aaZg F9adjKVlIkZNdInbHi98o3PL6qsjv7I9elBAAzvsbYeK5cU36xZJ9xqZUdq9Ia+mQIbi y1IvsAVQlz/FHURsJ5Fr++Qi1gFMMmxo8ZNcDLvXGN2ICb8d2gLWi0nqm+4/KgizbqY1 0FM8heeXFeP3DObWym4h6YIitkDphZGFlcdRGRJoEuBl56JZrHc4CHeyDmcNgy/1pJyP RdfA== 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 e186si1569105pgc.163.2017.06.07.04.55.42; Wed, 07 Jun 2017 04:55:42 -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 S1751615AbdFGLz1 (ORCPT + 25 others); Wed, 7 Jun 2017 07:55:27 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:42432 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbdFGLzW (ORCPT ); Wed, 7 Jun 2017 07:55:22 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id v57BqjZm014276; Wed, 7 Jun 2017 20:53:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v57BqjZm014276 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1496836394; bh=yUEF1Bi2JCjOEu2HXa97CPrt7xX5wVWrvRlJrmNsWlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rMrE/3kLTD/sCIxaP+zG4+ACafhsI2ncxNOeNAJ+/C8JW6nwmL/lrmyLDWf5R375v 689GKgHPml2hP0N3tEy662K4T6aT0Al1XkS8ZWoLSvzU7aSP0+0e5e4Z4kPpHULaLH KHzhLSmU9OecYdoqLxuFf0dyW2dZzCMqwG5ZjiCyJaxETUMIdWY/j1TuEevb3UtT0S 5RP+kR3eOn4CpJ8244lci9teCGN3sMXi2t4o5a9xnzRcsR24zdkWi/uNZVt6JAI7E6 cp0SbIAM9gC/cUMwyXISUhwwL2/v3+OtF4zwKaqPH6WKcnw7vfYdfa4FxbuehfqzMX Y5LoODgWC6k5Q== 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 v5 23/23] mtd: nand: denali: enable bad block table scan Date: Wed, 7 Jun 2017 20:52:32 +0900 Message-Id: <1496836352-8016-24-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496836352-8016-1-git-send-email-yamada.masahiro@socionext.com> References: <1496836352-8016-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 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 904f859e19b6..43006c506a6b 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1247,29 +1247,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) { @@ -1412,13 +1389,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 */