diff mbox series

efi_loader: remove CONFIG_EFI_SETUP_EARLY

Message ID 20221021030157.50600-1-takahiro.akashi@linaro.org
State Accepted
Commit 023d9c93932cd0106fb921290c6128705343a6da
Headers show
Series efi_loader: remove CONFIG_EFI_SETUP_EARLY | expand

Commit Message

AKASHI Takahiro Oct. 21, 2022, 3:01 a.m. UTC
Since the commit a9bf024b2933 ("efi_loader: disk: a helper function to
create efi_disk objects from udevice"), CONFIG_EFI_SETUP_EARLY option is
by default on and will never be turned off.

So just remove this option.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 common/board_r.c           |  2 +-
 lib/efi_loader/Kconfig     |  5 -----
 lib/efi_loader/efi_setup.c | 43 ++++++++++----------------------------
 3 files changed, 12 insertions(+), 38 deletions(-)

Comments

Heinrich Schuchardt Oct. 21, 2022, 6:43 a.m. UTC | #1
On 10/21/22 05:01, AKASHI Takahiro wrote:
> Since the commit a9bf024b2933 ("efi_loader: disk: a helper function to
> create efi_disk objects from udevice"), CONFIG_EFI_SETUP_EARLY option is
> by default on and will never be turned off.
>
> So just remove this option.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Thanks for removing this outdated code.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Ilias Apalodimas Oct. 21, 2022, 7:45 a.m. UTC | #2
On Fri, 21 Oct 2022 at 09:43, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 10/21/22 05:01, AKASHI Takahiro wrote:
> > Since the commit a9bf024b2933 ("efi_loader: disk: a helper function to
> > create efi_disk objects from udevice"), CONFIG_EFI_SETUP_EARLY option is
> > by default on and will never be turned off.
> >
> > So just remove this option.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
>
> Thanks for removing this outdated code.
>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/common/board_r.c b/common/board_r.c
index 92ca2066ee3a..683c045b617c 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -692,7 +692,7 @@  static init_fnc_t init_sequence_r[] = {
 	/* initialize higher level parts of CPU like time base and timers */
 	cpu_init_r,
 #endif
-#ifdef CONFIG_EFI_SETUP_EARLY
+#ifdef CONFIG_EFI_LOADER
 	efi_init_early,
 #endif
 #ifdef CONFIG_CMD_NAND
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 41756ea53961..7b50f4b38545 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -42,10 +42,6 @@  config CMD_BOOTEFI_BOOTMGR
 	  via UEFI variables Boot####, BootOrder, and BootNext. This enables the
 	  'bootefi bootmgr' command.
 
-config EFI_SETUP_EARLY
-	bool
-	default y
-
 choice
 	prompt "Store for non-volatile UEFI variables"
 	default EFI_VARIABLE_FILE_STORE
@@ -161,7 +157,6 @@  config EFI_IGNORE_OSINDICATIONS
 config EFI_CAPSULE_ON_DISK_EARLY
 	bool "Initiate capsule-on-disk at U-Boot boottime"
 	depends on EFI_CAPSULE_ON_DISK
-	select EFI_SETUP_EARLY
 	help
 	  Normally, without this option enabled, capsules will be
 	  executed only at the first time of invoking one of efi command.
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index 9d7189336dc4..af66076bd3d0 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -175,16 +175,15 @@  static efi_status_t efi_init_os_indications(void)
 }
 
 /**
- * __efi_init_early() - handle initialization at early stage
+ * efi_init_early() - handle initialization at early stage
  *
- * This function is called in efi_init_obj_list() only if
- * !CONFIG_EFI_SETUP_EARLY.
+ * expected to be called in board_init_r().
  *
  * Return:	status code
  */
-static efi_status_t __efi_init_early(void)
+int efi_init_early(void)
 {
-	efi_status_t ret = EFI_SUCCESS;
+	efi_status_t ret;
 
 	/* Allow unaligned memory access */
 	allow_unaligned();
@@ -200,29 +199,15 @@  static efi_status_t __efi_init_early(void)
 
 	/* Initialize EFI driver uclass */
 	ret = efi_driver_init();
-out:
-	return ret;
-}
-
-/**
- * efi_init_early() - handle initialization at early stage
- *
- * external version of __efi_init_early(); expected to be called in
- * board_init_r().
- *
- * Return:	status code
- */
-int efi_init_early(void)
-{
-	efi_status_t ret;
+	if (ret != EFI_SUCCESS)
+		goto out;
 
-	ret = __efi_init_early();
-	if (ret != EFI_SUCCESS) {
-		/* never re-init UEFI subsystem */
-		efi_obj_list_initialized = ret;
-		return -1;
-	}
 	return 0;
+out:
+	/* never re-init UEFI subsystem */
+	efi_obj_list_initialized = ret;
+
+	return -1;
 }
 
 /**
@@ -238,12 +223,6 @@  efi_status_t efi_init_obj_list(void)
 	if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
 		return efi_obj_list_initialized;
 
-	if (!IS_ENABLED(CONFIG_EFI_SETUP_EARLY)) {
-		ret = __efi_init_early();
-		if (ret != EFI_SUCCESS)
-			goto out;
-	}
-
 	/* Set up console modes */
 	efi_setup_console_size();