aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-12-10Merge tag 'efi-2022-01-rc4-2' of ↵WIP/10Dec2021Tom Rini24-44/+346
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2022-01-rc4-2 UEFI: * correctly handle missing TPM device * prepare for block devices for U-Boot as EFI app # gpg: Signature made Fri 10 Dec 2021 04:29:20 AM 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
2021-12-09efi: Add a media/block driver for EFI block devicesSimon Glass4-0/+137
Add a block driver which handles read/write for EFI block devices. This driver actually already exists ('efi_block') but is not really suitable for use as a real U-Boot driver: - The operations do not provide a udevice - The code is designed for running as part of EFI loader, so uses EFI_PRINT() and EFI_CALL(). - The bind method probes the device, which is not permitted - It uses 'EFI' as its parent device The new driver is more 'normal', just requiring its platform data be set up in advance. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-12-09efi: Add uclass for devices provided by UEFI firmwareSimon Glass12-1/+101
UCLASS_EFI_LOADER is used for devices created by applications and drivers loaded by U-Boots UEFI implementation. This patch provides a new uclass (UCLASS_EFI_MEDIA) to be used for devices that provided by a UEFI firmware calling U-Boot as an EFI application. If the two uclasses can be unified, is left to future redesign. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-12-09efi: Rename UCLASS_EFI and IF_TYPE_EFISimon Glass6-16/+16
These names are better used for access to devices provided by an EFI layer. Use EFI_LOADER instead here, since these are only available in U-Boot's EFI_LOADER layer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-12-09efi_loader: correctly handle no tpm device errorMasahisa Kojima3-8/+18
When the TCG2 protocol is installed in efi_tcg2_register(), TPM2 device must be present. tcg2_measure_pe_image() expects that TCP2 protocol is installed and TPM device is available. If TCG2 Protocol is installed but TPM device is not found, tcg2_measure_pe_image() returns EFI_SECURITY_VIOLATION and efi_load_image() ends with failure. The same error handling is applied to efi_tcg2_measure_efi_app_invocation(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-12-09efi_loader: check tcg2 protocol installation outside the TCG protocolMasahisa Kojima1-0/+18
There are functions that calls tcg2_agile_log_append() outside of the TCG protocol invocation (e.g tcg2_measure_pe_image). These functions must to check that TCG2 protocol is installed. If not, measurement shall be skipped. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-12-09efi_loader: efi_tcg2_register returns appropriate errorMasahisa Kojima4-18/+55
This commit modify efi_tcg2_register() to return the appropriate error. With this fix, sandbox will not boot because efi_tcg2_register() fails due to some missing feature in GetCapabilities. So disable sandbox if EFI_TCG2_PROTOCOL is enabled. UEFI secure boot variable measurement is not directly related to TCG2 protocol installation, tcg2_measure_secure_boot_variable() is moved to the separate function. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-12-09doc: usage: Fix command in fdt overlay apply sequenceAlexander Dahl1-1/+1
Literally adhering to the docs gave this wrong output: U-Boot> setenv fdtaddr 0x87f00000 U-Boot> fdtaddr $fdtaddr Unknown command 'fdtaddr' - try 'help' Fixes: d80162cfc559 ("doc: Document how to apply fdt overlays") Signed-off-by: Alexander Dahl <ada@thorsis.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-12-09Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2-8/+2
This fixes two regressions: eMMC operation on boards with WiFi (so using three MMC devices), and a repeated wrong error message in USB gadget mode (fastboot, ums).
2021-12-08sunxi: Remove misleading USB-OTG charger messageAndre Przywara1-7/+1
The sunxi MUSB glue driver has some code to check for external VBUS presence when it's going to use the MUSB host mode, and it warns if there is VBUS provided through the cable (in sunxi_musb_enable()). This code was apparently copied to the USB gadget detection code (g_dnl_board_usb_cable_connected()), but here we actually *expect* external VBUS power, so a warning is wrong and confusing. So far this message rarely triggered, but a recent patch (6fa41cdd19b9) changed this: =========================== => ums 0 mmc 2 UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe90000 A charger is plugged into the OTG /A charger is plugged into the OTG \A charger is plugged into the OTG |A charger is plugged into the OTG -A charger is plugged into the OTG .... =========================== Remove the message for the gadget cable detection call, and just return the status of the VBUS detection, as this is what the callers are after. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2021-12-08sunxi: dts: Fix typoed eMMC checkAndre Przywara1-1/+1
Commit 03510bf62149 ("sunxi: only include alias for eMMC when mmc2 used") protected the eMMC alias in U-Boot's DT stub the with the associated Kconfig symbol, but was actually using the wrong name. Fix the name of the symbol to match what's defined in Kconfig and what the defconfig files actually use. Fixes: 03510bf62149 ("sunxi: only include alias for eMMC when mmc2 used") Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reported-by: 5kft@5kft.org Reviewed-by: Icenowy Zheng <icenowy@aosc.io>
2021-12-03Merge https://source.denx.de/u-boot/custodians/u-boot-riscvWIP/03Dec2021Tom Rini19-405/+1512
2021-12-02Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-netTom Rini2-12/+12
- Two fixes from Marek for designware and mdio.
2021-12-02riscv: Enable SPI flash env for SiFive Unmatched.Thomas Skibo2-0/+14
Enable saving environment to SPI flash memory on SiFive Unmatched. Signed-off-by: Thomas Skibo <thomas-git@skibo.net> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02riscv: Support booting SiFive Unmatched from SPI.Thomas Skibo4-0/+51
Configure SPI flash devices into SPL. Add SPI boot option to spl.c. Document how to format flash for booting. Signed-off-by: Thomas Skibo <thomas-git@skibo.net> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02doc: board: Update Microchip MPFS Icicle Kit docPadmarao Begari1-2/+5
UART1 use for U-Boot and Linux console instead of UART0 and UART0 is reserved for Hart Software Services(HSS). Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-12-02riscv: Update Microchip MPFS Icicle Kit supportPadmarao Begari3-2/+21
This patch updates Microchip MPFS Icicle Kit support. For now, add Microchip I2C driver, set environment variables for mac addresses and default build for SBI_V02. Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02riscv: dts: Split Microchip device treePadmarao Begari4-389/+913
The device tree split into .dtsi and .dts files, common device node for eMMC/SD, enable I2C1, UART1 for console instead of UART0, enable the DDR 2GB memory and in that 288MB memory is reserved for fabric buffer. Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02i2c: Add Microchip PolarFire SoC I2C driverPadmarao Begari3-0/+489
Add I2C driver code for the Microchip PolarFire SoC. This driver supports I2C data transfer and probe for I2C slave addresses. Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02net: macb: Remove Microchip compatible stringPadmarao Begari1-11/+7
Remove the microchip compatible string and default compatible "cdns,macb" support both 32-bit and 64-bit DMA access. Signed-off-by: Padmarao Begari <padmarao.begari@microchip.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2021-12-02board: ae350: Support autoboot from RAMLeo Yu-Chi Liang1-1/+12
Add boot command "bootcmd_ram" to support autoboot from RAM. This feature could be useful at the very initial state of chip design when there is only a minimal set of peripheral. (e.g. without mmc and mac ..etc) The kernel image is default to be loaded at 0x2000000 via debug port, and the following script serves as an example: spl() { cmd="riscv64-linux-gdb -q \ -ex \"target remote $host:$port\" \ -ex \"load\" \ -ex \"thread apply all set \\\$pc=&_start\" \ -ex \"thread apply all set \\\$a0=\\\$mhartid\" \ -ex \"thread apply all set \\\$a1=<dtb address>\" \ -ex \"restore u-boot.itb binary 0x200000\" \ -ex \"restore Image binary 0x2000000\" \ -ex \"c\" \ spl/u-boot-spl " echo $cmd eval $cmd } The address where the kernel is loaded can be altered by changing the value of KERNEL_IMAGE_ADDR. Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Rick Chen <rick@andestech.com>
2021-12-02net: dwc_eth_qos: Enable clock in probeMarek Vasut1-11/+11
Enable DWC IP clock in driver probe, so the MII access is possible even outside of active network transfers. This is particularly useful when using 'mii' or 'mdio' commands to explore PHY state, neither of which works with DWMAC currently due to the disabled clock. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Stephen Warren <swarren@nvidia.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-12-02net: eth-phy: Handle gpio_request_by_name() return valueMarek Vasut1-1/+1
The gpio_request_by_name() returns zero in case of success, however the conditional return value check in gpio_request_by_name() checks only for (ret != -ENOENT) and if the condition is true, returns ret outright. This leads to a situation where successful gpio_request_by_name() return leads to immediate successful eth_phy_of_to_plat() return as well, and to skipped parsing of "reset-assert-us" and "reset-deassert-us", so the PHY driver operates with valid reset GPIO, but with assert/deassert times set to default, which is 0, instead of the values from DT. This breaks PHY reset. Fix this by checking if return value is non-zero and then for this one single allowed non-zero return value, -ENOENT. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-30Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini2-3/+75
- turris_omnia: enable A385 watchdog before disabling MCU watchdog (Pali) - a37xx: Reset whole UART when changing parent clock from TBG to XTAL (Pali)
2021-11-30Merge tag 'tpm-30112021' of https://source.denx.de/u-boot/custodians/u-boot-tpmWIP/30Nov2021Tom Rini2-1/+7
TPM2 API fixes Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-30Merge tag 'efi-2022-01-rc4' of ↵Tom Rini11-78/+526
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-01-rc4 Documentation: * describe how to enable Virtio RNG on QEMU ARM UEFI: * enable testing the TCG2 protocol * support TPM event log passed from firmware
2021-11-30tis: fix tpm_tis_remove()Heinrich Schuchardt2-1/+10
tpm_tis_remove() leads to calling tpm_tis_ready() with the IO region unmapped and chip->locality == -1 (locality released). This leads to a crash in mmio_write_bytes(). The patch implements these changes: tpm_tis_remove(): Unmap the IO region after calling tpm_tis_cleanup(). tpm_tis_cleanup(): Request locality before IO output and releasing locality. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30efi_loader: Extend PCR's for firmware measurementsRuchika Gupta1-0/+76
Firmwares before U-Boot may be capable of doing tpm measurements and passing them to U-Boot in the form of eventlog. However there may be scenarios where the firmwares don't have TPM driver and are not capable of extending the measurements in the PCRs. Based on TCG spec, if previous firnware has extended PCR's, PCR0 would not be 0. So, read the PCR0 to determine if the PCR's need to be extended as eventlog is parsed or not. Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30tpm: use more algorithms than sha256 on pcr_readRuchika Gupta3-6/+14
The current tpm2_pcr_read is hardcoded using SHA256. Make the actual command to TPM configurable to use wider range of algorithms. The current command line is kept as is i.e limited to SHA-256 only. Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30efi_loader: Add check for event log passed from firmwareRuchika Gupta2-69/+402
Platforms may have support to measure their initial firmware components and pass the event log to u-boot. The event log address can be passed in property tpm_event_log_addr and tpm_event_log_size of the tpm node. Platforms may choose their own specific mechanism to do so. A weak function is added to check if even log has been passed to u-boot from earlier firmware components. If available, the eventlog is parsed to check for its correctness and further event logs are appended to the passed log. Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30test: unit test for the EFI_TCG2_PROTOCOLHeinrich Schuchardt1-0/+20
Encapsulate the UEFI EFI_TCG2_PROTOCOL unit test in an Python test. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-30configs: enable CMD_TPM on QEMU ARMHeinrich Schuchardt3-0/+3
With TPM emulation enabled in u-boot-test-hooks we should also provide the tpm2 command used for the test/py/tests/test_tpm2.py test. One of the Python TPMv2 tests expects sandbox specific values. So disable it on other platforms. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-30doc: qemu-arm peripherialsHeinrich Schuchardt2-3/+11
* add description how to add RNG device * for a disk specify format=raw to avoid a warning * fix a typo Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30serial: a37xx: Reset whole UART when changing parent clock from TBG to XTALPali Rohár1-1/+12
Sometimes UART stops transmitting characters after UART clock is changed back to XTAL. In this state UART fifo is always full. Kernel during early boot wants to print output on UART and is waiting for non-empty UART fifo. Which leads to CPU hangup without any (debug) output on UART. Marvell Armada 3700 Functional Specifications says that for programming fractional divisor registers it is required to disable UART, enable loopback mode, reset fifos, program registers, disable loopback mode, release reset of fifos and enable UART. But these steps do not fix above mentioned issue that UART hangup. Also gating UART clock does not help. And even resetting UART state machines do not help. Experiments showed that UART fifo is unblocked after board is being reset (during board reset UART HW transmit UART fifo even CPU is not executing kernel/bootloader anymore). And another experiments showed that same workaround can be achieved also by external reset of UART HW (without need to reset board). So do not implement any of "Marvell recommended" steps from Functional Specifications as they do not work. And rather prior changing parent clock back to XTAL, do external reset of UART HW. This operation also resets all UART registers, so basically it also sets UART clock to default, which is XTAL. It is unknown why UART hangups and enters such broken state. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-11-30arm: mvebu: turris_omnia: enable A385 watchdog before disabling MCU watchdogPali Rohár1-2/+63
Commit aeb0ca64dbb5 ("arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART") disabled MCU watchdog when booting over UART to ensure that watchdog does not reboot the board before UART transfer finishes. But if UART transfer fails for some reason, or if U-Boot binary crashes, then board hangs forever as there is no watchdog running which could reset it. To fix this issue, enable A385 watchdog with very high timeout before disabling MCU watchdog to ensure that even slow transfer can finish successfully before watchdog timer expires and also to ensure that if board hangs for some reason, watchdog will reset it. Omnia's MCU watchdog has fixed 120 seconds timer and it cannot be changed (without updating MCU firmware). A385 watchdog by default uses 25 MHz input clock and so the largest timeout value (2^32-1) can be just 171 seconds. But A385 watchdog can be switched to use NBCLK (L2) as input clock (on Turris Omnia it is 800 MHz clock) and in this case final watchdog clock frequency is calculated as: freq = NBCLK / 2 / (2 ^ R) So A385 watchdog on Turris Omnia can be configured to at most 1374 seconds (about 22 minutes). We set it to 10 minutes, which should be enough even for bigger U-Boot binaries or slower UART transfers. Both U-Boot and Linux kernel, when initializing A385 watchdog, switch watchdog timer to 25 MHz input clock, so usage of NBCLK input clock in U-Boot SPL does not cause any issues. Fixes: aeb0ca64dbb5 ("arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART") Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz>
2021-11-29Prepare v2022.01-rc3v2022.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-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>