Commit 453281a9 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by David Woodhouse

mtd: nand: introduce NAND_CREATE_EMPTY_BBT

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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 7cba7b14
...@@ -999,7 +999,8 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc ...@@ -999,7 +999,8 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc
continue; continue;
/* Create the table in memory by scanning the chip(s) */ /* 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; td->version[i] = 1;
if (md) if (md)
......
...@@ -84,7 +84,7 @@ struct nand_bbt_descr { ...@@ -84,7 +84,7 @@ struct nand_bbt_descr {
#define NAND_BBT_PERCHIP 0x00000080 #define NAND_BBT_PERCHIP 0x00000080
/* bbt has a version counter at offset veroffs */ /* bbt has a version counter at offset veroffs */
#define NAND_BBT_VERSION 0x00000100 #define NAND_BBT_VERSION 0x00000100
/* Create a bbt if none axists */ /* Create a bbt if none exists */
#define NAND_BBT_CREATE 0x00000200 #define NAND_BBT_CREATE 0x00000200
/* Search good / bad pattern through all pages of a block */ /* Search good / bad pattern through all pages of a block */
#define NAND_BBT_SCANALLPAGES 0x00000400 #define NAND_BBT_SCANALLPAGES 0x00000400
......
...@@ -223,6 +223,8 @@ typedef enum { ...@@ -223,6 +223,8 @@ typedef enum {
* the OOB area. * the OOB area.
*/ */
#define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 #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 */ /* Options set by nand scan */
/* Nand scan has allocated controller struct */ /* Nand scan has allocated controller struct */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment