From patchwork Mon May 25 15:44:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon polette X-Patchwork-Id: 27617 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 bilbo.ozlabs.org (Postfix) with ESMTPS id C40BBB6F35 for ; Tue, 26 May 2009 01:48:28 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M8cLq-0007IF-Np; Mon, 25 May 2009 15:44:34 +0000 Received: from mail-ew0-f173.google.com ([209.85.219.173]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M8cLh-0007Hv-5q for linux-mtd@lists.infradead.org; Mon, 25 May 2009 15:44:32 +0000 Received: by ewy21 with SMTP id 21so2834429ewy.18 for ; Mon, 25 May 2009 08:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=BSHlG0fn4xpFpAT56kiQ+3wbSQtoMAMiku/Qx15KkJE=; b=LbuSpvyS9gG1SRjWVvw2zAR+ZuFDfDNwZ99tpPqyNcSuBdaiBQNrwYfh8JLbKOXWQB pvwQFG2BYVKB5clkI5SpS28z0PMz550kpCKUVtB5kJhiQifmzefb4QHyVXyXlGGuQo3b WBrFtqUlcsJWFH9yMX8igskYVRAtwGa8nVM40= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XI2y9TUHYZaAXdaYeWFNYo4WXUKCcJZl2MVwtaFg0jGR7/qXwhvEinop3w56iVjuTC mvoTQCiieQZ22keeYqFHLIEPMtMHs2W1x8aLgAEuE2Nr1iDu31qdtN9uNFPpkKs4nEH6 s4ShFgl2mkogOgGabnC6QMbTxeC2lWTfOwN6A= MIME-Version: 1.0 Received: by 10.216.44.211 with SMTP id n61mr1903204web.133.1243266262663; Mon, 25 May 2009 08:44:22 -0700 (PDT) Date: Mon, 25 May 2009 17:44:22 +0200 Message-ID: <72795ccb0905250844w13ed9798me95d70614050f676@mail.gmail.com> Subject: [PATCH] mtd: Nand Atmel: add On Flash BBT support From: simon polette To: linux-mtd , linux-arm-kernel@lists.arm.linux.org.uk X-Spam-Score: 0.0 (/) Cc: spolette@adetelgroup.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi, Here is a patch which add support for On Flash Bad Block Table on AT91 and AVR32 devices. Signed-off-by: Simon Polette --- drivers/mtd/nand/Kconfig | 9 +++++++++ drivers/mtd/nand/atmel_nand.c | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) if (nand_scan_ident(mtd, 1)) { diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 890936d..c860688 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -333,6 +333,15 @@ config MTD_NAND_ATMEL_ECC_NONE endchoice +config MTD_NAND_ATMEL_FLASH_BBT + bool "Use On-Flash Bad Block Table" + depends on MTD_NAND_ATMEL + help + This enables the On-Flash BBT, which mean that the bad blocks + will be scanned one time then the BBT will be stored + in flash, so scanning Nand flash for bad blocks will be no more + necessary for the next boots. + config MTD_NAND_PXA3xx tristate "Support for NAND flash devices on PXA3xx" depends on MTD_NAND && PXA3xx diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 47a33ce..dca19dd 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -464,6 +464,9 @@ static int __init atmel_nand_probe(struct platform_device *pdev) goto err_no_card; } } +#ifdef CONFIG_MTD_NAND_ATMEL_FLASH_BBT + nand_chip->options |= NAND_USE_FLASH_BBT; +#endif /* first scan to find the device and get the page size */