aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2015-12-30 14:41:29 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-01-06 21:54:08 -0500
commit48bf35de3133996fbac2be16430cd4ea00fa8d38 (patch)
tree7c8c4dae2b8e6747f5c78a93d2250e7f2e2bb4c3
parentcc01e6075c7f5fee72746bb0ec763b84a46c3778 (diff)
mtd: nand: jz4740: remove custom 'erased check' implementation
The jz4740 driver is manually checking for 'erased pages' while correcting ECC bytes. This logic can now done by the core infrastructure, and can thus be removed from this driver. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/jz4740_nand.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index adccae3da120..b19d2a9a5eb9 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -224,24 +224,6 @@ static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat,
224 uint32_t t; 224 uint32_t t;
225 unsigned int timeout = 1000; 225 unsigned int timeout = 1000;
226 226
227 t = read_ecc[0];
228
229 if (t == 0xff) {
230 for (i = 1; i < 9; ++i)
231 t &= read_ecc[i];
232
233 t &= dat[0];
234 t &= dat[nand->chip.ecc.size / 2];
235 t &= dat[nand->chip.ecc.size - 1];
236
237 if (t == 0xff) {
238 for (i = 1; i < nand->chip.ecc.size - 1; ++i)
239 t &= dat[i];
240 if (t == 0xff)
241 return 0;
242 }
243 }
244
245 for (i = 0; i < 9; ++i) 227 for (i = 0; i < 9; ++i)
246 writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i); 228 writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i);
247 229
@@ -443,6 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev)
443 chip->ecc.size = 512; 425 chip->ecc.size = 512;
444 chip->ecc.bytes = 9; 426 chip->ecc.bytes = 9;
445 chip->ecc.strength = 4; 427 chip->ecc.strength = 4;
428 chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK;
446 429
447 if (pdata) 430 if (pdata)
448 chip->ecc.layout = pdata->ecc_layout; 431 chip->ecc.layout = pdata->ecc_layout;