efi_loader: add option to initialise EFI subsystem early
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Thu, 29 Oct 2020 04:47:45 +0000 (13:47 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 30 Oct 2020 13:20:27 +0000 (14:20 +0100)
If this option, CONFIG_EFI_SETUP_EARLY, is enabled, the initialisation
of UEFI subsystem will be done as part of U-Boot initialisation.

Please note that this option won't be enabled explicitly by users,
instead, should be enabled implicitly by other configuration options.

Specifically, this feature will be utilised in implementing capsule-on-disk
feature.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
common/board_r.c
lib/efi_loader/Kconfig

index b9217b2e27f04a689a89eb6f12f9dc30d39398c8..2212d981e5ea4419ed675b62836d0bbdd26bb33a 100644 (file)
@@ -73,6 +73,9 @@
 #if defined(CONFIG_GPIO_HOG)
 #include <asm/gpio.h>
 #endif
+#ifdef CONFIG_EFI_SETUP_EARLY
+#include <efi_loader.h>
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -889,6 +892,9 @@ static init_fnc_t init_sequence_r[] = {
 #endif
 #if defined(CONFIG_PRAM)
        initr_mem,
+#endif
+#ifdef CONFIG_EFI_SETUP_EARLY
+       (init_fnc_t)efi_init_obj_list,
 #endif
        run_main_loop,
 };
index ab42f3ba75b19f68e0ea810ced85f45176e3c052..075481428cdf19ff214a6e39beead6aab06118ea 100644 (file)
@@ -27,6 +27,10 @@ config EFI_LOADER
 
 if EFI_LOADER
 
+config EFI_SETUP_EARLY
+       bool
+       default n
+
 choice
        prompt "Store for non-volatile UEFI variables"
        default EFI_VARIABLE_FILE_STORE