path: root/commands/detect.c
Commit message (Collapse)AuthorAgeFilesLines
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-18/+5
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <> Signed-off-by: Sascha Hauer <>
* driver: Add device_detect_all() functionSascha Hauer2017-12-011-3/+1
| | | | | | | | Add a device_detect_all function to detect all devices and use it in the detect command. This makes the functionality reusable in other code. Signed-off-by: Sascha Hauer <>
* detect command: Drop -e optionSascha Hauer2017-12-011-13/+10
| | | | | | | | | | | | | | | The -e option is not that useful. Normally, when a device cannot be detected, then there should be no reason to not try to detect other devices. When a user is interested in a particular detect result, detect can still be called with that (and only that) device. We could also argue that the user should not care about the result of the detect call, but instead check if the desired device is present afterwards. Drop handling of the -e option, but still ignore it for compatibility reasons. Signed-off-by: Sascha Hauer <>
* commands: detect: use device_detect_by_nameSascha Hauer2015-06-261-4/+1
| | | | | | | Instead of looking up the device ourselves let device_detect_by_name do the work. Signed-off-by: Sascha Hauer <>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <> Signed-off-by: Sascha Hauer <>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | 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 <> Signed-off-by: Sascha Hauer <>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <>
* detect command: Add missing help text for -a optionSascha Hauer2013-09-271-0/+1
| | | | Signed-off-by: Sascha Hauer <>
* detect command: Add -a option to detect all devicesSascha Hauer2013-06-211-1/+16
| | | | Signed-off-by: Sascha Hauer <>
* devices: add detect mechanismSascha Hauer2013-05-311-0/+77
We often encounter the situation where slow devices should not be probed during startup since probing is slow and maybe unnecessary for unused devices. With MMC we have the 'probe' device parameter, for ata we have the same, for USB we have the 'usb' command. Overall this is not very consistent. With MMC there is the additional problem that the probe parameter is attached to the logical device when we often have the information which physical device we want to probe. This patch adds a 'detect' callback for devices and adds a command to detect devices and to list the devices which are actually detecable. Signed-off-by: Sascha Hauer <>