mtd/drivers/mtd/nand nand_bbt.c,1.13,1.14

gleixner at infradead.org gleixner at infradead.org
Fri Jun 4 04:34:42 EDT 2004


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv29803

Modified Files:
	nand_bbt.c 
Log Message:
Scan all pages when creating a flash table. Add check option for second page. Signed-off-by: Thomas Gleixner <tglx at linutronix.de>

Index: nand_bbt.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_bbt.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- nand_bbt.c	1 Jun 2004 19:43:25 -0000	1.13
+++ nand_bbt.c	4 Jun 2004 08:34:39 -0000	1.14
@@ -246,8 +246,12 @@
 
 	if (bd->options & NAND_BBT_SCANALLPAGES)
 		len = 1 << (this->erase_shift - this->page_shift);
-	else
-		len = 1;
+	else {
+		if (bd->options & NAND_BBT_SCAN2NDPAGE)
+			len = 1;
+		else	
+			len = 2;
+	}
 	scanlen	= mtd->oobblock + mtd->oobsize;
 	readlen = len * mtd->oobblock;
 	ooblen = len * mtd->oobsize;
@@ -879,14 +883,14 @@
 };
 
 static struct nand_bbt_descr smallpage_flashbased = {
-	.options = NAND_BBT_SCANEMPTY,
+	.options = NAND_BBT_SCANEMPTY | NAND_BBT_SCANALLPAGES,
 	.offs = 5,
 	.len = 1,
 	.pattern = scan_ff_pattern
 };
 
 static struct nand_bbt_descr largepage_flashbased = {
-	.options = NAND_BBT_SCANEMPTY,
+	.options = NAND_BBT_SCANEMPTY | NAND_BBT_SCANALLPAGES,
 	.offs = 0,
 	.len = 2,
 	.pattern = scan_ff_pattern
@@ -930,7 +934,7 @@
  * nand_default_bbt - [NAND Interface] Select a default bad block table for the device 
  * @mtd:	MTD device structure
  *
- * This function tries selects the default bad block table
+ * This function selects the default bad block table
  * support for the device and calls the nand_scan_bbt function
  *
 */
@@ -971,8 +975,8 @@
 		this->bbt_md = NULL;
 		if (mtd->oobblock > 512)
 			return nand_scan_bbt (mtd, &largepage_memorybased);
-		else	
-			return nand_scan_bbt (mtd, &smallpage_memorybased);			
+		else
+			return nand_scan_bbt (mtd, &smallpage_memorybased);
 	}
 }
 





More information about the linux-mtd-cvs mailing list