aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_bootmgr.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-12-18 08:31:50 -0500
committerTom Rini <trini@konsulko.com>2023-12-18 09:55:32 -0500
commit1373ffde52e16af83fb14a1d228508a8caaa9996 (patch)
tree03bb09d38a260233e3f5b9493d14c82dbd267299 /lib/efi_loader/efi_bootmgr.c
parentfdefb4e194c65777fa11479119adaa71651f41d4 (diff)
parent97a897444235921ce19b4f8a3b27de6f5a9ab367 (diff)
Merge tag 'v2024.01-rc5' into next
Prepare v2024.01-rc5
Diffstat (limited to 'lib/efi_loader/efi_bootmgr.c')
-rw-r--r--lib/efi_loader/efi_bootmgr.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index 56d97f2382..e815fa06c8 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -1262,8 +1262,6 @@ efi_status_t efi_env_set_load_options(efi_handle_t handle,
return ret;
}
-#if !CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)
-
/**
* copy_fdt() - Copy the device tree to a new location available to EFI
*
@@ -1337,8 +1335,6 @@ static void *get_config_table(const efi_guid_t *guid)
return NULL;
}
-#endif /* !CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) */
-
/**
* efi_install_fdt() - install device tree
*
@@ -1358,18 +1354,15 @@ static void *get_config_table(const efi_guid_t *guid)
*/
efi_status_t efi_install_fdt(void *fdt)
{
+ struct bootm_headers img = { 0 };
+ efi_status_t ret;
+
/*
* The EBBR spec requires that we have either an FDT or an ACPI table
* but not both.
*/
-#if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)
- if (fdt) {
+ if (CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) && fdt)
log_warning("WARNING: Can't have ACPI table and device tree - ignoring DT.\n");
- return EFI_SUCCESS;
- }
-#else
- struct bootm_headers img = { 0 };
- efi_status_t ret;
if (fdt == EFI_FDT_USE_INTERNAL) {
const char *fdt_opt;
@@ -1402,6 +1395,12 @@ efi_status_t efi_install_fdt(void *fdt)
return EFI_LOAD_ERROR;
}
+ /* Create memory reservations as indicated by the device tree */
+ efi_carve_out_dt_rsv(fdt);
+
+ if (CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE))
+ return EFI_SUCCESS;
+
/* Prepare device tree for payload */
ret = copy_fdt(&fdt);
if (ret) {
@@ -1414,9 +1413,6 @@ efi_status_t efi_install_fdt(void *fdt)
return EFI_LOAD_ERROR;
}
- /* Create memory reservations as indicated by the device tree */
- efi_carve_out_dt_rsv(fdt);
-
efi_try_purge_kaslr_seed(fdt);
if (CONFIG_IS_ENABLED(EFI_TCG2_PROTOCOL_MEASURE_DTB)) {
@@ -1433,7 +1429,6 @@ efi_status_t efi_install_fdt(void *fdt)
log_err("ERROR: failed to install device tree\n");
return ret;
}
-#endif /* GENERATE_ACPI_TABLE */
return EFI_SUCCESS;
}