aboutsummaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* cmd: bootefi: error handling bootefi selftestHeinrich Schuchardt2024-03-211-3/+1
| | | | | | | | | | | | If bootefi selftest is executed and a problem with the device-tree installation occurs, efi_install_fdt() writes sensible error messages. It never returns EFI_INVALID_PARAMETER. It neither makes sense to check for EFI_INVALID_PARAMETER nor to show the usage help for the bootefi command in this case. Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: bootefi: Don't show usage help if EFI binary fails.Heinrich Schuchardt2024-03-211-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | If an EFI binary returns an error code EFI_INVALID_PARAMETER, we show the usage help for the bootefi command: Shell> exit 0x8000000000000002 ## Application failed, r = 2 bootefi - Boots an EFI payload from memory Usage: bootefi <image address>[:<image size>] [<fdt address>] - boot EFI payload bootefi bootmgr [fdt address] - load and boot EFI payload based on BootOrder/BootXXXX variables. If specified, the device tree located at <fdt address> gets exposed as EFI configuration table. This makes no sense. Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: sbi: formatting PolarFire Hart Software Services versionHeinrich Schuchardt2024-03-121-0/+1
| | | | | | | | The 'PolarFire Hart Software Services' SBI implementation returns the version of the incorporated OpenSBI. Format the number accordingly. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
* cmd: sbi: Correctly display unknown implementation IDsHeinrich Schuchardt2024-03-121-1/+1
| | | | | | | | | | | | | | | | | | | For an unknown implementation ID an output like SBI 1.0Unknown implementation ID 16777216 Extensions: sbi_set_timer ... was shown. The number 16777216 is not the implementation ID. * Show the correct number * Use a hexadecimal output format * Add a missing line feed Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
* cmd: avb: rework do_avb_verify_partIgor Opaniuk2024-02-151-33/+17
| | | | | | | | | | | | Use existing str_avb_slot_error() function for obtaining verification fail reason details. Take into account device lock state for setting correct androidboot.verifiedbootstate kernel cmdline parameter. Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Link: https://lore.kernel.org/r/20240209192045.3961832-7-igor.opaniuk@foundries.io Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
* cmd: avb: rework printsIgor Opaniuk2024-02-151-48/+75
| | | | | | | | | Simplify and add more context for prints where it's needed. Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240209192045.3961832-5-igor.opaniuk@foundries.io Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
* avb: move SPDX license identifiers to the first lineIgor Opaniuk2024-02-151-3/+1
| | | | | | | | | | | | | | | | | | | Move SPDX license identifiers to the first line, so it conforms to license placement rule [1]: Placement: The SPDX license identifier in kernel files shall be added at the first possible line in a file which can contain a comment. For the majority of files this is the first line, except for scripts which require the '#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX identifier goes into the second line. [1] https://www.kernel.org/doc/Documentation/process/license-rules.rst Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Link: https://lore.kernel.org/r/20240209192045.3961832-3-igor.opaniuk@foundries.io Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
* cmd: hash: fix param count checkIgor Opaniuk2024-02-131-9/+10
| | | | | | | | | | | | | | | | | | | | | | Add correct check for parameter count. This fixes this issue when `hash` cmd is invoked without params: => hash data abort pc : [<bf739204>] lr : [<ba6effa8>] reloc pc : [<60019204>] lr : [<5afcffa8>] sp : ba6dd9c8 ip : bf7391f0 fp : bf74ec14 r10: 00000001 r9 : ba6dfea0 r8 : bf7ea030 r7 : 00000000 r6 : ba6effa8 r5 : 00000000 r4 : ffffffff r3 : bf7c257c r2 : 00000001 r1 : 00000000 r0 : bf7e6e34 Flags: nZCv IRQs off FIQs on Mode SVC_32 Code: e5934004 e1a0e003 e59f3050 e2444001 (e5f4c001) Resetting CPU ... resetting ... Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
* smbios: correctly name Structure Table Maximum Size fieldHeinrich Schuchardt2024-02-021-1/+1
| | | | | | | | | | In the SMBIOS 3 entry point the Structure Table Maximum Size field was incorrectly named max_struct_size. A Maximum Structure Size field only exists in the SMBIOS 2.1 entry point and has a different meaning. Call the Structure Table Length field table_maximum_size. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* cmd: smbios: show correct table size for SMBIOS2.1 entry pointHeinrich Schuchardt2024-02-021-4/+4
| | | | | | | | | | | The SMBIOS table size for SMBIOS2.1 entry points is in field 'Structure Table Length' (offset 0x16) and not in field 'Maximum Structure Size' (offset 0x08). Rename the receiving variable max_struct_size to table_maximum_size to avoid future confusion. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* cmd: smbios: replace missing string by 'Not Specified'Heinrich Schuchardt2024-02-021-1/+5
| | | | | | | A missing string value is indicated by a string index of 0. In this case print 'Not Specified' like the Linux dmidecode command does. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* cmd: smbios: add missing colon after UUIDHeinrich Schuchardt2024-02-021-1/+1
| | | | | | | For consistent formatting add a colon ':' after the UUID label. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: smbios: always use '0x%04x' for printing handlesHeinrich Schuchardt2024-02-021-2/+2
| | | | | | Handles are u16 numbers. Consistently use '0x%04x' to print them. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* cmd: sbi: add support for Debug Trigger ExtensionHeinrich Schuchardt2024-01-311-0/+1
| | | | | | | Detect and show if the SBI implements the Debug Trigger Extension. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
* cmd: in do_efi_capsule_esrt use efi_get_configuration_tableHeinrich Schuchardt2024-01-291-5/+2
| | | | | | | Use library function efi_get_configuration_table() to find the ESRT. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: provide command to display SMBIOS informationHeinrich Schuchardt2024-01-263-0/+198
| | | | | | | | | | | | | | | U-Boot can either generated an SMBIOS table or copy it from a prior boot stage, e.g. QEMU. Provide a command to display the SMBIOS information. Currently only type 1 and 2 are translated to human readable text. Other types may be added later. Currently only a hexdump and the list of strings is provided for these. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: bootmenu: rename U-Boot console to ExitSvyatoslav Ryhel2024-01-241-5/+5
| | | | | | | | | | | It seems that the U-Boot console entry of the bootmenu has lost its original meaning. Now, even if it is chosen, the probability that you will enter the actual U-Boot console is quite low. Boot env, bootflow, bootcommand script may appear, but not the actual console. Hence, let's remove ambiguity and name this entry by what it actually does: 'Exit' the bootmenu. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
* cmd: increase default for SYS_MAXARGSHeinrich Schuchardt2024-01-241-1/+1
| | | | | | | | | | | The value of CONFIG SYS_MAXARGS limits the usability of the 'for' command. The current default of 16 is too low for some use case. Cf. https://bugs.launchpad.net/snap-core18/+bug/1910094 Increase the default to 64. Reported-by: Dave Jones <dave.jones@canonical.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* cmd/flash: Make this default y for CFI and NOR onlyTom Rini2024-01-221-1/+1
| | | | | | | | | This command is only useful on CFI and NOR type flashes and not others. Update the dependency so that it's not enabled by default in other cases. This will lead to a number of platforms no longer building this command, where it was not useful. Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd/mtdparts: Make this select MTD_PARTITIONSTom Rini2024-01-221-0/+1
| | | | | | | Rather than rely on someone selecting or implying this hidden symbol that the command requires, select it explicitly. Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd: license: Add CONFIG_GZIP dependencyIvan Orlov2024-01-181-0/+1
| | | | | | | | | | | 'License' command processing code could be successfully compiled only when CONFIG_GZIP option is enabled, otherwise it can't find the 'gunzip' function definition (it is defined in lib/gunzip.c). Add CONFIG_GZIP dependency to 'license' command config option in the corresponding Kconfig. Signed-off-by: Ivan Orlov <ivan.orlov@codethink.co.uk>
* cmd: bootflow: remove dead code in do_bootflow_cmdline()Heinrich Schuchardt2024-01-181-2/+0
| | | | | | | | Checking argc < 3 twice is redundant. Addresses-Coverity-ID: 477198 Logically dead code Fixes: 921f63e57238 ("bootflow: Allow setting a cmdline arg with no value") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* getchar(): Correct usageTom Rini2024-01-181-2/+2
| | | | | | | | | | | The function getchar() returns an 'int' and not a 'char'. Coverity notes that "Assigning the return value of getchar to char ... truncates its value." and so for the most part we can resolve this easily by using 'int' as intended, and often used throughout the codebase. A few places are not so simple and would require further re-architecting of the code in order to change this, so we leave them be. Signed-off-by: Tom Rini <trini@konsulko.com>
* Revert "cmd: Set modern hush as default shell"Tom Rini2024-01-181-1/+5
| | | | | | | | | | Currently at least two SoC families are able to cause a crash using their regular boot scripts, with the new parser. For now, revert to the old parser as default. This reverts commit 78912cfde281146d28254b230ecaa9b06722e6ff. Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge tag 'efi-2024-04-rc1-2' of ↵Tom Rini2024-01-172-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.denx.de/u-boot/custodians/u-boot-efi Documentation: * add generated index to table of contents * create index entries for commands * update Python packages used to build the documentation * fix typos in dfu documentation UEFI: * split unrelated code from efi_bootmgr.c * rename CONFIG_BOOTEFI_BOOTMGR to CONFIG_EFI_BOOTMGR * net: tftp: remove explicit EFI configuration dependency * fs: remove explicit EFI configuration dependency Other: * Add Goldfish RTC driver and make it available on RISC-V QEMU
| * efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGRAKASHI Takahiro2024-01-172-4/+4
| | | | | | | | | | | | | | | | At this point, EFI boot manager interfaces is fully independent from bootefi command. So just rename the configuration parameter. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * efi_loader: split unrelated code from efi_bootmgr.cAKASHI Takahiro2024-01-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Some code moved from cmd/bootefi.c is actually necessary only for "bootefi <addr>" command (starting an image manually loaded by a user using U-Boot load commands or other methods (like JTAG debugger). The code will never been opted out as unused code by a compiler which doesn't know how EFI boot manager is implemented. So introduce a new configuration, CONFIG_EFI_BINARY_EXEC, to enforce them opted out explicitly. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* | cmd/mem.c: fix wrong use of ifdef, drop pointless SUPPORT_64BIT_DATA macroRasmus Villemoes2024-01-171-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro MEM_SUPPORT_64BIT_DATA is always defined, as either 1 or 0, so using "#ifdef MEM_SUPPORT_64BIT_DATA" doesn't do what one expects. This means that currently all 32 bit targets get compiled with the .q suffix mentioned in the help text, while it doesn't actually work. Use the proper "#if" instead. There's really no point defining another similarly-named macro with exactly the same value, so just use MEM_SUPPORT_64BIT_DATA throughout. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* | cmd/mem.c: use memmove in do_mem_cp()Rasmus Villemoes2024-01-161-1/+1
|/ | | | | | | | | | | | There's no 'mv' shell command for handling overlapping src and dst regions, and there's no point introducing one, when we can just make the existing 'cp' command DTRT in all cases. memmove() should at most be a few instructions more then memcpy() (to detect the appropriate direction to do the copy), which is of course completely in the noise with all the string processing that a shell command does. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
* cmd: mtd: avoid unintentional integer overflowHeinrich Schuchardt2024-01-151-2/+2
| | | | | | | | | | | | | mtd dump beyond 4 GiB will show incorrect results. Multiplying two u32 will yield a u32. Add a missing cast. Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command") Addresses-Coverity-ID: 477205 ("Unintentional integer overflow") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/all/20240111073155.19545-1-heinrich.schuchardt@canonical.com Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
* cmd: efidebug: check pointer after memory allocationHeinrich Schuchardt2024-01-131-0/+4
| | | | | | | | | After calling efi_alloc() we must check that the return value is not NULL. Fixes: f01c961ee34c ("cmd: efidebug: add uri device path") Addresses-Coverity-ID: 477185 Dereference null return value Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* efi_loader: Clean up efi_dp_append and efi_dp_concatIlias Apalodimas2024-01-132-6/+7
| | | | | | | | | | | | | | | | | | Looking back at the initrd storing functionality, we introduced three functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In hindsight we could have simplified that by a lot. First of all none of the functions append anything. They all allocate a new device path and concatenate the contents of two device paths in one. A boolean parameter controls the final device path -- if that's true an end node is injected between the two device paths. So let's rewrite this and make it a bit easier to read. Get rid of efi_dp_append(), efi_dp_concat() and rename efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more intuitive and the only adjustment that is needed is an extra boolean argument on all callsites. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* cmd: acpi: check HW reduced flag in acpi listHeinrich Schuchardt2024-01-071-0/+4
| | | | | | | | | | On non x86 platforms the hardware reduce flag must be set in the FADT table. Write an error message if the flag is missing. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Rebased on -next to use nomap, add hyphens: Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd: acpi: fix listing DSDT and FACSHeinrich Schuchardt2024-01-071-2/+6
| | | | | | | | | | If field X_FIRMWARE_CTRL is filled, field FIRMWARE must be ignored. If field X_DSDT is filled, field DSDT must be ignored. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Rebased on -next to use nomap: Signed-off-by: Simon Glass <sjg@chromium.org>
* acpi: Write pointers to tables instead of addressesSimon Glass2024-01-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Sandbox uses an API to map between addresses and pointers. This allows it to have (emulated) memory at zero and avoid arch-specific addressing details. It also allows memory-mapped peripherals to work. As an example, on many machines sandbox maps address 100 to pointer value 10000000. However this is not correct for ACPI, if sandbox starts another program (e.g EFI app) and passes it the tables. That app has no knowledge of sandbox's address mapping. So to make this work we want to store 10000000 as the value in the table. Add two new 'nomap' functions which clearly make this exeption to how sandbox works. This should allow EFI apps to access ACPI tables with sandbox, e.g. for testing purposes. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge patch series "Modernize U-Boot shell"Tom Rini2023-12-283-0/+156
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Francis Laniel <francis.laniel@amarulasolutions.com> says: During 2021 summer, Sean Anderson wrote a contribution to add a new shell, based on LIL, to U-Boot [1, 2]. While one of the goals of this contribution was to address the fact actual U-Boot shell, which is based on Busybox hush, is old there was a discussion about adding a new shell versus updating the actual one [3, 4]. So, in this series, with Harald Seiler, we updated the actual U-Boot shell to reflect what is currently in Busybox source code. Basically, this contribution is about taking a snapshot of Busybox shell/hush.c file (as it exists in commit 37460f5da) and adapt it to suit U-Boot needs. This contribution was written to be as backward-compatible as possible to avoid breaking the existing. So, the modern hush flavor offers the same as the actual, that is to say: 1. Variable expansion. 2. Instruction lists (;, && and ||). 3. If, then and else. 4. Loops (for, while and until). No new features offered by Busybox hush were implemented (e.g. functions). It is possible to change the parser at runtime using the "cli" command: => cli print old => cli set modern => cli print modern => cli set old The default parser is the old one. Note that to use both parser, you would need to set both CONFIG_HUSH_MODERN_PARSER and CONFIG_HUSH_OLD_PARSER. In terms of testing, new unit tests were added to ut to ensure the new behavior is the same as the old one and it does not add regression. Nonetheless, if old behavior was buggy and fixed upstream, the fix is then added to U-Boot [5]. In sandbox, all of these tests pass smoothly: => printenv board board=sandbox => ut hush Running 20 hush tests ... Failures: 0 => cli set modern => ut hush Running 20 hush tests ... Failures: 0 Thanks to the effort of Harald Seiler, I was successful booting a board: => printenv fdtfile fdtfile=amlogic/meson-gxl-s905x-libretech-cc.dtb => cli get old => boot ... root@lepotato:~# root@lepotato:~# reboot ... => cli set modern => cli get modern => printenv fdtfile fdtfile=amlogic/meson-gxl-s905x-libretech-cc.dtb => boot ... root@lepotato:~# This contribution indeed adds a lot of code and there were concern about its size [6, 7]. With regard to the amount of code added, the cli_hush_upstream.c is 13030 lines long but it seems a smaller subset is really used: gcc -D__U_BOOT__ -E common/cli_hush_upstream.c | wc -l 2870 Despite this, it is better to still have the whole upstream code for the sake of easing maintenance. With regard to memory size, I conducted some experiments for version 8 of this series and for a subset of arm64 boards and found the worst case to be 4K [8]. Tom Rini conducted more research on this and also found the increase to be acceptable [9]. If you want to review it - your review will really be appreciated - here are some information regarding the commits: * commits marked as "test:" deal with unit tests. * commit "cli: Add Busybox upstream hush.c file." copies Busybox shell/hush.c into U-Boot tree, this explain why this commit contains around 12000 additions. * commit "cli: Port Busybox 2021 hush to U-Boot." modifies previously added file to permit us to use this as new shell. The really good idea of #include'ing Busybox code into a wrapper file to define some particular functions while minimizing modifications to upstream code comes from Harald Seiler. * commit "cmd: Add new parser command" adds a new command which permits selecting parser at runtime. I am not really satisfied with the fact it calls cli_init() and cli_loop() each time the parser is set, so your reviews would be welcomed. * Other commits focus on enabling features we need (e.g. if).
| * cmd: Set modern hush as default shellFrancis Laniel2023-12-281-5/+1
| | | | | | | | Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
| * cli: Enables using modern hush parser as command line parserFrancis Laniel2023-12-283-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | If one defines HUSH_MODERN_PARSER, it is then possible to use modern parser with: => cli get old => cli set modern => cli get modern Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
| * cmd: Add new cli commandFrancis Laniel2023-12-282-0/+116
| | | | | | | | | | | | | | | | This command can be used to print the current parser with 'cli get'. It can also be used to set the current parser with 'cli set'. For the moment, only one value is valid for set: old. Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
| * cli: Add menu for hush parserFrancis Laniel2023-12-281-0/+13
|/ | | | | | | | | | For the moment, the menu contains only entry: HUSH_OLD_PARSER which is the default. The goal is to prepare the field to add a new hush parser which guarantees actual behavior is still correct. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Francis Laniel <francis.laniel@amarulasolutions.com>
* Merge patch series "Complete decoupling of bootm logic from commands"Tom Rini2023-12-213-47/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simon Glass <sjg@chromium.org> says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working
| * bootm: Create a function to run through the bootz statesSimon Glass2023-12-211-7/+2
| | | | | | | | | | | | | | | | | | In a few places, the bootz command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new bootz_run() function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * bootm: Create a function to run through the bootm statesSimon Glass2023-12-211-13/+1
| | | | | | | | | | | | | | | | | | In quite a few places, the bootm command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new bootm_run() function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * bootm: Rename do_bootm_states() to bootm_run_states()Simon Glass2023-12-213-6/+6
| | | | | | | | | | | | | | | | | | 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>
| * bootm: Drop arguments from do_bootm_states()Simon Glass2023-12-213-17/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * bootz: Avoid use of #ifdefSimon Glass2023-12-211-9/+8
| | | | | | | | | | | | | | 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>
| * booti: Avoid use of #ifdefSimon Glass2023-12-211-13/+11
| | | | | | | | | | | | | | 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>
* | cmd: part: Cover both part type entries with GUID ifdefMarek Vasut2023-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | The 'part type' subcommand depends on GUID partition table support. The help text exposes one of two 'part type' subcommand entries, hide both in case GUID partition table support is not enabled to avoid confusing users. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* | bootflow: Allow setting a cmdline arg with no valueSimon Glass2023-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | This is supposed to be supported by the 'bootflow cmd' command, at least according to the help. There is a 'bootflow cmd clear' but it is often more intuitive to use 'bootcmd cmd set' with an empty value. Update the command to pass BOOTFLOWCL_EMPTY in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
* | arm: afs: Set the filesize env. var. on loadRobert Catherall2023-12-201-2/+10
| | | | | | | | | | | | | | | | | | The `afs load` command copies data to RAM. Set the filesize environment variable to record how much data was 'loaded' Signed-off-by: Robert Catherall <robert.catherall@arm.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Andre Przywara <andre.przywara@arm.com>