aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2023-02-19efi_loader: Measure the loaded DTBEtienne Carriere
Measures the DTB passed to the EFI application upon new boolean config switch CONFIG_EFI_TCG2_PROTOCOL_MEASURE_DTB. For platforms where the content of the DTB passed to the OS can change across reboots, there is not point measuring it hence the config switch to allow platform to not embed this feature. Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-02-13Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- mvebu: Support for 2 new Armada 385 boards (Tony) - mvebu: Minor misc board enhancements (Tony) - kirkwood: Serial driver fixes (Kconfig & dtsi) (Tony) - cmd: return code when tlv_eeprom incorrectly called (Heinrich)
2023-02-13cmd: return code when tlv_eeprom incorrectly calledHeinrich Schuchardt
A command called with incorrect parameters should set $? to 1 (false). Instead of calling cmd_usage(cmdtp) and then returning 0 just return CMD_RET_FAILURE. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de>
2023-02-12cmd: fdt: allow standalone "fdt move"Andre Przywara
At the moment every subcommand of "fdt", except "addr" itself, requires the DT address to be set first. We explicitly check for that before even comparing against the subcommands' string. This early bailout also affects the "move" subcommand, even though that does not require or rely on a previous call to "fdt addr". In fact it even sets the FDT address to the target of the move command, so is a perfect beginning for a sequence of fdt commands. Move the check for a previously set FDT address to after we handle the "move" command also, so we don't need a dummy call to "fdt addr" first, before being able to move the devicetree. This skips one pointless "fdt addr" call in scripts which aim to alter the control DT, but need to copy it to a safe location first (for instance to $fdt_addr_r). Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-12cmd: fdt: move: Use map_sysmem to convert pointersAndre Przywara
The "fdt move" subcommand was using the provided DTB addresses directly, without trying to "map" them into U-Boot's address space. This happened to work since on the vast majority of "real" platforms there is a simple 1:1 mapping of VA to PAs, so either value works fine. However this is not true on the sandbox, so the "fdt move" command fails there miserably: => fdt addr $fdtcontroladdr => cp.l $fdtcontroladdr $fdt_addr_r 40 # simple memcpy works => fdt move $fdtcontroladdr $fdt_addr_r Segmentation fault Use the proper "map_sysmem" call to convert PAs to VAs, to make this more robust in general and to enable operation in the sandbox. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-12cmd: clk: probe the clock before dump themPatrick Delaunay
The clock UCLASS need to be probed to allow availability of the private data (struct clk *), get in show_clks() with dev_get_clk_ptr() before use them. Without this patch the clock dump can cause crash because all the private data are not available before calling the API clk_get_rate(). It is the case for the SCMI clocks, priv->channel is needed for scmi_clk_get_rate() and it is initialized only in scmi_clk_probe(). This issue causes a crash for "clk dump" command on STM32MP135F-DK board for SCMI clock not yet probed. Fixes: 1a725e229096 ("clk: fix clock tree dump to properly dump out every registered clock") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20221213145708.v2.1.Ia0bc6b272f1e2e3f37873c61d79138c2663c4055@changeid
2023-02-10Merge tag 'efi-2023-04-rc2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2023-04-rc2 Documentation: * Provide page with links to talks on U-Boot UEFI: * Enable CTRL+S to save the boot order in eficonfig command * Run attribute check for QueryVariableInfo() only for the file store * Bug fixes Others: * Improve output formatting of the coninfo command # -----END PGP SIGNATURE----- # gpg: Signature made Fri 10 Feb 2023 12:15:45 PM EST # gpg: using RSA key 6DC4F9C71F29A6FA06B76D33C481DBBC2C051AC4 # gpg: Good signature from "Heinrich Schuchardt <xypron.glpk@gmx.de>" [unknown] # gpg: aka "[jpeg image of size 1389]" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6DC4 F9C7 1F29 A6FA 06B7 6D33 C481 DBBC 2C05 1AC4
2023-02-10Correct SPL use of EFI_SECURE_BOOTSimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_SECURE_BOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of EFI_MM_COMM_TEESimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_EFI_MM_COMM_TEE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of VIDEO_ANSISimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_VIDEO_ANSI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL uses of VIDEOSimon Glass
This converts 2 usages of this option to the non-SPL form, since there is no SPL_VIDEO defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10Correct SPL use of USB_FUNCTION_FASTBOOTSimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_USB_FUNCTION_FASTBOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-02-10Correct SPL use of UDP_FUNCTION_FASTBOOTSimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_UDP_FUNCTION_FASTBOOT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-02-10Correct SPL uses of SYS_LONGHELPSimon Glass
This converts 5 usages of this option to the non-SPL form, since there is no SPL_SYS_LONGHELP defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-10efi_loader: enable eficonfig command by defaultHeinrich Schuchardt
The eficonfig command is required to set boot options. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10cmd: CONFIG_CMD_EFICONFIG requires CONFIG_MENUHeinrich Schuchardt
The eficonfig command invokes functions implemented in common/menu.c like * menu_default_set() * menu_get_choice() * menu_destroy() * menu_item_add() Fixes: 87d791423ac6 ("eficonfig: menu-driven addition of UEFI boot option") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-02-10eficonfig: CTRL+S to save the boot orderMasahisa Kojima
The change boot order menu in eficonfig can have at most INT_MAX lines and it is troublesome to scroll down to the "Save" entry. This commit assigns CTRL+S to save the boot order. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10menu: remove CTRL+C to quitMasahisa Kojima
On the sandbox called without "--terminal raw" CTRL+C leaves U-Boot, "ESC/CTRL+C to quit" is misleading. Let's remove CTRL+C to quit key handling from bootmenu and eficonfig menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-02-10cmd: improve coninfo output formattingHeinrich Schuchardt
Device name are typically longer than 8 characters. This leads to ragged output. Only the I and O bit of the device flags are of interest for the user. Writing a hexadecimal number is just confusing. Before the patch the output looked like this: => coninfo List of available devices: pl011@9000000 00000007 IO stdin stdout stderr serial 00000003 IO usbkbd 00000001 I. With the patch the output looks like this: => coninfo List of available devices |-- pl011@9000000 (IO) | |-- stdin | |-- stdout | |-- stderr |-- serial (IO) |-- usbkbd (I) Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL uses of CMD_TFTPPUTSimon Glass
This converts 3 usages of this option to the non-SPL form, since there is no SPL_CMD_TFTPPUT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL use of CMD_NVEDIT_EFISimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_NVEDIT_EFI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL uses of CMD_EFICONFIGSimon Glass
This converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_EFICONFIG defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07env: Drop ENV_IS_IN_SATASimon Glass
This is not used anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07Drop dataflash_mmc_mux commandSimon Glass
This is not used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-02-07cmd: Drop mfsl commandSimon Glass
This is not used anywhere. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07cmd: Add an option to enable the ini commandSimon Glass
This command has no Kconfig option at present, but seems useful enough to keep around. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06cmd: Add a SEAMA image load commandLinus Walleij
Add a command to load SEAMA (Seattle Image), a NAND flash on-flash storage format. This type of flash image is found in some D-Link routers such as DIR-645, DIR-842, DIR-859, DIR-860L, DIR-885L, DIR890L and DCH-M225, as well as in WD and NEC routers on the ath79 (MIPS), Broadcom BCM53xx, and RAMIPS platforms. This U-Boot command will read and decode a SEAMA image from raw NAND flash on any platform. As it is always using big endian format for the data decoding is always necessary on platforms such as ARM. The command is needed to read a SEAMA-encoded boot image on the D-Link DIR-890L router for boot from NAND flash in an upcoming port of U-Boot to the Broadcom Northstar (BCM4709, BCM53xx) architecture. A basic test and documentation is added as well. The test must be run on a target with NAND flash support and at least one resident SEAMA image in flash. Cc: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-02-06qemu: Move qfw kernel setup into a common fileSimon Glass
This is currently in the cmd/ file but we want to call it from a driver. Move it into a common place. Tidy up the header-file order while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06qemu: Update qfw command to use addressesSimon Glass
This uses casts all over the place. Use the correct type so that these can be avoided, as is done with other commands. Also simplify a few conditionals. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06bootstd: Allow enabling BOOTSTD_FULL without needing EXPOSimon Glass
It is sometimes useful to have one without the other, e.g. on a device without a display, since at present the expo feature requires CONFIG_VIDEO to be enabled. Update the Makefile and bootflow command to support this, as well as the EXPO dependency. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-31Merge https://source.denx.de/u-boot/custodians/u-boot-mmcTom Rini
2023-01-31Merge tag 'u-boot-amlogic-20230131' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-amlogic - jethub j100: add rescue boot from microSD - move meson sm command to cmd/meson and add efusedump sub-command - switch dwc2 otg to DM for G12A, GXL & AXG - Add new boards: - Odroid Go Ultra - Odroid-N2L
2023-01-31cmd: mmc: Expand bkops handlingMarek Vasut
Add more capable "bkops" command which allows enabling and disabling both manual and automatic bkops. The existing 'mmc bkops-enable' subcommand is poorly named to cover all the possibilities, hence the new-ish subcommand. Note that both commands are wrappers around the same common code. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-01-27eficonfig: add vertical scroll supportMasahisa Kojima
The current eficonfig menu does not support vertical scroll, so it can not display the menu entries greater than the console row size. This commit add the vertial scroll support. The console size is retrieved by SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode() service, then calculates the row size for menu entry by subtracting menu header and description row size from the console row size. "start" and "end" are added in the efimenu structure. "start" keeps the menu entry index at the top, "end" keeps the bottom menu entry index. item_data_print() menu function only draws the menu entry between "start" and "end". This commit also fixes the issue that "Save" and "Quit" entries can be moved by BKEY_PLUS in change boot order menu. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-27eficonfig: refactor change boot order implementationMasahisa Kojima
This commit removes the change boot order specific menu implementation. The change boot order implementation calls eficonfig_process_common() same as other menus. The change boot order menu requires own item_data_print and item_choice implementation, but display_statusline function can be a same function as other menus. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-27eficonfig: refactor eficonfig_process_common functionMasahisa Kojima
Current change boot order implementation does not call eficonfig_process_common() and call own menu functions for display_statusline, item_data_print and item_choice. Change boot order functionality should call eficonfig_process_common() to improve maintenanceability. This commit is a preparation to remove the change boot order specific implementation. The menu functions (display_statusline, item_data_print and item_choice) are added as argument of eficonfig_process_common(). The menu description string displayed at the bottom of the menu is also added as argument. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-27cmd: fix mtest on 64 bit systemsHeinrich Schuchardt
* Use 16 digits on 64 bit systems. * Use 64 bit patterns on 64 bit systems. * Expect the sign bit in bit 63 on 64 bit systems. * Adjust the formatting of a constant. * Always print result on new line Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Stefan Roese <sr@denx.de>
2023-01-26cmd: fix return code of 'sf erase'Heinrich Schuchardt
If the offset or the size passed to the 'sf erase' command exceeds the size of the SPI flash displaying the command usage is not helpful. Return CMD_RET_FAILURE instead of CMD_RET_USAGE. Use the CMD_RET_* constants instead of 0, 1, -1. Simplify a logical expression in the final return statement. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Dhruva Gole <d-gole@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-01-26cmd: simplify do_spi_flash()Heinrich Schuchardt
CMD_RET_USAGE == -1. The special handling of this value at the end of do_spi_flash() does not make any sense. To avoid future confusion use the CMD_RET_* constants and simplify the code. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-01-26cmd: fix return code of 'sf write' and 'sf read'Heinrich Schuchardt
If the offset or the size passed to the 'sf write' or 'sf read' command exceeds the size of the SPI flash displaying the command usage is not helpful. Return CMD_RET_FAILURE instead of CMD_RET_USAGE. Use the CMD_RET_* constants instead of 0, 1, -1. Simplify a logical expression in the final return statement. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-01-23bootstd: Drop the old bootflow_scan_first()Simon Glass
This function is not used outside tests. Drop it and rename bootflow_scan_dev() since it is how we start a scan now. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Allow scanning a single bootdev labelSimon Glass
We want to support scanning a single label, like 'mmc' or 'usb0'. Add this feature by plumbing the label through to the iterator, setting a flag to indicate that only siblings of the initial device should be used. This means that scanning a bootdev by its name is not supported anymore. That feature doesn't seem very useful in practice, so it is no great loss. Add a test for bootdev_find_by_any() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a hunter for the extension featureSimon Glass
This needs to run before any bootdev is used, so add a hunter for it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23extension: Refactor to allow non-command usageSimon Glass
The current extension code is designed to be used from commands. We want to add a boot driver which uses it. To help with this, split the code into the command processing and a function which actually does the scan. Really the extension code should be in common/ or use driver model, but this is a start. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Use hunters when scanning for bootflowsSimon Glass
Add a flag to control whether hunters are used when scanning for bootflows. Enable it by default and tidy up the flag comments a little. Fow now this has no effect, until a future patch enables this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Treat DHCP and PXE as bootdev labelsSimon Glass
These are associated with the ethernet boot device but do not match its uclass name, so handle them as special cases. Provide a way to pass flags through with the bootdev so that we know how to process it. The flags are checked by the bootmeths, to ensure that only the selected bootmeth is used. While these both use the network device, they work quite differently. It is common to run only one of these, or to run PXE before DHCP. Provide bootflow flags to control which methods are used. Check these in the two bootmeths so that only the chosen one is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Include the device tree in the bootflowSimon Glass
Some bootmeths provide a way to load a device tree as well as the base OS image. Add a way to store this in the bootflow. Update the 'bootflow info' command to show this information. Note that the device tree is not allocated, but instead is stored at an address provided by an environment variable. This may need to be adjusted at some point, but for now it works well and fits in with the existing distro-boot scripts. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23net: Add a function to run dhcpSimon Glass
At present this must be done by executing the command. Also it involves fiddling with the environment to determine the correct autoload behaviour. Ideally it should be possible to run network operations without even having the command line present (CONFIG_CMDLINE). For now, add a function to handle DHCP, so it can be called from a bootdev more easily. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-01-23bootstd: Support running bootdev huntersSimon Glass
Add a way to run a bootdev hunter to find bootdevs of a certain type. Add this to the 'bootdev hunt' command. Test for this are added in a later patch, since a useful test needs some hunters to work with. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add the concept of a bootdev hunterSimon Glass
Some bootdevs must be enumerated before they appear. For example, USB bootdevs are not visible until USB is enumerated. With standard boot this needs to happen automatically, since we only want to enumerate a bus if it is needed. Add a way to define bootdev 'hunters' which can be used to hunt for bootdevs of a given type. Track which ones have been used and add a command to list them. Include a clang work-around which seems to be needed. Signed-off-by: Simon Glass <sjg@chromium.org>