From patchwork Sat May 30 17:41:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 27882 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 54996B7066 for ; Sun, 31 May 2009 18:57:08 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MAgns-0004v3-Iz; Sun, 31 May 2009 08:54:04 +0000 Received: from aeryn.fluff.org.uk ([87.194.8.8] helo=teyla.home.fluff.org) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MATFG-0000Si-MQ for linux-mtd@lists.infradead.org; Sat, 30 May 2009 18:25:31 +0000 Received: from ben by teyla.home.fluff.org with local (Exim 4.69) (envelope-from ) id 1MASYs-0005gY-Lr; Sat, 30 May 2009 18:41:38 +0100 From: Ben Dooks To: linux-mtd@lists.infradead.org Subject: [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND Date: Sat, 30 May 2009 18:41:36 +0100 Message-Id: <1243705298-21814-10-git-send-email-ben-linux@fluff.org> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1243705298-21814-9-git-send-email-ben-linux@fluff.org> References: <1243705298-21814-1-git-send-email-ben-linux@fluff.org> <1243705298-21814-2-git-send-email-ben-linux@fluff.org> <1243705298-21814-3-git-send-email-ben-linux@fluff.org> <1243705298-21814-4-git-send-email-ben-linux@fluff.org> <1243705298-21814-5-git-send-email-ben-linux@fluff.org> <1243705298-21814-6-git-send-email-ben-linux@fluff.org> <1243705298-21814-7-git-send-email-ben-linux@fluff.org> <1243705298-21814-8-git-send-email-ben-linux@fluff.org> <1243705298-21814-9-git-send-email-ben-linux@fluff.org> X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Sun, 31 May 2009 04:53:59 -0400 Cc: Michel Pollet , Ben Dooks 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: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Michel Pollet Added a flag to allow the machine code to tell the NAND subsystem that it should try to pickup a BBT from the flash, and also skip the NAND full scan at startup. Signed-off-by: Michel Pollet Signed-off-by: Ben Dooks --- arch/arm/plat-s3c/include/plat/nand.h | 5 +++++ drivers/mtd/nand/s3c2410.c | 6 ++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-s3c/include/plat/nand.h index 350ec95..bed4a51 100644 --- a/arch/arm/plat-s3c/include/plat/nand.h +++ b/arch/arm/plat-s3c/include/plat/nand.h @@ -13,6 +13,10 @@ /** * struct s3c2410_nand_set - define a set of one or more nand chips * @disable_ecc: Entirely disable ECC - Dangerous + * @flash_bbt: Openmoko u-boot can create a Bad Block Table + * Setting this flag will allow the kernel to + * look for it at boot time and also skip the NAND + * scan. * @nr_chips: Number of chips in this set * @nr_partitions: Number of partitions pointed to be partitoons (or zero) * @name: Name of set (optional) @@ -25,6 +29,7 @@ */ struct s3c2410_nand_set { unsigned int disable_ecc:1; + unsigned int flash_bbt:1; int nr_chips; int nr_partitions; diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index ef56652..d315b51 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c @@ -845,6 +845,12 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, dev_info(info->device, "NAND ECC UNKNOWN\n"); break; } + + /* If you use u-boot BBT creation code, specifying this flag will + * let the kernel fish out the BBT from the NAND, and also skip the + * full NAND scan that can take 1/2s or so. Little things... */ + if (set->flash_bbt) + chip->options |= NAND_USE_FLASH_BBT | NAND_SKIP_BBTSCAN; } /**