From patchwork Wed Sep 29 17:43:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 66087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D6FF9B711C for ; Thu, 30 Sep 2010 03:46:18 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P10hj-0000kQ-0J; Wed, 29 Sep 2010 17:44:31 +0000 Received: from www.tglx.de ([62.245.132.106]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P10hg-0000j8-Np for linux-mtd@lists.infradead.org; Wed, 29 Sep 2010 17:44:29 +0000 Received: from Shiva.tec.linutronix.de (www.tglx.de [127.0.0.1]) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id o8THiAfs006339; Wed, 29 Sep 2010 19:44:24 +0200 From: Sebastian Andrzej Siewior To: linux-mtd@lists.infradead.org Subject: [PATCH 4/5] mtd/nand: introduce NAND_CREATE_EMPTY_BBT Date: Wed, 29 Sep 2010 19:43:53 +0200 Message-Id: <1285782234-32509-5-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1285782234-32509-1-git-send-email-bigeasy@linutronix.de> References: <1285782234-32509-1-git-send-email-bigeasy@linutronix.de> X-Virus-Scanned: clamav-milter 0.95.3 at www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on www.tglx.de X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100929_134428_997804_26455227 X-CRM114-Status: GOOD ( 17.16 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- Cc: tglx@linutronix.de, Sebastian Andrzej Siewior X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org it will create an empty BBT table without considering vendor's BBT information. Vendor's information may be unavailable if the NAND controller has a different DATA & OOB layout or if this information is allready purged. Signed-off-by: Sebastian Andrzej Siewior --- drivers/mtd/nand/nand_bbt.c | 3 ++- include/linux/mtd/bbm.h | 2 +- include/linux/mtd/nand.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 11e4204..fd3295e 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -994,7 +994,8 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc continue; /* Create the table in memory by scanning the chip(s) */ - create_bbt(mtd, buf, bd, chipsel); + if (!(this->options & NAND_CREATE_EMPTY_BBT)) + create_bbt(mtd, buf, bd, chipsel); td->version[i] = 1; if (md) diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index ba15b52..57cc0e6 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h @@ -84,7 +84,7 @@ struct nand_bbt_descr { #define NAND_BBT_PERCHIP 0x00000080 /* bbt has a version counter at offset veroffs */ #define NAND_BBT_VERSION 0x00000100 -/* Create a bbt if none axists */ +/* Create a bbt if none exists */ #define NAND_BBT_CREATE 0x00000200 /* Search good / bad pattern through all pages of a block */ #define NAND_BBT_SCANALLPAGES 0x00000400 diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 68caf20..c4b1055 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -218,6 +218,8 @@ typedef enum { /* If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch * the OOB area */ #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 +/* Create an empty BBT with no vendor information if the BBT is available */ +#define NAND_CREATE_EMPTY_BBT 0x00200000 /* Options set by nand scan */ /* Nand scan has allocated controller struct */