Skip to contentSkip to conversation

txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)

PATCH Applied Ralf Rösch 3 participants 3 messages Dec 30, 2010 – Jan 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)

See commit: c0cbfd0e81d879a950ba6f0df3f75ea30c5ab16e
Using __nand_correct_data() helper function, this driver can read 512 byte (with 6 byte ECC) at a time.

This is correct, but not more:
With NAND chips providing page sizes > 512 Bytes chip->ecc.bytes are calculated > 6 in txx9ndfmc_nand_scan. According the data sheet there are (only) 6 bytes ECC available.

After applying the patch a Hynix 512M*8 with 2k page size could be successfully formatted and used with an ubifs file system.

---
 drivers/mtd/nand/txx9ndfmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/nand/txx9ndfmc.c +3 -2
index 054a41c..ca270a4 100644
@@ -277,8 +277,9 @@ static int txx9ndfmc_nand_scan(struct mtd_info *mtd)
 	ret = nand_scan_ident(mtd, 1, NULL);
 	if (!ret) {
 		if (mtd->writesize >= 512) {
-			chip->ecc.size = mtd->writesize;
-			chip->ecc.bytes = 3 * (mtd->writesize / 256);
+			/* Hardware ECC 6 byte ECC per 512 Byte data */
+			chip->ecc.size = 512;
+			chip->ecc.bytes = 6;
 		}
 		ret = nand_scan_tail(mtd);
 	}
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ralf Rösch

See commit: c0cbfd0e81d879a950ba6f0df3f75ea30c5ab16e
Using __nand_correct_data() helper function, this driver can read 512 byte (with 6 byte ECC) at a time.

This is correct, but not more:
With NAND chips providing page sizes > 512 Bytes chip->ecc.bytes are calculated > 6 in txx9ndfmc_nand_scan. According the data sheet there are (only) 6 bytes ECC available.

Quoted 4 lines

After applying the patch a Hynix 512M*8 with 2k page size could be successfully formatted and used with an ubifs file system.

Thank you for the fix. It is good news that this controller can work with large page NAND.

#2 lore raw
In reply to Ralf Rösch
Quoted 9 lines · Ralf Rösch

See commit: c0cbfd0e81d879a950ba6f0df3f75ea30c5ab16e
Using __nand_correct_data() helper function, this driver can read 512 byte (with 6 byte ECC) at a time.

This is correct, but not more:
With NAND chips providing page sizes > 512 Bytes chip->ecc.bytes are calculated > 6 in txx9ndfmc_nand_scan. According the data sheet there are (only) 6 bytes ECC available.

Quoted 4 lines

After applying the patch a Hynix 512M*8 with 2k page size could be successfully formatted and used with an ubifs file system.

Pushed to l2-mtd-2.6.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Битюцкий Артём)