Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274922
b: refs/heads/master
c: f975c6b
h: refs/heads/master
v: v3
  • Loading branch information
Michael Hench authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 14b45fc commit c1b20e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4aa10626adbc27dcf2e3462bb82b4963c5545669
refs/heads/master: f975c6bcb07caacff7fa9904e5d2daa51bcf549d
19 changes: 19 additions & 0 deletions trunk/drivers/mtd/nand/fsl_elbc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,25 @@ static int fsl_elbc_run_command(struct mtd_info *mtd)
return -EIO;
}

if (chip->ecc.mode != NAND_ECC_HW)
return 0;

if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) {
uint32_t lteccr = in_be32(&lbc->lteccr);
/*
* if command was a full page read and the ELBC
* has the LTECCR register, then bits 12-15 (ppc order) of
* LTECCR indicates which 512 byte sub-pages had fixed errors.
* bits 28-31 are uncorrectable errors, marked elsewhere.
* for small page nand only 1 bit is used.
* if the ELBC doesn't have the lteccr register it reads 0
*/
if (lteccr & 0x000F000F)
out_be32(&lbc->lteccr, 0x000F000F); /* clear lteccr */
if (lteccr & 0x000F0000)
mtd->ecc_stats.corrected++;
}

return 0;
}

Expand Down

0 comments on commit c1b20e8

Please sign in to comment.