diff options
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index a46e9bb847bd..bb2e24b2d6c4 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -410,10 +410,11 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
410 | else { | 410 | else { |
411 | nand_get_device(chip, mtd, FL_WRITING); | 411 | nand_get_device(chip, mtd, FL_WRITING); |
412 | 412 | ||
413 | /* Write to first two pages and to byte 1 and 6 if necessary. | 413 | /* |
414 | * If we write to more than one location, the first error | 414 | * Write to first two pages if necessary. If we write to more |
415 | * encountered quits the procedure. We write two bytes per | 415 | * than one location, the first error encountered quits the |
416 | * location, so we dont have to mess with 16 bit access. | 416 | * procedure. We write two bytes per location, so we dont have |
417 | * to mess with 16 bit access. | ||
417 | */ | 418 | */ |
418 | do { | 419 | do { |
419 | chip->ops.len = chip->ops.ooblen = 2; | 420 | chip->ops.len = chip->ops.ooblen = 2; |
@@ -423,11 +424,6 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
423 | 424 | ||
424 | ret = nand_do_write_oob(mtd, ofs, &chip->ops); | 425 | ret = nand_do_write_oob(mtd, ofs, &chip->ops); |
425 | 426 | ||
426 | if (!ret && (chip->options & NAND_BBT_SCANBYTE1AND6)) { | ||
427 | chip->ops.ooboffs = NAND_SMALL_BADBLOCK_POS | ||
428 | & ~0x01; | ||
429 | ret = nand_do_write_oob(mtd, ofs, &chip->ops); | ||
430 | } | ||
431 | i++; | 427 | i++; |
432 | ofs += mtd->writesize; | 428 | ofs += mtd->writesize; |
433 | } while (!ret && (chip->options & NAND_BBT_SCAN2NDPAGE) && | 429 | } while (!ret && (chip->options & NAND_BBT_SCAN2NDPAGE) && |
@@ -3131,16 +3127,6 @@ ident_done: | |||
3131 | *maf_id == NAND_MFR_MICRON)) | 3127 | *maf_id == NAND_MFR_MICRON)) |
3132 | chip->options |= NAND_BBT_SCAN2NDPAGE; | 3128 | chip->options |= NAND_BBT_SCAN2NDPAGE; |
3133 | 3129 | ||
3134 | /* | ||
3135 | * Numonyx/ST 2K pages, x8 bus use BOTH byte 1 and 6 | ||
3136 | */ | ||
3137 | if (!(busw & NAND_BUSWIDTH_16) && | ||
3138 | *maf_id == NAND_MFR_STMICRO && | ||
3139 | mtd->writesize == 2048) { | ||
3140 | chip->options |= NAND_BBT_SCANBYTE1AND6; | ||
3141 | chip->badblockpos = 0; | ||
3142 | } | ||
3143 | |||
3144 | /* Check for AND chips with 4 page planes */ | 3130 | /* Check for AND chips with 4 page planes */ |
3145 | if (chip->options & NAND_4PAGE_ARRAY) | 3131 | if (chip->options & NAND_4PAGE_ARRAY) |
3146 | chip->erase_cmd = multi_erase_cmd; | 3132 | chip->erase_cmd = multi_erase_cmd; |