Skip to content

Commit

Permalink
mtd: nand: introduce NAND_CREATE_EMPTY_BBT
Browse files Browse the repository at this point in the history
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 this information may be
allready purged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and David Woodhouse committed Oct 24, 2010
1 parent 7cba7b1 commit 453281a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,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)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mtd/bbm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ typedef enum {
* 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 */
Expand Down

0 comments on commit 453281a

Please sign in to comment.