Siddharth,
On Monday 06 August 2007 21:17, Siddharth Choudhuri wrote:
> I tried using the nandwrite (mkyaffs2image -> erase flash ->
> nandwrite -a -o /dev/mtdN yaffs2.img), but every time I
> mount/umount, I get a series of "gc prioritised messages" for
> every block that the image was written to. However, if I erase
> the flash and copy the files, the same messages does not
> appear. Are these messages a notification or error ?
I don't see how nandwrite can be formating the oob data correctly.
I've made a small change to the oob scatter loop, see if this
does anything for you. Apply the patch to mtd-utils-1.0.0.
-imcd
diff -uar mtd-utils-1.0.0/nandwrite.c mtd-utils-1.0.0-x/nandwrite.c
--- mtd-utils-1.0.0/nandwrite.c 2006-04-30 16:59:15.000000000 -0400
+++ mtd-utils-1.0.0-x/nandwrite.c 2007-08-07 10:03:04.000000000 -0400
@@ -392,7 +392,7 @@
goto closeall;
}
if (!noecc) {
- int i, start, len;
+ int i, start, len, off = 0;
/*
* We use autoplacement and have the oobinfo with the autoplacement
* information from the kernel available
@@ -402,12 +402,12 @@
*/
if (!oobinfochanged && (old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE)) {
for (i = 0;old_oobinfo.oobfree[i][1]; i++) {
- /* Set the reserved bytes to 0xff */
start = old_oobinfo.oobfree[i][0];
len = old_oobinfo.oobfree[i][1];
memcpy(oobbuf + start,
- oobreadbuf + start,
+ oobreadbuf + off,
len);
+ off += len;
}
} else {
/* Set at least the ecc byte positions to 0xff */