nand: make bbt support optional
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
a1e9c15260
commit
b672f87cc0
|
@ -41,6 +41,14 @@ config NAND_INFO
|
|||
Show informational strings about the vendor and nand flash type
|
||||
during startup
|
||||
|
||||
config NAND_BBT
|
||||
bool
|
||||
default y
|
||||
prompt "support bad block tables"
|
||||
help
|
||||
Say y here to include support for bad block tables. This speeds
|
||||
up the process of checking for bad blocks
|
||||
|
||||
config NAND_IMX
|
||||
bool
|
||||
prompt "i.MX NAND driver"
|
||||
|
|
|
@ -6,7 +6,8 @@ obj-$(CONFIG_NAND_ECC_SOFT) += nand_ecc.o nand_swecc.o
|
|||
obj-$(CONFIG_NAND_ECC_HW) += nand_hwecc.o
|
||||
obj-$(CONFIG_NAND_ECC_HW_SYNDROME) += nand_hwecc_syndrome.o
|
||||
obj-$(CONFIG_MTD_NAND_IDS) += nand_ids.o
|
||||
obj-$(CONFIG_NAND) += nand_base.o nand_bbt.o
|
||||
obj-$(CONFIG_NAND) += nand_base.o
|
||||
obj-$(CONFIG_NAND_BBT) += nand_bbt.o
|
||||
|
||||
obj-$(CONFIG_MTD_NAND_DISKONCHIP) += diskonchip.o
|
||||
obj-$(CONFIG_MTD_NAND_NOMADIK) += nomadik_nand.o
|
||||
|
|
|
@ -281,11 +281,14 @@ int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
|
|||
{
|
||||
struct nand_chip *chip = mtd->priv;
|
||||
|
||||
#ifdef CONFIG_NAND_BBT
|
||||
if (!chip->bbt)
|
||||
return chip->block_bad(mtd, ofs, getchip);
|
||||
|
||||
/* Return info from the table */
|
||||
return nand_isbad_bbt(mtd, ofs, allowbbt);
|
||||
#else
|
||||
return chip->block_bad(mtd, ofs, getchip);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1028,9 +1031,10 @@ static void nand_set_defaults(struct nand_chip *chip, int busw)
|
|||
chip->read_buf = busw ? nand_read_buf16 : nand_read_buf;
|
||||
if (!chip->verify_buf)
|
||||
chip->verify_buf = busw ? nand_verify_buf16 : nand_verify_buf;
|
||||
#ifdef CONFIG_NAND_BBT
|
||||
if (!chip->scan_bbt)
|
||||
chip->scan_bbt = nand_default_bbt;
|
||||
|
||||
#endif
|
||||
if (!chip->controller) {
|
||||
chip->controller = &chip->hwcontrol;
|
||||
}
|
||||
|
@ -1428,9 +1432,12 @@ int nand_scan_tail(struct mtd_info *mtd)
|
|||
/* Check, if we should skip the bad block table scan */
|
||||
if (chip->options & NAND_SKIP_BBTSCAN)
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_NAND_BBT
|
||||
/* Build bad block table */
|
||||
return chip->scan_bbt(mtd);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue