public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Peter Grayson <pgrayson@realmsys.com>
To: linux-mtd@lists.infradead.org
Subject: Can you really write a jffs2 image with nandwrite?
Date: Mon, 28 Feb 2005 19:14:07 -0700	[thread overview]
Message-ID: <1109643247.5043.26.camel@pgrayson1.realmsys.com> (raw)

I am using a PowerPC 405 based Linux system running 2.6.10 kernel with
CVS head of mtd patched in. The board has a 256MB Samsung NAND flash
part with 2048 byte page size, 64 spare bytes per page, and 64 pages per
eraseblock (128kB eraseblock).

I want to use jffs2 partitions on this flash part. I can mount an empty
partition with jffs2 and that works well, but I have been unable to
weild mkfs.jffs2 and nandwrite to successfully write jffs2 images to
flash.

>From reading the mkfs.jffs2 code, it seems that mkfs.jffs2 has no
concept of out-of-bounds data. Consequently, it appears that the
nandwrite expects to find out-of-bounds data immediately after the in-
bounds data for every page. I have looked at the bits of the jffs2 image
produced by mkfs.jffs2 and I can see that it does not really produce out
of bounds data.

Below is the mkfs.jffs2 command line I am using. I have tried many other
combinations of options, but they do not yield appreciably different
results.

mkfs.jffs2
 	--pagesize=2048 \
	--eraseblock=128 \
	--pad \
	--output=image.jffs2 \
	--compression-mode none \
	--no-cleanmarkers \
	--big-endian \
	--squash \
	--verbose \
	--root=$ROOT_DIR

When I try using this image with "nandwrite -j", the image appears to be
written successfully, but when I try to mount the new filesystem, mount
fails with the following error message:

  mount: Mounting /dev/mtdblock0 on /mnt failed: Invalid argument

If I try to use "nandwrite -j -o", nandwrite complains about the image
not being aligned:

  Input file is not page aligned: Success
  Data did not fit into device, due to bad blocks
  : Success

In this case, nandwrite bails out early and does not write anything to
flash.

Is there something obvious I am missing? I have read the FAQ at:

  http://www.linux-mtd.infradead.org/tech/faq.html

so I know that the working theory is that this should work, but it is
not working for me. Has anyone else had a similar experience?

Thanks in advance for any help you can offer.

- Pete

             reply	other threads:[~2005-03-01  2:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01  2:14 Peter Grayson [this message]
2005-03-01  2:47 ` Can you really write a jffs2 image with nandwrite? Thomas Gleixner
2005-03-01 18:11   ` Peter Grayson
2005-03-01 19:16     ` Thomas Gleixner
2005-03-01 20:47       ` Peter Grayson
2005-03-02  9:57         ` Artem B. Bityuckiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1109643247.5043.26.camel@pgrayson1.realmsys.com \
    --to=pgrayson@realmsys.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox