|
@@ -4177,6 +4177,7 @@ static const char * const nand_ecc_modes[] = {
|
|
[NAND_ECC_HW] = "hw",
|
|
[NAND_ECC_HW] = "hw",
|
|
[NAND_ECC_HW_SYNDROME] = "hw_syndrome",
|
|
[NAND_ECC_HW_SYNDROME] = "hw_syndrome",
|
|
[NAND_ECC_HW_OOB_FIRST] = "hw_oob_first",
|
|
[NAND_ECC_HW_OOB_FIRST] = "hw_oob_first",
|
|
|
|
+ [NAND_ECC_ON_DIE] = "on-die",
|
|
};
|
|
};
|
|
|
|
|
|
static int of_get_nand_ecc_mode(struct device_node *np)
|
|
static int of_get_nand_ecc_mode(struct device_node *np)
|
|
@@ -4717,6 +4718,18 @@ int nand_scan_tail(struct mtd_info *mtd)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case NAND_ECC_ON_DIE:
|
|
|
|
+ if (!ecc->read_page || !ecc->write_page) {
|
|
|
|
+ WARN(1, "No ECC functions supplied; on-die ECC not possible\n");
|
|
|
|
+ ret = -EINVAL;
|
|
|
|
+ goto err_free;
|
|
|
|
+ }
|
|
|
|
+ if (!ecc->read_oob)
|
|
|
|
+ ecc->read_oob = nand_read_oob_std;
|
|
|
|
+ if (!ecc->write_oob)
|
|
|
|
+ ecc->write_oob = nand_write_oob_std;
|
|
|
|
+ break;
|
|
|
|
+
|
|
case NAND_ECC_NONE:
|
|
case NAND_ECC_NONE:
|
|
pr_warn("NAND_ECC_NONE selected by board driver. This is not recommended!\n");
|
|
pr_warn("NAND_ECC_NONE selected by board driver. This is not recommended!\n");
|
|
ecc->read_page = nand_read_page_raw;
|
|
ecc->read_page = nand_read_page_raw;
|