* [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)
@ 2010-12-30 9:30 Ralf Rösch
2011-01-04 5:13 ` Atsushi Nemoto
2011-01-05 8:37 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Ralf Rösch @ 2010-12-30 9:30 UTC (permalink / raw)
To: linux-mtd; +Cc: Atsushi Nemoto
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.
Signed-off-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
---
drivers/mtd/nand/txx9ndfmc.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c
index 054a41c..ca270a4 100644
--- a/drivers/mtd/nand/txx9ndfmc.c
+++ b/drivers/mtd/nand/txx9ndfmc.c
@@ -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);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)
2010-12-30 9:30 [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max) Ralf Rösch
@ 2011-01-04 5:13 ` Atsushi Nemoto
2011-01-05 8:37 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Atsushi Nemoto @ 2011-01-04 5:13 UTC (permalink / raw)
To: ralf.roesch; +Cc: linux-mtd
On Thu, 30 Dec 2010 10:30:11 +0100, Ralf Rösch <ralf.roesch@rw-gmbh.de> wrote:
> 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.
>
> Signed-off-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Thank you for the fix. It is good news that this controller can work
with large page NAND.
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)
2010-12-30 9:30 [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max) Ralf Rösch
2011-01-04 5:13 ` Atsushi Nemoto
@ 2011-01-05 8:37 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2011-01-05 8:37 UTC (permalink / raw)
To: Ralf Rösch; +Cc: Atsushi Nemoto, linux-mtd
On Thu, 2010-12-30 at 10:30 +0100, Ralf Rösch wrote:
> 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.
>
> Signed-off-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Pushed to l2-mtd-2.6.git, thanks!
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-05 8:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-30 9:30 [PATCH] txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max) Ralf Rösch
2011-01-04 5:13 ` Atsushi Nemoto
2011-01-05 8:37 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).