All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
To: Shibin George <george.shibin1993@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: nandwrite vs. flashcp when writing image to mtd device
Date: Thu, 21 Mar 2019 08:54:45 +0100	[thread overview]
Message-ID: <32029ac2-c9c3-93a0-3195-0829387ceeac@sigma-star.at> (raw)
In-Reply-To: <CAGu8XfQHuEcU6b+bbD80641ePKvR--5sv7vraGibKZBj4_JEnA@mail.gmail.com>

Hi,

flashcp is a rather crude program and hasn't seen any improvements in way over a decade.
All it does is round the size of your input file up to the reported block size, erases
that range and then writes the input file.

It directly opens the device file, works on the raw fd and does 2 ioctls to retrieve
the erase size and erase that range.

The size of 6815744 happens to be the reported block size of 262144 * 26. Erasing multiple
blocks in one go is supported by the erase ioctl, it is also what libmtd does internally.

However, flashcp is completely oblivious of bad blocks, OOB size and other fun stuff.

nandwrite is somewhat more sophisticated. It is aware of all of the above and has a lot of
extra command line options for fine grained control over those things. It also uses libmtd
to access the flash which in turn is aware of a lot of newer ioctls and provides a number
of fallback code paths.

So yes, I would recommend using nandwrite for writing images to nand flashes.

Regards,

David

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2019-03-21  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  6:45 nandwrite vs. flashcp when writing image to mtd device Shibin George
2019-03-21  7:54 ` David Oberhollenzer [this message]

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=32029ac2-c9c3-93a0-3195-0829387ceeac@sigma-star.at \
    --to=david.oberhollenzer@sigma-star.at \
    --cc=george.shibin1993@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.