summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig1
-rw-r--r--lib/Makefile5
-rw-r--r--lib/abuf.c12
-rw-r--r--lib/acpi/acpi_table.c4
-rw-r--r--lib/efi_driver/efi_block_device.c2
-rw-r--r--lib/efi_driver/efi_uclass.c2
-rw-r--r--lib/efi_loader/Kconfig7
-rw-r--r--lib/efi_loader/efi_acpi.c12
-rw-r--r--lib/efi_loader/efi_bootbin.c188
-rw-r--r--lib/efi_loader/efi_boottime.c9
-rw-r--r--lib/efi_loader/efi_conformance.c2
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c2
-rw-r--r--lib/efi_loader/efi_device_path_utilities.c2
-rw-r--r--lib/efi_loader/efi_dt_fixup.c2
-rw-r--r--lib/efi_loader/efi_esrt.c2
-rw-r--r--lib/efi_loader/efi_fdt.c2
-rw-r--r--lib/efi_loader/efi_file.c2
-rw-r--r--lib/efi_loader/efi_firmware.c2
-rw-r--r--lib/efi_loader/efi_gop.c2
-rw-r--r--lib/efi_loader/efi_helper.c1
-rw-r--r--lib/efi_loader/efi_hii.c2
-rw-r--r--lib/efi_loader/efi_hii_config.c2
-rw-r--r--lib/efi_loader/efi_http.c2
-rw-r--r--lib/efi_loader/efi_ipconfig.c2
-rw-r--r--lib/efi_loader/efi_load_initrd.c1
-rw-r--r--lib/efi_loader/efi_net.c2
-rw-r--r--lib/efi_loader/efi_riscv.c1
-rw-r--r--lib/efi_loader/efi_root_node.c2
-rw-r--r--lib/efi_loader/efi_runtime.c2
-rw-r--r--lib/efi_loader/efi_signature.c2
-rw-r--r--lib/efi_loader/efi_string.c2
-rw-r--r--lib/efi_loader/efi_tcg2.c1
-rw-r--r--lib/efi_loader/efi_unicode_collation.c2
-rw-r--r--lib/efi_loader/efi_var_common.c2
-rw-r--r--lib/efi_loader/efi_var_mem.c2
-rw-r--r--lib/efi_loader/efi_variable_tee.c2
-rw-r--r--lib/efi_loader/efi_watchdog.c2
37 files changed, 243 insertions, 49 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index baeb615626d..0a295161385 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -1067,6 +1067,7 @@ menu "System tables"
config BLOBLIST_TABLES
bool "Put tables in a bloblist"
depends on BLOBLIST
+ default y if X86
default y if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
default n
help
diff --git a/lib/Makefile b/lib/Makefile
index 3595086af7c..fc6e68c901a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -41,7 +41,12 @@ obj-$(CONFIG_ERRNO_STR) += errno_str.o
obj-$(CONFIG_FIT) += fdtdec_common.o
obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o
+
+# With QEMU the SMBIOS tables come from there, not from U-Boot
+ifndef CONFIG_QFW_SMBIOS
obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o
+endif
+
obj-$(CONFIG_SMBIOS_PARSER) += smbios-parser.o
obj-$(CONFIG_IMAGE_SPARSE) += image-sparse.o
obj-y += initcall.o
diff --git a/lib/abuf.c b/lib/abuf.c
index 937c3df351e..61adf7fc6b1 100644
--- a/lib/abuf.c
+++ b/lib/abuf.c
@@ -26,6 +26,12 @@ void abuf_map_sysmem(struct abuf *abuf, ulong addr, size_t size)
{
abuf_set(abuf, map_sysmem(addr, size), size);
}
+
+ulong abuf_addr(const struct abuf *abuf)
+{
+ return map_to_sysmem(abuf->data);
+}
+
#else
/* copied from lib/string.c for convenience */
static char *memdup(const void *src, size_t len)
@@ -113,6 +119,12 @@ void abuf_init_set(struct abuf *abuf, void *data, size_t size)
abuf_set(abuf, data, size);
}
+void abuf_init_const(struct abuf *abuf, const void *data, size_t size)
+{
+ /* for now there is no flag indicating that the abuf data is constant */
+ abuf_init_set(abuf, (void *)data, size);
+}
+
void abuf_init_move(struct abuf *abuf, void *data, size_t size)
{
abuf_init_set(abuf, data, size);
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 150f75027a5..c0ed24984af 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -273,7 +273,9 @@ int acpi_write_fadt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
return acpi_add_fadt(ctx, fadt);
}
+#ifndef CONFIG_QFW_ACPI
ACPI_WRITER(5fadt, "FADT", acpi_write_fadt, 0);
+#endif
int acpi_write_madt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
{
@@ -308,7 +310,9 @@ int acpi_write_madt(struct acpi_ctx *ctx, const struct acpi_writer *entry)
return 0;
}
+#ifndef CONFIG_QFW_ACPI
ACPI_WRITER(5madt, "MADT", acpi_write_madt, 0);
+#endif
void acpi_create_dbg2(struct acpi_dbg2_header *dbg2,
int port_type, int port_subtype,
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 19a5ee24794..d3c668dc183 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -28,6 +28,8 @@
* iPXE uses the simple file protocol to load Grub or the Linux Kernel.
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <blk.h>
#include <dm.h>
#include <efi_driver.h>
diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c
index e1e28df20b2..495be53cb77 100644
--- a/lib/efi_driver/efi_uclass.c
+++ b/lib/efi_driver/efi_uclass.c
@@ -17,6 +17,8 @@
* controllers.
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <dm.h>
#include <efi_driver.h>
#include <log.h>
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index c46ffe3a9d8..ad0bbdd8a77 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -8,13 +8,14 @@ config EFI_LOADER
SYS_CPU = armv7 || \
SYS_CPU = armv8) || \
X86 || RISCV || SANDBOX)
+ # We have not fully removed the requirement for some block device
+ depends on BLK
# We need EFI_STUB_64BIT to be set on x86_64 with EFI_STUB
depends on !EFI_STUB || !X86_64 || EFI_STUB_64BIT
# We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
depends on !EFI_APP
default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
- select BLK
select CHARSET
# We need to send DM events, dynamically, in the EFI block driver
select DM_EVENT
@@ -386,7 +387,7 @@ config EFI_DT_FIXUP
config EFI_LOADER_HII
bool "HII protocols"
- default y
+ default y if !HAS_BOARD_SIZE_LIMIT
help
The Human Interface Infrastructure is a complicated framework that
allows UEFI applications to draw fancy menus and hook strings using
@@ -406,7 +407,7 @@ if EFI_UNICODE_COLLATION_PROTOCOL2
config EFI_UNICODE_CAPITALIZATION
bool "Support Unicode capitalization"
- default y
+ default y if !HAS_BOARD_SIZE_LIMIT
help
Select this option to enable correct handling of the capitalization of
Unicode codepoints in the range 0x0000-0xffff. If this option is not
diff --git a/lib/efi_loader/efi_acpi.c b/lib/efi_loader/efi_acpi.c
index 67bd7f8ca24..4422b31ac6a 100644
--- a/lib/efi_loader/efi_acpi.c
+++ b/lib/efi_loader/efi_acpi.c
@@ -5,6 +5,8 @@
* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <log.h>
#include <mapmem.h>
@@ -25,6 +27,16 @@ efi_status_t efi_acpi_register(void)
ulong addr, start, end;
efi_status_t ret;
+ /*
+ * The bloblist is already marked reserved. For now, we don't bother
+ * marking it with EFI_ACPI_RECLAIM_MEMORY since we would need to cut a
+ * hole in the EFI_BOOT_SERVICES_CODE region added by
+ * add_u_boot_and_runtime(). At some point that function could create a
+ * more detailed map.
+ */
+ if (IS_ENABLED(CONFIG_BLOBLIST_TABLES))
+ return EFI_SUCCESS;
+
/* Mark space used for tables */
start = ALIGN_DOWN(gd->arch.table_start, EFI_PAGE_MASK);
end = ALIGN(gd->arch.table_end, EFI_PAGE_MASK);
diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
index 428991df88f..10ec5e9ada3 100644
--- a/lib/efi_loader/efi_bootbin.c
+++ b/lib/efi_loader/efi_bootbin.c
@@ -6,13 +6,16 @@
#define LOG_CATEGORY LOGC_EFI
+#include <bootflow.h>
#include <charset.h>
+#include <dm.h>
#include <efi.h>
#include <efi_loader.h>
#include <env.h>
#include <image.h>
#include <log.h>
#include <malloc.h>
+#include <mapmem.h>
static struct efi_device_path *bootefi_image_path;
static struct efi_device_path *bootefi_device_path;
@@ -157,42 +160,21 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path,
*
* @source_buffer: memory address of the UEFI image
* @source_size: size of the UEFI image
+ * @dp_dev: EFI device-path
+ * @dp_img: EFI image-path
* Return: status code
*/
-static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
+static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size,
+ struct efi_device_path *dp_dev,
+ struct efi_device_path *dp_img)
{
- efi_handle_t mem_handle = NULL, handle;
- struct efi_device_path *file_path = NULL;
- struct efi_device_path *msg_path;
+ efi_handle_t handle;
+ struct efi_device_path *msg_path, *file_path;
efi_status_t ret;
u16 *load_options;
- if (!bootefi_device_path || !bootefi_image_path) {
- log_debug("Not loaded from disk\n");
- /*
- * Special case for efi payload not loaded from disk,
- * such as 'bootefi hello' or for example payload
- * loaded directly into memory via JTAG, etc:
- */
- file_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
- (uintptr_t)source_buffer,
- source_size);
- /*
- * Make sure that device for device_path exist
- * in load_image(). Otherwise, shell and grub will fail.
- */
- ret = efi_install_multiple_protocol_interfaces(&mem_handle,
- &efi_guid_device_path,
- file_path, NULL);
- if (ret != EFI_SUCCESS)
- goto out;
- msg_path = file_path;
- } else {
- file_path = efi_dp_concat(bootefi_device_path,
- bootefi_image_path, 0);
- msg_path = bootefi_image_path;
- log_debug("Loaded from disk\n");
- }
+ file_path = efi_dp_concat(dp_dev, dp_img, 0);
+ msg_path = dp_img;
log_info("Booting %pD\n", msg_path);
@@ -211,32 +193,27 @@ static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
ret = do_bootefi_exec(handle, load_options);
out:
- if (mem_handle) {
- efi_status_t r;
-
- r = efi_uninstall_multiple_protocol_interfaces(
- mem_handle, &efi_guid_device_path, file_path, NULL);
- if (r != EFI_SUCCESS)
- log_err("Uninstalling protocol interfaces failed\n");
- }
- efi_free_pool(file_path);
return ret;
}
/**
- * efi_binary_run() - run loaded UEFI image
+ * efi_binary_run_dp() - run loaded UEFI image
*
* @image: memory address of the UEFI image
* @size: size of the UEFI image
* @fdt: device-tree
+ * @dp_dev: EFI device-path
+ * @dp_img: EFI image-path
*
* Execute an EFI binary image loaded at @image.
* @size may be zero if the binary is loaded with U-Boot load command.
*
* Return: status code
*/
-efi_status_t efi_binary_run(void *image, size_t size, void *fdt)
+static efi_status_t efi_binary_run_dp(void *image, size_t size, void *fdt,
+ struct efi_device_path *dp_dev,
+ struct efi_device_path *dp_img)
{
efi_status_t ret;
@@ -252,5 +229,132 @@ efi_status_t efi_binary_run(void *image, size_t size, void *fdt)
if (ret != EFI_SUCCESS)
return ret;
- return efi_run_image(image, size);
+ return efi_run_image(image, size, dp_dev, dp_img);
+}
+
+/**
+ * efi_binary_run() - run loaded UEFI image
+ *
+ * @image: memory address of the UEFI image
+ * @size: size of the UEFI image
+ * @fdt: device-tree
+ *
+ * Execute an EFI binary image loaded at @image.
+ * @size may be zero if the binary is loaded with U-Boot load command.
+ *
+ * Return: status code
+ */
+efi_status_t efi_binary_run(void *image, size_t size, void *fdt)
+{
+ efi_handle_t mem_handle = NULL;
+ struct efi_device_path *file_path = NULL;
+ efi_status_t ret;
+
+ if (!bootefi_device_path || !bootefi_image_path) {
+ log_debug("Not loaded from disk\n");
+ /*
+ * Special case for efi payload not loaded from disk,
+ * such as 'bootefi hello' or for example payload
+ * loaded directly into memory via JTAG, etc:
+ */
+ file_path = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
+ (uintptr_t)image, size);
+ /*
+ * Make sure that device for device_path exist
+ * in load_image(). Otherwise, shell and grub will fail.
+ */
+ ret = efi_install_multiple_protocol_interfaces(&mem_handle,
+ &efi_guid_device_path,
+ file_path, NULL);
+ if (ret != EFI_SUCCESS)
+ goto out;
+ } else {
+ log_debug("Loaded from disk\n");
+ }
+
+ ret = efi_binary_run_dp(image, size, fdt, bootefi_device_path,
+ bootefi_image_path);
+out:
+ if (mem_handle) {
+ efi_status_t r;
+
+ r = efi_uninstall_multiple_protocol_interfaces(mem_handle,
+ &efi_guid_device_path, file_path, NULL);
+ if (r != EFI_SUCCESS)
+ log_err("Uninstalling protocol interfaces failed\n");
+ }
+ efi_free_pool(file_path);
+
+ return ret;
+}
+
+/**
+ * calc_dev_name() - Calculate the device name to give to EFI
+ *
+ * If not supported, this shows an error.
+ *
+ * Return name, or NULL if not supported
+ */
+static const char *calc_dev_name(struct bootflow *bflow)
+{
+ const struct udevice *media_dev;
+
+ media_dev = dev_get_parent(bflow->dev);
+
+ if (!bflow->blk) {
+ if (device_get_uclass_id(media_dev) == UCLASS_ETH)
+ return "Net";
+
+ log_err("Cannot boot EFI app on media '%s'\n",
+ dev_get_uclass_name(media_dev));
+
+ return NULL;
+ }
+
+ if (device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE)
+ return "usb";
+
+ return blk_get_uclass_name(device_get_uclass_id(media_dev));
+}
+
+efi_status_t efi_bootflow_run(struct bootflow *bflow)
+{
+ struct efi_device_path *device, *image;
+ const struct udevice *media_dev;
+ struct blk_desc *desc = NULL;
+ const char *dev_name;
+ char devnum_str[9];
+ efi_status_t ret;
+ void *fdt;
+
+ media_dev = dev_get_parent(bflow->dev);
+ if (bflow->blk) {
+ desc = dev_get_uclass_plat(bflow->blk);
+
+ snprintf(devnum_str, sizeof(devnum_str), "%x:%x",
+ desc ? desc->devnum : dev_seq(media_dev), bflow->part);
+ } else {
+ *devnum_str = '\0';
+ }
+
+ dev_name = calc_dev_name(bflow);
+ log_debug("dev_name '%s' devnum_str '%s' fname '%s' media_dev '%s'\n",
+ dev_name, devnum_str, bflow->fname, media_dev->name);
+ if (!dev_name)
+ return EFI_UNSUPPORTED;
+ ret = calculate_paths(dev_name, devnum_str, bflow->fname, &device,
+ &image);
+ if (ret)
+ return EFI_UNSUPPORTED;
+
+ if (bflow->flags & BOOTFLOWF_USE_BUILTIN_FDT) {
+ log_debug("Booting with built-in fdt\n");
+ fdt = EFI_FDT_USE_INTERNAL;
+ } else {
+ log_debug("Booting with external fdt\n");
+ fdt = map_sysmem(bflow->fdt_addr, 0);
+ }
+ ret = efi_binary_run_dp(bflow->buf, bflow->size, fdt, device, image);
+
+ return ret;
}
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 723a9b58691..5164cb15986 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -5,6 +5,8 @@
* Copyright (c) 2016 Alexander Graf
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <bootm.h>
#include <div64.h>
#include <dm/device.h>
@@ -3256,11 +3258,10 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
* To get ready to call EFI_EXIT below we have to execute the
* missed out steps of EFI_CALL.
*/
- assert(__efi_entry_check());
- EFI_PRINT("%lu returned by started image\n",
- (unsigned long)((uintptr_t)exit_status &
- ~EFI_ERROR_MASK));
+ EFI_RETURN(exit_status);
+
current_image = parent_image;
+
return EFI_EXIT(exit_status);
}
diff --git a/lib/efi_loader/efi_conformance.c b/lib/efi_loader/efi_conformance.c
index 167067e26cd..2bae93a94bd 100644
--- a/lib/efi_loader/efi_conformance.c
+++ b/lib/efi_loader/efi_conformance.c
@@ -5,6 +5,8 @@
* Copyright (C) 2022 Arm Ltd.
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <log.h>
#include <efi_api.h>
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index 481a9712d9d..f6889cb7399 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -5,6 +5,8 @@
* Copyright (c) 2017 Heinrich Schuchardt
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <blk.h>
#include <efi_loader.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_device_path_utilities.c b/lib/efi_loader/efi_device_path_utilities.c
index ac250bbfcc9..552c5bb1f05 100644
--- a/lib/efi_loader/efi_device_path_utilities.c
+++ b/lib/efi_loader/efi_device_path_utilities.c
@@ -5,6 +5,8 @@
* Copyright (c) 2017 Leif Lindholm
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
const efi_guid_t efi_guid_device_path_utilities_protocol =
diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c
index 0dac94b0c6c..26928cfc454 100644
--- a/lib/efi_loader/efi_dt_fixup.c
+++ b/lib/efi_loader/efi_dt_fixup.c
@@ -5,6 +5,8 @@
* Copyright (c) 2020 Heinrich Schuchardt
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_dt_fixup.h>
#include <efi_loader.h>
#include <efi_rng.h>
diff --git a/lib/efi_loader/efi_esrt.c b/lib/efi_loader/efi_esrt.c
index 443bd999ce1..e235c8fe91c 100644
--- a/lib/efi_loader/efi_esrt.c
+++ b/lib/efi_loader/efi_esrt.c
@@ -5,6 +5,8 @@
* Copyright (C) 2021 Arm Ltd.
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <log.h>
#include <efi_api.h>
diff --git a/lib/efi_loader/efi_fdt.c b/lib/efi_loader/efi_fdt.c
index f882622fdad..1ba6641d821 100644
--- a/lib/efi_loader/efi_fdt.c
+++ b/lib/efi_loader/efi_fdt.c
@@ -6,6 +6,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <env.h>
#include <errno.h>
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 95b3c890ee9..201fa5f8f3c 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -5,6 +5,8 @@
* Copyright (c) 2017 Rob Clark
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <efi_loader.h>
#include <log.h>
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index 112775daf4c..5a754c9cd03 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -6,6 +6,8 @@
* Author: AKASHI Takahiro
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <dfu.h>
#include <efi_loader.h>
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
index 41e12fa7246..4593975be5a 100644
--- a/lib/efi_loader/efi_gop.c
+++ b/lib/efi_loader/efi_gop.c
@@ -5,6 +5,8 @@
* Copyright (c) 2016 Alexander Graf
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <dm.h>
#include <efi_loader.h>
#include <log.h>
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
index bf96f61d3d0..04b2efc4a3b 100644
--- a/lib/efi_loader/efi_helper.c
+++ b/lib/efi_loader/efi_helper.c
@@ -4,6 +4,7 @@
*/
#define LOG_CATEGORY LOGC_EFI
+
#include <bootm.h>
#include <env.h>
#include <image.h>
diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c
index 74e402df1b8..44235970a7c 100644
--- a/lib/efi_loader/efi_hii.c
+++ b/lib/efi_loader/efi_hii.c
@@ -6,6 +6,8 @@
* Copyright (c) 2018 AKASHI Takahiro, Linaro Limited
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <malloc.h>
#include <asm/unaligned.h>
diff --git a/lib/efi_loader/efi_hii_config.c b/lib/efi_loader/efi_hii_config.c
index ae0f3ecd3b1..37d8c6629e2 100644
--- a/lib/efi_loader/efi_hii_config.c
+++ b/lib/efi_loader/efi_hii_config.c
@@ -10,6 +10,8 @@
* the Makefile.
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
const efi_guid_t efi_guid_hii_config_routing_protocol
diff --git a/lib/efi_loader/efi_http.c b/lib/efi_loader/efi_http.c
index 694e1993418..88816256b03 100644
--- a/lib/efi_loader/efi_http.c
+++ b/lib/efi_loader/efi_http.c
@@ -7,6 +7,8 @@
* IP4_CONFIG2_PROTOCOL
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <efi_loader.h>
#include <image.h>
diff --git a/lib/efi_loader/efi_ipconfig.c b/lib/efi_loader/efi_ipconfig.c
index 0b247a4c028..f1c092daafd 100644
--- a/lib/efi_loader/efi_ipconfig.c
+++ b/lib/efi_loader/efi_ipconfig.c
@@ -4,6 +4,8 @@
*
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <image.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c
index 23508431c83..fb8cc7bcbe3 100644
--- a/lib/efi_loader/efi_load_initrd.c
+++ b/lib/efi_loader/efi_load_initrd.c
@@ -4,6 +4,7 @@
*/
#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <efi_load_initrd.h>
#include <efi_variable.h>
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 67593ef50c0..ce9272fa240 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -15,6 +15,8 @@
* Reset(): EfiSimpleNetworkInitialized -> EfiSimpleNetworkInitialized
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <dm.h>
#include <linux/sizes.h>
diff --git a/lib/efi_loader/efi_riscv.c b/lib/efi_loader/efi_riscv.c
index 4d398c5be34..6f2ccf4f7e6 100644
--- a/lib/efi_loader/efi_riscv.c
+++ b/lib/efi_loader/efi_riscv.c
@@ -7,6 +7,7 @@
*/
#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <efi_variable.h>
#include <log.h>
diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c
index 4d7fb74b5d6..74225edad29 100644
--- a/lib/efi_loader/efi_root_node.c
+++ b/lib/efi_loader/efi_root_node.c
@@ -5,6 +5,8 @@
* Copyright (c) 2018 Heinrich Schuchardt
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <malloc.h>
#include <efi_dt_fixup.h>
#include <efi_loader.h>
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 05369c47b01..35eb6a77766 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -5,6 +5,8 @@
* Copyright (c) 2016 Alexander Graf
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <command.h>
#include <cpu_func.h>
#include <dm.h>
diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c
index 184eac8cddb..93a4f257016 100644
--- a/lib/efi_loader/efi_signature.c
+++ b/lib/efi_loader/efi_signature.c
@@ -4,6 +4,8 @@
* Copyright (c) 2019 Linaro Limited, Author: AKASHI Takahiro
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <efi_loader.h>
#include <efi_variable.h>
diff --git a/lib/efi_loader/efi_string.c b/lib/efi_loader/efi_string.c
index 413e329b600..50d1daf33a9 100644
--- a/lib/efi_loader/efi_string.c
+++ b/lib/efi_loader/efi_string.c
@@ -5,6 +5,8 @@
* Copyright (c) 2020 AKASHI Takahiro, Linaro Limited
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <efi_loader.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index a15c73162ee..c697b53441a 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -8,6 +8,7 @@
*/
#define LOG_CATEGORY LOGC_EFI
+
#include <dm.h>
#include <efi_loader.h>
#include <efi_variable.h>
diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c
index d48700a352b..df2a988ee39 100644
--- a/lib/efi_loader/efi_unicode_collation.c
+++ b/lib/efi_loader/efi_unicode_collation.c
@@ -5,6 +5,8 @@
* Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <charset.h>
#include <cp1250.h>
#include <cp437.h>
diff --git a/lib/efi_loader/efi_var_common.c b/lib/efi_loader/efi_var_common.c
index ea8d2a4cf98..4b34a58b4cf 100644
--- a/lib/efi_loader/efi_var_common.c
+++ b/lib/efi_loader/efi_var_common.c
@@ -5,6 +5,8 @@
* Copyright (c) 2020 Linaro Limited, Author: AKASHI Takahiro
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <efi_variable.h>
#include <stdlib.h>
diff --git a/lib/efi_loader/efi_var_mem.c b/lib/efi_loader/efi_var_mem.c
index 139e16aad7c..b265d95dd6b 100644
--- a/lib/efi_loader/efi_var_mem.c
+++ b/lib/efi_loader/efi_var_mem.c
@@ -5,6 +5,8 @@
* Copyright (c) 2020, Heinrich Schuchardt
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
#include <efi_variable.h>
#include <u-boot/crc.h>
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 8b6b0a39086..0d090d051dd 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -10,6 +10,8 @@
* Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
*/
+#define LOG_CATEGORY LOGC_EFI
+
#if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT)
#include <arm_ffa.h>
#endif
diff --git a/lib/efi_loader/efi_watchdog.c b/lib/efi_loader/efi_watchdog.c
index f5fb9117717..c21d8086074 100644
--- a/lib/efi_loader/efi_watchdog.c
+++ b/lib/efi_loader/efi_watchdog.c
@@ -5,6 +5,8 @@
* Copyright (c) 2017 Heinrich Schuchardt
*/
+#define LOG_CATEGORY LOGC_EFI
+
#include <efi_loader.h>
/* Conversion factor from seconds to multiples of 100ns */