[U-Boot] [PATCH v3 4/7] efi_loader: load saved non-volatile variables at init

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Jun 4 21:38:27 UTC 2019


On 6/4/19 8:52 AM, AKASHI Takahiro wrote:
> Data cache will be read in from persistent storage after (re)boot
> to restore UEFI non-volatile variables.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> ---
>   lib/efi_loader/efi_setup.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
> index 8691d686d29d..45d6aca051f3 100644
> --- a/lib/efi_loader/efi_setup.c
> +++ b/lib/efi_loader/efi_setup.c
> @@ -8,6 +8,7 @@
>   #include <common.h>
>   #include <bootm.h>
>   #include <efi_loader.h>
> +#include <environment.h>
>
>   #define OBJ_LIST_NOT_INITIALIZED 1
>
> @@ -102,6 +103,11 @@ efi_status_t efi_init_obj_list(void)
>   	/* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */
>   	switch_to_non_secure_mode();
>
> +#ifdef CONFIG_EFI_VARIABLE_USE_ENV

No clue what ENV refers to here as we are not talking about U-Boot
environment variables anymore. How about CONFIG_EFI_PERSISTENT_VARIABLES.


> +	/* Load non-volatile variables */
> +	env_efi_load();

Can't we make env_efi_load() a __weak function which does nothing. If we
have a backend, that backend replaces the weak function. That way we
restrict the config variables to the Makefile.

Regards

Heinrich

> +#endif
> +
>   	/* Define supported languages */
>   	ret = efi_init_platform_lang();
>   	if (ret != EFI_SUCCESS)
>



More information about the U-Boot mailing list