summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/nand_imx.c11
-rw-r--r--drivers/mtd/nand/nand_imx_bbm.c4
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index 1a065cb46f..8e1558da6b 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -1072,7 +1072,7 @@ static uint8_t bbt_pattern[] = { 'B', 'b', 't', '0' };
static uint8_t mirror_pattern[] = { '1', 't', 'b', 'B' };
static struct nand_bbt_descr bbt_main_descr = {
- .options = NAND_BBT_LASTBLOCK
+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_WRITE
| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
.offs = 0,
.len = 4,
@@ -1082,7 +1082,7 @@ static struct nand_bbt_descr bbt_main_descr = {
};
static struct nand_bbt_descr bbt_mirror_descr = {
- .options = NAND_BBT_LASTBLOCK
+ .options = NAND_BBT_LASTBLOCK | NAND_BBT_WRITE
| NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
.offs = 0,
.len = 4,
@@ -1312,8 +1312,8 @@ static int __init imxnd_probe(struct device_d *dev)
if (nfc_is_v21())
writew(NFC_V2_SPAS_SPARESIZE(64), host->regs + NFC_V2_SPAS);
} else {
- bbt_main_descr.options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
- bbt_mirror_descr.options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
+ bbt_main_descr.options |= NAND_BBT_CREATE;
+ bbt_mirror_descr.options |= NAND_BBT_CREATE;
if (nfc_is_v21())
writew(NFC_V2_SPAS_SPARESIZE(16), host->regs + NFC_V2_SPAS);
@@ -1330,9 +1330,6 @@ static int __init imxnd_probe(struct device_d *dev)
if (host->flash_bbt && this->bbt_td->pages[0] == -1 && this->bbt_md->pages[0] == -1) {
dev_warn(dev, "no BBT found. create one using the imx_nand_bbm command\n");
- } else {
- bbt_main_descr.options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
- bbt_mirror_descr.options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
}
add_mtd_nand_device(mtd, "nand");
diff --git a/drivers/mtd/nand/nand_imx_bbm.c b/drivers/mtd/nand/nand_imx_bbm.c
index c005482b06..582b4c069a 100644
--- a/drivers/mtd/nand/nand_imx_bbm.c
+++ b/drivers/mtd/nand/nand_imx_bbm.c
@@ -124,8 +124,8 @@ static int attach_bbt(struct mtd_info *mtd, void *bbt)
{
struct nand_chip *chip = mtd_to_nand(mtd);
- chip->bbt_td->options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
- chip->bbt_md->options |= NAND_BBT_WRITE | NAND_BBT_CREATE;
+ chip->bbt_td->options |= NAND_BBT_CREATE;
+ chip->bbt_md->options |= NAND_BBT_CREATE;
free(chip->bbt);
chip->bbt = bbt;