From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54B64F3D32A for ; Thu, 5 Mar 2026 16:14:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CE8583F7F; Thu, 5 Mar 2026 17:14:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 8F89F83F7F; Thu, 5 Mar 2026 17:14:13 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 88F5183F9B for ; Thu, 5 Mar 2026 17:14:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vincent.stehle@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A6D70339; Thu, 5 Mar 2026 08:14:04 -0800 (PST) Received: from debian (X72Y076X74-2.nice.arm.com [10.34.129.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3103A3F694; Thu, 5 Mar 2026 08:14:10 -0800 (PST) From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= To: u-boot@lists.denx.de Cc: =?UTF-8?q?Vincent=20Stehl=C3=A9?= , Heinrich Schuchardt , Ilias Apalodimas , Tom Rini Subject: [PATCH 3/4] cmd: efidebug: add ecpt command Date: Thu, 5 Mar 2026 17:13:48 +0100 Message-ID: <20260305161349.2317130-4-vincent.stehle@arm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260305161349.2317130-1-vincent.stehle@arm.com> References: <20260305161349.2317130-1-vincent.stehle@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add an "efidebug ecpt" command, to print the conformance profiles in the ECPT: => efidebug ecpt cce33c35-74ac-4087-bce7-8b29b02eeb27 EFI EBBR 2.1 Conformance Profile Signed-off-by: Vincent Stehlé Cc: Heinrich Schuchardt Cc: Ilias Apalodimas Cc: Tom Rini --- cmd/efidebug.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 109496d9e95..672214a54b7 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -533,6 +533,47 @@ static int do_efi_show_defaults(struct cmd_tbl *cmdtp, int flag, return CMD_RET_SUCCESS; } +#if CONFIG_IS_ENABLED(EFI_ECPT) +/** + * do_efi_show_ecpt() - show UEFI conformance profiles in ECPT + * + * @cmdtp: Command table + * @flag: Command flag + * @argc: Number of arguments + * @argv: Argument array + * Return: CMD_RET_SUCCESS on success, + * CMD_RET_USAGE or CMD_RET_FAILURE on failure + * + * Implement efidebug "ecpt" sub-command. + * Show all the UEFI Conformance Profiles listed in the EFI Conformance Profiles + * Table (ECPT). + */ +static int do_efi_show_ecpt(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + const struct efi_conformance_profiles_table *ecpt; + u16 n; + + if (argc != 1) + return CMD_RET_USAGE; + + ecpt = efi_get_configuration_table(&efi_ecpt_guid); + if (!ecpt) { + log_info("ECPT: table not present\n"); + return CMD_RET_SUCCESS; + } + + for (n = 0; n < ecpt->number_of_profiles; n++) { + const efi_guid_t *guid = &ecpt->conformance_profiles[n]; + + printf("%pUl %s\n", guid->b, + uuid_guid_get_str(guid->b) ?: "(unknown)"); + } + + return CMD_RET_SUCCESS; +} +#endif /* CONFIG_IS_ENABLED(EFI_ECPT) */ + static const char * const efi_mem_type_string[] = { [EFI_RESERVED_MEMORY_TYPE] = "RESERVED", [EFI_LOADER_CODE] = "LOADER CODE", @@ -1586,6 +1627,10 @@ static struct cmd_tbl cmd_efidebug_sub[] = { "", ""), U_BOOT_CMD_MKENT(defaults, CONFIG_SYS_MAXARGS, 1, do_efi_show_defaults, "", ""), +#if CONFIG_IS_ENABLED(EFI_ECPT) + U_BOOT_CMD_MKENT(ecpt, CONFIG_SYS_MAXARGS, 1, do_efi_show_ecpt, + "", ""), +#endif U_BOOT_CMD_MKENT(images, CONFIG_SYS_MAXARGS, 1, do_efi_show_images, "", ""), U_BOOT_CMD_MKENT(memmap, CONFIG_SYS_MAXARGS, 1, do_efi_show_memmap, @@ -1680,6 +1725,10 @@ U_BOOT_LONGHELP(efidebug, " - show UEFI handles\n" "efidebug defaults\n" " - show default EFI filename and PXE architecture\n" +#if CONFIG_IS_ENABLED(EFI_ECPT) + "efidebug ecpt\n" + " - show conformance profiles in the ECPT\n" +#endif "efidebug images\n" " - show loaded images\n" "efidebug memmap\n" -- 2.51.0