[PATCH v2 0/3] fwu: Call EFI stack initialization after preboot
Michal Simek
michal.simek at amd.com
Fri Mar 20 09:31:43 CET 2026
On 3/20/26 00:56, Casey Connolly wrote:
> Hi Michal,
>
> On 18/03/2026 14:25, Michal Simek wrote:
>> Hi,
>>
>> the whole series is trying to address issues we have on platforms where usb
>> and ufs init are not done before efi initialization. This is happenin on
>> platforms where A/B update is enabled. FWU code is called early and do EFI
>> initialization before usb and ufs started that's why they are not visible.
>
> I guess I'm missing something here (but I'd very much appreciate an
> explanation!) but isn't it actually necessary to set up the EFI
> subsystem /before/ register block devices?
>
> Since EFI sets up an event listener to react to new UCLASS_BLK devices
> and create EFI device handles to represent them, it doesn't create
> device handles for block devices that existed before the EFI subsystem
> is up.
This is solving different problem. This is related to FWU code/update capsule
itself.
There are two options for automatic capsule applying.
The first one is in main_loop()
62 if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY)) {
63 /* efi_init_early() already called */
64 if (efi_init_obj_list() == EFI_SUCCESS)
65 efi_launch_capsules();
66 }
And second is in efi_init_obj_list()
385 /* Execute capsules after reboot */
386 if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK) &&
387 !IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY))
388 ret = efi_launch_capsules();
And because everything passed on the first run when efi_init_obj_list() is
called again it never calls efi_launch_capsules().
240 /* Initialize only once, but start every time if correctly initialized*/
241 if (efi_obj_list_initialized == OBJ_LIST_INITIALIZED)
242 return efi_start_obj_list();
It means when you plug things later capsule update is never automatically called
again.
These 3 patches happened based on my discussion with Ilias where we agreed that
there is actually no reason to call FWU (which calls efi_init_obj_list() first)
that early.
Calling it later postpone efi initialization which give us a room to do
additional steps via preboot.
> I ran into this issue when I wrote this patch:
> https://gitlab.com/LinaroLtd/qcom-eco/u-boot/-/commit/e3616009a441358bf96bd2885d77fd46df710a9a
Then please send this patch out and your patch is likely solving different problem.
Thanks,
Michal
More information about the U-Boot
mailing list