[PATCH 2/3 v2] efi_loader: Force a sinlge FMP instance per hardware store

Masami Hiramatsu masami.hiramatsu at linaro.org
Fri Jun 18 15:52:51 CEST 2021


Hi Ilias,

2021年6月18日(金) 19:51 Ilias Apalodimas <ilias.apalodimas at linaro.org>:
>
> Chapter 23 of the EFI spec (rev 2.9) says:
> "A specific updatable hardware firmware store must be represented by
> exactly one FMP instance".
> This is not the case for us, since both of our FMP protocols can be
> installed at the same time because they are controlled by a single
> 'dfu_alt_info' env variable.
> So make the config options depend on each other and allow the user to
> install one of them at any given time.  If we fix the meta-data provided
> by the 'dfu_alt_info' in the future,  to hint about the capsule type
> (fit or raw) we can revise this and enable both FMPs to be installed, as
> long as they target different firmware hardware stores
>
> Note that we are not using a Kconfig 'choice' on purpose, since we
> want to allow both of those to be installed and tested in sandbox

This sounds like changing the Kconfig, thus...

[...]
> --- a/lib/efi_loader/efi_capsule.c
> +++ b/lib/efi_loader/efi_capsule.c
> @@ -918,15 +918,15 @@ 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;
> +       __maybe_unused efi_handle_t handle = NULL;
>         efi_status_t ret = EFI_SUCCESS;
>
>         if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_FIT)) {
> @@ -975,10 +975,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;

I think this part of the change should be included in the next patch.

Thank you,

>
>         /*
>          * Find capsules on disk.
> --
> 2.32.0.rc0
>


-- 
Masami Hiramatsu


More information about the U-Boot mailing list