summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'next'Tom Rini2021-04-0513-77/+781
|\
| * sandbox: Provide a way to bind fixed/removeable devicesSimon Glass2021-03-271-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | At present when a file is bound to a host device it is always marked as removeable. Arguably the device is removeable, since it can be unbound at will. However while it is bound, it is not considered removable by the user. Also it is useful to be able to model both fixed and removeable devices for code that distinguishes them. Add a -r flag to the 'host bind' command and plumb it through to provide this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Update do_host_bind() argument countingSimon Glass2021-03-271-3/+6
| | | | | | | | | | | | | | Remove the 'bind' subcommand before processing the arguments. This will make it easier to add an optional flag. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Disintangle declarations in do_host_bind()Simon Glass2021-03-271-4/+9
| | | | | | | | | | | | | | | | | | This function has a strange mix of declarations and argument parsing which is a bit hard to follow and harder to modify. Separate out the declarations at the start of the function and adjust the ordering of the code slightly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * cmd: Add missing check for CONFIG_SYS_LONGHELPSimon Glass2021-03-272-0/+4
| | | | | | | | | | | | | | Two commands are missing this check, so compilation fails when building without CONFIG_CMDLINE. Add it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Add a command to display coreboot sysinfoSimon Glass2021-03-273-0/+404
| | | | | | | | | | | | | | | | This information is interesting to look at and can be important for debugging and inspection. Add a command to display it in a helpful format. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Make coreboot sysinfo available to any x86 boardSimon Glass2021-03-271-1/+1
| | | | | | | | | | | | | | | | | | It is possible to boot U-Boot for chromebook_coral either 'bare metal' or from coreboot. In the latter case we want to provide access to the coreboot sysinfo tables. Move the definitions into a file available to any x86 board. Signed-off-by: Simon Glass <sjg@chromium.org>
| * cmd: efi: ESRT table debug printJose Marinho2021-03-251-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit enables the ESRT printing from the u-boot shell by invoking: - efidebug capsule esrt CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi: Add ESRT to the EFI system tableJose Marinho2021-03-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ESRT is initialised during efi_init_objlist after efi_initialize_system_table(). The ESRT is recreated from scratch at the following events: - successful UpdateCapsule; - FMP instance install. The code ensures that every ESRT entry has a unique fw_class value. Limitations: - The ESRT is not updated if an FMP instance is uninstalled; - the fields image_type and flags are in the current implementation left undefined. Setting these values will require a per-platform function that returns the image_type/flags as a function of the image fw_class. CC: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Sughosh Ganu <sughosh.ganu@linaro.org> CC: AKASHI Takahiro <takahiro.akashi@linaro.org> CC: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Andre Przywara <andre.przywara@arm.com> CC: Alexander Graf <agraf@csgraf.de> CC: nd@arm.com Signed-off-by: Jose Marinho <jose.marinho@arm.com> Remove two EFI_CALL() indirections. Move ESRT GUID in efidebug's list of GUIDs. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efidebug: add multiple device path instances on Boot####Ilias Apalodimas2021-03-251-36/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | The UEFI spec allows a packed array of UEFI device paths in the FilePathList[] of an EFI_LOAD_OPTION. The first file path must describe the loaded image but the rest are OS specific. Previous patches parse the device path and try to use the second member of the array as an initrd. So let's modify efidebug slightly and install the second file described in the command line as the initrd device path. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
| * efi_loader: Replace config option for initrd loadingIlias Apalodimas2021-03-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline interpreted initrd if the protocol is not installed. This creates a problem for EFI installers, since they won't be able to load their own initrd and continue the installation. It also makes the feature hard to use, since we can either have a single initrd or we have to recompile u-boot if the filename changes. So let's introduce a different logic that will decouple the initrd path from the config option we currently have. When defining a UEFI BootXXXX we can use the filepathlist and store a file path pointing to our initrd. Specifically the EFI spec describes: "The first element of the array is a device path that describes the device and location of the Image for this load option. Other device paths may optionally exist in the FilePathList, but their usage is OSV specific" When the EFI application is launched through the bootmgr, we'll try to interpret the extra device path. If that points to a file that exists on our disk, we'll now install the load_file2 and the efi-stub will be able to use it. This opens up another path using U-Boot and defines a new boot flow. A user will be able to control the kernel/initrd pairs without explicit cmdline args or GRUB. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * cmd/load: support uploading EFI binary via UARTHeinrich Schuchardt2021-03-251-2/+8
| | | | | | | | | | | | | | | | | | | | When uploading an EFI binary via the UART we have to call efi_set_bootdev() or we won't be able to execute it. Put the includes into alphabetic order. Fixes: 5f59518a7b1a ("efi_loader: setting boot device") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi: Fix compiler warningsSimon Glass2021-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * Merge tag 'v2021.04-rc4' into nextTom Rini2021-03-153-0/+44
| |\ | | | | | | | | | Prepare v2021.04-rc4
| * | cmd: SCP03: enable and provision commandJorge Ramirez-Ortiz2021-03-133-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable and provision the SCP03 keys on a TEE controlled secured elemt from the U-Boot shell. Executing this command will generate and program new SCP03 encryption keys on the secure element NVM. Depending on the TEE implementation, the keys would then be stored in some persistent storage or better derived from some platform secret (so they can't be lost). Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
| * | tpm: Don't select LOGSimon Glass2021-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | We don't need to enable logging to run this command since the output will still appear. Drop the 'select'. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | tpm: Switch TPMv1 over to use the new APISimon Glass2021-03-022-30/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Take over the plain 'tpm_...' functions for use by the new TPM API. Rename all the TPMv1 functions so they are called from the API. Update the TPMv1 functions so that they are called from the API. Change existing users to use the tpm1_ prefix so they don't need to go through the API, which might introduce uncertainty. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
| * | reset: Remove addr parameter from reset_cpu()Harald Seiler2021-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, the reset_cpu() function had an `addr` parameter which was meant to pass in an address of the reset vector location, where the CPU should reset to. This feature is no longer used anywhere in U-Boot as all reset_cpu() implementations now ignore the passed value. Generic code has been added which always calls reset_cpu() with `0` which means this feature can no longer be used easily anyway. Over time, many implementations seem to have "misunderstood" the existence of this parameter as a way to customize/parameterize the reset (e.g. COLD vs WARM resets). As this is not properly supported, the code will almost always not do what it is intended to (because all call-sites just call reset_cpu() with 0). To avoid confusion and to clean up the codebase from unused left-overs of the past, remove the `addr` parameter entirely. Code which intends to support different kinds of resets should be rewritten as a sysreset driver instead. This transformation was done with the following coccinelle patch: @@ expression argvalue; @@ - reset_cpu(argvalue) + reset_cpu() @@ identifier argname; type argtype; @@ - reset_cpu(argtype argname) + reset_cpu(void) { ... } Signed-off-by: Harald Seiler <hws@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | cmd: CMD_USB depends on USBHeinrich Schuchardt2021-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usb command cannot be compiled with CONFIG_USB=n: ld.bfd: cmd/usb.c:660: undefined reference to `usb_stop' ld.bfd: cmd/usb.c:663: undefined reference to `usb_started' Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | cmd/load: support uploading EFI binary via UARTHeinrich Schuchardt2021-03-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When uploading an EFI binary via the UART we have to call efi_set_bootdev() or we won't be able to execute it. Put the includes into alphabetic order. Fixes: 5f59518a7b1a ("efi_loader: setting boot device") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | | efi: Fix compiler warningsSimon Glass2021-03-161-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass <sjg@chromium.org> Replace (uintptr_t)NULL by 0. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | cmd: Fix virtio command dependencyBin Meng2021-03-051-0/+1
| | | | | | | | | | | | | | | | | | The 'virtio' command calls blk_common_cmd() which is only available when CONFIG_HAVE_BLOCK_DEVICE is on. Fix the Kconfig dependency. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* | cmd: Add a command to display the address mapBin Meng2021-03-053-0/+43
|/ | | | | | | | | This adds a new command 'addrmap' to display the address map for non-identity virtual-physical memory mappings. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* Merge tag 'efi-2021-04-rc3-2' of ↵Tom Rini2021-02-271-0/+4
|\ | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2021-04-rc3-2 Bug fixes: * debug build for mkeficapsule * limit output length for VenHw, VenMedia * ACPI tables must be in EfiACPIReclaimMemory
| * cmd/efidebug: add firmware management protocol GUIDHeinrich Schuchardt2021-02-261-0/+4
| | | | | | | | | | | | | | Add missing GUID short text used in the efidebug tables and efidebug dh sub-commands. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbWIP/26Feb2021Tom Rini2021-02-261-1/+2
|\ \ | | | | | | | | | - fastboot updates / fixes
| * | part: Support getting whole disk from part_get_info_by_dev_and_name_or_numSean Anderson2021-02-261-1/+2
| |/ | | | | | | | | | | | | | | This adds an option to part_get_info_by_dev_and_name_or_num to allow callers to specify whether whole-disk partitions are fine. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spiTom Rini2021-02-261-11/+18
|\ \ | | | | | | | | | | | | - new GigaDevice flash ids - fixes for imx, nxp_spi drivers
| * | cmd: sf: Print error on test failureSean Anderson2021-02-261-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sf test command is used to test spi flashes (and spi masters). Printing the exact error code is very helpful to those debugging the spi stack. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * | cmd: sf: Display errno on erase failureSean Anderson2021-02-261-2/+5
| |/ | | | | | | | | | | | | | | | | | | | | If there is an error while erasing SPI flash, no errno is displayed. This makes it difficult to determine the cause of the error. This change mirrors the logic for write errors above. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini2021-02-261-0/+1
|\ \ | |/ |/|
| * cmd/riscv/sbi: support System Reset ExtensionHeinrich Schuchardt2021-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Let the sbi command detect the 'System Reset Extension' (EID #0x53525354 "SRST"). Cf. https://github.com/riscv/riscv-sbi-doc Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com> Reviewed-by: Leo Liang <ycliang@andestech.com> Reviewed-by: Bin Meng <bin.meng@windriver.com>
* | cmd: pinmux: depend on PINCTRLMarek Behún2021-02-241-0/+1
| | | | | | | | | | | | | | | | | | | | The pinmux command uses functions pinctrl_get_pin_*(), which are missing if PINCTRL config option is disabled. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | cmd: pwm: Rework argc sanity checkingTom Rini2021-02-241-22/+19
|/ | | | | | | | | | | | | | | Currently, we check argc in a number of places to make sure that we have all of the required arguments for each of the pwm sub-commands. However, there's at least one place where we've got dead code as we'll never have argc == 0, due to checking that argc was at least 4 earlier and having only subtracted 3. Rework things so that when we have determined our subcommand make sure we have the right number of arguments for it, or error out. This means we can stop checking against argc again later. Reported-by: Coverity (CID: 316601) Cc: Pragnesh Patel <pragnesh.patel@sifive.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIOIgor Opaniuk2021-02-212-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use CONFIG_IS_ENABLED() macro, which provides more convenient way to check $(SPL)DM_I2C/$(SPL)DM_I2C_GPIO configs for both SPL and U-Boot proper. CONFIG_IS_ENABLED(DM_I2C) expands to: - 1 if CONFIG_SPL_BUILD is undefined and CONFIG_DM_I2C is set to 'y', - 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_DM_I2C is set to 'y', - 0 otherwise. All occurences were replaced automatically using these bash cmds: $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
* cmd: mmc: update the mmc command's usage about argumentJaehoon Chung2021-02-191-3/+3
| | | | | | | | It's confusing whether arguments are optional or mandatory. Update the command's usage to clarify how to use. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* image: Adjust the workings of fit_check_format()Simon Glass2021-02-157-9/+9
| | | | | | | | | | | | | | | | | At present this function does not accept a size for the FIT. This means that it must be read from the FIT itself, introducing potential security risk. Update the function to include a size parameter, which can be invalid, in which case fit_check_format() calculates it. For now no callers pass the size, but this can be updated later. Also adjust the return value to an error code so that all the different types of problems can be distinguished by the user. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
* Merge branch '2021-02-02-drop-asm_global_data-when-unused'Tom Rini2021-02-1523-0/+24
|\ | | | | | | - Merge the patch to take <asm/global_data.h> out of <common.h>
| * common: Drop asm/global_data.h from common headerWIP/2021-02-02-drop-asm_global_data-when-unusedSimon Glass2021-02-0223-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* | cmd: mvebu/bubt: Fix default options in helpPali Rohár2021-02-081-3/+3
| | | | | | | | | | | | | | Default options depends on compile time defines. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
* | Merge tag 'efi-2021-04-rc2' of ↵WIP/04Feb2021Tom Rini2021-02-041-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2021-04-rc2 Bug fixes: * do not allow creating of files with filenames on FAT file system * install UEFI System Partition GUID on ESP handle * in dtbdump.efi test tool use GUID to find ESP handle Documentation: * man-page for load command * describe end of life of plat_auto
| * | efi_loader: install UEFI System Partition GUIDHeinrich Schuchardt2021-02-041-0/+5
| |/ | | | | | | | | | | | | | | | | On the handle for the UEFI System Partition we must install the System Partition GUID (with a NULL interface). Let the efidebug command display the GUID. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | Merge tag 'dm-pull-3feb21' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini2021-02-041-26/+26
|\ \ | | | | | | | | | | | | Support late device removal Allow booting a 32-bit system with a top memory address beyond 4 GiB
| * | bdinfo: Change to use bdinfo_print_num_ll() where the number could be 64-bitBin Meng2021-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are some calls to bdinfo_print_num_l() with parameters that could be a 64-bit value on a 32-bit system. Change those calls to use bdinfo_print_num_ll() instead. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | bdinfo: Rename function names to be clearerBin Meng2021-02-031-26/+26
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present we have bdinfo_print_num() to print unsigned long numbers. We also have print_phys_addr() which accept numbers that might be 64-bit on a 32-bit platform. Rename these 2 functions to be clearer: bdinfo_print_num() => bdinfo_print_num_l() print_phys_addr() => bdinfo_print_num_ll() While we are here, make bdinfo_print_num_ll() public so that it can be used outside cmd/bdinfo.c in the future. Signed-off-by: Bin Meng <bin.meng@windriver.com>
* | cmd: pxe_utils: sysboot: Add zboot support to boot x86 Linux kernel imageKory Maincent2021-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | Add "zboot" command to the list of supported boot in the label_boot function. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: add component tags in the summary] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* | cmd: pxe_utils: Replace ifdef by IS_ENABLEDKory Maincent2021-02-031-26/+24
|/ | | | | | | | | | | | Replace all the macro ifdef by IS_ENABLED. All of these configs are set in the defconfig files and not in the include board headers files. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: keep the preprocessor case unchanged] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* cmd: CMD_ACPI depends on ACPIGENHeinrich Schuchardt2021-02-011-1/+2
| | | | | | | | | | | | | Trying to compile qemu-x86_64_defconfig with CONFIG_CMD_ACPI=y and CONFIG_ACPIGEN=n fails with ld.bfd: cmd/built-in.o: in function `do_acpi_items': cmd/acpi.c:162: undefined reference to `acpi_dump_items' Add the missing configuration dependency. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini2021-01-314-29/+95
|\ | | | | | | | | | | | | | | | | | | | | - Assorted gadget changes including: - dfu: Fix handling of UBI partitions in MTD backend - gadget: f_thor: fix wrong file size cast - Extend cmd: bcb - Fixes for fastboot and rockchip gadgets - dfu: Add SCRIPT and SKIP entities - dfu/thor: Add `dfu_alt_info` reinitialization from flashed script - u-boot: Reduce size of u-boot as usbd_device_* arrays are not exported
| * thor: add support for the dfu_alt_info reintialization from the flashed scriptMarek Szyprowski2021-01-311-7/+12
| | | | | | | | | | | | | | | | Reinitialize dfu_env_entities after flashing the 'SCRIPT' entity to ensure that the potential changes to the 'dfu_alt_info' environment variable are applied. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>