aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2023-12-21bootm: Rename do_bootm_states() to bootm_run_states()Simon Glass
Rename the function to bootm_run_states() to better indicate ts purpose. The 'do_' prefix is used to indicate a command processor, which this is now not. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-21bootm: Drop arguments from do_bootm_states()Simon Glass
Use the bootm_info struct to hold the information required by bootm. Now that none of the functions called from do_bootm_states() needs an argv[] list, change the arguments of do_bootm_states() as well. Take care to use the same value for boot_progress even though it is a little inconsistent. For booti make sure it only uses argv[] and argc at the top of the function, so we can eventually refactor to remove these parameters. With bootm, some OSes need access to the arguments provided to the command, so set these up in the bootm_info struct, for bootm only. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-21bootz: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-21booti: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-13cmd: check argc for acpi dumpHeinrich Schuchardt
'acpi dump' without parameter results in a NULL dereference. Check the number of arguments. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13cmd: acpi: fix acpi list commandHeinrich Schuchardt
ACPI tables may comprise either RSDT, XSDT, or both. The current code fails to check the presence of the RSDT table before accessing it. This leads to an exception if the RSDT table is not provided. The XSDT table takes precedence over the RSDT table. The return values of list_rsdt() and list_rsdp() are always zero and not checked. Remove the return values. Addresses in the XSDT table are 64-bit. Adjust the output accordingly. As the RSDT table has to be ignored if the XSDT command is present there is no need to compare the tables in a display command. Anyway the specification does not require that the sequence of addresses in the RSDT and XSDT table are the same. The FACS table header does not provide revision information. Correct the description of dump_hdr(). Adjust the ACPI test to match the changed output format of the 'acpi list' command. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13boot: Drop size parameter from image_setup_libfdt()Simon Glass
The of_size parameter is not used, so remove it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-13bootstd: Add a menu option to bootflow scanSimon Glass
Allow showing a menu and automatically booting, with 'bootflow scan'. This is more convenient than using a script. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13sandbox: Add a dummy booti commandSimon Glass
Add basic sandbox support for 'booti' so we can start to boot the test ARMbian image. This is helpful in checking that it is parsed correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13video: Add a function to clear the displaySimon Glass
Move the code from the 'cls' command into the console file, so it can be called from elsewhere. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13Merge patch series "bootm: Refactoring to reduce reliance on CMDLINE (part A)"Tom Rini
To quote the author: It would be useful to be able to boot an OS when CONFIG_CMDLINE is disabled. This could allow reduced code size. Standard boot provides a way to handle programmatic boot, without scripts, so such a feature is possible. The main impediment is the inability to use the booting features of U-Boot without a command line. So the solution is to avoid passing command arguments and the like to code in boot/ A similar process has taken place with filesystems, for example, where we have (somewhat) separate Kconfig options for the filesystem commands and the filesystems themselves. This series starts the process of refactoring the bootm logic so that it can be called from standard boot without using the command line. Mostly it removes the use of argc, argv and cmdtbl from the internal logic. Some limited tidy-up is included, but this is kept to smaller patches, rather than trying to remove all #ifdefs etc. Some function comments are added, however. A simple programmatic boot is provided as a starting point. This work will likely take many series, so this is just the start. Size growth with this series for firefly-rk3288 (Thumb2) is: arm: (for 1/1 boards) all +23.0 rodata -49.0 text +72.0 This should be removed by: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/11 but it is not included in this series as it is already large enough. No functional change is intended in this series. Changes in v3: - Add a panic if programmatic boot fails - Drop RFC tag Changes in v2: - Add new patch to adjust position of unmap_sysmem() in boot_get_kernel() - Add new patch to obtain command arguments - Fix 'boot_find_os' typo - Pass in the command name - Use the command table to provide the command name, instead of "bootm"
2023-12-13command: Introduce functions to obtain command argumentsSimon Glass
Add some functions which provide an argument to a command, or NULL if the argument does not exist. Use the same numbering as argv[] since it seems less confusing than the previous idea. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com>
2023-12-13bootm: Adjust the parameters of bootm_find_images()Simon Glass
Rather than passing it all the command-line args, pass in the pieces that it needs. These are the image address, the ramdisk address/name and the FDT address/name. Ultimately this will allow usage of this function without being called from the command line. Move the function comment to the header file and tidy it a little. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13treewide: Tidy up semicolon after command macrosSimon Glass
The U_BOOT_CMD_COMPLETE() macro has a semicolon at the end, perhaps inadvertently. Some code has taken advantage of this. Tidy this up by dropping the semicolon from the macro and adding it to macro invocations as required. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-12-09Merge patch series "cmd: bdinfo: Optionally use getopt and implement bdinfo -a"Tom Rini
Clean up our bdinfo command a bit and introduce "bdinfo -a"
2023-12-09cmd: bdinfo: Implement support for printing ethernet settings via bdinfo -eMarek Vasut
Add support for printing ethernet settings only via 'bdinfo -e' . Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-12-09cmd: bdinfo: Implement support for printing memory layout via bdinfo -mMarek Vasut
Add support for printing memory layout only via 'bdinfo -m' . Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-12-09cmd: bdinfo: Optionally use getopt and implement bdinfo -aMarek Vasut
Add optional support for getopt() and in case this is enabled via GETOPT configuration option, implement support for 'bdinfo -a'. The 'bdinfo -a' behaves exactly like bdinfo and prints 'all' the bdinfo information. This is implemented in preparation for other more fine-grained options. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-11-30Merge branch 'staging' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-tegra into next Device tree improvents for Paz00 and DM PMIC convertion of recently merged Tegra boards.
2023-11-28Merge patch series "cmd: add scmi command"Tom Rini
To quote the author: "Scmi" command will be re-introduced per Michal's request. The functionality is the same as I put it in my patch set of adding SCMI base protocol support, but made some tweak to make UT, "ut dm scmi_cmd," more flexible and tolerable when enabling/disabling a specific SCMI protocol for test purpose. Each commit may have some change history inherited from the preceding patch series. Test ==== The patch series was tested on the following platforms: * sandbox
2023-11-28cmd: add scmi command for SCMI firmwareAKASHI Takahiro
This command, "scmi", may provide a command line interface to various SCMI protocols. It supports at least initially SCMI base protocol and is intended mainly for debug purpose. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
2023-11-27Merge patch series "ufs: Add a PCI UFS controller support"Tom Rini
To quote the author: This adds a PCI UFS controller support and enables the support on QEMU RISC-V for testing. Requiring QEMU v8.2+.
2023-11-27cmd: ufs: Correct the help textBin Meng
Remove the additional space and use "sub-system" for consistency with other commands like "scsi" and "usb". Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-27cmd: kconfig: Make ufs prompt look similar to other commandsBin Meng
At present the 'ufs' command prompt does not look similar like other commands. Update it. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-27ufs: Correct the UFS terminlogyBin Meng
UFS stands for Universal Flash Storage, not Subsytem. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-25Merge tag 'u-boot-dfu-next-20231124' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu into next u-boot-dfu-next-20231124 - Make dfu entity name size configurable in KConfig - Implement start-stop for UMS (graceful shutdown via eject) - Improve help messages for cmd/bind - Improve help message for udc bind failures
2023-11-22net: Make NET imply NETDEVICESTom Rini
Normally, when NET is enabled, CMD_NET will then be enabled and in turn NETDEVICES will (likely) be enabled via imply. However, if we disable CMDLINE in a defconfig we now no longer get CMD_NET enabling NETDEVICES for us. This suggestion (as an imply is) really isn't about the network commands but network itself and is a legacy of how intertwined NET/CMD_NET were historically. Move this over to the NET entry instead where it is a more logical fit. Reported-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2023-11-21cmd: bind: Try to improve the (un)bind helpMiquel Raynal
While it may sound totally obvious for the regular U-Boot developer to get the parameters of the bind/unbind commands from the output of 'dm tree', it did not felt straightforward to me until I was explicitly told to look there. And even when I knew the command, I did not make a direct link between the arguments of this command and the columns returned by 'dm tree'. Several of us lost a lot of time because of that, I would like to kindly help other users by slightly improving this textual line. Unfortunately, because of how this string is used (like within the 'help' command) I cannot detail much more, but at least the pointer is there. While we add this message, we can also imply CMD_DM when we enable CMD_BIND so the debug message does not lead to an unknown command. This way the 'dm' command will likely be there unless explicitly disabled. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20231010090304.49335-3-miquel.raynal@bootlin.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-11-21cmd: Change the dependencies between CMD_BIND and USB_GADGETMiquel Raynal
Today CMD_BIND defaults to 'y' when USB_ETHER is enabled. In practice, CMD_BIND should default to 'y' when any USB gadget is enabled not only USB_ETHER. Let's invert the logic of the dependency and use the weak 'imply' keyword to enforce this. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on vim3 Link: https://lore.kernel.org/r/20231010090304.49335-2-miquel.raynal@bootlin.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-11-20cmd: eficonfig: create shortened boot optionsHeinrich Schuchardt
The boot options created by eficonfig should use shortened device-paths to avoid problems if drives are enumerated in a different sequence. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-11-20Merge tag 'v2024.01-rc3' into nextTom Rini
Prepare v2024.01-rc3
2023-11-18cmd: efidebug: add uri device pathMasahisa Kojima
This adds the URI device path option for 'boot add' subcommand. User can add the URI load option for downloading ISO image file or EFI application through network. Currently HTTP is only supported. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-11-18efi_loader: add return to efibootmgr event groupMasahisa Kojima
When the image loaded by efibootmgr returns, efibootmgr needs to clean the resources. Adding the event of returning to efibootmgr is useful to simplify the implementation. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-11-17Merge branch '2023-11-16-assorted-updates' into nextTom Rini
- squashfs improvements, remove common.h in some places, assorted code fixes, fix a few CONFIG symbol names in Kconfig files, bring in linux's <linux/time.h> conversion functions, poplar updates, bcb improvements.
2023-11-16cmd: bcb: extend BCB C API to allow read/write the fieldsDmitrii Merkurev
Currently BCB C API only allows to modify 'command' BCB field. Extend it so that we can also read and modify all the available BCB fields (command, status, recovery, stage). Co-developed-by: Cody Schuffelen <schuffelen@google.com> Signed-off-by: Cody Schuffelen <schuffelen@google.com> Signed-off-by: Dmitrii Merkurev <dimorinny@google.com> Cc: Eugeniu Rosca <erosca@de.adit-jv.com> Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Simon Glass <sjg@chromium.org> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com> Cc: Sean Anderson <sean.anderson@seco.com> Cc: Cody Schuffelen <schuffelen@google.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on vim3 Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-11-16cmd: bcb: support various block device interfaces for BCB commandDmitrii Merkurev
Currently BCB command-line, C APIs and implementation only support MMC interface. Extend it to allow various block device interfaces. Signed-off-by: Dmitrii Merkurev <dimorinny@google.com> Cc: Eugeniu Rosca <erosca@de.adit-jv.com> Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Cc: Simon Glass <sjg@chromium.org> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com> Cc: Sean Anderson <sean.anderson@seco.com> Cc: Cody Schuffelen <schuffelen@google.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on vim3 Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-11-16Merge patch series "nand: Add sandbox tests"Tom Rini
To quote the author: This series tests raw nand flash in sandbox and fixes various bugs discovered in the process. I've tried to do things in a contemporary manner, avoiding the (numerous) variations present on only a few boards. The test is pretty minimal. Future work could test the rest of the nand API as well as the MTD API. Bloat (for v1) at [1] (for boards with SPL_NAND_SUPPORT enabled). Almost everything grows by a few bytes due to nand_page_size. A few boards grow more, mostly those using nand_spl_loaders.c. CI at [2]. [1] https://gist.github.com/Forty-Bot/9694f3401893c9e706ccc374922de6c2 [2] https://source.denx.de/u-boot/custodians/u-boot-clk/-/pipelines/18443
2023-11-16cmd: nand: Map memory before accessing itSean Anderson
In sandbox, all memory must be mapped before accessing it. Do so for the nand command. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-11-14bootstd: Add a return code to bootflow menuSimon Glass
Return an error when the user does not select an OS, so we know whether to boot or not. Move calling of bootflow_menu_run() into a separate function so we can call it from other places. Expand the test to cover these cases. Add some documentation also, while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-07scsi: Forceably finish migration to DM_SCSITom Rini
The migration deadline for moving to DM_SCSI was v2023.04. A further reminder was sent out in August 2023 to the remaining platforms that had not migrated already, and that a few more over the line (or configs deleted). With this commit we: - Rename CONFIG_DM_SCSI to CONFIG_SCSI. - Remove all of the non-DM SCSI code. This includes removing other legacy symbols and code and removes some legacy non-DM AHCI code. - Some platforms that had previously been DM_SCSI=y && SCSI=n are now fully migrated to DM_SCSI as a few corner cases in the code assumed DM_SCSI=y meant SCSI=y. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07lib: uuid: move CONFIG_RANDOM_UUIDAKASHI Takahiro
This option is independent from any commands and should be managed under lib. For instance, drivers/block/rkmtd.c is a user. It would be better to remove this configuration. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-11-07cmd: Make most commands depend on CMDLINESimon Glass
If we disable CMDLINE then we should not ask about enabling the hush parser nor any of the commands that would be run on the command line as it is no longer available. Convert the CMDLINE option into a menuconfig and make every command referenced under cmd/Kconfig depend on it. This leaves as future work moving the commands that are not under the cmd/ hierarchy as future work. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07boot: Move SYS_BOOTM_LEN to be by LEGACY_IMAGE_FORMATTom Rini
This particular option is required for booting all image types, regardless of if we are starting an OS via command line or something else. Move the question for SYS_BOOTM_LEN to be by the question for LEGACY_IMAGE_FORMAT, as that's where our generic OS questions start. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07efi: Rearrange the Kconfig for CMD_BOOTEFI_BOOTMGRSimon Glass
The command should not be used to enable library functionality. Add a new BOOTEFI_BOOTMGR Kconfig for that. Adjust the conditions so that the same code is built. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2023-11-07video: Don't require the font commandSimon Glass
While it is nice to have the font command, using 'select' makes it impossible to build the console code without it. Stop using 'select' and make it default if CONSOLE_TRUETYPE is enabled when asking the command. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07env: Move env_set() out of cmd/nvedit.c and in to env/common.cTom Rini
Inside of env/common.c we already have our helper env_set_xxx functions, and even have a comment that explains why env_set() itself wasn't moved. We now handle that move. This requires that we rename the previous _do_env_set() to env_do_env_set() and note it as an internal env function. Add comments about this function to explain why we do this when we add the prototype. Add a new function, env_inc_id() to allow for the counter to be updated by both commands and callers, and document this as well by the prototype. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07Kconfig: Move CONFIG_SYS_[CP]BSIZE to common/KconfigTom Rini
Move CONFIG_SYS_CBSIZE (console buffer size) and CONFIG_SYS_PBSIZE (console print buffer size) out of cmd/Kconfig and in to common/Kconfig. Create help entries for both which explain their usage and why they are both not entirely command centric. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07qemu: Correct CMD_QFW dependencies in KconfigTom Rini
Rather than selecting CMD_QFW, we should make the option itself by enabled by default on these platforms. Then in the board-specific Kconfig we should select the appropriate back-end as needed if the command is enabled. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07version: Separate our version string from the version commandTom Rini
In order to be able to disable all commands we need to construct our version string in a common file, and have the version command reference that string, like the other users of it do. Create common/version.c with just the strings. Signed-off-by: Tom Rini <trini@konsulko.com>