summaryrefslogtreecommitdiff
path: root/cmd/efi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-03-25 17:34:34 -0400
committerTom Rini <trini@konsulko.com>2023-03-25 17:34:34 -0400
commitfde439219ff53a46bdd5dff69e049ccd4be57310 (patch)
tree423643707fad940e0845cbebf74d545b05b3d336 /cmd/efi.c
parent4b635046b5e92e419fbd1bf93e5b0ef86dbcadc2 (diff)
parent93e3364804ffd4a5d4a0df9c750a1859f9fe298b (diff)
Merge tag 'efi-next-20230325' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
Pull request for efi-next-20230325 Documenation: * add man-page for efi command UEFI: * Let EFI app call ExitBootServices() before legacy booting kernel * Support zboot and bootm in the EFI app * Let efi command show configuration tables * Support booting a 64-bit kernel from 64-bit EFI app * Allocate device-tree copy from high memory * simplify efi_str_to_u16()
Diffstat (limited to 'cmd/efi.c')
-rw-r--r--cmd/efi.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/cmd/efi.c b/cmd/efi.c
index c0384e0db28..6cd5361aca5 100644
--- a/cmd/efi.c
+++ b/cmd/efi.c
@@ -7,10 +7,12 @@
#include <common.h>
#include <command.h>
#include <efi.h>
+#include <efi_api.h>
#include <errno.h>
#include <log.h>
#include <malloc.h>
#include <sort.h>
+#include <uuid.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -273,8 +275,34 @@ done:
return ret ? CMD_RET_FAILURE : 0;
}
+static int do_efi_tables(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ struct efi_system_table *systab;
+
+ if (IS_ENABLED(CONFIG_EFI_APP)) {
+ systab = efi_get_sys_table();
+ if (!systab) {
+ printf("Cannot read system table\n");
+ return CMD_RET_FAILURE;
+ }
+ } else {
+ int size;
+ int ret;
+
+ ret = efi_info_get(EFIET_SYS_TABLE, (void **)&systab, &size);
+ if (ret) /* this should not happen */
+ return CMD_RET_FAILURE;
+ }
+
+ efi_show_tables(systab);
+
+ return 0;
+}
+
static struct cmd_tbl efi_commands[] = {
U_BOOT_CMD_MKENT(mem, 1, 1, do_efi_mem, "", ""),
+ U_BOOT_CMD_MKENT(tables, 1, 1, do_efi_tables, "", ""),
};
static int do_efi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
@@ -298,5 +326,6 @@ static int do_efi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
U_BOOT_CMD(
efi, 3, 1, do_efi,
"EFI access",
- "mem [all] Dump memory information [include boot services]"
+ "mem [all] Dump memory information [include boot services]\n"
+ "tables Dump tables"
);