diff options
-rw-r--r-- | drivers/mtd/nand/mxs_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 5 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c index 92005448d2e..d3c420afde6 100644 --- a/drivers/mtd/nand/mxs_nand.c +++ b/drivers/mtd/nand/mxs_nand.c @@ -1181,7 +1181,7 @@ int board_nand_init(struct nand_chip *nand) memset(&fake_ecc_layout, 0, sizeof(fake_ecc_layout)); nand_set_controller_data(nand, nand_info); - nand->options |= NAND_NO_SUBPAGE_WRITE; + nand->options |= NAND_NO_SUBPAGE_WRITE | NAND_NEED_BBTSCAN; nand->cmd_ctrl = mxs_nand_cmd_ctrl; diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d9e5fc95f5c..9d1ab57e20a 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -4216,6 +4216,11 @@ int nand_scan_tail(struct mtd_info *mtd) if (!mtd->bitflip_threshold) mtd->bitflip_threshold = DIV_ROUND_UP(mtd->ecc_strength * 3, 4); + if (chip->options & NAND_NEED_BBTSCAN) { + chip->options |= NAND_BBT_SCANNED; + return chip->scan_bbt(mtd); + } + return 0; } EXPORT_SYMBOL(nand_scan_tail); diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index d55807b2e27..d93989663b1 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -224,6 +224,8 @@ typedef enum { * kmap'ed, vmalloc'ed highmem buffers being passed from upper layers */ #define NAND_USE_BOUNCE_BUFFER 0x00100000 +/* Chip needs BBT scan */ +#define NAND_NEED_BBTSCAN 0x00200000 /* Options set by nand scan */ /* bbt has already been read */ |