summaryrefslogtreecommitdiffstats
path: root/commands/flash.c
Commit message (Collapse)AuthorAgeFilesLines
* fix erasing/protecting flashes with unspecified sizeSascha Hauer2016-04-191-1/+1
| | | | | | | | | | | | | | | | | fixes: 81737c1 mtd: Fix erasing of devices >4GiB Several places erased a complete flash partition passing ~0 as count to erase(). With the above commit count to erase was changed from an unsigned type to a signed type, so the (count > f->size - offset) check in erase() no longer triggers and the ~0 count is no longer adjusted to the whole device size. Among other things this results in saveenv failures on NOR flashes. This patch fixes this by introducing an explicit macro for erasing the whole device which is tested for in erase(). All other negative values are rejected. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Giorgio <giorgio.nicole@arcor.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-52/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+3
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: flash: add missing newlines to error messagesWolfram Sang2012-12-141-2/+2
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | 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>
* make parse_area_spec arguments loff_tSascha Hauer2012-06-301-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-2/+2
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command: flash: remove broken filename checkWolfram Sang2011-12-221-10/+0
| | | | | | | | | It makes no sense to check the filename pointer here, because a) we have already been using it and b) argc has been tested against 1 already, so argv[1] should not be NULL. So, drop the checks. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Cosmetic fixes, including format attributes for printf() and friends.Krzysztof Halasa2010-12-211-2/+2
| | | | | Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: unify documentation for 'protect' and 'unprotect'Robert Schwebel2010-11-021-28/+42
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* doc: unify documentation for 'erase'Robert Schwebel2010-11-011-14/+16
| | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* trivial: fix command case for erase usage lineUwe Kleine-König2010-03-301-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cfi_flash: move include/cfi_flash.c next to driverSascha Hauer2010-02-081-1/+0
| | | | | | | | This file has no useful things for others than the driver, so move it next to the driver and remove the corresponding include from other files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-3/+0
| | | | | | | 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>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-191-8/+4
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* protect command: ignore -ENOSYSSascha Hauer2009-10-121-2/+3
| | | | | | | Return success on -ENOSYS. (un)protecting a device which is not protectable should not irritate users. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add missing close() in do_protectSascha Hauer2008-08-131-4/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* CFI Flash driver: Fix error pathSascha Hauer2008-08-131-9/+10
| | | | | | We forgot to close the file when parse_area_spec() failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Subject: [PATCH] [general] Fixed constant strings in data section issueSascha Hauer2008-04-041-2/+2
| | | | | | | | For practical reasons I changed all string literals assumed to be constant to reside in .rodata subsection at end of .text section. Signed-off-by: Carsten Schlote <schlote@vahanus.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* various doc addedJuergen Beisert2007-11-091-0/+40
| | | | Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
* various small typos fixedJuergen Beisert2007-10-161-3/+2
|
* fix area parsing for erase/protect, add error parsingSascha Hauer2007-10-091-3/+9
|
* declare lots of functions staticSascha Hauer2007-09-281-2/+2
|
* remove u-boot command paramter flagSascha Hauer2007-09-241-2/+2
|
* whitespace cleanupSascha Hauer2007-09-131-1/+1
|
* Do not use -f <file> to specify the device for erase and protect, butSascha Hauer2007-09-111-23/+27
| | | | instead se positional parameters.
* implement flash protectionSascha Hauer2007-07-161-16/+47
|
* fix printf in do_flerase()Sascha Hauer2007-07-141-1/+1
|
* svn_rev_653Sascha Hauer2007-07-051-0/+125
restructure tree, add reginfo command