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

AKASHI Takahiro takahiro.akashi at linaro.org
Wed Jun 5 00:58:17 UTC 2019


On Tue, Jun 04, 2019 at 11:38:27PM +0200, Heinrich Schuchardt wrote:
> 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.

It will be trivial once you take a look at "menuconfig."

> 
> >+	/* 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.

This is a discussion.
There can be different approaches here, so
I would like to deter to a developer who will implement a next
backing storage (other than U-Boot env), which is likely to be
Standalone MM services for secure boot.
Unfortunately I'm not responsible for that(StMM).

I hope that some Linaro engineers may have comments here.

Thanks,
-Takahiro Akashi

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


More information about the U-Boot mailing list