]> www.infradead.org Git - mtd-utils.git/commit
mtd-utils: nandwrite: full 64-bit support w/ libmtd
authorBrian Norris <computersforpeace@gmail.com>
Thu, 11 Nov 2010 06:39:13 +0000 (22:39 -0800)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 13 Nov 2010 11:55:33 +0000 (13:55 +0200)
commit15d811481cf1cf61ae23fabbd1e191ebdbcf3881
tree8f4bcc8443f6f1cea41d758400b4a5eaed42e828
parenta188ff405000902139a46d9e3753cae0e1168d46
mtd-utils: nandwrite: full 64-bit support w/ libmtd

Several ioctls are replaced with libmtd calls which should give us 64-bit
support for large devices. libmtd mostly provides drop-in replacements
for the functionality we need. However, when we require erasure of a
badly-written block, mtd_erase() only erases a single block, whereas
MEMERASE could erase a larger region. In nandwrite, we may have a "virtual
blocksize" of more than one (when blockalign > 1). Thus, I added a loop
for this case.

The mtd_oob_buf struct is no longer needed, nor is "erase_info_t".

Error messages for the new libmtd calls reflect the style found in
flash_erase.

Tested with nandsim and with NAND chips up to 4GB in size (I don't have
a device that truly requires 64-bit addressing yet).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
nandwrite.c