From patchwork Wed Aug 20 00:40:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 51 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=1755650492; bh=OfPo1jHsgQIkL83nUSmjeQ4FkUYMvjEajdKa5I2ni5Y=; 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=YpPA2orlJMmXoM53ED65txnNNXpajqtqq5teYmPbltIBve9DEi3kQOehM98gqsMu9 rRsufXbqnInLWU7r73Mg+fUjQj+U5oNIwLWho9qslYMYAM1VEyLYRwZuKqvSUxWb3p 4F2Q88zpJXZM/qmQhf8NxH9H//Jj/uQTLUi5wO5Tm7uS9enPIMhmyRB9fsVHrAzffd 6Xf243swzbcg7ZPv0k4WMjdbR3Jr4DtUMpi7unINaCwfRu8EeMYV8FsSDcqjigyfb4 h7qpfEwvGOv2GehD6cWV/VdP/lXuGkYudVF4Qstmg9IbLBnu+0hcKCUiSGArtViCC2 yJZfjckIS04Uw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5AB7B6728E for ; Tue, 19 Aug 2025 18:41:32 -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 L6CyE3bGE_Mi for ; Tue, 19 Aug 2025 18:41:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650491; bh=OfPo1jHsgQIkL83nUSmjeQ4FkUYMvjEajdKa5I2ni5Y=; 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=JYfSe/d731aNPVx1EAZJ115vQN42kjwqJB6md+G31TrNIewEEHgbxCSTHp9hSoDw1 33R8jZ8ubAs7dIovb1b6XWZ/IWdz5DfOy97ORKb5ahMNPgZVK4XF6Htwmn6DSGdWGl NIk5SBoeY1AOLgldq3mJs2ZY8OtPi+FjANmxdM75csyQBKYlgO3f7bz2LR0zUfrOAr fsJgChAVRRNqC0ivP11vS1CFQI3XNeFZ3P5cYyRx52HcbE4zSgpsqdjberoJedWG4C cTedyBzEQ8ycXMg3kkboA/jVP0aRziTMZWNHNiwbIsiS3ccyDCL1u7TrZndusTpHWW hOB9TghV6yA4Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1A13867669 for ; Tue, 19 Aug 2025 18:41:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650488; bh=rpQZw3+FzJxNEX0iOkmjuBJejp3vmUEAzPxwGIzSevw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJMScp+aCjP2d95IkWmO7r7AHCGV12tAhC934S4sXF8E4P83vpTVX+4K7k8sZM+8s PIEhy3BFik04K3GiJrbS8EtglDUL3qZtBnREmVRg/iPxDaELARjCDChZPplR3xTstW /Csww5P2YXZSc+Lgz5slULRTZ/Jiwymq91U6jkbDAgmMoZ59TyEe3vVs3F88JlVxFH gLUTBdnwlI3CoGAkYNfs9AXhwxjCifjHFf+zbBKdgCPXaH21adfJp4heBoiJVWPg0h VVRhodN9vCAdUPozDB9lJgminboBl6AgGmPWbocRP+ZySiBWy8OsB/qehEA9mVokl6 hse7dEBYoYiUw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7471A67658; Tue, 19 Aug 2025 18:41:28 -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 k6KhZeuUoavA; Tue, 19 Aug 2025 18:41:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650488; bh=uQPwUhmQ5FIoLZP0ZkPstyEM8zLuGB+wq5SRPbKwqbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=blZuVD+hP6NEPgTb5Tbk/7H9ffxiQbyzBTgA9ngXniyTTDvx2YQs7ahMV8ZyNikkt odnKrr/2z9pjzemrjd/X7s/M3C+1vzfe/HlkV2pB7UH53Cv41sDA6pn0HU04TguB16 rRQARR0OtPGHsw8clIh9Mb3KkwobQcx+PV55slcW0Ng/ADBc+8Q1Qi4xO3L6uyTKCc /9OsBBybrEcDnYbG75p3QPnTywakJ2MNKdMc+PHEqovFxQILLVrIgXaUv7WxXaiCZw km9kAtlMCM3uGvw2NR6+h0GReJA9y+EYKiGUkcNxrNTQuxvy1S7sR6A4pa5UDMQ8Wc H+thpuuLqg99g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E408C6728E; Tue, 19 Aug 2025 18:41:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:27 -0600 Message-ID: <20250820004039.3920254-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820004039.3920254-1-sjg@u-boot.org> References: <20250820004039.3920254-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XET6G7GRHD574XERQM4BFZ47FI3YBSCL X-Message-ID-Hash: XET6G7GRHD574XERQM4BFZ47FI3YBSCL 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 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 --- 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