diff options
author | Ben Dooks <ben-mtd@fluff.org> | 2008-04-15 06:36:20 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-04-22 16:41:03 -0400 |
commit | c45c6c68333c04de84c21a4b869f36a96f642779 (patch) | |
tree | 142fb3db8452f127262937891069f075f00bec41 /drivers/mtd/nand/s3c2410.c | |
parent | 71d54f3855b4ca98559e8782350336ec2433cc24 (diff) |
[MTD] [NAND] S3C2410 Allow unset ecc to be ignored for ecc correction
If a block's ecc field is all 0xff, then ignore the ECC
correction. This is for systems where some of the blocks,
such as the initial cramfs are written without ECC and
need to be loaded on start.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand/s3c2410.c')
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 15397e0f3965..35401f7b9302 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -357,6 +357,14 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat, | |||
357 | if (diff0 == 0 && diff1 == 0 && diff2 == 0) | 357 | if (diff0 == 0 && diff1 == 0 && diff2 == 0) |
358 | return 0; /* ECC is ok */ | 358 | return 0; /* ECC is ok */ |
359 | 359 | ||
360 | /* sometimes people do not think about using the ECC, so check | ||
361 | * to see if we have an 0xff,0xff,0xff read ECC and then ignore | ||
362 | * the error, on the assumption that this is an un-eccd page. | ||
363 | */ | ||
364 | if (read_ecc[0] == 0xff && read_ecc[1] == 0xff && read_ecc[2] == 0xff | ||
365 | && info->platform->ignore_unset_ecc) | ||
366 | return 0; | ||
367 | |||
360 | /* Can we correct this ECC (ie, one row and column change). | 368 | /* Can we correct this ECC (ie, one row and column change). |
361 | * Note, this is similar to the 256 error code on smartmedia */ | 369 | * Note, this is similar to the 256 error code on smartmedia */ |
362 | 370 | ||