aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2022-07-13efi_loader: memory leak in efi_set_bootdev()Heinrich Schuchardt1-2/+2
efi_dp_str() allocates memory which should be released after use. Use %pD printf code. Adjust message wording. Fixes: d837cb1e3b6b ("efi: Add debugging to efi_set_bootdev()") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-07-11Merge branch 'next'Tom Rini7-102/+169
2022-07-08Merge tag 'dm-pull-28jun22' of ↵Tom Rini1-24/+48
https://source.denx.de/u-boot/custodians/u-boot-dm into next nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
2022-07-07Convert CONFIG_SYS_BOOTM_LEN to KconfigTom Rini1-0/+10
This converts the following to Kconfig: CONFIG_SYS_BOOTM_LEN As part of this, rework error handling in boot/bootm.c so that we pass the buffer size to handle_decomp_error as CONFIG_SYS_BOOTM_LEN will not be available to host tools but we do know the size that we passed to malloc(). Cc: Soeren Moch <smoch@web.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-05Convert CONFIG_USE_ONENAND_BOARD_INIT to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_USE_ONENAND_BOARD_INIT Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-28Rename CONFIG_SYS_AUTOLAOD to CONFIG_SYS_DISABLE_AUTOLOADTom Rini1-0/+9
The "autoload" environment variable is always checked with env_get_yesno as it can be set to any form of no. The default behavior of env_get_yesno is to return -1 on variables that are not set, which acts as true in general (we test for non-zero return). To convert CONFIG_SYS_AUTOLOAD to Kconfig, given that it was almost always used to set autoload to no, first rename to CONFIG_SYS_DISABLE_AUTOLOAD for consistency sake. Then, make it so that if enabled we set autoload=0 in the default environment. Migrate all platforms which set CONFIG_SYS_AUTOLOAD to non-true or that set autoload to false in their default environment to using CONFIG_SYS_DISABLE_AUTOLOAD Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-28i2c: fix stack buffer overflow vulnerability in i2c md commandNicolas Iooss1-12/+12
When running "i2c md 0 0 80000100", the function do_i2c_md parses the length into an unsigned int variable named length. The value is then moved to a signed variable: int nbytes = length; #define DISP_LINE_LEN 16 int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes; ret = dm_i2c_read(dev, addr, linebuf, linebytes); On systems where integers are 32 bits wide, 0x80000100 is a negative value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned 0x80000100 instead of 16. The consequence is that the function which reads from the i2c device (dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill but with a size parameter which is too large. In some cases, this could trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c (used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to a 16-bit integer. This is because function i2c_transfer expects an unsigned short length. In such a case, an attacker who can control the response of an i2c device can overwrite the return address of a function and execute arbitrary code through Return-Oriented Programming. Fix this issue by using unsigned integers types in do_i2c_md. While at it, make also alen unsigned, as signed sizes can cause vulnerabilities when people forgot to check that they can be negative. Signed-off-by: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-06-28dm: core: Add a command to show driver model statisticsSimon Glass1-0/+24
This command shows the memory used by driver model along with various hints as to what it might be if some 'core' tags were moved to use the tag list instead of a core (i.e. always-there) pointer. This may help with future work to reduce memory usage. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Sort dm subcommandsSimon Glass1-25/+25
Put these in alphabetic order, both in the help and in the implementation, as there are quite a few subcommands now. Tweak the help for 'dm tree' to better explain what it does. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Rename dm_dump_all()Simon Glass1-4/+4
This is not a good name anymore as it does not dump everything. Rename it to dm_dump_tree() to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-27Merge tag 'xilinx-for-v2022.10' of ↵WIP/27Jun2022-nextTom Rini1-31/+8
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2022.10 cpu: - Add driver for microblaze cpu net: - Add support for DM_ETH_PHY to AXI emac and emaclite xilinx: - Switch platforms to DM_ETH_PHY - DT chagnes in ZynqMP and Zynq - Enable support for SquashFS zynqmp: - Add support for KR260 boards - Move BSS from address 0 - Move platform identification from board code to soc driver - Improve zynqmp_psu_init_minimize versal: - Enable loading app at EL1 serial: - Setup default address and clock rates for DEBUG uarts pinctrl: - Add support for tri state and output enable properties relocate-rela: - Clean relocate-rela implementation for ARM64 - Add support for Microblaze microblaze: - Add support for runtime relocation - Rework cache handling (wiring, Kconfig) based on cpuinfo - Remove interrupt support timer: - Extract axi timer driver from Microblaze to generic location
2022-06-24cmd: cpu: migrate cpu command to U_BOOT_CMD_WITH_SUBCMDS()Ovidiu Panait1-31/+8
Migrate cpu command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce duplicated code. This also fixes the cpu command on boards that enable CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Link: https://lore.kernel.org/r/20220531181435.3473549-1-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-06-22cmd/misc: Stop using a function pointerTom Rini1-4/+2
Currently, enabling CMD_MISC gives: cmd/misc.c:67:25: warning: assignment to 'int (*)(struct udevice *, int, void *, int)' from incompatible pointer type 'int (*)(struct udevice *, int, const void *, int)' [-Wincompatible-pointer-types] Because 'misc_read' takes a void * and 'misc_write' takes a const void *, both of which make sense for their operation. Given there's one place we make use of the function pointer, just call read or write directly for the operation we're called with. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-22cmd: load: add load command for memory mappedRui Miguel Silva3-0/+65
cp.b is used a lot as a way to load binaries to memory and execute them, however we may need to integrate this with the efi subsystem to set it up as a bootdev. So, introduce a loadm command that will be consistent with the other loadX commands and will call the efi API's. ex: loadm $kernel_addr $kernel_addr_r $kernel_size with this a kernel with CONFIG_EFI_STUB enabled will be loaded and then subsequently booted with bootefi command. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-06-20Merge branch 'master' into nextTom Rini1-1/+3
Merge in v2022.07-rc5.
2022-06-19cmd: correct return value for printenv -eHeinrich Schuchardt1-1/+3
If printenv -e is executed and the specified variable is not found, the return value $? of the command should be 1 (false). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-06qfw: Don't fail if setup data size is 0Pierre-Clément Tosi1-4/+6
Skip missing setup data (which is valid) rather than failing with an error. Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reported-by: Andrew Walbran <qwandor@google.com> Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
2022-06-06ubifs: Add missing dependency on GZIPPali Rohár1-0/+1
GZIP option can be manually de-selected when UBIFS is enabled. This cause following compile error because ubifs calls gzip functions. /tmp/ccxVrh2c.ltrans1.ltrans.o: in function `gzip_decompress.lto_priv.566': <artificial>:(.text+0x768): undefined reference to `zunzip' collect2: error: ld returned 1 exit status make: *** [Makefile:1813: u-boot] Error 1 So add missing dependency on GZIP. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-06-06cmd: dm: migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS()Ovidiu Panait1-52/+12
Migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce duplicated code. We can also drop the CONFIG_NEEDS_MANUAL_RELOC exception, as the command list is updated post relocation in board_r.c initcall initr_manual_reloc_cmdtable(). Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
2022-06-06Convert CONFIG_SYS_CBSIZE to KconfigTom Rini1-0/+9
This converts the following to Kconfig: CONFIG_SYS_CBSIZE Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06Convert CONFIG_SYS_PBSIZE to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_SYS_PBSIZE Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06Convert CONFIG_SYS_MAXARGS to KconfigTom Rini1-0/+4
This converts the following to Kconfig: CONFIG_SYS_MAXARGS Signed-off-by: Tom Rini <trini@konsulko.com>
2022-05-31bootmenu: use utf-8 for menu titleMasahisa Kojima1-22/+21
The commit a3d0aa87acbe ("bootmenu: update bootmenu_entry structure") changes the bootmenu title type from char to u16(UTF16 string) to support EFI based system. If EFI_LOADER is not enabled, printf("%ls") is not supported, so bootmenu does not appear correctly. This commit changes the type of menu title from u16(UTF16) to utf-8 string and EFI strings is conveted into utf-8. Fixes: a3d0aa87acbe ("bootmenu: update bootmenu_entry structure") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Tested-by: Pali Rohar <pali@kernel.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-28cmd/bootefi: correct command syntaxHeinrich Schuchardt1-6/+15
For indicating the address and size of a memory region other commands use a <addr>[:<size>] syntax. Do the same for bootefi. Fixes: 2058983689f0 ("cmd: bootefi: restore ability to boot arbitrary blob") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-28bootmenu: U-Boot console is enabled as defaultMasahisa Kojima2-12/+2
The commit 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") disables to enter U-Boot console from bootmenu as default, this change affects the existing bootmenu users. This commit reverts the default behavior, the bootmenu can enter U-Boot console same as before. CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is renamed BOOTMENU_DISABLE_UBOOT_CONSOLE and depends on AUTOBOOT_MENU_SHOW. Fixes: 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Tested-by: Pali Rohar <pali@kernel.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-26cmd/sbi: add implementation ID 6 - CofferHeinrich Schuchardt1-0/+1
The sbi command displays the ID of the implementation of the RISC-V Supervisor Binary Interface Specification. A new ID for Coffer has recently been added. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-05-23spi: spi_flash_probe_bus_cs() rely on DT for spi speed and modePatrice Chotard1-4/+11
Now, spi_flash_probe_bus_cs() relies on DT for spi speed and mode and logically calls spi_get_bus_and_cs(). In case spi mode and speed are not read from DT, make usage of spi_flash_probe() instead. To sum-up: - Previous call tree was: spi_flash_probe() -> spi_flash_probe_bus_cs() -> spi_get_bus_and_cs() - Current call tree is: spi_flash_probe() -> _spi_get_bus_and_cs() spi_flash_probe_bus_cs() -> spi_get_bus_and_cs() This patch impacts the following : - cmd/sf.c: if spi mode and/or speed is passed in argument of do_spi_flash_probe(), call spi_flash_probe() otherwise call spi_flash_probe_bus_cs(). - drivers/net/fm/fm.c: as by default spi speed and mode was set to 0 and a comment indicates that speed and mode are read from DT, use spi_flash_probe_bus_cs(). - drivers/net/pfe_eth/pfe_firmware.c: spi speed and mode are not read from DT by all platforms using this driver, so keep legacy and replace spi_flash_probe_bus_cs() by spi_flash_probe(); - drivers/net/sni_netsec.c : spi speed and mode are not read from DT, so replace spi_flash_probe_bus_cs() by spi_flash_probe(). - drivers/usb/gadget/max3420_udc.c: Can't find any platform which make usage of this driver, nevertheless, keep legacy and replace spi_get_bus_and_cs() by _spi_get_bus_and_cs(). - env/sf.c: a comment indicates that speed and mode are read from DT. So use spi_flash_probe_bus_cs(). Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Marek Behun <marek.behun@nic.cz> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Vignesh R <vigneshr@ti.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Cc: "Pali Rohár" <pali@kernel.org> Cc: Konstantin Porotchkin <kostap@marvell.com> Cc: Igal Liberman <igall@marvell.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Pratyush Yadav <p.yadav@ti.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Anji J <anji.jagarlmudi@nxp.com> Cc: Biwen Li <biwen.li@nxp.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
2022-05-23spi: spi-uclass: Add new spi_get_bus_and_cs() implementationPatrice Chotard1-2/+2
Move legacy spi_get_bus_and_cs() code to _spi_get_bus_and_cs(). Add new spi_get_bus_and_cs() implementation which rely on DT for speed and mode and don't need any drv_name nor dev_name parameters. This will prepare the ground for next patch. Update all callers to use _spi_get_bus_and_cs() to keep the same behavior. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Marek Behun <marek.behun@nic.cz> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Vignesh R <vigneshr@ti.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Cc: "Pali Rohár" <pali@kernel.org> Cc: Konstantin Porotchkin <kostap@marvell.com> Cc: Igal Liberman <igall@marvell.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Pratyush Yadav <p.yadav@ti.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Anji J <anji.jagarlmudi@nxp.com> Cc: Biwen Li <biwen.li@nxp.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
2022-05-16cmd: mvebu: Hide bubt specific options when bubt is disabledPali Rohár1-0/+4
CONFIG_MVEBU_NAND_BOOT, CONFIG_MVEBU_SPI_BOOT, CONFIG_MVEBU_MMC_BOOT and CONFIG_MVEBU_UBOOT_DFLT_NAME are unused when CONFIG_CMD_MVEBU_BUBT is not enabled. So hide them. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-05-08Merge tag 'efi-2022-07-rc3-2' of ↵WIP/08May2022Tom Rini1-141/+0
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc3-2 UEFI: * Fix build errors due to - using sed with non-standard extension for regular expression - target architecture not recognized for CROSS_COMPILE=armv7a-* - CONFIG_EVENT not selected * add sha384/512 on certificate revocation Others: * factor out the user input handling in bootmenu command
2022-05-07bootmenu: factor out the user input handlingMasahisa Kojima1-141/+0
This commit moves the user input handling from cmd/bootmenu.c to common/menu.c to reuse it from other modules. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-06cmd: gpt: add subcommand repairPhilippe Reynes1-1/+15
Adds a sub-command repair to the command gpt that allow to repair a corrupted gpt table. If the both gpt table (primary and backup) are valid, then the command does nothing. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-05-05cmd: mmc: don't assign unused valuesHeinrich Schuchardt1-2/+4
Don't assign a value to variable speedmode which is never used. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-05cmd: onenand: fix printf codesHeinrich Schuchardt1-3/+3
For printing size_t use %zu or %zx. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-05cmd: simplify do_adc_single()Heinrich Schuchardt1-6/+1
If argc is not < 3, it must be >= 3. If argc >= 3, argv[2] cannot be NULL. Fixes: 9de612ae4ded ("cmd: adc: Add support for storing ADC result in env variable") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-05cmd: fix long text for fdt commandHeinrich Schuchardt1-1/+1
We don't have an option -cq but two distinct options -c and -q. Fixes: e9496ec37440 ("fdt: Add -q option to fdt addr for distro_bootcmd") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-03bootmenu: add Kconfig option not to enter U-Boot consoleMasahisa Kojima2-11/+68
This commit adds the Kconfig option to disable to enter the U-Boot console from bootmenu. If CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is enabled, "U-Boot console" entry is appeared as the last entry in the bootmenu, then user can enter U-Boot console. If CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is disabled, "Quit" entry is appeared as the last entry instead of "U-Boot console". When user chooses "Quit" from bootmenu, the following default commands are invoked. - "bootefi bootmgr" (if efi bootmgr is enabled) - "run bootcmd" If the both commands are executed and returns to the bootmenu, the bootmenu will appears again. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-05-03bootmenu: add UEFI boot entry into bootmenuMasahisa Kojima1-1/+152
This commit adds the UEFI related menu entries into the bootmenu. User can select which UEFI "Boot####" option to execute from bootmenu, then bootmenu sets the "BootNext" UEFI variable and invoke efi bootmgr. The efi bootmgr will handle the "BootNext" UEFI variable. If the "BootNext" UEFI variable is preset and efi bootmgr is enabled, bootmenu invokes efi bootmgr to handle "BootNext" as first priority. The UEFI boot entry has the "UEFI BOOTXXXX" prefix as below. *** U-Boot Boot Menu *** UEFI BOOT0000 : debian UEFI BOOT0001 : ubuntu Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2022-05-03bootmenu: update bootmenu_entry structureMasahisa Kojima2-32/+76
This is a preparation for succeeding addition of uefi boot and distro boot menu entries into bootmenu. The bootmenu_entry title is updated to u16 string because uefi use u16 string. This commit also factors out the function to prepare the entries generated by "bootmenu_x" U-Boot environment variable. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-03cmd: simplify bootmenuHeinrich Schuchardt1-13/+7
* correct output for timeout > 99 s * don't use spaces to advance to the output column Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-29acpi: Fix buffer overflow in do_acpi_dump()Andrew Scull1-1/+1
When do_acpi_dump() converts the table name to upper case, pass the actual size of the output buffer so that the null terminator doesn't get written beyond the end of the buffer. Signed-off-by: Andrew Scull <ascull@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-04-25Merge branch '2022-04-25-initial-implementation-of-stdboot'Tom Rini5-0/+679
To quote the author: The bootflow feature provide a built-in way for U-Boot to automatically boot an Operating System without custom scripting and other customisation. This is called 'standard boot' since it provides a standard way for U-Boot to boot a distro, without scripting. It introduces the following concepts: - bootdev - a device which can hold a distro - bootmeth - a method to scan a bootdev to find bootflows (owned by U-Boot) - bootflow - a description of how to boot (owned by the distro) This series provides an implementation of these, enabled to scan for bootflows from MMC, USB and Ethernet. It supports the existing distro boot as well as the EFI loader flow (bootefi/bootmgr). It works similiarly to the existing script-based approach, but is native to U-Boot. With this we can boot on a Raspberry Pi 3 with just one command: bootflow scan -lb which means to scan, listing (-l) each bootflow and trying to boot each one (-b). The final patch shows this. With a standard way to identify boot devices, booting become easier. It also should be possible to support U-Boot scripts, for backwards compatibility only. ... The design is described in these two documents: https://drive.google.com/file/d/1ggW0KJpUOR__vBkj3l61L2dav4ZkNC12/view?usp=sharing https://drive.google.com/file/d/1kTrflO9vvGlKp-ZH_jlgb9TY3WYG6FF9/view?usp=sharing
2022-04-25bootstd: Add a bootmeth commandSimon Glass3-0/+125
Add a 'bootmeth' command to handle listing and ordering of boot methods. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add a bootflow commandSimon Glass3-0/+423
Add a 'bootflow' command to handle listing and selection of bootflow. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add a bootdev commandSimon Glass3-0/+131
Add a 'bootdev' command to handle listing and selection of bootdevs. Disable standard boot for a few boards which otherwise run out of space. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-24cmd: part: add explicit dependency on PARTITIONSWIP/24Apr2022AKASHI Takahiro1-0/+1
This is a follow-up patch for my "disk: don't compile in partition support for spl/tpl if not really necessary". "part" command is useful only if, at least, one of partition table types is selected. So it should have a dependency on PARTITIONS which is now automatically selected if one of partition table types is enabled. With this change, *_defconfig which explicitly selects CMD_PART but has no partition table types enabled should also be fixed. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-04-23Merge tag 'efi-2022-07-rc1-3' of ↵WIP/23Apr2022Tom Rini2-16/+24
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-07-rc1-3 Documentation: * Document image size parameter of bootefi command UEFI: * avoid building partition support in SPL/TPL where not required * improve integration of EFI subsystem and driver model * restore ability to boot arbitrary blob
2022-04-23bootmenu: fix menu API error handlingMasahisa Kojima1-2/+2
U-Boot menu framework(common/menu.c) returns 1 if it is successful, returns negative value if it fails. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-04-23cmd: bootefi: restore ability to boot arbitrary blobKyle Evans1-14/+22
Up until commit 5f59518a7b1ae ("efi_loader: setting boot device"), we could boot an arbitrary blob with bootefi. Indeed, efi_run_image() even has a special case for missing device paths indicating a payload that was directly loaded via JTAG, for example. Restore the ability to inject a UEFI payload into memory and `bootefi` it. If the address passed isn't the last PE-COFF loaded, then we'll wipe out the pre-existing DP/Image information and let efi_run_image() synthesize a memory device path. An image size is required if we're booting an arbitrary payload, and the FDT argument has been changed to accept `-`. The size could be deduced from the image header, but it's required anyways as an explicit acknowledgment that one's trying to boot an arbitrary payload rather than accidentally using the wrong address in the single-addr form. Fixes: 5f59518a7b1a ("efi_loader: setting boot device") Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-04-22fdt: Add -q option to fdt addr for distro_bootcmdPeter Hoyes1-7/+23
distro_bootcmd uses this construct a few times to test $fdt_addr_r, and fall back on $fdtcontroladdr if not set/invalid: if fdt addr ${fdt_addr_r}; then ... else ... fi If the `fdt addr` test fails, it prints the following message on the console, suggesting there is an error when there is not: libfdt fdt_check_header(): FDT_ERR_BADMAGIC To remove this potentially confusing error message, this patch adds -q as a 'quiet' option for fdt addr, and uses this flag in config_distro_bootcmd.h Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>