|
@@ -224,24 +224,6 @@ static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat,
|
|
uint32_t t;
|
|
uint32_t t;
|
|
unsigned int timeout = 1000;
|
|
unsigned int timeout = 1000;
|
|
|
|
|
|
- t = read_ecc[0];
|
|
|
|
-
|
|
|
|
- if (t == 0xff) {
|
|
|
|
- for (i = 1; i < 9; ++i)
|
|
|
|
- t &= read_ecc[i];
|
|
|
|
-
|
|
|
|
- t &= dat[0];
|
|
|
|
- t &= dat[nand->chip.ecc.size / 2];
|
|
|
|
- t &= dat[nand->chip.ecc.size - 1];
|
|
|
|
-
|
|
|
|
- if (t == 0xff) {
|
|
|
|
- for (i = 1; i < nand->chip.ecc.size - 1; ++i)
|
|
|
|
- t &= dat[i];
|
|
|
|
- if (t == 0xff)
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
for (i = 0; i < 9; ++i)
|
|
for (i = 0; i < 9; ++i)
|
|
writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i);
|
|
writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i);
|
|
|
|
|
|
@@ -443,6 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev)
|
|
chip->ecc.size = 512;
|
|
chip->ecc.size = 512;
|
|
chip->ecc.bytes = 9;
|
|
chip->ecc.bytes = 9;
|
|
chip->ecc.strength = 4;
|
|
chip->ecc.strength = 4;
|
|
|
|
+ chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK;
|
|
|
|
|
|
if (pdata)
|
|
if (pdata)
|
|
chip->ecc.layout = pdata->ecc_layout;
|
|
chip->ecc.layout = pdata->ecc_layout;
|