Allo subcommands need at least one nonopt arg, so check for
it right after parsing the options and drop the check in the
MARKBAD command.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Since this commit we interpret the argument to the bad block ioctls
as a pointer to a 64bit number:
|commit e71c343668
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date: Fri Oct 14 11:57:55 2011 +0200
|
| mtd: fix arguments to bad block ioctls
|
| In the Kernel the mtd ioctls expect a pointer to the offset, whereas
| barebox interprets the pointer itself as an offset. Since we want
| to add 64bit support for file sizes a pointer may not be sufficient,
| so align with the kernel and convert it to a pointer to the offset.
|
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This missed some places, fix them aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The old way happily removed cdev entries which were no bb dev
at all. Fix this by checking if the given device actually is
a bb device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The cdev operations are available without the complete file API,
so they are more suitable for internal usage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It's good to seperate the code which others can use from commands.
This way other users do not depend on the command being compiled in.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We used to write the data in nand_bb_write directly to the
NAND flash. If we do not write a whole NAND page at once, this
resulted in multiple writes of one page which corrupted the
ecc data.
Fix this by collecting 4096 bytes of data before actually
writing the data to the flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When reading from bad block aware devices we must make sure not
to read beyond eraseblock boundaries.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>