summaryrefslogtreecommitdiff
path: root/flash_otp_write.c
AgeCommit message (Collapse)Author
2013-10-22flash_otp_write: use helper to check the nandHuang Shijie
Use the mtd_type_is_nand_user() helper to check if it is a NAND (including SLC/MLC). Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2013-03-11flash_otp_write: fix a buffer overflow on NAND with write size > 2048Uwe Kleine-König
I'm not aware of any chip having a write size bigger than 2048 today. Still checking for that instead of a sleeping problem to bite us maybe in a few years is easy. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2013-03-11flash_otp_write: fix writing to NAND in presence of partial readsUwe Kleine-König
When doing something like: { printf "\xff"; printf "\xfe"; } | flash_otp_write -u /dev/mtd0 0 flash_otp_write might see only a single byte when reading from stdin for the first tim. In this case (and without this patch) it pads to $writesize with '\xff's and writes that out. In the next iteration it reads the 2nd byte, pads and writes again. So the 2nd byte is written to offset $writesize instead of 1. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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>
2010-09-27mtd-utils: standardize PROGRAM_NAMEMike Frysinger
Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. 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-23s/oobblock/writesize/gJoern Engel
Follow the kernel in the rename. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-04-11Initial commitDavid Woodhouse