Mirror of git://git.busybox.net/busybox with our patches on top
Source
/*
* nandwrite and nanddump ported to busybox from mtd-utils
*
* Author: Baruch Siach <baruch@tkos.co.il>, Orex Computed Radiography
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*
* TODO: add support for large (>4GB) MTD devices
*/
//config:config NANDWRITE
//config: bool "nandwrite (5.9 kb)"
//config: default y
//config: select PLATFORM_LINUX
//config: help
//config: Write to the specified MTD device, with bad blocks awareness
//config:
//config:config NANDDUMP
//config: bool "nanddump (6.3 kb)"
//config: default y
//config: select PLATFORM_LINUX
//config: help
//config: Dump the content of raw NAND chip
//applet:IF_NANDWRITE(APPLET(nandwrite, BB_DIR_USR_SBIN, BB_SUID_DROP))
//applet:IF_NANDDUMP(APPLET_ODDNAME(nanddump, nandwrite, BB_DIR_USR_SBIN, BB_SUID_DROP, nanddump))
//kbuild:lib-$(CONFIG_NANDWRITE) += nandwrite.o
//kbuild:lib-$(CONFIG_NANDDUMP) += nandwrite.o
//usage:#define nandwrite_trivial_usage
//usage: "[-np] [-s ADDR] MTD_DEVICE [FILE]"
//usage:#define nandwrite_full_usage "\n\n"
//usage: "Write to MTD_DEVICE\n"
//usage: "\n -n Write without ecc"
//usage: "\n -p Pad to page size"
//usage: "\n -s ADDR Start address"
//usage:#define nanddump_trivial_usage
//usage: "[-no]" IF_LONG_OPTS(" [--bb padbad|skipbad]") " [-s ADDR] [-l LEN] [-f FILE] MTD_DEVICE"
//usage:#define nanddump_full_usage "\n\n"
//usage: "Dump MTD_DEVICE\n"
//usage: "\n -n Read without ecc"
//usage: "\n -o Dump oob data"
//usage: "\n -s ADDR Start address"
//usage: "\n -l LEN Length"
//usage: "\n -f FILE Dump to file ('-' for stdout)"
//usage: IF_LONG_OPTS(
//usage: "\n --bb METHOD"
//usage: "\n skipbad: skip bad blocks"
//usage: "\n padbad: substitute bad blocks by 0xff (default)"
//usage: )
/* Old headers call it MTD_MODE_RAW.
* FIXME: In kernel headers, MTD_FILE_MODE_RAW is not a define,
* it's an enum. How I can test for existence of an enum?
*/