@@ -972,4 +972,5 @@ efi_status_t efi_esrt_register(void);
* - error code otherwise.
*/
efi_status_t efi_esrt_populate(void);
+efi_status_t efi_load_capsule_drivers(void);
#endif /* _EFI_LOADER_H */
@@ -919,13 +919,13 @@ static void efi_capsule_scan_done(void)
}
/**
- * arch_efi_load_capsule_drivers - initialize capsule drivers
+ * efi_load_capsule_drivers - initialize capsule drivers
*
- * Architecture or board specific initialization routine
+ * Generic FMP drivers backed by DFU
*
* Return: status code
*/
-efi_status_t __weak arch_efi_load_capsule_drivers(void)
+efi_status_t __weak efi_load_capsule_drivers(void)
{
__maybe_unused efi_handle_t handle;
efi_status_t ret = EFI_SUCCESS;
@@ -976,11 +976,6 @@ efi_status_t efi_launch_capsules(void)
index = get_last_capsule();
- /* Load capsule drivers */
- ret = arch_efi_load_capsule_drivers();
- if (ret != EFI_SUCCESS)
- return ret;
-
/*
* Find capsules on disk.
* All the capsules are collected at the beginning because
@@ -254,6 +254,12 @@ efi_status_t efi_init_obj_list(void)
if (ret != EFI_SUCCESS)
goto out;
+ if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) {
+ ret = efi_load_capsule_drivers();
+ if (ret != EFI_SUCCESS)
+ goto out;
+ }
+
#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
ret = efi_gop_register();
if (ret != EFI_SUCCESS)
We only install FMPs if a CapsuleUpdate is requested. Since we now have an ESRT table which relies on FMPs to build the required information, it makes more sense to unconditionally install them. This will allow userspace applications (e.g fwupd) to make use of the ERST and provide us with files we can use to run CapsuleUpdate on-disk Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> --- Changes since v2: - Changes since v1: - Only install the FMPs if CONFIG_EFI_HAVE_CAPSULE_SUPPORT is selected include/efi_loader.h | 1 + lib/efi_loader/efi_capsule.c | 11 +++-------- lib/efi_loader/efi_setup.c | 6 ++++++ 3 files changed, 10 insertions(+), 8 deletions(-) -- 2.32.0.rc0