9
0
Fork 0
Commit Graph

36 Commits

Author SHA1 Message Date
Holger Schurig f1f532084a commands: harmonize in-barebox documentation
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>
2014-05-14 10:03:43 +02:00
Holger Schurig ab23d0bb3f commands: group 'help' output
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>
2014-05-14 07:59:55 +02:00
Sascha Hauer 68bd6e9309 nand command: check for <dev> directly after option parsing
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>
2013-03-04 11:00:33 +01:00
Sascha Hauer 938f748103 nand command: use enumeration for command instead of bitmask
A command can only be one of NAND_*, so use an enumeration instead
of a bitmask.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 29c589c8dc nand command: use loff_t for block offset
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:33 +01:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Sascha Hauer 4987f61ee2 mtd: fix bad block ioctls
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>
2012-07-10 19:07:33 +02:00
Sascha Hauer 33d1cc4bf2 commands: remove struct command pointer from commands
This is unused in all commands and thus can be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:07 +01:00
Sascha Hauer f880d7bc87 nand bb: add proper bb remove function
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>
2011-04-12 09:54:56 +02:00
Sascha Hauer e7c06800ee nand bb: switch to cdev operations
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>
2011-04-12 09:54:56 +02:00
Sascha Hauer 027db60302 nand: move bb handling code to drivers/mtd/nand
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>
2011-04-12 09:54:56 +02:00
Sascha Hauer 3efa8f7bed devfs: remove unused struct filep* argument from open/close
the cdev layer is under the file layer, so it should not use
struct filep*.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:07 +02:00
Sascha Hauer eb133335e6 nand: Make write support optional
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:41:32 +02:00
Sascha Hauer 8527af99a2 nand: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:37:52 +01:00
Juergen Beisert c6f4ea0dcf Make some help comments less confusing
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-18 08:11:06 +01:00
Sascha Hauer 922bb41a47 remove typedef cmd_tbl_t and replace it with struct command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer c0f46a1d3d commands/nand.c: Fix memory hole
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-21 11:13:25 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
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>
2009-12-15 10:18:30 +01:00
Sascha Hauer 9af2cfb9ef nand bb: Be sure that fd is at the beginning when erasing
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-10 12:15:02 +01:00
Sascha Hauer 420a3173f0 commands: remove maxargs
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>
2009-10-19 16:18:33 +02:00
Sascha Hauer 63e01b4969 call getopt_reset only once
instead of calling getopt_reset in each command,
call it only once before calling the command.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:52 +02:00
Sascha Hauer 0c45663798 nand bb: fix handling of two subsequent bad blocks
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-12 19:32:33 +02:00
Sascha Hauer 2ee3e596c5 nand bb: fix removal of bb devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-11 09:13:28 +02:00
Sascha Hauer 33a6b5abca nand bb: fix check when erasing a bb device
We can actually partly erase a bb device, so fix the check.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-11 09:13:22 +02:00
Sascha Hauer 7d27f77b6e nand bb: Fix writing of nand page unaligned data
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>
2009-08-13 10:43:06 +02:00
Sascha Hauer 4b34297cfb Get rid of remaining DEVICE_TYPE_* usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:46 +02:00
Sascha Hauer a2b7cd183b introduce cdev
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:44 +02:00
Sascha Hauer dba6c8ed44 fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-03-19 18:23:48 +01:00
Nishanth Menon aec8bdd7e5 Commands:NAND: Rmove unwanted prints remove unwanted prints which can interfere with protocols such as kermit downloads
Signed-off-by: Nishanth Menon <x0nishan@ti.com>
2008-09-15 10:11:04 +02:00
Sascha Hauer 2f6ccbb9f8 NAND: Calculate size of bb devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-03 14:53:26 +02:00
Sascha Hauer f118d1a103 NAND: fix reading of bad block aware devices
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>
2008-09-03 14:04:15 +02:00
Sascha Hauer 9fc8c4e9bb nand: add nand -b for marking blocks as bad
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-02 17:22:46 +02:00
Sascha Hauer 1fbb5f65d6 nand: Allow adding/removing of more than one bad block aware device at once
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:15 +02:00
Sascha Hauer ccd76741c4 NAND: nand command updates
- allow removal of bad block aware devices
- turn printfs into debug

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:14 +02:00
Sascha Hauer 3d45abb7c4 [NAND] continue to make it work. Now works partly on at91sam9260 2008-06-06 09:30:39 +02:00
Sascha Hauer f3351ebd78 add basic at91sam9260 support. Currently only second stage
bootloader is supported:
- No SDRAM initialisation
- No UART init / baudrate change
2008-06-06 09:30:32 +02:00