mtd/util nandwrite.c,1.22,1.23

gleixner at infradead.org gleixner at infradead.org
Tue Mar 15 13:53:22 EST 2005


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv15853

Modified Files:
	nandwrite.c 
Log Message:
Set the ECC locations to 0xff in case we write with ECC

Index: nandwrite.c
===================================================================
RCS file: /home/cvs/mtd/util/nandwrite.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- nandwrite.c	8 Jan 2005 16:12:06 -0000	1.22
+++ nandwrite.c	15 Mar 2005 18:53:18 -0000	1.23
@@ -371,6 +371,19 @@
 				perror ("File I/O error on input file");
 				goto closeall;
 			}
+			if (!noecc) {
+				int i;
+				/* Set the ECC positions to 0xff 
+				 * Not sure, if we should also take care of the
+				 * reserved byte locations in case of autoplacement.
+				 * This makes only sense if we use the oob_info
+				 * which we read above. Not sure. The worst case
+				 * might be that the image contains some nonsense
+				 * at the bad block marker location.
+				 */
+				for (i = 0; i < oob.eccbytes; i++)
+					oobbuf[i] = 0xff;
+			}
 			/* Write OOB data first, as ecc will be placed in there*/
 			oob.start = mtdoffset;
 			if (ioctl(fd, MEMWRITEOOB, &oob) != 0) {





More information about the linux-mtd-cvs mailing list