summaryrefslogtreecommitdiff
path: root/flash_erase.c
AgeCommit message (Collapse)Author
2015-11-11mtd-utils: Restructure the mtd-utils source.Dongsheng Yang
* There is no code modification in this commit, only moving * the files to proper place. The user tools looks a little messy as we place almost the all tools in the root directory of mtd-utils. To make it more clear, I propose to introduce the following structure for our source code. mtd-utils/ |-- lib |-- include |-- misc-utils |-- jffsX-utils |-- nand-utils |-- nor-utils |-- ubi-utils |-- ubifs-utils `-- tests Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2013-10-24flash_erase: check the nand typeHuang Shijie
Now, the MTD_NANDFLASH stands for SLC nand, and the MTD_MLCNANDFLASH stands for the MLC nand. This patch includes the stdbool.h, and changes the "isNAND" to boolean type, and checks the right nand type for the MLC and SLC nand. If the user wants to format a MLC nand for JFFS2, we will print out a message to warn him, and exit right now. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2013-05-29flash_erase: use pwrite() rather than lseek() && write()Mike Frysinger
Saves a syscall. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-09-25consistency between u_int32_t / off_t / off64_tRichard Genoud
We should use the off_t type instead of off64_t or u_int32_t as its length is controlled by the WITHOUT_LARGEFILE flag. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2011-06-30flash_erase: fix incorrect help messageBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-06-27autogenerate version.h from build systemMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18flash_erase: increas version numberv1.4.3Artem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-03-18flash_erase: start position should be in bytesPeter Korsgaard
Commit a8801d8 (unify flash_erase and flash_eraseall) changed the flash_erase interface in a backwards incompatible way. Before that commit start position was given in bytes, and now it must be provided in blocks. While I agree the new interface is nicer, we shouldn't break the interface. I have scripts that expect the old behaviour, and I'm most likely not alone, so change the interface back to the old way. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-10-17mtd-utils: flash_erase: Fix output of offsetsBrian Norris
Need to use unsigned arithmetic and a 64-bit cast in order to calculate and output the correct offset for eraseblocks at large offsets. Signed integer arithmetic does not produce the correct result "uint64_t" result, so for offsets over 2GB we get messages like: Erasing 512 Kibyte @ ffffffff83180000 -- 4308642136 % complete. Note that this error was not affecting proper erasure; it just produced incorrect status messages. Also, we should not add an extra eraseblock for the final status message; this gives misleading output when, for example, the following statement is executed: $ flash_erase /dev/mtd0 0 1 Erasing 512 Kibyte @ 80000 -- 100 % complete We aren't erasing at offset 0x80000; it should display offset 0. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-09-27mtd-utils: unify flash_erase and flash_eraseallMike Frysinger
These have overlapping functionality, and while flash_eraseall supports newer 64bit ioctls, flash_erase does not. So rather than graft support onto flash_erase, merge the functionality of two into flash_erase so we only have to support one util from now on. A simple wrapper is provided to ease old flash_eraseall users into the new combined flash_erase util. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2006-10-09Fixup whitespaceJosh Boyer
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-05-14MTD Utils. (Resubmit as attachment)Steve Finney
Add a basic usage message to flash_erase.c. Signed-off-by: Steven Finney <sfinney@healthhero.com>
2006-04-11Initial commitDavid Woodhouse