diff options
Diffstat (limited to 'drivers/mtd/nand/raw/nand_micron.c')
-rw-r--r-- | drivers/mtd/nand/raw/nand_micron.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index 1622d3145587..8ca9fad6e6ad 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c | |||
@@ -390,6 +390,14 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) | |||
390 | (chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2) | 390 | (chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2) |
391 | return MICRON_ON_DIE_UNSUPPORTED; | 391 | return MICRON_ON_DIE_UNSUPPORTED; |
392 | 392 | ||
393 | /* | ||
394 | * It seems that there are devices which do not support ECC officially. | ||
395 | * At least the MT29F2G08ABAGA / MT29F2G08ABBGA devices supports | ||
396 | * enabling the ECC feature but don't reflect that to the READ_ID table. | ||
397 | * So we have to guarantee that we disable the ECC feature directly | ||
398 | * after we did the READ_ID table command. Later we can evaluate the | ||
399 | * ECC_ENABLE support. | ||
400 | */ | ||
393 | ret = micron_nand_on_die_ecc_setup(chip, true); | 401 | ret = micron_nand_on_die_ecc_setup(chip, true); |
394 | if (ret) | 402 | if (ret) |
395 | return MICRON_ON_DIE_UNSUPPORTED; | 403 | return MICRON_ON_DIE_UNSUPPORTED; |
@@ -398,13 +406,13 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) | |||
398 | if (ret) | 406 | if (ret) |
399 | return MICRON_ON_DIE_UNSUPPORTED; | 407 | return MICRON_ON_DIE_UNSUPPORTED; |
400 | 408 | ||
401 | if (!(id[4] & MICRON_ID_ECC_ENABLED)) | ||
402 | return MICRON_ON_DIE_UNSUPPORTED; | ||
403 | |||
404 | ret = micron_nand_on_die_ecc_setup(chip, false); | 409 | ret = micron_nand_on_die_ecc_setup(chip, false); |
405 | if (ret) | 410 | if (ret) |
406 | return MICRON_ON_DIE_UNSUPPORTED; | 411 | return MICRON_ON_DIE_UNSUPPORTED; |
407 | 412 | ||
413 | if (!(id[4] & MICRON_ID_ECC_ENABLED)) | ||
414 | return MICRON_ON_DIE_UNSUPPORTED; | ||
415 | |||
408 | ret = nand_readid_op(chip, 0, id, sizeof(id)); | 416 | ret = nand_readid_op(chip, 0, id, sizeof(id)); |
409 | if (ret) | 417 | if (ret) |
410 | return MICRON_ON_DIE_UNSUPPORTED; | 418 | return MICRON_ON_DIE_UNSUPPORTED; |