|
@@ -400,6 +400,14 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip)
|
|
|
(chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2)
|
|
(chip->id.data[4] & MICRON_ID_INTERNAL_ECC_MASK) != 0x2)
|
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * It seems that there are devices which do not support ECC officially.
|
|
|
|
|
+ * At least the MT29F2G08ABAGA / MT29F2G08ABBGA devices supports
|
|
|
|
|
+ * enabling the ECC feature but don't reflect that to the READ_ID table.
|
|
|
|
|
+ * So we have to guarantee that we disable the ECC feature directly
|
|
|
|
|
+ * after we did the READ_ID table command. Later we can evaluate the
|
|
|
|
|
+ * ECC_ENABLE support.
|
|
|
|
|
+ */
|
|
|
ret = micron_nand_on_die_ecc_setup(chip, true);
|
|
ret = micron_nand_on_die_ecc_setup(chip, true);
|
|
|
if (ret)
|
|
if (ret)
|
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
@@ -408,13 +416,13 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip)
|
|
|
if (ret)
|
|
if (ret)
|
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
|
|
|
|
|
|
- if (!(id[4] & MICRON_ID_ECC_ENABLED))
|
|
|
|
|
- return MICRON_ON_DIE_UNSUPPORTED;
|
|
|
|
|
-
|
|
|
|
|
ret = micron_nand_on_die_ecc_setup(chip, false);
|
|
ret = micron_nand_on_die_ecc_setup(chip, false);
|
|
|
if (ret)
|
|
if (ret)
|
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
|
|
|
|
|
|
|
|
+ if (!(id[4] & MICRON_ID_ECC_ENABLED))
|
|
|
|
|
+ return MICRON_ON_DIE_UNSUPPORTED;
|
|
|
|
|
+
|
|
|
ret = nand_readid_op(chip, 0, id, sizeof(id));
|
|
ret = nand_readid_op(chip, 0, id, sizeof(id));
|
|
|
if (ret)
|
|
if (ret)
|
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|
|
return MICRON_ON_DIE_UNSUPPORTED;
|