aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2024-04-14cmd: mtd: OTP access supportArseniy Krasnov
Add access to OTP region. It supports info, dump, write and lock operations. Usage example: 'mtd otpread nand0 u 0 1024' - dump 1024 bytes of user area starting from offset 0 of device 'nand0'. 'mtd otpwrite nand0 10 11223344' - write binary data 0x11, 0x22, 0x33, 0x44 to offset 10 to user area of device 'nand0'. 'mtd otplock nand0 0 1024' - lock 1024 bytes of user area starting from offset 0 of device 'nand0'. 'mtd otpinfo nand0 f' - show info about factory area of device 'nand0'. Link: https://lore.kernel.org/all/20240326223919.3781-1-avkrasnov@salutedevices.com Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2024-04-14cmd: sf: Fix sf probe crashWeizhao Ouyang
Handle the return value of spi_flash_probe_bus_cs() to avoid sf probe crashes. Link: https://lore.kernel.org/all/20240104114619.280513-1-o451686892@gmail.com Signed-off-by: Weizhao Ouyang <o451686892@gmail.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Acked-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2024-04-13Fix references to trace docVincent Stehlé
The README.trace has been moved and converted to rst in commit dce26c7d56ed ("doc: move README.trace to HTML documentation"); fix all the remaining references to this file. Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-12sandbox: move sandbox specifics to booti_setup()Heinrich Schuchardt
Instead of checking a configuration setting in booti_start() adjust the sandbox implementation of booti_setup(). Write a console message when trying to run the booti command on the sandbox indicating that it is not supported. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-04-10Merge patch series "pxe: Allow extlinux booting without CMDLINE enabled"Tom Rini
Simon Glass <sjg@chromium.org> says: This series is the culmanation of the current line of refactoring series. It adjusts pxe to call the booting functionality directly rather than going through the command-line interface. With this is is possible to boot using the extlinux bootmeth without the command line enabled. It also updates fastboot to do a similar thing.
2024-04-10fastboot: Change fastboot_buf_addr to an addressSimon Glass
Given the name of this variable, it should be an address, not a pointer. Update this, to make it easier to use with sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Dmitrii Merkurev <dimorinny@google.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on vim3
2024-04-10bootm: Make OS booting dependent on BOOTMSimon Glass
Booting an OS does not require the 'bootm' command, so change the condition for these options. Move them into boot/ so they don't depend on CMDLINE Note that CMD_BOOTM_PRE_LOAD has been put directly into the bootm code so will need some additional refactoring (and a test!) to allow it to change over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10bootm: Add a Kconfig option for bootm functionalitySimon Glass
Create a separate Kconfig option which enables the bootm logic, separate from the 'bootm' command. This will eventually allow booting without CMDLINE enabled. Update boards which disable CMD_BOOTM to disable BOOTM instead, since CMD_BOOTM now depends on BOOTM Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10Merge patch series "Complete decoupling of zboot logic from commands"Tom Rini
Simon Glass <sjg@chromium.org> says: This series refactors the zboot code to allow it to be used with CONFIG_COMMAND disabled. A new zboot_run() function is used to boot a zimage.
2024-04-10x86: zboot: Separate logic functions from commandsSimon Glass
Move zboot_start() and zboot_info() in with the other logic functions. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10x86: zboot: Move argument processing outside zboot_start()Simon Glass
Process the arguments before calling zboot_start() so that we can separate the command line from the internal logic. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Drop intermediate zboot_go() functionSimon Glass
This function only calls zboot_go() so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Drop intermediate zboot_setup() functionSimon Glass
Move error checking into the caller so that do_zboot_setup() can call zboot_setup() directly. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Move environment setting into zboot_load()Simon Glass
The only difference between the command and the underlying logic is the setting of envrionment variables. Move this out of the command processing since it needs to be done in any case. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Create separate functions for the logicSimon Glass
Separate out the commands from the logic. This will eventually allow the logic to be used when CONFIG_CMDLINE is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Avoid iteration in do_zboot_states()Simon Glass
Drop the iteration and write out each state in full. This will allow the arguments to be reduced and adjusted in future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10x86: zboot: Create a separate ZBOOT option for zboot logicSimon Glass
Most of the functionality of zboot is contained in the logic which handles a zimage. Create a separate Kconfig for the logic so that it can (later) be used without the command itself being enabled. Enable ZBOOT by default on x86, with the command depending on that. The existing 'imply' can therefore be removed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10x86: zboot: Move command code into its own fileSimon Glass
Much of the code in zimage.c deals with the zboot command. Move it into a sepatate zboot.c file within the cmd/ directory. This will eventually allow use of the zimage logic without the command being enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10cmd: sysboot: null check filenameCaleb Connolly
Currently if ${bootfile} is unset and sysboot is invoked with no filename specified then U-Boot will crash will a null-pointer dereference. Add the missing check and a matching error print. Fixes: 993c912d304d ("cmd: sysboot: Create a sysboot command dedicated file") Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04cmd: rng: Print "Abort" on -EINTRMarek Behún
In the rng command, print Abort instead of Reading RNG failed if the error number is -EINTR, which can happen if the user pressed CTRL-C. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-02Merge tag 'u-boot-dfu-next-20240402' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dfu u-boot-dfu-next-20240402 - Implement Qualcomm wrapper for dwc3 - Multiple sector size support for UMS - CDC ACM gadget initialization fix - Refactor board code from dwc3 to prepare better interrupt support - Bugfix for for qcom-smmu when compiling with -DDEBUG
2024-03-27cmd: smbios: type 1 wake-up time, familyHeinrich Schuchardt
Correct type 1 output * render wake up time as string * print family string * remove duplicate serial number output Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-27acpi: rename aslc_id, aslc_revisionHeinrich Schuchardt
The fields Creator ID and Creator Revision contain information about the tool that created an ACPI table. This may be the ASL compiler for some tables but it is not for others. Naming these fields aslc_id and aslc_revision is misleading. It is usual to see diverse values of Creator ID. On a laptop I saw these: 'AMD ', 'INTL, 'MSFT', 'PTEC'. Obviously not all relate to the Intel ASL compiler. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-25Merge tag 'v2024.04-rc5' into nextTom Rini
Prepare v2024.04-rc5
2024-03-22usb: gadget: UMS: support multiple sector sizesCaleb Connolly
UFS storage often uses a 4096-byte sector size, add support for dynamic sector sizes based loosely on the Linux implementation. Support for dynamic sector sizes changes the types used in some divisions, resulting in the compiler attempting to use libgcc helpers (__aeabi_ldivmod). Replace these divisions with calls to lldiv() to handle this correctly. Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-4-41be480172e1@linaro.org [mkorpershoek: squashed the lldiv() fix from caleb] Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-03-21cmd: bootefi: error handling bootefi selftestHeinrich Schuchardt
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>
2024-03-21cmd: bootefi: Don't show usage help if EFI binary fails.Heinrich Schuchardt
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>
2024-03-19Merge tag 'u-boot-socfpga-next-20240319' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga into next - A new driver in the misc to register setting from device tree. This also provides user a clean interface and all register settings are centralized in one place, device tree. - Enable Agilex5 platform for Intel product. Changes, modification and new files are created for board, dts, configs and makefile to create the base for Agilex5. Build-tested on SoC64 boards, boot tested on some of them.
2024-03-15Merge tag 'u-boot-rockchip-20240315' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-rockchip into next Please pull the updates for rockchip platform: - Add board: rk3588 Generic, Cool Pi CM5, Theobroma-Systems RK3588 Jaguar SBC, Toybrick TB-RK3588X; rk3588s Cool Pi 4B; rk3566 Pine64 PineTab2; - Add saradc v2 support; - Add PMIC RK806 support; - rk3588 disable force_jtag by default; - Migrate to use IO-domain driver for all boards; - Use common bss and stack addresses for rk33xx and rk35xx boards; - Other updates for driver, config and dts;
2024-03-14pmic: reword help textQuentin Schulz
Reword the help text for the pmic read and pmic write commands to better match what's expected from the user. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-03-13cmd: add FDT setup for bootelf by flagMaxim Moskalets
Added the ability to use FDT for ELF applications, required to run some OS. To make FDT setup, you need to set the -d fdt_addr_r cmd option for bootelf command. Enable by selecting CMD_ELF_FDT_SETUP. Signed-off-by: Maxim Moskalets <Maxim.Moskalets@kaspersky.com>
2024-03-13cli: allow users to determine history buffer allocation methodHanyuan Zhao
This commit allows users to choose the appropriate memory allocation method between static allocated and dynamically calloc. The previous static-array way will not obviously contribute to the final binary size since it is uninitialized, and might have better performance than the dynamical one. Now we provide the users with both the two options. Signed-off-by: Hanyuan Zhao <hanyuan-z@qq.com>
2024-03-13cmd: rng: Add rng list commandWeizhao Ouyang
The 'rng list' command probes all RNG devices and list those devices that are successfully probed. Also update the help info. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
2024-03-12cmd: sbi: formatting PolarFire Hart Software Services versionHeinrich Schuchardt
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>
2024-03-12cmd: sbi: Correctly display unknown implementation IDsHeinrich Schuchardt
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>
2024-03-07cmd: md5sum: use hash_commandIgor Opaniuk
Drop old implementation and use hash_command() instead, as how it's currently done for crc32 and sha1sum cmds. Test: => md5sum 0x60000000 0x200 md5 for 60000000 ... 600001ff ==> e6bbbe95f5b41996f4a9b9af7bbd4050 Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2024-03-04cmd: eeprom: Fix config dependencyIvan Orlov
We should have CONFIG_DM_I2C or CONFIG_SYS_I2C_LEGACY enabled in order for `cmd/eeprom.c` to compile as it depends on the i2c functions which are not compiled otherwise. Update the Kconfig entry for the 'eeprom' command correspondingly. Signed-off-by: Ivan Orlov <ivan.orlov@codethink.co.uk> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-03-04fs: drop reiserfsPeter Robinson
It was only included by a single board which doesn't appear to have ever used it for any default use cases so drop the filesystem now that isn't used by any in-tree configurations. Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2024-03-02cmd: remove common.h from exception command implementationsHeinrich Schuchardt
The common.h should not be used anymore. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-03-02cmd: setexpr: fix no matching string in gsub return empty valueMassimiliano Minella
In gsub, when the destination string is empty, the string 't' is provided and the regular expression doesn't match, then the final result is an empty string. Example: => echo ${foo} => setenv foo => setexpr foo gsub e a bar => echo ${foo} => The variable ${foo} should contain "bar" and the lack of match shouldn't be considered an error. This patch fixes the erroneous behavior by removing the return statement and breaking out of the loop in case of lack of match. Also add a test for the no match case. Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
2024-02-15cmd: avb: rework do_avb_verify_partIgor Opaniuk
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>
2024-02-15cmd: avb: rework printsIgor Opaniuk
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>
2024-02-15avb: move SPDX license identifiers to the first lineIgor Opaniuk
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>
2024-02-13cmd: hash: fix param count checkIgor Opaniuk
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>
2024-02-02smbios: correctly name Structure Table Maximum Size fieldHeinrich Schuchardt
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>
2024-02-02cmd: smbios: show correct table size for SMBIOS2.1 entry pointHeinrich Schuchardt
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>
2024-02-02cmd: smbios: replace missing string by 'Not Specified'Heinrich Schuchardt
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>
2024-02-02cmd: smbios: add missing colon after UUIDHeinrich Schuchardt
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>
2024-02-02cmd: smbios: always use '0x%04x' for printing handlesHeinrich Schuchardt
Handles are u16 numbers. Consistently use '0x%04x' to print them. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-31cmd: sbi: add support for Debug Trigger ExtensionHeinrich Schuchardt
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>