All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Marinho <jose.marinho@arm.com>
To: u-boot@lists.denx.de
Cc: Jose Marinho <jose.marinho@arm.com>,
	ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org,
	xypron.glpk@gmx.de, takahiro.akashi@linaro.org, agraf@csgraf.de,
	nd@arm.com
Subject: [PATCH 3/3] cmd: efi: efidebug print ECPT table
Date: Fri, 17 Dec 2021 12:55:06 +0000	[thread overview]
Message-ID: <20211217125506.138902-4-jose.marinho@arm.com> (raw)
In-Reply-To: <20211217125506.138902-1-jose.marinho@arm.com>

Signed-off-by: Jose Marinho <jose.marinho@arm.com>
---
 cmd/efidebug.c       | 41 +++++++++++++++++++++++++++++++++++++++++
 include/efi_loader.h |  2 ++
 2 files changed, 43 insertions(+)

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index a53a5029fa..c3246e1820 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -889,6 +889,38 @@ static int do_efi_show_tables(struct cmd_tbl *cmdtp, int flag,
 	return CMD_RET_SUCCESS;
 }
 
+#ifdef CONFIG_EFI_ECPT
+static int do_efi_ecpt(struct cmd_tbl *cmdtp, int flag,
+		       int argc, char * const argv[])
+{
+	struct efi_conformance_profiles_table *ecpt;
+
+	if (argc != 1)
+		return CMD_RET_USAGE;
+
+	for (int idx = 0; idx < systab.nr_tables; idx++)
+		if (!guidcmp(&efi_ecpt_guid, &systab.tables[idx].guid))
+			ecpt = (struct efi_system_resource_table *)systab.tables[idx].table;
+
+	if (!ecpt) {
+		log_info("ECPT: table not present\n");
+		return CMD_RET_SUCCESS;
+	}
+
+	const int num_profiles = ecpt->number_of_profiles;
+
+	printf("========================================\n");
+	printf("ECPT: version:%d\n", ecpt->version);
+	printf("ECPT: num profiles:%d\n", num_profiles);
+
+	for (int i = 0; i < num_profiles; i++)
+		printf("ECPT: profile %d = %pUL\n", i, &ecpt->conformance_profiles[i]);
+	printf("========================================\n");
+
+	return CMD_RET_SUCCESS;
+}
+#endif /* CONFIG_EFI_ECPT */
+
 /**
  * create_initrd_dp() - Create a special device for our Boot### option
  *
@@ -1681,6 +1713,11 @@ static struct cmd_tbl cmd_efidebug_sub[] = {
 			 "", ""),
 	U_BOOT_CMD_MKENT(query, CONFIG_SYS_MAXARGS, 1, do_efi_query_info,
 			 "", ""),
+#ifdef CONFIG_EFI_ECPT
+	U_BOOT_CMD_MKENT(ecpt, CONFIG_SYS_MAXARGS, 1, do_efi_ecpt,
+			 "", ""),
+#endif
+
 };
 
 /**
@@ -1769,6 +1806,10 @@ static char efidebug_help_text[] =
 	"  - show UEFI memory map\n"
 	"efidebug tables\n"
 	"  - show UEFI configuration tables\n"
+#ifdef CONFIG_EFI_ECPT
+	"efidebug ecpt\n"
+	"  - show UEFI conformance profiles table\n"
+#endif
 #ifdef CONFIG_CMD_BOOTEFI_BOOTMGR
 	"efidebug test bootmgr\n"
 	"  - run simple bootmgr for test\n"
diff --git a/include/efi_loader.h b/include/efi_loader.h
index d20ff396d0..d60a340136 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -310,6 +310,8 @@ extern const efi_guid_t efi_guid_firmware_management_protocol;
 extern const efi_guid_t efi_esrt_guid;
 /* GUID of the SMBIOS table */
 extern const efi_guid_t smbios_guid;
+/* GUID for the ECPT */
+extern const efi_guid_t efi_ecpt_guid;
 
 extern char __efi_runtime_start[], __efi_runtime_stop[];
 extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[];
-- 
2.25.1


  parent reply	other threads:[~2021-12-17 12:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 12:55 [PATCH 0/3] Conformance Profiles Table support in U-boot Jose Marinho
2021-12-17 12:55 ` [PATCH 1/3] efi: Create ECPT table Jose Marinho
2021-12-17 17:19   ` Heinrich Schuchardt
2021-12-23 15:01     ` Jose Marinho
2021-12-17 12:55 ` [PATCH 2/3] efi: ECPT add EBBRv2.0 conformance profile Jose Marinho
2021-12-17 17:26   ` Heinrich Schuchardt
2021-12-23 14:57     ` Jose Marinho
2021-12-23 18:31       ` Heinrich Schuchardt
2021-12-31 14:36         ` Jose Marinho
2022-01-01 23:56           ` Heinrich Schuchardt
2022-08-29 23:58             ` Heinrich Schuchardt
2021-12-17 12:55 ` Jose Marinho [this message]
2021-12-17 13:29   ` [PATCH 3/3] cmd: efi: efidebug print ECPT table Heinrich Schuchardt
2021-12-17 18:07   ` Heinrich Schuchardt
2021-12-23 14:59     ` Jose Marinho
2021-12-17 18:05 ` [PATCH 0/3] Conformance Profiles Table support in U-boot Heinrich Schuchardt
2021-12-23 15:20   ` Jose Marinho
2021-12-23 18:27     ` Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217125506.138902-4-jose.marinho@arm.com \
    --to=jose.marinho@arm.com \
    --cc=agraf@csgraf.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=nd@arm.com \
    --cc=sughosh.ganu@linaro.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.