summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-12-15clk: define LOG_CATEGORY for generic and ccf clocksPatrick Delaunay8-12/+39
Define LOG_CATEGORY to allow filtering with log command for generic clock and CCF clocks. This patch also change existing printf, debug and pr_ macro to log_ or dev_ macro. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2021-12-15clk: cosmetic: reorder include filesPatrick Delaunay6-15/+18
Reorder include files in the U-Boot expected order: the common.h header should always be first, followed by other headers in order, then headers with directories, then local files. It is a preliminary step for next patch. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2021-12-15clk: fix clk_get_rate() documentationGiulio Benetti1-1/+2
Improve clk_get_rate() @return documentation that otherwise is a bit ambiguous. At the moment I expect to return 0 as error since the return type is 'ulong', instead the function really returns negative value in case the corresponding function pointer is null and returns 0 if the clock is invalid. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2021-11-29Prepare v2022.01-rc3Tom Rini1-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-29board: iot2050: update build documentation for OP-TEEIvan Mikhaylov1-1/+1
Set ta-target explicitly to correspond with OP-TEE recipe in siemens/meta-iot2050. Errors without explicit set of ta-target: aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mthumb’ aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mno-unaligned-access’ aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mfloat-abi=hard’ make: *** [mk/compile.mk:159: out/arm-plat-k3/ta_arm32-lib/libdl/dlfcn.o] Error 1 Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-11-29qemu: common: Fix build with update capsuleVincent Stehlé1-1/+0
The common emulation Makefile has a dependency on a non-existent qemu_capsule.o when building with support for capsule update enabled (CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y). The code which was in qemu_capsule.c has been completely moved to lib/efi_loader/efi_capsule.c by commit 7a6fb28c8e4b ("efi_loader: capsule: add back efi_get_public_key_data()"). Remove the false dependency. This fixes the following build error: make[1]: *** No rule to make target 'board/emulation/common/qemu_capsule.o', needed by 'board/emulation/common/built-in.o'. Stop. Fixes: commit 47a25e81d35c ("Revert "efi_capsule: Move signature from DTB to .rodata"") Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Simon Glass <sjg@chromium.org>
2021-11-29fastboot: Add maintainers entrySean Anderson1-0/+12
Add an entry in maintainers for fastboot. It is starting off orphaned, but hopefully someone can pick it up. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2021-11-29clk: Add myself as a maintainer for the clock subsystemSean Anderson1-0/+1
Lukasz has not been very responsive in reviewing clock patches. Add myself as a maintainer. Signed-off-by: Sean Anderson <seanga2@gmail.com> Acked-by: Lukasz Majewski <lukma@denx.de>
2021-11-27Merge tag 'efi-2022-01-rc3-2' of ↵Tom 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-27test: 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-27test: 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-27test: 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-27test: 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-27test: 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 ↵Tom 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-20Merge tag 'u-boot-amlogic-20211119' of ↵Tom 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-20Merge 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-19Merge 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-19arm64: 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-19lmb: 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-19board_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-19part: 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>