[MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jun 8 07:59:02 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9db41f9edcb87ae050fcb171c44be7f212728d54
Commit:     9db41f9edcb87ae050fcb171c44be7f212728d54
Parent:     a4536b19df92adda215f6fc225b52dc4cee4cf83
Author:     Michel Pollet <buserror at gmail.com>
AuthorDate: Wed May 13 16:54:14 2009 +0100
Committer:  Ben Dooks <ben-linux at fluff.org>
CommitDate: Mon Jun 8 12:10:36 2009 +0100

    [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND
    
    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 <buserror at gmail.com>
    Signed-off-by: Ben Dooks <ben-linux at fluff.org>
---
 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 9356516..18f9588 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 by @partitions
  * @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;
 }
 
 /**



More information about the linux-mtd-cvs mailing list