summaryrefslogtreecommitdiff
path: root/cmd/misc.c
AgeCommit message (Collapse)AuthorFilesLines
2021-08-02global: Convert simple_strtoul() with hex to hextoul()Simon Glass1-3/+3
It is a pain to have to specify the value 16 in each call. Add a new hextoul() function and update the code to use it. Add a proper comment to simple_strtoul() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-19dm: Avoid accessing seq directlySimon Glass1-1/+1
At present various drivers etc. access the device's 'seq' member directly. This makes it harder to change the meaning of that member. Change access to go through a function instead. The drivers/i2c/lpc32xx_i2c.c file is left unchanged for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-23cmd: Add a 'misc' command to access miscellaneous devicesBin Meng1-0/+134
Enable the command "misc" for accessing miscellaneous devices with a MISC uclass driver. The command provides listing all MISC devices as well as read and write functionalities via their drivers. Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-10-23cmd: Rename CMD_MISC to CMD_SLEEPBin Meng1-88/+0
The "cmd/Kconfig" has a TODO description for CMD_MISC that it should really be named as CMD_SLEEP. Change it in the whole source tree. Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-05-19common: Drop linux/delay.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19command: Remove the cmd_tbl_t typedefSimon Glass1-2/+4
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2016-07-25cmd: misc: Add support for fractions in sleepmario.six@gdsys.cc1-1/+20
A feasible way to communicate certain errors for devices that have no other way of signalling besides LEDs is to flash these LEDs. For errors in U-Boot, a script that utilizes the led and sleep commands would be a practicable way, but currently the sleep command can only delay for an integral amount of seconds, which is too slow to create an easily noticeable pattern for flashing LEDs. Therefore, this patch adds support for fractions (down to .001 seconds) to the sleep command. The parsing is kept minimal, simplistic and as robust as possible: After converting the passed string using simple_strtoul and multiplying it with 1000, we search for the first dot, convert the three characters after that into a number (if they are not numbers, we ignore the fractional part and just use the delay we got from simple_strtoul), and add this number to the delay. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass1-0/+67
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>