summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2015-01-10 13:27:27 -0500
committerTom Rini <trini@ti.com>2015-01-10 13:27:27 -0500
commitb8c702263266379b12ea06bfe9bf2885710975eb (patch)
tree961c9d46a7de7ee32709ddfb8b783f4796ac4d7c
parent4c8c485ad9249e1ca1822474954b78799ca937e9 (diff)
parentab37b76d5d7879009565d1d1a2be6de63f86a674 (diff)
downloadu-boot-imx-b8c702263266379b12ea06bfe9bf2885710975eb.zip
u-boot-imx-b8c702263266379b12ea06bfe9bf2885710975eb.tar.gz
u-boot-imx-b8c702263266379b12ea06bfe9bf2885710975eb.tar.bz2
Merge git://git.denx.de/u-boot-nand-flash
-rw-r--r--drivers/mtd/nand/nand_base.c11
-rw-r--r--drivers/mtd/nand/nand_util.c4
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 70e780c..63bdf65 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -634,9 +634,10 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
{
struct nand_chip *chip = mtd->priv;
- if (!(chip->options & NAND_BBT_SCANNED)) {
- chip->scan_bbt(mtd);
+ if (!(chip->options & NAND_SKIP_BBTSCAN) &&
+ !(chip->options & NAND_BBT_SCANNED)) {
chip->options |= NAND_BBT_SCANNED;
+ chip->scan_bbt(mtd);
}
if (!chip->bbt)
@@ -2905,7 +2906,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
WATCHDOG_RESET();
/* Check if we have a bad block, we do not erase bad blocks! */
- if (nand_block_checkbad(mtd, ((loff_t) page) <<
+ if (!instr->scrub && nand_block_checkbad(mtd, ((loff_t) page) <<
chip->page_shift, 0, allowbbt)) {
pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
__func__, page);
@@ -4325,10 +4326,6 @@ int nand_scan_tail(struct mtd_info *mtd)
if (!mtd->bitflip_threshold)
mtd->bitflip_threshold = mtd->ecc_strength;
- /* Check, if we should skip the bad block table scan */
- if (chip->options & NAND_SKIP_BBTSCAN)
- chip->options |= NAND_BBT_SCANNED;
-
return 0;
}
EXPORT_SYMBOL(nand_scan_tail);
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 024f6fb..afdd160 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -91,6 +91,7 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
kfree(chip->bbt);
}
chip->bbt = NULL;
+ chip->options &= ~NAND_BBT_SCANNED;
}
for (erased_length = 0;
@@ -179,9 +180,6 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
if (!opts->quiet)
printf("\n");
- if (opts->scrub)
- chip->scan_bbt(meminfo);
-
return 0;
}