summaryrefslogtreecommitdiffstats
path: root/commands/clk.c
Commit message (Collapse)AuthorAgeFilesLines
* clk: fix clk_set_rate command help textDenis Orlov2024-03-251-1/+1
| | | | | | | | | | It was at odds with the list of options, with the former mentioning RATE and the latter mentioning HZ as a parameter. It seems that every other clk-related command uses HZ, so use it here too. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20240320164404.15347-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use pr_setenv() where appropriateSascha Hauer2022-06-211-7/+3
| | | | | | | We now have pr_setenv() which is a setenv() variant that takes a format string. Use it where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: fix clk_round_rate command descriptionDenis Orlov2022-05-201-2/+2
| | | | | | Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20220520065519.28173-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: set SPDX-License-Identifier for files without license statementAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | | In absence of a dual licensing statement, this is GPL-2.0-only as the barebox project as a whole. Add a SPDX-License-Identifier to make this clear. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: Add clk_name_* functionsSascha Hauer2021-06-211-16/+2
| | | | | | | | | | | At some places a clk name may be known without having a struct clk * directly. Add some convenience functions to handle this situation and use them in the clk commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-2-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add clk_round_rate commandSascha Hauer2021-06-161-0/+32
| | | | | | | | | | clk_round_rate returns the rate a clk rate will result to if called clk_set_rate on it with that rate. Add a command for it as it comes in handy sometimes for testing and debugging purposes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615131849.17418-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk_dump command: Allow printing a single clockSascha Hauer2020-09-231-2/+13
| | | | | | | | So far the clk_dump command can only print all clocks. With this patch we can limit the output to ancestors and children of a given clock. This makes it easier to find the desired information in big clock trees. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: add clock command completionSascha Hauer2016-11-081-0/+5
| | | | | | This adds tab completion for the clk_* commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* stdio: replace fprintf(stderr,...) with eprintfSascha Hauer2016-04-151-1/+1
| | | | | | | We have a shortcut for fprintf(stderr, so use it. This is done to be able to remove fprintf in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+1
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: clk_dump: use COMMAND_SUCCESS instead of 0 return codeAntony Pavlov2015-10-261-2/+2
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: add clk_get_rate commandAntony Pavlov2015-10-221-0/+55
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-27/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | | | | | | 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: Add clk commandsSascha Hauer2012-10-041-0/+144
This adds some basic commands to manupulate clocks on the command line. Right now we have: - clk_set_parent - clk_set_rate - clk_enable - clk_disable - clk_dump The commands work based on the clock name, otherwise they behave like the Linux Kernel C functions. clk_dump will dump the clocktree to the console. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>