diff mbox series

[11/15] efi_loader: Create the log on startup

Message ID 20241028124815.47262-12-sjg@chromium.org
State Rejected, archived
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: Add support for logging to a buffer | expand

Commit Message

Simon Glass Oct. 28, 2024, 12:48 p.m. UTC
Create an EFI log when the EFI subsystem is first touched. This happens
after relocation in board_init_f()

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/efi_loader/efi_setup.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c
index aa59bc7779d..468156db813 100644
--- a/lib/efi_loader/efi_setup.c
+++ b/lib/efi_loader/efi_setup.c
@@ -8,6 +8,7 @@ 
 #define LOG_CATEGORY LOGC_EFI
 
 #include <efi_loader.h>
+#include <efi_log.h>
 #include <efi_variable.h>
 #include <log.h>
 #include <asm-generic/unaligned.h>
@@ -186,6 +187,12 @@  int efi_init_early(void)
 	/* Allow unaligned memory access */
 	allow_unaligned();
 
+	if (IS_ENABLED(CONFIG_EFI_LOG)) {
+		ret = efi_log_init();
+		if (ret)
+			return -ENOSPC;
+	}
+
 	/* Initialize root node */
 	ret = efi_root_node_register();
 	if (ret != EFI_SUCCESS)