diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-08 15:22:54 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-12 09:54:56 +0200 |
commit | 3ab2b35477e878b4a793adbdb6c8464d061ef9a1 (patch) | |
tree | 6f605db39dc89be1a829ba31a395470125730f67 | |
parent | 4b9544013ee61131bbe942d851734e84226e634a (diff) | |
download | barebox-3ab2b35477e878b4a793adbdb6c8464d061ef9a1.tar.gz barebox-3ab2b35477e878b4a793adbdb6c8464d061ef9a1.tar.xz |
nand omap: handle erased pages correctly in hamming ecc mode
do not throw ecc errors on erased pages.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mtd/nand/nand_omap_gpmc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index d61f7d9f..9d375aa3 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -377,6 +377,11 @@ static int omap_correct_data(struct mtd_info *mtd, uint8_t *dat, switch (oinfo->ecc_mode) { case OMAP_ECC_HAMMING_CODE_HW_ROMCODE: + if (read_ecc[0] == 0xff && read_ecc[1] == 0xff && + read_ecc[2] == 0xff && calc_ecc[0] == 0x0 && + calc_ecc[1] == 0x0 && calc_ecc[0] == 0x0) + break; + /* Regenerate the orginal ECC */ orig_ecc = gen_true_ecc(read_ecc); new_ecc = gen_true_ecc(calc_ecc); |