DOC2000 flash: Do I miss something?

Juergen Beisert jbe at pengutronix.de
Tue Mar 24 10:00:20 EDT 2009


Hi,

On Dienstag, 24. März 2009, Ravi Vasarla wrote:
> Check the MTD drivers write size, usually pagesize is same as the
> writesize. In nandwrite.c the ioctl will fired only when passed the option
> like -a (autoplace) -n (noecc) passed. I guess it should not give below
> error with -j option. Check with the latest version of mtd-util of
> nandwrite.c file

$ nandwrite -j /dev/mtd1 /root.jffs2 (from ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.2.0.tar.bz2)

fails in this block (from nandwrite.c):

[...]
	/*
	 * force oob layout for jffs2 or yaffs ?
	 * Legacy support
	 */
	if (forcejffs2 || forceyaffs) {
		struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo;

		if (autoplace) {
			fprintf(stderr, "Autoplacement is not possible for legacy -j/-y options\n");
			goto restoreoob;
		}
		if ((old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE) && !forcelegacy) {
			fprintf(stderr, "Use -f option to enforce legacy placement on autoplacement enabled mtd device\n");
			goto restoreoob;
		}
		if (meminfo.oobsize == 8) {
			if (forceyaffs) {
				fprintf (stderr, "YAFSS cannot operate on 256 Byte page size");
				goto restoreoob;
			}
			/* Adjust number of ecc bytes */
			jffs2_oobinfo.eccbytes = 3;
		}

		if (ioctl (fd, MEMSETOOBSEL, oobsel) != 0) {  <----- this one fails
			perror ("MEMSETOOBSEL");
			goto restoreoob;
		}
	}
[...]

Hmm, "Legacy support" sounds more like "do not use in recent implementations
any more".

BTW: Simply erasing, mounting, untar my rootfilesystem into the DOC works without these
CLEANMARKER and ECC error messages.

Regards,
Juergen



More information about the linux-mtd mailing list