diff options
| author | Tom Rini <[email protected]> | 2022-04-10 11:21:39 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-04-10 11:21:39 -0400 |
| commit | 33ae8c5bebba0874fbc432914406e63fbc219080 (patch) | |
| tree | 050e8c63351c2efd654930e59a6fd2fe031c52c2 /lib | |
| parent | 5c7399ec90513bc0310801c9f852ea7697a91759 (diff) | |
| parent | 6b7a6210fde96bb95c8168af4ebf4eb83401df9e (diff) | |
Merge tag 'efi-2022-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-07-rc1
Documentation:
* Describe how enable DM_SERIAL for a board
UEFI
* Preparatory patches for better integration of DM and UEFI
* Use sysreset after capsule updates instead of do_reset
* Allow to disable persisting non-volatile variables
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/efi_loader/Kconfig | 10 | ||||
| -rw-r--r-- | lib/efi_loader/efi_capsule.c | 65 |
2 files changed, 42 insertions, 33 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 28657f50c96..559b95a599b 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -62,11 +62,18 @@ config EFI_MM_COMM_TEE variable related operations to that. The application will verify, authenticate and store the variables on an RPMB. +config EFI_VARIABLE_NO_STORE + bool "Don't persist non-volatile UEFI variables" + help + If you choose this option, non-volatile variables cannot be persisted. + You could still provide non-volatile variables via + EFI_VARIABLES_PRESEED. + endchoice config EFI_VARIABLES_PRESEED bool "Initial values for UEFI variables" - depends on EFI_VARIABLE_FILE_STORE + depends on !EFI_MM_COMM_TEE help Include a file with the initial values for non-volatile UEFI variables into the U-Boot binary. If this configuration option is set, changes @@ -129,6 +136,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE config EFI_CAPSULE_ON_DISK bool "Enable capsule-on-disk support" + depends on SYSRESET select EFI_HAVE_CAPSULE_SUPPORT help Select this option if you want to use capsule-on-disk feature, diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index f00440163d4..a107f285ddf 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -18,6 +18,7 @@ #include <malloc.h> #include <mapmem.h> #include <sort.h> +#include <sysreset.h> #include <asm/global_data.h> #include <crypto/pkcs7.h> @@ -619,6 +620,36 @@ out: return EFI_EXIT(ret); } +/** + * efi_load_capsule_drivers - initialize capsule drivers + * + * Generic FMP drivers backed by DFU + * + * Return: status code + */ +efi_status_t __weak efi_load_capsule_drivers(void) +{ + __maybe_unused efi_handle_t handle; + efi_status_t ret = EFI_SUCCESS; + + if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) { + handle = NULL; + ret = EFI_CALL(efi_install_multiple_protocol_interfaces( + &handle, &efi_guid_firmware_management_protocol, + &efi_fmp_fit, NULL)); + } + + if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { + handle = NULL; + ret = EFI_CALL(efi_install_multiple_protocol_interfaces( + &handle, + &efi_guid_firmware_management_protocol, + &efi_fmp_raw, NULL)); + } + + return ret; +} + #ifdef CONFIG_EFI_CAPSULE_ON_DISK /** * get_dp_device - retrieve a device path from boot variable @@ -1015,36 +1046,6 @@ static void efi_capsule_scan_done(void) } /** - * efi_load_capsule_drivers - initialize capsule drivers - * - * Generic FMP drivers backed by DFU - * - * Return: status code - */ -efi_status_t __weak efi_load_capsule_drivers(void) -{ - __maybe_unused efi_handle_t handle; - efi_status_t ret = EFI_SUCCESS; - - if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) { - handle = NULL; - ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &handle, &efi_guid_firmware_management_protocol, - &efi_fmp_fit, NULL)); - } - - if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { - handle = NULL; - ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &handle, - &efi_guid_firmware_management_protocol, - &efi_fmp_raw, NULL)); - } - - return ret; -} - -/** * check_run_capsules() - check whether capsule update should run * * The spec says OsIndications must be set in order to run the capsule update @@ -1157,9 +1158,9 @@ efi_status_t efi_launch_capsules(void) * UEFI spec requires to reset system after complete processing capsule * update on the storage. */ - log_info("Reboot after firmware update"); + log_info("Reboot after firmware update.\n"); /* Cold reset is required for loading the new firmware. */ - do_reset(NULL, 0, 0, NULL); + sysreset_walk_halt(SYSRESET_COLD); hang(); /* not reach here */ |
