From patchwork Wed Aug 20 11:23:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 69 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689066; bh=7W+EeHWTnvzU5WuEEGI5DUaMS6g5cfUJawrL9/y6JQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=f2iaCUX6lq/StZ80JWhizbe3DYZCiIxXJCe3OkwGxrbOtIEo+3DlUXK79phDLe0Ie cCCziyJ+fkgGGDinjT1Uamcpz+zAIQkkxJHKu/NbTyg9BnVqZkHmBySsoG04o6WA96 kzNcSOL5BLj0COgQPF/sv96yOG45XraSoqxM7/TNXZYzrDpdDGdk5NW+Nkp88TR58W q61F3thW/bth64hUhZR1EcnhwGVSkZFW4ycfx0sik3/p5KWsHEdvHxnFN66qUe+FYr S70ImsDuMm3L8X4KD9RElCwxJTtDwH1Ef9ijOQVjXovApIwgw6aQzVdfKnCbZtHu8s A5BPcRsFOdGJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C64D674AF for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pFixjN2XbAUu for ; Wed, 20 Aug 2025 05:24:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689063; bh=7W+EeHWTnvzU5WuEEGI5DUaMS6g5cfUJawrL9/y6JQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ROqtQZ5SriTjqu7bKPEmSo4qR4CUpoi+gbUGqyVjSIXBYbjDOViokCJx0juZRtMTd 9YbB74AJdiLr0qfYNUmgmeJVLEnQBAFRR/jNOLBFYlXOPJSr4ERqgxyqbfuE2sYw0Z Ij04FaNdeFaLTAAXjAiK9zG5Rzl9eTK7sNX/xKQ5aosIPVXWXzCKgJMLzSzGKKavyn XIKeXy6ml5jC7UGw7uJQShr7DcmJxp7OfGssUDhwixSfyffM4TxAcaT138M7+x5WI3 7rLFRAOo/lVnBNcZ+WmTChpRbqWeIp/xsRhxe8iEPH3sMHCLXyPc+ICVfaPz6Baanr PIe4oloAB2nvg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 97E1A67693 for ; Wed, 20 Aug 2025 05:24:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=GMmAZIfVbijSIXw0zcIUSjsB5gqQDZ3BkhDcgvHoOK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ToeCV2zxFMndRhWoJQtfo36TxHBVnt+Nvci2odILsRi0ygLbZ6aL5dz/e4/psBPxk 9tJ6NH00D9kOIfGY6Fp8kaIkj/4mEpGXkkizIyjorpyf1Sx4QUcDws26NbsWX1xCzX X2yPpYcGayg487/NETLVveIW9HdDJ+6Cw9N7bboxUmht5eC6w2ZhkSg/0FrgohC65F drXW3G/yJNk6SlfC7Ta5idbJUSHexnH+1cfJmGaF4ZCjW+R9OHPQVSsFhjqasyQFPS Z28dt8lc/b7jU8jx1noRqPEVznTBwyz0swIr8pDUA365xDsFiUglW9zlwqbWTmnxDu vJ/u7tkZVa/Tw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D02026767E; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id oEbnP2Afd-hX; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689056; bh=LgYAdMU08sPXAxtVmCOyM91Zq+SDUoY9ThvLeD6FgfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ON9AiJXgvhcveW2nZUZABCz2iT48GXbXITqycYFEQ2KMrtLxBAcJjo57IVM4KI2hf +qraXvInSgy0+77PDWLS/v53OUA3ecvZ3qIgyp9rutWo2L9SM4XTPE4hz6CvzUo9ZA 3RzIGfevZWQTel/lwzxNUWPRzv3tSSsQ0asAjhvixe86pmINK5TeiZrb1bZyhMgnSz AQMNmGfUiabncMbq3SOqBNoTyOHSYhWVE23cpwN80ung1c7ExwD4tLxNOFlfve5Bu8 /Jt73JsAK+2j4LQjwL7n/zKAIZPpqPCHybHvyqMS45UDUL7iz7CJjq3q6NLNrRdUp0 OgkvH9fK1qtVA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BCBE46766B; Wed, 20 Aug 2025 05:24:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:25 -0600 Message-ID: <20250820112340.147082-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DBBNYCWMB3I625SFLLMDZPFYFPFX4PNJ X-Message-ID-Hash: DBBNYCWMB3I625SFLLMDZPFYFPFX4PNJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 13/18] efi: app: Implement %pD in the app List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This printf() extension is useful for the app. Add an implementation of efi_dp_str() so that it works as expected. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi/Kconfig | 12 +++++++++++- lib/efi_client/efi.c | 15 +++++++++++++++ lib/efi_loader/Kconfig | 7 ------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/efi/Kconfig b/lib/efi/Kconfig index 16de786b1e2..ed12741f61a 100644 --- a/lib/efi/Kconfig +++ b/lib/efi/Kconfig @@ -11,12 +11,22 @@ config EFI This is used to provide libraries shared by both. +if EFI_LOADER + config EFI_BINARY_EXEC bool "Execute UEFI binary" default y - depends on EFI_LOADER help Select this option if you want to execute the UEFI binary after loading it with U-Boot load commands or other methods. You may enable CMD_BOOTEFI_BINARY so that you can use bootefi command to do that. + +config EFI_DEVICE_PATH_TO_TEXT + bool "Device path to text protocol" + default y + help + The device path to text protocol converts device nodes and paths to + human readable strings. + +endif # EFI_LOADER diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index e2cc9d3eae3..739010e60e3 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -196,3 +196,18 @@ void efi_free_pool(void *ptr) efi_free(priv, ptr); } + +/* helper for debug prints.. efi_free_pool() the result. */ +uint16_t *efi_dp_str(struct efi_device_path *dp) +{ + struct efi_priv *priv = efi_get_priv(); + u16 *val; + + if (!priv->efi_dp_to_text) + return NULL; + + val = priv->efi_dp_to_text->convert_device_path_to_text(dp, true, + true); + + return val; +} diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 6f67e4897f3..c2bb9375df4 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -356,13 +356,6 @@ endmenu menu "UEFI protocol support" -config EFI_DEVICE_PATH_TO_TEXT - bool "Device path to text protocol" - default y - help - The device path to text protocol converts device nodes and paths to - human readable strings. - config EFI_DEVICE_PATH_UTIL bool "Device path utilities protocol" default y