aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-11-26Merge tag 'efi-2022-01-rc3-2' of ↵WIP/26Nov2021Tom Rini13-106/+95
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-01-rc3-2 Test: * fix pylint warnings UEFI: * disable interrupts before removing devices in ExitBootServices() * implement poweroff in efi_system_reset() on sandbox * allow booting via EFI even if some block device fails
2021-11-26test: fix pylint error in u_boot_console_exec_attach.pyHeinrich Schuchardt1-2/+4
* provide module docstring Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26test: fix pylint error in u_boot_console_sandbox.pyHeinrich Schuchardt1-1/+3
* provide module docstring Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26test: fix pylint errors in u_boot_utils.pyHeinrich Schuchardt1-11/+14
* there is no os.path.unlink() method * don't inherit from object * add module docstring * move imports to the top * avoid unused variable Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26test: fix pylint errors in u_boot_spawn.pyHeinrich Schuchardt1-13/+13
* don't inherit from object * imports should be on the top level * avoid unused variable names * avoid unnecessary else after raise Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26test: fix pylint errors in multiplexed_log.pyHeinrich Schuchardt1-6/+8
* don't inherit from object * remove superfluous comprehension * add module docstring Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26efi_selftest: simplify endian conversion for FDT testHeinrich Schuchardt1-7/+8
UEFI code is always little-endian. Remove a superfluous test. Remove a superfluous type conversion. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26efi_loader: segfault in efi_clear_os_indications()Heinrich Schuchardt2-50/+31
If we call efi_clear_os_indications() before initializing the memory store for UEFI variables a NULL pointer dereference occurs. The error was observed on the sandbox with: usb start host bind 0 sandbox.img load host 0:1 $kernel_addr_r helloworld.efi bootefi $kernel_addr_r Here efi_resister_disk() failed due to an error in the BTRFS implementation. Move the logic to clear EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED to the rest of the capsule code. If CONFIG_EFI_IGNORE_OSINDICATIONS=y, we should still clear the flag. If OsIndications does not exist, we should not create it as it is owned by the operating system. Fixes: 149108a3eb59 ("efi_loader: clear OsIndications") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-26test: address some pylint warningsHeinrich Schuchardt2-9/+7
* remove unused variables * module description must precede import statements * fix inconsistent return values Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26sandbox: poweroff in efi_system_reset()Heinrich Schuchardt1-2/+4
efi_system_reset() should exit if called with EFI_RESET_SHUTDOWN. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26efi_loader: efi_disk_register() should not failHeinrich Schuchardt1-2/+2
Our algorithm for creating USB device paths may lead to duplicate device paths which result in efi_disk_register() failing. Instead we should just skip devices that cannot be registered as EFI block devices. Fix a memory leak in efi_disk_add_dev() caused by the duplicate device path. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26efi: Call bootm_disable_interrupts earlier in efi_exit_boot_servicesTom Rini1-3/+1
If we look at the path that bootm/booti take when preparing to boot the OS, we see that as part of (or prior to calling do_bootm_states, explicitly) the process, bootm_disable_interrupts() is called prior to announce_and_cleanup() which is where udc_disconnect() / board_quiesce_devices() / dm_remove_devices_flags() are called from. In the EFI path, these are called afterwards. In efi_exit_boot_services() however we have been calling bootm_disable_interrupts() after the above functions, as part of ensuring that we disable interrupts as required by the spec. However, bootm_disable_interrupts() is also where we go and call usb_stop(). While this has been fine before, on the TI J721E platform this leads us to an exception. This exception seems likely to be the case that we're trying to stop devices that we have already disabled clocks for. The most direct way to handle this particular problem is to make EFI behave like the do_bootm_states() process and ensure we call bootm_disable_interrupts() prior to ending up in usb_stop(). Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Simon Glass <sjg@chromium.org> Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20Merge branch 'efi-2022-01' of ↵WIP/20Nov2021Tom Rini13-110/+631
https://source.denx.de/u-boot/custodians/u-boot-efi Scripts: * Update spelling.txt LMB: * remove extern keyword in lmb.h * drop unused lmb_size_bytes() Test: * test truncation in snprintf() Documentation: * add include/lmb.h to HTML documentation UEFI: * reduce non-debug logging output for measured boot * fix use after free in measured boot * startup the tpm device when installing the protocol * implement EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES * record capsule result only if capsule is read
2021-11-20efi_loader: startup the tpm device when installing the protocolIlias Apalodimas1-0/+9
Due to U-Boot's lazy binding mentality the TPM is probed but not properly initialized. The user can startup the device from the command line e.g 'tpm2 startup TPM2_SU_CLEAR'. However we can initialize the TPM during the TCG protocol installation, which is easier to use overall. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20efi_loader: fix FinalEvents table if an EFI app invoked GetEventLogIlias Apalodimas1-29/+70
As described in the TCG spec [1] in sections 7.1.1 and 7.1.2 the FinalEvent table should include events after GetEventLog has been called. This currently works for us as long as the kernel is the only EFI application calling that. Specifically we only implement what's described in 7.1.1. So refactor the code a bit and support EFI application(s) calling GetEventLog. Events will now be logged in both the EventLog and FinalEvent table as long as ExitBootServices haven't been invoked. [1] https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20efi_loader: bump EFI_SPECIFICATION_VERSION to 2.9Heinrich Schuchardt1-2/+2
We have implemented all what is new in UEFI specification 2.9 and relevant for U-Boot. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20efi_selftest: unit test for EFI_GROUP_BEFORE_EXIT_BOOT_SERVICEHeinrich Schuchardt1-11/+56
Add a test for the EFI_GROUP_BEFORE_EXIT_BOOT_SERVICE event group. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20efi_loader: EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICESHeinrich Schuchardt2-0/+22
Implement the EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES event group handling. Add the definition of EFI_EVENT_GROUP_AFTER_READY_TO_BOOT. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20efi_loader: capsule: Record capsule result only if capsule is readMasami Hiramatsu1-3/+3
Record capsule update result only if the capsule file is successfully read, because the capsule GUID is not sure when the file can not be read or the file is not a capsule. Without this fix, if user puts a dummy (non-capsule) file under (ESP)EFI/UpdateCapsule, U-Boot causes a synchronous abort. This also fixes use-after-free bug of the 'capsule' variable. Fixes: c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support") Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20efi_loader: Reduce efi_tcg2 logging statementMasahisa Kojima1-1/+1
log_info() is used for the debug level logging statement which should use log_debug() instead. Convert it to reduce the log output. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20efi_loader: Sphinx comments in efi_api.hHeinrich Schuchardt1-7/+7
Fix incorrect Sphinx comments in efi_api.h: * add missing 'struct' * correct indentation Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20efi: add comment for efi_system_table and efi_configuration_tableMasahisa Kojima1-0/+32
This commit adds the comment for efi_system_table and efi_configuration_table structure. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20doc: fix typos in trace.rstHeinrich Schuchardt1-8/+8
Fix obvious typos. Use US spelling consistently. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20scripts: update spelling.txt from upstream LinuxHeinrich Schuchardt1-5/+360
This list is used by checkpatch.pl. The Linux v5.15 version has several words that where mispelled in U-Boot too. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20test: test truncation in snprintf()Heinrich Schuchardt1-0/+18
Test that the return value of snprintf() is correct in the case of truncation. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-20lmb: fix typo 'commun'Heinrich Schuchardt1-1/+1
%s/commun/common/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20lmb: drop unused lmb_size_bytes()Heinrich Schuchardt1-6/+0
lmb_size_bytes() is unused. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20lmb: remove extern keyword in lmb.hHeinrich Schuchardt1-19/+17
The extern keyword is not needed in include/lmb.h to declare functions. Remove it. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20doc: add include/lmb.h to the HTML documentationHeinrich Schuchardt3-11/+20
Correct Sphinx style comments in include/lmb.h Add the logical memory block API to the HTML documentation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20lmb: remove lmb_is_nomap() from includeHeinrich Schuchardt2-7/+5
Defining static functions in includes should be avoided. Function lmb_is_nomap() is only used in the unit test. So move it to the unit test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-19Merge tag 'u-boot-amlogic-20211119' of ↵WIP/19Nov2021Tom Rini5-24/+35
https://source.denx.de/u-boot/custodians/u-boot-amlogic - pinctrl: Correct the driver GPIO declaration - meson64_android: handle errors on boot and run fastboot on boot failure
2021-11-19Merge tag 'tpm-19112021' of https://source.denx.de/u-boot/custodians/u-boot-tpmTom Rini3-23/+20
TPM1.2 and Atmel fixes # gpg verification failed.
2021-11-19configs: meson64_android: add PANIC stage for SYSTEM failsNeil Armstrong1-2/+10
If bootloader was updated without running oem format, reboot will cause boot loop because the SYSTEM stage fails. Add a final PANIC stage running fastboot to permit recovery. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2021-11-19configs: meson64_android: bypass other checks on run_fastboot=1Neil Armstrong1-16/+19
This can lead to GPT and BCB errors even if fastboot was selected early by usb rom boot and the eMMC is blank/invalid. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2021-11-19pinctrl: meson: Correct the driver GPIO declarationSimon Glass4-6/+6
This should use the provided U_BOOT_DRIVER() macro so that the driver gets added to the appropriate linker list. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7c9dcfed50f ("pinctrl: meson: rework gx pmx function") Reported-by: Tom Rini <trini@konsulko.com> Tested-by: Tom Rini <trini@konsulko.com> on libretech-cc Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-18Merge branch '2021-11-18-regression-fixes'Tom Rini6-16/+39
- An assortment of fixes related to GD, GD_FLG_SKIP_RELOC, and the lmb - Environment fix on synquacer developmentbox - Fix for get_info is not valid in partition code
2021-11-18arm64: Add missing GD_FLG_SKIP_RELOC handlingMarek Vasut2-0/+7
In case U-Boot enters relocation with GD_FLG_SKIP_RELOC, skip the relocation. The code still has to set up new_gd pointer and new stack pointer. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
2021-11-18lmb: Reserve U-Boot separately if relocation is disabledMarek Vasut1-0/+5
In case U-Boot starts with GD_FLG_SKIP_RELOC, the U-Boot code is not relocated, however the stack and heap is at the end of DRAM after relocation. Reserve a LMB area for the non-relocated U-Boot code so it won't be overwritten. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
2021-11-18board_f: Copy GD to new GD even if relocation disabledMarek Vasut1-16/+18
Even if U-Boot has relocation disabled via GD_FLG_SKIP_RELOC , the relocated stage of U-Boot still picks GD from new_gd location. The U-Boot itself is not relocated, but GD might be, so copy the GD to new GD location even if relocation is disabled. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Peng Fan <peng.fan@oss.nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
2021-11-18part: return -ENOSYS when get_info not valid.schspa1-0/+7
In some case, get_info() interface can be NULL, add this check to stop from crash. Signed-off-by: schspa <schspa@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-18Revert "board: synquacer: developerbox: Don't set gd->env_addr to ↵Masami Hiramatsu1-0/+2
default_environment" Without default setting of gd->env_addr, U-Boot will cause a synchronous abort if the env-variables on the SPI flash is broken or not saved corectly. Set gd->env_addr correctly. This reverts commit 535870f3b0fb09ee9b2885409f05304111464643. Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2021-11-17drivers: tpm: atmel_twi: fix printf specifier compile warningMathew McBride1-1/+1
%d was being used as the specifier for size_t, leading to a compiler warning Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17drivers: tpm: atmel_twi: implement get_desc operationMathew McBride1-1/+4
Without get_desc, the tpm command will not provide a description of the device in 'tpm device' or 'tpm info'. Due to the characteristics of the Atmel TPM it isn't possible to determine certain attributes (e.g open/close status) without using the TPM stack (compare Infineon and ST TPM drivers), so just print out the chip model and udevice name as the identifier. Signed-off-by: Mathew McBride <matt@traverse.com.au> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17drivers: tpm: atmel_twi: do not use an offset byteMathew McBride1-0/+1
This driver was broken due to an empty offset byte being prepended at the start of every transmission. The hardware does not mimic an EEPROM device with registers so an offset byte is not required. Signed-off-by: Mathew McBride <matt@traverse.com.au> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17drivers: tpm: atmel_twi: drop non-DM_I2C compatibilityMathew McBride1-13/+1
There are no users of this driver without DM_I2C Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17cmd: tpm-v1: fix load_key_by_sha1 compile errorsMathew McBride2-7/+7
This command is not compiled by default and has not been updated alongside changes to the tpmv1 API, such as passing the TPM udevice to the relevant functions. Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17cmd: tpm-v1: fix compile error in TPMv1 list resources commandMathew McBride1-1/+6
This command is not compiled by default and was not updated to pass the udevice to tpm_get_capability. Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-16Merge branch '2021-11-15-assorted-fixes'Tom Rini24-41/+53
- Rename "tqc" to "tq" and related updates - Assorted minor ARM updates, build updates and documentation updates
2021-11-16Merge tag 'xilinx-for-v2022.01-rc3' of ↵WIP/16Nov2021Tom Rini12-22/+1243
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2022.01-rc3 sdhci: - Fix emmc mini case with missing firmware interface zynqmp: - Restore JTAG interface if required - Allow overriding board name - Add support for DLC21 - Fix one fallthrought statement description - Use config macro instead of name duplication - Save multiboot to variable firmware: - Handle ipi_req errors better - Use local buffer in case user doesn't need it instead of NULL/0 location spi: - gqsi: Fix write issue at low frequencies net: - gem: Disable broadcasts
2021-11-15image: Explicitly declare do_bdinfo()WIP/2021-11-15-assorted-fixesAndy Shevchenko3-5/+4
Compiler is not happy: common/image-board.c: In function ‘boot_get_kbd’: common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration] 902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~ Move the forward declaration to a header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>