Re: [Yaffs] [PATCH] YAFFS2 to work with current MTD

Startseite
Anhänge:
Nachricht
+ (text/plain)
Nachricht löschen
Nachricht beantworten
Autor: Karl Olsen
Datum:  
To: Vitaly Wool, yaffs
Betreff: Re: [Yaffs] [PATCH] YAFFS2 to work with current MTD
---- Original Message ----
From: "Vitaly Wool" <>
To: <>
Sent: Monday, July 10, 2006 12:50 PM
Subject: [Yaffs] [PATCH] YAFFS2 to work with current MTD

> inlined is the patch that make YAFFS2 work for me with the Linus's
> git version of the MTD tree. Please note that I've made YAFFS2
> structures smaller -- that's just because I wouldn't have succeeded
> otherwise, I have only 23 bytes spare OOB area out of 2k page. Any
> comments/remarks are welcome.


Thanks for doing this!

Some comments on your yaffs_mtdif2.c:

In the read and write functions, isn't the "if (dev->useNANDECC)"
unnecessary since the yaffs2 code only supports the MTD ECC?

And in the write function, you write the data and tags using separate mtd
calls. This means (at least for normal NAND) that the spare area is written
twice, first with data ecc, and then with tags. Wouldn't something like
this be better, since write_oob() can write both in one go? Note that tags
is never NULL.

/* Write data and oob area, or only oob area */
yaffs_PackTags2 (&pt, tags);
ops.mode = MTD_OOB_AUTO;
ops.oobbuf = (void *)&pt;
ops.ooblen = sizeof(pt);
ops.len = data ? dev->nBytesPerChunk : sizeof(pt);
ops.ooboffs = 0;
ops.datbuf = (uint8_t *)data;
retval = mtd->write_oob (mtd, addr, &ops);


Karl Olsen