From patchwork Wed Aug 20 00:40:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 39 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=1755650465; bh=FqRo1z80ecODAo/IQS7s9gvXK5+DoXEGsWkkclL1ZGw=; 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=g4qjdrF4nZaTC7yoXQCVTUN12nDJDBoz6xAuXXKuTwMAdaMqx9bsg7xwoinDRd4wi Cq8v8gDaUjTVmR9TiDS5kTNQCuJV6mo1Bx8bqAX7qW4xIhzMNSaCQIwAvr+jTi+HL0 GZ10Dq8eRBkM/Q3siJHCUgHZr/KKPXJW7JkeDzzeMo9zMVomYMn8Ygf5i6HtPmX1b3 K9KrCE1YYrJc2g3tDaqMvo54DXb3B/+StqNI8EaOD1jtlosecnEcF9ri30cHbp3vFu KjDA+tRpX0RBwxTw0Rh0Z75VqvVpWOe0AHqxxZqXFW4LnZHdLB88alIFCtlc8qdF77 ZH/a0Ju4n0VeA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EABF467650 for ; Tue, 19 Aug 2025 18:41:05 -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 InbGoBKuZZq4 for ; Tue, 19 Aug 2025 18:41:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650465; bh=FqRo1z80ecODAo/IQS7s9gvXK5+DoXEGsWkkclL1ZGw=; 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=g4qjdrF4nZaTC7yoXQCVTUN12nDJDBoz6xAuXXKuTwMAdaMqx9bsg7xwoinDRd4wi Cq8v8gDaUjTVmR9TiDS5kTNQCuJV6mo1Bx8bqAX7qW4xIhzMNSaCQIwAvr+jTi+HL0 GZ10Dq8eRBkM/Q3siJHCUgHZr/KKPXJW7JkeDzzeMo9zMVomYMn8Ygf5i6HtPmX1b3 K9KrCE1YYrJc2g3tDaqMvo54DXb3B/+StqNI8EaOD1jtlosecnEcF9ri30cHbp3vFu KjDA+tRpX0RBwxTw0Rh0Z75VqvVpWOe0AHqxxZqXFW4LnZHdLB88alIFCtlc8qdF77 ZH/a0Ju4n0VeA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DA0696764B for ; Tue, 19 Aug 2025 18:41:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650464; bh=Kpj+CKljDtCr+xR/kUcZk4X38xfGWLGBnmqYCc2qhpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZaiaFZ0GiOx9BROtoqLNPoEzf1UVphVCAGDA9XbwtzTlPxZKvIpaqwuLA7mrFPSCX 2hMHiq0LkaE5fw1q4Lv5zfJXA4YkYbZHFJ06pImX/qen2tWQ12ez9JgMBRqUefegP5 gATyRPEEP5cf3Q2kQxO9F15qaXVssK3fQUCcfI8U7qhNhCvaQNHPZUuEKUWpbQwwNL ZpIeQFV0j64oqaQae+5xo6lfd/6SBKW1pSVMqJStzvpC6JFnfwcRxYU5gay/RBoDr8 pTEtcyqeL0ykr+kUNPEPO9fuS/RaCcIVSQWFjF08SlFcyz0BrCIF9BCE+o7WefnwCa WjFpTz09iqq+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DF91675C0; Tue, 19 Aug 2025 18:41:04 -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 N4N2J6w16Ox4; Tue, 19 Aug 2025 18:41:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650460; bh=DH5/qcr/LtZNgX3JBkzIkAp90RZGNtSaJWt9rMUMqcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SAG7x1jER0eVmhOtMJKJwm3N5o783sj0uh9i535NilVj+R1uatJEHY90QyJhO4lTG QykzT5sBVKAll1BWByNEOSLkwKm44ez325XG/TMgBITbPo5TMYrG8antOKuP4hfh29 em5tD2pxsIf6GfE43djnbJtmaIqGSwdxhVDGLiS3I5GoMHjuLweKEBkftuNWnNF+oE 60GdDn+FYFzGl4lFdAd9xSerdvkah1lFLMo9OO8V/vKkHkZ0DWuJKutNC4gpw2mb7w yVr3lo7/YVK9QqIcAJp4ZBRTgZH4/+d0i427nMPRzhzD23o7Exuvt8DjNHdNhmtCfF w6VXiF+qKhe4Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CA5AD6749C; Tue, 19 Aug 2025 18:40:59 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:15 -0600 Message-ID: <20250820004039.3920254-2-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: FIG5TZMOFFNRI3BZ3UDOOAKLSQF5YSTN X-Message-ID-Hash: FIG5TZMOFFNRI3BZ3UDOOAKLSQF5YSTN 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 01/18] efi: Add missing break statements in dp_size() 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 The conversion to using a size variable was missing a break statement for the BLK case. Fix it. Signed-off-by: Simon Glass Fixes: ffde1a39228 ("efi: Use variables in dp_size()") --- lib/efi/device_path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index 4c2c0bb614f..d1fdd0fba81 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -328,7 +328,7 @@ bool efi_dp_is_multi_instance(const struct efi_device_path *dp) __maybe_unused static unsigned int dp_size(struct udevice *dev) { - uint parent_size, size; + uint parent_size, size = 0; if (!dev || !dev->driver) return sizeof(struct efi_device_path_udevice); @@ -374,6 +374,7 @@ __maybe_unused static unsigned int dp_size(struct udevice *dev) size = sizeof(struct efi_device_path_udevice); break; } + break; case UCLASS_MMC: if (IS_ENABLED(CONFIG_MMC)) size = sizeof(struct efi_device_path_sd_mmc_path); From patchwork Wed Aug 20 00:40:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 40 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=1755650469; bh=NRY7RUrBKSRa+HmzVZ/O72nNjZAQ8q1Ajj+hpCedJPU=; 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=kzcAWt5MnQuaBzNioV34tBGOnavP5VXZh/TEPYi3KIy/z90msfuWqykBLtkSmKxgh bIei2BGW3UPiAzCx0VQydLvnEsAuhmTY3eYYlSBlNQNvdzcOFC0EPS++8x75JCBVgC kZLIud4qAGZq+eMpJrmxNZVAOtGr+J1UfY1BQeh0PhWZr7MKlTdaUMptCPRyGOIbt0 lCh8DdtVI6XOLsY8RNdQhM+OT7E53XvAwh64qmdSSG0qWlqVoDUQzahInXOcd56V8T xVmXhN0u8TVtyNDG61aKDB3EgdufwiAy6aAW6GLiN1FpZAB/A+IgYob/16y3KcySlz +WjDmoVy0vDsA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7BFC467652 for ; Tue, 19 Aug 2025 18:41:09 -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 0FmGhP0WzyDA for ; Tue, 19 Aug 2025 18:41:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650469; bh=NRY7RUrBKSRa+HmzVZ/O72nNjZAQ8q1Ajj+hpCedJPU=; 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=kzcAWt5MnQuaBzNioV34tBGOnavP5VXZh/TEPYi3KIy/z90msfuWqykBLtkSmKxgh bIei2BGW3UPiAzCx0VQydLvnEsAuhmTY3eYYlSBlNQNvdzcOFC0EPS++8x75JCBVgC kZLIud4qAGZq+eMpJrmxNZVAOtGr+J1UfY1BQeh0PhWZr7MKlTdaUMptCPRyGOIbt0 lCh8DdtVI6XOLsY8RNdQhM+OT7E53XvAwh64qmdSSG0qWlqVoDUQzahInXOcd56V8T xVmXhN0u8TVtyNDG61aKDB3EgdufwiAy6aAW6GLiN1FpZAB/A+IgYob/16y3KcySlz +WjDmoVy0vDsA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B5B367650 for ; Tue, 19 Aug 2025 18:41:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650468; bh=qVAQ+scG72mwKFx7OEMC86q/STE27Se+ScLnEfrzasc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4WjXxxx3/np/z3zatE7JT5EENJiAfVDpkFqraA2HHlXrcgKw7jk076X4ajbCYDb+ 8hMD3rRwzoThYVCNcLWsfdTD0PBsYehXnkNbx4yAjyeRelpfIeOFdox1CrDxrk6ZYf 98p/XN7v7MnK7EREtzu7er9guR6FRWb+un/d3USzh+kOZmLEfp2kuSSIGRtZ9a3yji rqibfoZo589xsYtAlUaXp+Zz78lm4Mzsc3Hn533brP80Uu//ulUwY3Gko8plLiEUcQ blCuidbkTSIOU4tOOYND2OZz76Ht+d7SG8tUxiZGGHxYPaUuis3nQOE9mTQvzLD0Uc 4OVwIXlPEhkcQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4038A6728E; Tue, 19 Aug 2025 18:41:08 -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 kuLEs204xKP0; Tue, 19 Aug 2025 18:41:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650464; bh=CPbW/JbkoRSTkkwNiSaNsEcY1m8X5ml2yZLAlf7RkQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YI1NvM6fM2h1lNtN2Vpojn8kEPjCVSvYYgrAxosqwIa4YSZSCS122jPwvJdIzh10S EXisprnQ1AjEMOm3PoUATZoeQdAJvOPpc9wraU35jMJ94m+1eQdfeJ0sPLSHVZyBL7 0q1b/ytISEoBZBWU+XYBrgS6hdCPtq4jA4D3dxZKiKZK4Qm6E4U4SofSN5HEgfJHZk Pnw16CbrFuOoH3CfblAjJFRrwBXaQQX+kKCRifAx4pVHacRwrrmk3tFwdKiB3MQ1Ba AcJNT14BtG4CRsmd3DUTtgdIjPJwDhxqFfXnNvcrAUPtmT+mD7FEd5Am4wusMVik5b wAOWqNtElsuaA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6B0F06749C; Tue, 19 Aug 2025 18:41:04 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:16 -0600 Message-ID: <20250820004039.3920254-3-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: GFUXXXLNEL4U5QW3FOPNMEOM7PXWYDLW X-Message-ID-Hash: GFUXXXLNEL4U5QW3FOPNMEOM7PXWYDLW 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 02/18] efi: Add missing break to dp_fill() 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 While this doesn't really affect anything in practice, it is better to deal with an incorrect use of this function (calling it with a UCLASS which is not enabled). Add a break after the UCLASS_BLK case, to help this. Signed-off-by: Simon Glass Fixes: a48a8929de2 ("efi: Move most of efi_device_path into lib/efi") --- lib/efi/device_path.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index d1fdd0fba81..0926b51e987 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -529,6 +529,7 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) return &dp[1]; } + break; } case UCLASS_MMC: if (IS_ENABLED(CONFIG_MMC)) { From patchwork Wed Aug 20 00:40:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 41 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=1755650471; bh=h1GUHgVsPQBeZazMiUmaLBN4BQNM+THibYVnPZFRa+w=; 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=cQbw+Fo2OtNbnZjSjyuPDCdm4YGETI7vu3eZZjI1qg/TogZCwnzvVKD7J3wfgKlKw AYeWFdAL/QKgsM9yLrXCuKODDH8tZn0+8FRskJn2A/5NgDXsI4jbkAk0nEhapT8kvq fJFr4lXFFkgDMTNeRjee0BLXDlvQvi84nT1rKPEsO7VqvfDYE90sjUeMxgHHEmgB0w qhJybA4lW5kypIFvX4b4ddwskQqMdmh2e+2umjYGuOX3MR8CcXvGIQelqbVGBUQx5S QZYwSxwc23KVzRUeOn1+4UETajwyQROcwqpVsmdFP2YkPzoxNcxuQ+Mxh7tA1VnFwB L086SikljWKJg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E2F45675DE for ; Tue, 19 Aug 2025 18:41:11 -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 mkmq2pEYhgRk for ; Tue, 19 Aug 2025 18:41:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650471; bh=h1GUHgVsPQBeZazMiUmaLBN4BQNM+THibYVnPZFRa+w=; 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=cQbw+Fo2OtNbnZjSjyuPDCdm4YGETI7vu3eZZjI1qg/TogZCwnzvVKD7J3wfgKlKw AYeWFdAL/QKgsM9yLrXCuKODDH8tZn0+8FRskJn2A/5NgDXsI4jbkAk0nEhapT8kvq fJFr4lXFFkgDMTNeRjee0BLXDlvQvi84nT1rKPEsO7VqvfDYE90sjUeMxgHHEmgB0w qhJybA4lW5kypIFvX4b4ddwskQqMdmh2e+2umjYGuOX3MR8CcXvGIQelqbVGBUQx5S QZYwSxwc23KVzRUeOn1+4UETajwyQROcwqpVsmdFP2YkPzoxNcxuQ+Mxh7tA1VnFwB L086SikljWKJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFC4F6749C for ; Tue, 19 Aug 2025 18:41:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650469; bh=FcUWud7iZGklGReNoHQRumyMdXlgCu9tJxEc14yEwkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alsRVhn2RlDcvID8SPHM4j2eEZV0U+TJbsSX1NLiYu5vH+WxOKec0WH9QsrywPXtF UNKegsjiKqDYSG5wFO8W4KkcwUXHeUcPTjZeyDHz3PqP5vKnDT14IbFKImf1fm7Dfn CZDWKZRIbaAQT/W/5BD6APjt+gSvU2E7g9OFdVFqnNU9DwfUTRjT74OWzWvFyVKkZ/ lPKy0AT1Ek8KmiPT5c9JRwN1BV9PyIk6Eh8SnfThzarBZyb/S4pucPKg2fBGRc7A2x 0sBy9U51teslwG09NqI/FNrNJNjWkXRvNww8yf039oE+pzBEzzEU2pH6047Fox6KGQ 86T/PDHF5r9SQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69CBB6749C; Tue, 19 Aug 2025 18:41:09 -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 fEhrqqyW0PXi; Tue, 19 Aug 2025 18:41:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650467; bh=1CSCtZcn92TnM+DJ8mGjTKYzX3LWeXCBXnuENsZ9AtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rej3tY0UfO3ea13EWiI3AA/UVSMT/3TFPgSK8MyewpzAnjWbrshWBjeh5s2jsRu3N yEPx2Uiwd66GZ7nmbu8wYeSTlCi6pHTxPW6mBtRxYfu6wB3Tux48VLvqT3PEQGE/7x lA0Ohf9L2rokj1V5LOYeNuzxrgt/7VpludjBnx050Y+SOU4H/8Slz6yTPbV7fnbyqX RqAhXkYoIyeHo7qAFAVeq9Z2B1xVxq7Yw847WuGIfl+lfcz/liTo3aYHy9k7w71kEL yNMCWU2Z17QgtS6n7KXeIja2xjIMaSNBmzEQJEZmW6qEzQT8lWJ2juxL84V2KezaMT xIwn5HxlkYqYQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 211D5675C0; Tue, 19 Aug 2025 18:41:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:17 -0600 Message-ID: <20250820004039.3920254-4-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: YCUE7USIFQ47ONOFCV4EYP7X4GK23CDT X-Message-ID-Hash: YCUE7USIFQ47ONOFCV4EYP7X4GK23CDT 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 03/18] efi: Update path_uefi() to avoid allowed_unaligned() 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 call seems to have been added in an unrelated commit, likely to fix a bug: 046fe7b5074 ("efi_loader: efi_dp_from_file() expect UTF-8 path") With standard boot we don't need to call efi_set_bootdev(). Also this function is not available in the EFI app. So for now, add a condition, to avoid a build error in the x86 app when CONFIG_EFI_BINARY_EXEC is enabled. Signed-off-by: Simon Glass --- lib/efi/device_path.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index 0926b51e987..fb6653b23a3 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -741,12 +741,14 @@ static void path_to_uefi(void *uefi, const char *src) { u16 *pos = uefi; - /* - * efi_set_bootdev() calls this routine indirectly before the UEFI - * subsystem is initialized. So we cannot assume unaligned access to be - * enabled. - */ - allow_unaligned(); + if (!IS_ENABLED(CONFIG_EFI_APP)) { + /* + * efi_set_bootdev() calls this routine indirectly before the + * UEFI subsystem is initialized. So we cannot assume unaligned + * access to be enabled. + */ + allow_unaligned(); + } while (*src) { s32 code = utf8_get(&src); From patchwork Wed Aug 20 00:40:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 42 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=1755650476; bh=iNwF/Uqvw2unBIIIqS3MsSWm91O+3/BygmB15SE6Llc=; 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=YyNtviHPVMmTmT0x4H0q/x+/upK5TClMJpSPPIq2T5UG31vLwRtOLDuYOkwNAQRfW VXUvFO1NViTGVWksJrtBdJezX2TgOs02x7/5C3Zk8HsJYsw7r3Uq2FnMMUM7PHHQtB q3mBIwIyahhtM1EfjKb40AHfGI1jKLvo8hyTwfjHBjzKyNnm3Bq/2Qes0oHO0e4PId Biv+aUGQ08Xi3WKbLK/jL7wu82bHDrxEGoIk0kRjqbypxy+k5/w9loTldY/vH/YV+U Rh0s3JwX5M3PApV8z204vtlhg9l+EdKlgvC95sy8UNQXWgK2UGqHN8YFsse+mcyEQP zd5/dI+JX03Zw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4EB256764B for ; Tue, 19 Aug 2025 18:41:16 -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 99v0z309eDGD for ; Tue, 19 Aug 2025 18:41:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650476; bh=iNwF/Uqvw2unBIIIqS3MsSWm91O+3/BygmB15SE6Llc=; 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=YyNtviHPVMmTmT0x4H0q/x+/upK5TClMJpSPPIq2T5UG31vLwRtOLDuYOkwNAQRfW VXUvFO1NViTGVWksJrtBdJezX2TgOs02x7/5C3Zk8HsJYsw7r3Uq2FnMMUM7PHHQtB q3mBIwIyahhtM1EfjKb40AHfGI1jKLvo8hyTwfjHBjzKyNnm3Bq/2Qes0oHO0e4PId Biv+aUGQ08Xi3WKbLK/jL7wu82bHDrxEGoIk0kRjqbypxy+k5/w9loTldY/vH/YV+U Rh0s3JwX5M3PApV8z204vtlhg9l+EdKlgvC95sy8UNQXWgK2UGqHN8YFsse+mcyEQP zd5/dI+JX03Zw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3CC09675DE for ; Tue, 19 Aug 2025 18:41:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650474; bh=7tzQ7aPKo2HzMHc6UhCBYDTxvWT6yQZus2nlQLSNEcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AtYPq4G6RnGjhwQS5V+23BDA8ZfFEt1zdkkJeTqWyhlr+7gAa5L+ebCIhCdmEeq3I 9CKj9WGShDgHBVklDKw5sjCIO4Fba+8adlgeC+9M452kxVF5UBsJ9vXIpSd2nR2eDJ 0zmZkQ2t9ve9rB8US8TtxxFuQbXPLJ2/KkFTC0PqfbC5YL3pBrnOGr4EENbGq3qV2+ jlG8UjmJnckOciodG9NluXofrnJdoJTTmg1a6kSoT+fPCNjNySOApyHxM+hQxzON7+ jR3qM0fRLQJCqxeaBcaJSloi9MxuaM+J0KGOnEre0t/DnsZOxlnNm+jj0lOt6UjAGO ALAIpmCU4Cp8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 387C66728E; Tue, 19 Aug 2025 18:41:14 -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 yuVDTINT2YgB; Tue, 19 Aug 2025 18:41:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650470; bh=tSlL2eGRlvae5UGP1IgSx/PrB0Irk5rBakbiIHyR5wQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSXsCEnlgopinktQ8rTAadVPWjLxh35vpNzdCp09rv4tYQnZ7e1fuE1IjJBStUR8S nyot5QTYwcdUAK8779keT8C87RXu2ZERWBe+mLXZWsfR5PsMMYHzyhYZnq6WrD00h8 2456ATY11Jde5zlVMs3KZ26Q/MrHwGMvJvcaBt+8rQq2kKrrLcv8K8c/j0BoYop9Zj Gk1llsOqIjIukVBVQz7+LELAQIisfnBRJe7SiGc9aunCMiKv25OvKQUR67Z/NrkZsx p+sVRzd92KP4DP7MSUNZFpRh7lo+U3BJ68R88GVe4nL9+Z94ZY3aSdyMk3SKx6ko7O SQ13tCPNWAGoA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B509267659; Tue, 19 Aug 2025 18:41:09 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:18 -0600 Message-ID: <20250820004039.3920254-5-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: ZUK5ZKBYH4NBR2W2KJW4INMQKO6L5JKE X-Message-ID-Hash: ZUK5ZKBYH4NBR2W2KJW4INMQKO6L5JKE 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 04/18] efi: app: Support the efidebug command 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 command is useful for the app, so enable it. For now most of the subcommands don't work, so provide a message in that case. This seems better than silently pretending that the subcommand doesn't exist. Signed-off-by: Simon Glass --- cmd/Kconfig | 5 +++-- cmd/efidebug.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index b7b80cbe59f..fe9fb11ff95 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2228,8 +2228,9 @@ config CMD_CLS config CMD_EFIDEBUG bool "efidebug - display/configure UEFI environment" - depends on EFI_LOADER - select EFI_DEVICE_PATH_TO_TEXT + depends on EFI_LOADER || EFI_APP + default y if EFI_APP + select EFI_DEVICE_PATH_TO_TEXT if EFI_LOADER help Enable the 'efidebug' command which provides a subset of UEFI shell utility with simplified functionality. It will be useful diff --git a/cmd/efidebug.c b/cmd/efidebug.c index f52ba8de279..2e156fef525 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -28,6 +28,16 @@ #define BS systab.boottime +static bool app_not_supported(const char *cmd) +{ + if (!IS_ENABLED(CONFIG_EFI_APP)) + return false; + + printf("Command '%s' is not yet supported in the app\n", cmd); + + return true; +} + #ifdef CONFIG_EFI_HAVE_CAPSULE_SUPPORT /** * do_efi_capsule_update() - process a capsule update @@ -405,6 +415,9 @@ static int do_efi_show_drivers(struct cmd_tbl *cmdtp, int flag, u16 *driver_name, *image_path_text; efi_status_t ret; + if (app_not_supported("show_drivers")) + return CMD_RET_FAILURE; + ret = EFI_CALL(efi_locate_handle_buffer( BY_PROTOCOL, &efi_guid_driver_binding_protocol, NULL, &num, &handles)); @@ -458,6 +471,9 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, efi_uintn_t num, count, i, j; efi_status_t ret; + if (app_not_supported("show_handles")) + return CMD_RET_FAILURE; + ret = EFI_CALL(efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, &handles)); if (ret != EFI_SUCCESS) @@ -646,6 +662,9 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, int i; efi_status_t ret; + if (app_not_supported("memmap")) + return CMD_RET_FAILURE; + ret = efi_get_memory_map_alloc(&map_size, &memmap); if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; @@ -698,6 +717,9 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, static int do_efi_show_tables(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + if (app_not_supported("show tables")) + return CMD_RET_FAILURE; + efi_show_tables(&systab); return CMD_RET_SUCCESS; @@ -893,6 +915,9 @@ static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag, efi_status_t ret; int r = CMD_RET_SUCCESS; + if (app_not_supported("boot add")) + return CMD_RET_FAILURE; + guid = efi_global_variable_guid; /* attributes */ @@ -1073,6 +1098,9 @@ static int do_efi_boot_rm(struct cmd_tbl *cmdtp, int flag, u16 var_name16[9]; efi_status_t ret; + if (app_not_supported("boot rm")) + return CMD_RET_FAILURE; + if (argc == 1) return CMD_RET_USAGE; @@ -1199,6 +1227,9 @@ static int do_efi_boot_dump(struct cmd_tbl *cmdtp, int flag, efi_guid_t guid; efi_status_t ret; + if (app_not_supported("boot dump")) + return CMD_RET_FAILURE; + if (argc > 1) return CMD_RET_USAGE; @@ -1255,6 +1286,9 @@ static int show_efi_boot_order(void) struct efi_load_option lo; efi_status_t ret; + if (app_not_supported("show_boot_order")) + return CMD_RET_FAILURE; + size = 0; ret = efi_get_variable_int(u"BootOrder", &efi_global_variable_guid, NULL, &size, NULL, NULL); @@ -1574,6 +1608,9 @@ static int do_efi_query_info(struct cmd_tbl *cmdtp, int flag, u64 max_variable_size; int i; + if (app_not_supported("query")) + return CMD_RET_FAILURE; + for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-bs")) attr |= EFI_VARIABLE_BOOTSERVICE_ACCESS; From patchwork Wed Aug 20 00:40:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 43 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=1755650478; bh=88YdHabkxkMNhvtDfrGfXZMOUhQfYBJNIJyRUTHfWPE=; 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=IlrcaeBY3MG+1RFenG2lxxvtxOX4CFEuGpU2kSizNbAbySQ4DhlSMLeMVvVBChfg6 qeyxRxQVG+xVKMfLtGNT6b6WLzcyWcxP0YNok80aVwl7zvXDI3dDvdbCU7EXJI+QRm Z06qhsEg5t8wmBqaxGU98uZysSQZMPT9W7bdZi3XMgNSGEhi1sEseYtCZDJYM8sOF0 7GjmV3NQI1vDVkkF8R9bQI6h5v1hG+29zZ2G+crzdWypNJL7ajQHPj9SXxEzhWdACq HhkO+0y0dg4ERv+g1hz4n3DoSfdhvjOKlbrApJVbnHXz5KWZ+CtZIoqtOUQEYbyffq F2FUUkoshr4ew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B27306728E for ; Tue, 19 Aug 2025 18:41: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 10024) with ESMTP id yi6nH7XTh-6U for ; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650477; bh=88YdHabkxkMNhvtDfrGfXZMOUhQfYBJNIJyRUTHfWPE=; 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=Om+q09Ok6Aw4HoWaUNxnvprCAiOr3fYBnzc5C+PNQmlweYcGhMyQ7HNfdGEQo5muW /q+4roTgYyOID43y2bnPPWqNtn9xHpmSxjnb31xnpVlROo1hdl+YkobPHuOX9zAoR2 G39XMom8IycumMyaydN8i8rN8l85JCWr4Xvln7MdHI6DIv59877DbPOyUVdT7acHFY tVhESmEw6lm4xUbF7jd5sFOYytAITD8EhFIG2y/uF3VTpFzDvyMequysFdeRK3uPd2 JJtjXWfHt+AoKq9cNudg73evwem0393D5B86EC9UmhLuJ90yvtb5BiywXBxZzgzSFy 0u4Q5oVpMaT5Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1CFF675F5 for ; Tue, 19 Aug 2025 18:41:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650476; bh=I+dJsMOLbMtTIaf07XdJW7G+z2KzHHvci6fgjcKbjoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBBiJN+g+w17jWeZcOM1A/FUNJT8iWUgC55X5ZRZDmcFlKlhSedFV7Reb8MmDZEdk DzRc/MudbjgglmGW2SWd/SIBhGCum3RbaW8TLs7RYpqZLBPb8ckvi7wT2MPR3AyGDe IwuGlOapi78EXo1EKkCktbEw3JXFqz06iBmAgPIevmNRJoJ5bx2C5/8EKvBFilrKpM t1MU0HaKNW0uapG9b6SPmND7enc5bDcE+xs31J1zMlPK3QzPjXC6mIILN6FRxLoJ/N SYbHqeM8iulXxV/qrE2uuqmAJ33LQre7E/dYuFIoLMzX0i4QWHspS1GZCLeS1OvZgj nWFNGyBaqf5UA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0BC2E6728E; Tue, 19 Aug 2025 18:41:16 -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 Su0gPPGrW_cQ; Tue, 19 Aug 2025 18:41:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650474; bh=DgbKl0MALjB66321wQWLxQr8ayIAUMlRRVt5QG6Qbm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cDC0oA9HwBpcV/2CzmfnnukZ6vpn07zcTLZO0T2SqMqc/apCNqjbXPGU5PbY8KSfU T1yaDXjiXL2WZNbqoyOT+CobkLYs03zuVYXqMlOHa26u4DwSCxGHPDkj/6p8MSjMWB kmFd9AiMuyjINoZB+x5ndM0Clk1Ga30b5vkaMNjwN0+DLXwuAiO9Jh2j/8858WhWa8 jefemxQZ4ZtfYZJhS3IlXVTsDcHY3klZ7OhW3l3ua9Wdq41noERA2p6ig0iJvgQ6e1 g5rTX1MZHzSx9AmiKHgSGdGDGZxPXXsCmdUNscsdAXKKb3L0xT3ZHLT3W9zywJQG9Z W9OqfQKIZefNw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 592F0675C0; Tue, 19 Aug 2025 18:41:14 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:19 -0600 Message-ID: <20250820004039.3920254-6-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: 3K74ZM2VUO7MPNYBBN7VBFW5HYWIXMMB X-Message-ID-Hash: 3K74ZM2VUO7MPNYBBN7VBFW5HYWIXMMB 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 05/18] efi: app: Support efidebug memmap 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 It is helpful to see the memory map in some cases, so enable this subcommand in the app. Unfortunately we cannot assume that desc_size is the same in the underlying EFI implementation, so use a variable for that. Signed-off-by: Simon Glass --- cmd/efidebug.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 2e156fef525..d93fa43b779 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -659,15 +659,24 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, struct efi_mem_desc *memmap, *map; efi_uintn_t map_size; const char *type; - int i; - efi_status_t ret; + int desc_size, i; + efi_status_t eret; + int ret; - if (app_not_supported("memmap")) - return CMD_RET_FAILURE; + if (IS_ENABLED(CONFIG_EFI_APP)) { + uint key, version; + int size; - ret = efi_get_memory_map_alloc(&map_size, &memmap); - if (ret != EFI_SUCCESS) - return CMD_RET_FAILURE; + ret = efi_get_mmap(&memmap, &size, &key, &desc_size, &version); + if (ret) + return CMD_RET_FAILURE; + map_size = size; + } else { + eret = efi_get_memory_map_alloc(&map_size, &memmap); + if (eret) + return CMD_RET_FAILURE; + desc_size = sizeof(*map); + } printf("Type Start%.*s End%.*s Attributes\n", EFI_PHYS_ADDR_WIDTH - 5, spc, EFI_PHYS_ADDR_WIDTH - 3, spc); @@ -678,7 +687,8 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, * This is a false positive as memmap will always be * populated by allocate_pool() above. */ - for (i = 0, map = memmap; i < map_size / sizeof(*map); map++, i++) { + for (i = 0, map = memmap; i < map_size / desc_size; + map = (void *)map + desc_size, i++) { if (map->type < ARRAY_SIZE(efi_mem_type_string)) type = efi_mem_type_string[map->type]; else From patchwork Wed Aug 20 00:40:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 44 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=1755650481; bh=1m9k+/9Ie5/9rec7yiElOt4DWF+CHaGZlsjgx0Fx8qw=; 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=UaRKqk4MUjW0sKsI/XyaKgKGehoSaHiqFqv1p+zT8Ye6CeOGL1gBhgcha9OfWiwra vZbTx2a/w28d5x6A9V/UZCuPkzAA0C72kfPC4SQa/mUm42waih85nhfaeKKrPIVaoW VP4gnzZITl7JYHBaUbtlU8FkuBQSfSbQIumfZkvtF1OKZmgGGx3b9nEmnf6vKHE3q7 0/ZNapoEZ8NTNl2s8VZ1g96/gwYJ0NA3fR/tsWF0leLykw94H+TVc12iBJ+H3k0YIa HP4xH7w41/4WRxNXlh6wAjNqWu4wxdhj+XTIsOpxVtWkCN5X0eDarp6YGFOMRYlDxG /bluEClLM0vgw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56B726765F for ; Tue, 19 Aug 2025 18:41:21 -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 VTJ2ONx7hY2T for ; Tue, 19 Aug 2025 18:41:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650481; bh=1m9k+/9Ie5/9rec7yiElOt4DWF+CHaGZlsjgx0Fx8qw=; 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=UaRKqk4MUjW0sKsI/XyaKgKGehoSaHiqFqv1p+zT8Ye6CeOGL1gBhgcha9OfWiwra vZbTx2a/w28d5x6A9V/UZCuPkzAA0C72kfPC4SQa/mUm42waih85nhfaeKKrPIVaoW VP4gnzZITl7JYHBaUbtlU8FkuBQSfSbQIumfZkvtF1OKZmgGGx3b9nEmnf6vKHE3q7 0/ZNapoEZ8NTNl2s8VZ1g96/gwYJ0NA3fR/tsWF0leLykw94H+TVc12iBJ+H3k0YIa HP4xH7w41/4WRxNXlh6wAjNqWu4wxdhj+XTIsOpxVtWkCN5X0eDarp6YGFOMRYlDxG /bluEClLM0vgw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 151F3675F5 for ; Tue, 19 Aug 2025 18:41:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650478; bh=RvvZx7OrHkjaLZ0WyDjG7Wb7wOh/Y66KxUZGh+hRFKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miK/yubfFJ8+y70A8YH8MVGUgbluL4ZcJiTZd8908j4OO3KWKFJ8Le4lNUiDfocYN xYjrPUeJHUwHlkFJCx4/9dRGWeoZGmkwV8DgISUpRuDMm43Crq+PGCovPP98Pm6kAw pZgEeB1U3bBDr+/q87JOH0yKAWzAuIfFOZVu37KtZ7PKr5b3P24KrexL1K/iQXiHSu 9EwBWadAvvj4p/B4QniYXdHcTm16IF6Sh8zaq/Iazda/w104nADfmlL8DIxYKaDOpG rX1Ini5g6R7ysAYxY0zXNv6W6O3twX1DbYiPmrMle1mk8uFyQiTvC011yvBqaLhaU4 PCLtFoSN6HOpQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A10546765E; Tue, 19 Aug 2025 18:41: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 0gcLpLrwCqYT; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650476; bh=PxZn6AhTpaCsDwiDM1O8ECLxctZr8F+/umzGpdyoUSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RENaaWH2kRVPed+YzYOlWTBesp1BcYpWZX2RTD/A78W6TS2xv+twBPp1jgJo1qmW5 878QG6Ip7omh4XeFRMsSodabB7gwwccFe7KQ5ZVaezd+J8snn8g9+wkLECCtTLJdvl 1qolL3KIQmj2Eb0gKDG88BTguHtQQCcRXojQ0rDgPly4SsUZ6mzRAXZCCUFE8a6OOI ELo8QJNyOqScI+JMB5kyk3TugIhW5zYBOMsziJgIjFzAkn76grQNAXkYC0G4fF9ufe nNpqAw+FC05dZLFZjoLdOY7s+diMiyrmupkLmCGaF0SsHVkjaJXx80WePlvGEs3en3 3e5P7C5EhjZdQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5A8E9675DE; Tue, 19 Aug 2025 18:41:16 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:20 -0600 Message-ID: <20250820004039.3920254-7-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: NLZLKGJ6QR5K64AXX4H5QEWYNZZEHO7Y X-Message-ID-Hash: NLZLKGJ6QR5K64AXX4H5QEWYNZZEHO7Y 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 06/18] efi: app: Support efidebug show tables 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 It is useful to be able to see the available tables in the app, so enable this subcommand. Provide an implementation of efi_get_sys_table() that works for the EFI loader. Signed-off-by: Simon Glass --- cmd/efidebug.c | 5 +---- lib/efi_loader/efi_boottime.c | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index d93fa43b779..2f1fecf494a 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -727,10 +727,7 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, static int do_efi_show_tables(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - if (app_not_supported("show tables")) - return CMD_RET_FAILURE; - - efi_show_tables(&systab); + efi_show_tables(efi_get_sys_table()); return CMD_RET_SUCCESS; } diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index cc711a5c52f..8ba42ec4544 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -4026,3 +4026,8 @@ efi_status_t efi_initialize_system_table(void) return ret; } + +struct efi_system_table *efi_get_sys_table(void) +{ + return &systab; +} From patchwork Wed Aug 20 00:40:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 45 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=1755650483; bh=WBHgxG6jTzDJaSD9cG6cKU5A4EKRpPQTNGP6I+JPiTk=; 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=sD6GOMVkVeZ+LaKhuQoPcQkvhs0FXeXeQYBtjIyirCe6BtzzylN3g+4GYeBmp4WRX 0afE4OXZKM0hUHdOKjDtX/D6Mh2Ep9wR2HDEY8vneE5GmL05DHnQzWZtU6xf7SIsBh pNPe6Pl+KrldPNYGJ1rq6Weay6SA6gxp0Ww4ikpHGxV/UzhG/qpxdEywZasQ4iozy/ bz8sP+iGy9iT/E7va69ebBMLI45KHQBfTIqMG1vmtGZaJVpXam50XaYVRjSHrY8g8+ HYzzZtk6IOahQWRpGgJSPh+eZaX9PEeScLy9mqrUc7DCS8E7aayxpNQFBfH94hvifu 05986BRViVivQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 900EF6766B for ; Tue, 19 Aug 2025 18:41:23 -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 aZjpycSgzldW for ; Tue, 19 Aug 2025 18:41:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650481; bh=WBHgxG6jTzDJaSD9cG6cKU5A4EKRpPQTNGP6I+JPiTk=; 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=nvx/LTtgUqAKG/xQbwMt+BzBJ38ZG42Of7G7Si4DK8TYQRN4libWNvMNLbHeeRUx7 JzDixUao8VY7agYqRKtRBsqxBZ7KupMsUdKr+6yTqSyKN8YHcIA5jwGUu+A0t8G73G OZj75ILMp/G1ExNBVtEKaHqxBce+SlDVIOl27mC5Wp9mF7YW34vbI+dceoIfEwOcEf X6HPWYMjckZtpvi5iNAPqiXtsYfDC8GnmbV9dSe2LctxakOAEiLzcNXjPJMTpNZpO/ 37swsFDbe0zoj9QENxdFkna/LAiTigMBzysCxu6nY1wZf2nFcSQdHSHW7+OUuTuopU 4vJwcyLHaSSzQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E3C6E675C0 for ; Tue, 19 Aug 2025 18:41:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650478; bh=P+2a+3dXDCM2jZ2iQIN1gRGnqp8D+ZZvm3P10HH6yic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9rlqan2NxuD634zH7FAK9f33SDRwlTEorhO4SsZlFiIaQkXUq44hZyl/jh5meDQS KoiTIGEpXoZ+0PsBnNsWT38zKj8O/IGZefgBMpktadUP/83xy8mqOLnZwVVGADCQ0V X6ezelkcDy2kfCs8kaLuDDIVqT60nMZjIb3ILKZDE8CGBTsBEq9iVAZR8W6WTaulnH 0g0AlXpI3P8/WOFTwg8hTj5S9LxeAYHEH003mieIIzMsAd7/voBEPPX5m0aeZbuDvL VLqBBk1QgyJQi+DeU0TAQjHPQnHqZyM3euVsImLj2X3Q776wYVnvisLiISTn1BzrNM pgnNuyoxf1DnQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B81A0675DE; Tue, 19 Aug 2025 18:41: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 ONmLVG-QgyVr; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650477; bh=c0benN0k3zBzvGmc9mo2oJPUb0ZYnCR+Om3NwOm9mlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOfDSdCE6nC6+ilQNeMrvsQNQDo/PTllrbma0pAd1GGg0NffiQG9oBonYzJnTteQD e97aWaWoH56DeLp/4vFApMEIkdTThjSOVfPNKjXK5xgbd1IvgsWq46b19vXICU4/HB GfemODhlApesagyggZJly9EDZ4Lz7z0RrFya8s2GJJz5WkQRVsVmDc1TJDjqARs0lr 6J3R+Kvziqoyq6odg2T8M3Wy5Q3GNgZMbEBpM/3MKZ108voW9DajJusrVoetMAvXRS bZuueXPopI5YT0tPNQ+IWUNjRVzEAg3Mw2vTL02v1kL+LXYS+HP4A3kt4S+PkFr3KD g5kzApimpkG8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 38D3C675C0; Tue, 19 Aug 2025 18:41:17 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:21 -0600 Message-ID: <20250820004039.3920254-8-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: AW4HTCSTERK6CCBL5UMURYCTUQTYWNFY X-Message-ID-Hash: AW4HTCSTERK6CCBL5UMURYCTUQTYWNFY 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 07/18] efi: app: Provide easy access to runtime services 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 Add a function which allows the app to obtain the runtime services without first obtaining the priv data. Make use of this in efi_vars.c Signed-off-by: Simon Glass --- include/efi.h | 7 +++++++ lib/efi_client/efi.c | 5 +++++ lib/efi_client/efi_vars.c | 9 +++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/efi.h b/include/efi.h index 9ff945ae1c3..742c40bfd8c 100644 --- a/include/efi.h +++ b/include/efi.h @@ -604,6 +604,13 @@ struct efi_system_table *efi_get_sys_table(void); */ struct efi_boot_services *efi_get_boot(void); +/** + * efi_get_run() - Get access to the EFI runtime-services table + * + * Returns: pointer to EFI runtime-services table + */ +struct efi_runtime_services *efi_get_run(void); + /** * efi_get_parent_image() - Get the handle of the parent image * diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index c5573dd67f9..e2cc9d3eae3 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -65,6 +65,11 @@ struct efi_boot_services *efi_get_boot(void) return global_priv->boot; } +struct efi_runtime_services *efi_get_run(void) +{ + return global_priv->run; +} + efi_handle_t efi_get_parent_image(void) { return global_priv->parent_image; diff --git a/lib/efi_client/efi_vars.c b/lib/efi_client/efi_vars.c index 099a59b2a1e..e652ee3f243 100644 --- a/lib/efi_client/efi_vars.c +++ b/lib/efi_client/efi_vars.c @@ -18,8 +18,7 @@ efi_status_t efi_get_variable_int(const u16 *variable_name, const efi_guid_t *ve u32 *attributes, efi_uintn_t *data_size, void *data, u64 *timep) { - struct efi_priv *priv = efi_get_priv(); - struct efi_runtime_services *run = priv->run; + struct efi_runtime_services *run = efi_get_run(); return run->get_variable((u16 *)variable_name, vendor, attributes, data_size, data); } @@ -28,8 +27,7 @@ efi_status_t efi_set_variable_int(const u16 *variable_name, const efi_guid_t *ve u32 attributes, efi_uintn_t data_size, const void *data, bool ro_check) { - struct efi_priv *priv = efi_get_priv(); - struct efi_runtime_services *run = priv->run; + struct efi_runtime_services *run = efi_get_run(); return run->set_variable((u16 *)variable_name, vendor, attributes, data_size, data); } @@ -37,8 +35,7 @@ efi_status_t efi_set_variable_int(const u16 *variable_name, const efi_guid_t *ve efi_status_t efi_get_next_variable_name_int(efi_uintn_t *variable_name_size, u16 *variable_name, efi_guid_t *vendor) { - struct efi_priv *priv = efi_get_priv(); - struct efi_runtime_services *run = priv->run; + struct efi_runtime_services *run = efi_get_run(); return run->get_next_variable_name(variable_name_size, variable_name, vendor); } From patchwork Wed Aug 20 00:40:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 46 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=1755650483; bh=YMV8j+n+4E0aZt5bHEi6i94hW1famMi2hHCq/XZBTMg=; 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=g/mylgg0Y8P/WxVCk5fSYmO3OpMajLA13NoDlD+LZr9qzpFKR2TRMLuYnShX7r4O7 i+ASAdztL8TtxFkuHjuCpcVRmJiMnyDadrioEZ5YBrzZZXoevYf0KfXxMRq1L9BAKG 2+Fj1PH3+5VnOOie5mW/qj8lByCMkd5ZcA8VSf9VRinpqRlifPGdhMx4VV1806IRjy I2xT7M3u/9LOvF+qx9WCKnCfICmBc1dww6qpkSk62J19M4uqlmYYMHhgkVwTGO/hMB pkT5SUBknkQqkt0CSAcmOUGJ+22w5EJGLLYBrb9e2fLqEQPVAEu3JXyJdKKgyxTTiy UnneeRoAO/JSQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C4C7567659 for ; Tue, 19 Aug 2025 18:41:23 -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 x59tr0DW78OA for ; Tue, 19 Aug 2025 18:41:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650482; bh=YMV8j+n+4E0aZt5bHEi6i94hW1famMi2hHCq/XZBTMg=; 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=DRQRo5qzszmmQ5L3fWDiVDcI/LioEOloth11/Q/A3WvVCrhUo3k4pQ7rF9j0ujQYP 4s2ecrUZz/94gqN2kIig59wQBk6kxcAIfoskAnw+ZZ6aGjbvD/8ggXflY3B884iJEE yRkh5Y+Q4y5LXmAToWNApR04mBTPUnqKiVpHq0mY3qU54EES2SNr3Bi/MKs45jrBEP Hw/+6JFfS3Npr+uJpRWI6ibvBVpDHChxMujnsZPuAH+QOuPE4MeJCuar4qIdVTW9oU v8cnw5LKDlFEHHih6mI/z/iQUeqHrY49LteluoctLNnEbZ/vLUf4wH684bdJ3hguoI rAmWq1eFQdwIw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B9DD467660 for ; Tue, 19 Aug 2025 18:41:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650479; bh=QOoeHXyKSzdZntULICKDQtphcnot/aY3f7RwNRn6AJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQVmmW1GFVTG6UwigzVTq9RT9rKRy48dt0D+b108GbyaBMuTHG+x/FMvOp2jeCIfz HMCHlR1lyvheQwtYdd4bLo9bmspM4aj4XJ1qwMj4oJlWXuQAFW5WU0bvJLYVmaOt3A VbYoVZsJRXxtUI/VrCmcw73aJYSzRie00CmJLcLmjjX5dXYD0mORJChtLqgly0UUwM SBpUOIA/Q3WxGGvEp6xEl9Xzlx66FKBZdU0z8NwqVxzd6uJ7n3Z/MT3LBopFpk0xZx +oYAiFO3S0L83SvzVWLvEKsKmv++ECUOsrnxkAf8s/3nxd0kYM7m9iIb/GEF8uAYP7 Ase28LinWiBVA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 025506765D; Tue, 19 Aug 2025 18:41:19 -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 d_PY8Pzd2CMs; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650478; bh=f+jRJaW/lujFvdA+4MrE2EZGV8r6BTbje20isVhcoHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mZIX+DKnBCtJfZ/h+CVCi9CrNROvhZ9XANOqXBEOJO3/UKm7NO/0A7aW7WR+TbBHe 4QiFCDP2PEaW5B8aR7Q/JxuJPvv5zeC0TiDulilkRDEgRnJPEbyqSmkVorjEsk2Mbu leKEH6vySBsVAkb3DWALQDEEYqsXSlGcXo97i6ckl9BS25clJLip4DYKxsPYOUgv6s S1TxNBH4xpZuyWGX8KqsB/ipfK9c8+Z8zQsciyL+0O3qbFCYatJ+Uog0fwdghOFJJk ei330+swuUNxRY4B9rqPecWCBBDLHg5sv1sq2C2t6Ot/x5TsOUYMqtrU0kb5iBOzZr KLfdUkweNHC7g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 17DFD67650; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:22 -0600 Message-ID: <20250820004039.3920254-9-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: MMJVJTVEMNQX2QOYQHLWJEA3PDYA7LLE X-Message-ID-Hash: MMJVJTVEMNQX2QOYQHLWJEA3PDYA7LLE 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 08/18] efi: Move a few helper functions into the common efi/ dir 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 Checking if a variable is a load option is useful for the app, so move efi_varname_is_load_option() and u16_tohex() into a new helper.c file. Signed-off-by: Simon Glass --- lib/efi/Makefile | 1 + lib/efi/helper.c | 42 +++++++++++++++++++++++++++++++++++++ lib/efi_loader/efi_helper.c | 33 ----------------------------- 3 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 lib/efi/helper.c diff --git a/lib/efi/Makefile b/lib/efi/Makefile index 213c9910b39..a31caf1fce9 100644 --- a/lib/efi/Makefile +++ b/lib/efi/Makefile @@ -5,5 +5,6 @@ obj-y += basename.o obj-y += device_path.o +obj-y += helper.o obj-y += memory.o obj-y += run.o diff --git a/lib/efi/helper.c b/lib/efi/helper.c new file mode 100644 index 00000000000..34cf3f49f95 --- /dev/null +++ b/lib/efi/helper.c @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2020, Linaro Limited + */ + +#define LOG_CATEGORY LOGC_EFI + +#include +#include + +static int u16_tohex(u16 c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + + /* not hexadecimal */ + return -1; +} + +bool efi_varname_is_load_option(u16 *var_name16, int *index) +{ + int id, i, digit; + + if (memcmp(var_name16, u"Boot", 8)) + return false; + + for (id = 0, i = 0; i < 4; i++) { + digit = u16_tohex(var_name16[4 + i]); + if (digit < 0) + break; + id = (id << 4) + digit; + } + if (i == 4 && !var_name16[8]) { + if (index) + *index = id; + return true; + } + + return false; +} diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index 82e0fd7b069..56ea7d1c7d9 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -241,39 +241,6 @@ int efi_unlink_dev(efi_handle_t handle) return 0; } -static int u16_tohex(u16 c) -{ - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - - /* not hexadecimal */ - return -1; -} - -bool efi_varname_is_load_option(u16 *var_name16, int *index) -{ - int id, i, digit; - - if (memcmp(var_name16, u"Boot", 8)) - return false; - - for (id = 0, i = 0; i < 4; i++) { - digit = u16_tohex(var_name16[4 + i]); - if (digit < 0) - break; - id = (id << 4) + digit; - } - if (i == 4 && !var_name16[8]) { - if (index) - *index = id; - return true; - } - - return false; -} - /** * efi_next_variable_name() - get next variable name * From patchwork Wed Aug 20 00:40:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 47 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=1755650484; bh=5NnFcOsDHQT+qxz4826TWj6cdTgn7HkaKKiLCzq7Xs4=; 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=QZeUyRYz2WbXsmUPnOQixPW+AgOFy3ZavqKz1BryZ/3Nz0zcx/u6Jf4OQRIFNdAq1 tqca1/2xH/E3hi5IXFvMdqKjqwS+Wh+mM798G7eLinVm1ARas/ApJAbKI/uGvuGP4O AK8hgf14JvRBa04sK1rKj+limRWe3oJas+7qDGAetYE/ZNCEhhkyafGQKE+h+Mrek1 YH05/kxVxCcW5RQmWsjJAkbhyTNwfm8XWGCITSFyDoHnRqX1LHuiwHCXhldHu0XMju p94ISKl0T6STI9lIe8cIqojK5tigqM4KeLpr4FxL0/RxmMiSvXhjT96BcRJqVlzE/1 gi9uBu/S98NqA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0D95E67662 for ; Tue, 19 Aug 2025 18:41:24 -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 Kltds2epiuhY for ; Tue, 19 Aug 2025 18:41:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650483; bh=5NnFcOsDHQT+qxz4826TWj6cdTgn7HkaKKiLCzq7Xs4=; 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=u+o/aW2LBquXU84RxOJpJe4CpukCWam/bwOOcEgDrhaDj8U1oyUvqL5gcgaa7fPIw MUKvmB8KQN+1/yQF56xTYSwEf2bRdGBIDKOM2N4vI7eUyp0Ao7N//qTQbiUFVOJhjR ewvcSHMp7s41C9YwMnRrnovtLLG+DIw2uxs31E4jmU1EdXbzat+5SGs8OxMEOAkGeQ Kvs+m+HMsZQu6l9U0Ogscv6iKsC2cB6WZHlU87o4IiHJvCnfxmoTYHJPCUgOzcTS0R udpsgfoZSUqzXthBwOnQS+GWAXP77PdQ16sWHK4bctr8ROdSwN9ofK3BzmZlqnHubk a3OvYXQ2CrdPg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 24AEE67665 for ; Tue, 19 Aug 2025 18:41:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650480; bh=pbhPVfB1+d134sTqO+33RV5TtheN/E8DHdHuY05Sdeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sMZGxgIHdiWfcFeUZauDRMku9cUxZKtmhfOZGM9DQCX8AxJZ8C/o3XDICbzjmzg1U 6UXjhlZMxBoZ4xI/GGIZw+cXcbvDxtDJbS+0Xws+leGAbtEkdX54ZML5kYl2sFwaxa mvoGKfyM2YsVkJKTkXKjBoRi9PCEcZtQmL7y/NHDch/QjdPKD3SqHvt/lYQn5GkU2s QmXXzKF1oBXIOyVabVKMmgHqvNOOgO6yEUCIsPjTpBCIk9Qcm52qzEvXrCq13xErK0 o5Wq+5Wiel/OjFhgIUL7EENfLIG301n0asLbSRYOkh/QILGM3TRDRl2MLXB9PcShMo mPpXYEw7ncxdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19FEE675C0; Tue, 19 Aug 2025 18:41:20 -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 AJyHAxjXIizV; Tue, 19 Aug 2025 18:41:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650479; bh=S5VxVXWDYQFJcoBdORrn2EDLa1AWcCMyM6ghs7fYeN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V76WdVHqwrQNfPzf5sCcxNBv6oicOKIRm+xjwtnbOR/i8Wi0d+26LRc0r3fgerO0O cD9Us6qjVxPHHdvgBEgQyKJSz3O2aD0b3NM7NSqZDu/kEWoKcy9ZeSLGsiVduG2aO/ yd59aeW5JH3MCMSICrTS+ItWoGsobudY8bFdVcng8TMXVp+U3z/b0c0Q6W/aCE+tHb KaK6D9i3SnGMvsCos2SkB52s4NbyCZ+BV92lcxl88uMLAZXsrH2idTB9Ql2znOymVZ 3KcDHAH7P3yvxdOGPsF8faFHY1+GYfWHJw8goCDEUfIckgKlHWNwLC+tIyCyIrhid5 /7Cb/N/VGeYoA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EA7B867659; Tue, 19 Aug 2025 18:41:18 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:23 -0600 Message-ID: <20250820004039.3920254-10-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: S3RTB4PZP7S3U3K5UPESQEI4I5URUOLJ X-Message-ID-Hash: S3RTB4PZP7S3U3K5UPESQEI4I5URUOLJ 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 09/18] efi: Move some load-options handling into the common dir 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 These functions are useful for the app as well as the loader. For now, efi_set_load_options() calls efi_search_protocol() which is still in the loader, but we can provide an 'app' version when needed. It doesn't seem worth keeping that one function in a separate file. Signed-off-by: Simon Glass --- lib/efi/Makefile | 1 + lib/{efi_loader/efi_load_options.c => efi/load_options.c} | 0 lib/efi_loader/Makefile | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename lib/{efi_loader/efi_load_options.c => efi/load_options.c} (100%) diff --git a/lib/efi/Makefile b/lib/efi/Makefile index a31caf1fce9..9b65cbc0dc2 100644 --- a/lib/efi/Makefile +++ b/lib/efi/Makefile @@ -6,5 +6,6 @@ obj-y += basename.o obj-y += device_path.o obj-y += helper.o +obj-y += load_options.o obj-y += memory.o obj-y += run.o diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi/load_options.c similarity index 100% rename from lib/efi_loader/efi_load_options.c rename to lib/efi/load_options.c diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 3158fc6da68..2b232940bc3 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -38,7 +38,6 @@ obj-y += efi_fdt.o obj-y += efi_file.o obj-$(CONFIG_EFI_LOADER_HII) += efi_hii.o efi_hii_config.o obj-y += efi_image_loader.o -obj-y += efi_load_options.o obj-$(CONFIG_EFI_LOG) += efi_log.o obj-y += efi_memory.o obj-y += efi_root_node.o From patchwork Wed Aug 20 00:40:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 48 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=1755650488; bh=hQ3onlZZJHue1z+RWfPeOShGUu9dH0Uj9a9KJ5jkPm8=; 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=C2EWMJoEimxLoTB39MbIsIp6qrH5EusWWqQ2+tGL5ciWzM62HUq0GckY5Ayud7GwT q/DgiOFHVxRCy0Jk8C951V18NTxi8FH3SQMdAJgitUMl02G4gf0JYrRtiulNFVGncT AN/wB0ZJHf+/ENhO9dAgKtyH4W1mgfWoYcnl0FNulowW+qdzYU7A0PDGsHJ/1ReVxZ tslsRmF6E2JLJd0am/+CSyrC9nLrAVkhambqKBbSX8Z5Q13vctX79o10kim+WLa+uN A1TU1v6prX3hu7UuU/keOOWiaChLyius3jFccFgsaoXQlMO2GoaGdSA4mBpMMA/ie1 521d1MLh41Q2w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9AEA2675B8 for ; 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 10024) with ESMTP id qgZcpCuoONYS for ; 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=hQ3onlZZJHue1z+RWfPeOShGUu9dH0Uj9a9KJ5jkPm8=; 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=C2EWMJoEimxLoTB39MbIsIp6qrH5EusWWqQ2+tGL5ciWzM62HUq0GckY5Ayud7GwT q/DgiOFHVxRCy0Jk8C951V18NTxi8FH3SQMdAJgitUMl02G4gf0JYrRtiulNFVGncT AN/wB0ZJHf+/ENhO9dAgKtyH4W1mgfWoYcnl0FNulowW+qdzYU7A0PDGsHJ/1ReVxZ tslsRmF6E2JLJd0am/+CSyrC9nLrAVkhambqKBbSX8Z5Q13vctX79o10kim+WLa+uN A1TU1v6prX3hu7UuU/keOOWiaChLyius3jFccFgsaoXQlMO2GoaGdSA4mBpMMA/ie1 521d1MLh41Q2w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 752616765D for ; 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=1755650486; bh=EbVvyePPGft8bpiP/uAtvrs1NOh/HsgEce6seHVTJOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m1n4/XjhmmcUle2tTUJgMo158vk5GO7y3wUbJ9kxo+Kcj4Oj4xIWwQZC3gVjCK9Oh +2YmEkR9WOhItwWp/45YflXVDjd/CbP+UK/9oqoMQ1ZNpmekNAvN0zeCWvVkALe8z4 qGtjTQCCuZg2BP/h6THmwJ7JVUJ3tjgFHmdXlNTcOY9LUQKEjyx4UzUQlOE/qFRydn 0XSW0DaczPwuKwtwHtjScd6xd0nCeOfq3uGR04HoyH9Z4POkhBcjIDSihwFZtLJXG5 4ahGnnSGFco1wiWcHDOK5shZWtByB4027MNROgZenRONnsQIXCDCfPYma0u3fxI/Wc y1fIR2OW7uU5Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 530A7675C0; Tue, 19 Aug 2025 18:41: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 10026) with ESMTP id Wko2aiRfUT23; Tue, 19 Aug 2025 18:41:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650480; bh=qDjsJQlhz9fZ61kpLJDloi521kWWXBa3wIIvNXZxf40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JETTU3+m2t8vaKqYoqFue2eFeMEXLbpydLQ7FnVGcTi018J7M4bOZHUk1iDHBniLv lePsPzcxMWmGTyJC9vxq2i4OPvx3o3yCcd6WKA9poACWKNitvJFLE8ENvCNYsEGcOg 1+VrO3j9F9Do3D+qJDNEJJoxvBJK9eJYjoBHqs4DxONFkaQrqu8hlKpBRM2vmdiUNF cLgfzNQeVZKbju3bfIjXNJNFUcIjchUMl61C08D1dD0KBh4NK02ZtdWLB0aK5M/TkN TbvEVZrUrp7tbnQ38Yrkh0LF8Xo6dJwUKNkIq5/1CSHNP66ri9o7quiV+NGQrWUPEI ByCNDuhkEDCEQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E46026728E; Tue, 19 Aug 2025 18:41:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:24 -0600 Message-ID: <20250820004039.3920254-11-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: NPATU47EVJNDR6OFLGRYD5WDFGGNMRLF X-Message-ID-Hash: NPATU47EVJNDR6OFLGRYD5WDFGGNMRLF 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 10/18] efi: Move FDT and global-variable GUIDs to common files 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 The global-variable GUID is already set in the common device_path.c file but its declaration is only in the efi_loader header. Move it and also move over the FDT GUIDs. Signed-off-by: Simon Glass --- include/efi.h | 3 +++ include/efi_loader.h | 3 --- lib/efi/device_path.c | 2 ++ lib/efi_loader/efi_boottime.c | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/efi.h b/include/efi.h index 742c40bfd8c..ed22ff9a5a4 100644 --- a/include/efi.h +++ b/include/efi.h @@ -152,6 +152,9 @@ typedef struct efi_object *efi_handle_t; (c) & 0xff, ((c) >> 8) & 0xff, \ (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } } +extern const efi_guid_t efi_global_variable_guid; +extern const efi_guid_t efi_guid_fdt; + /* Generic EFI table header */ struct efi_table_hdr { u64 signature; diff --git a/include/efi_loader.h b/include/efi_loader.h index b57196da8da..c4d9c4f1c7c 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -317,7 +317,6 @@ extern const efi_guid_t efi_guid_host_dev; extern const efi_guid_t efi_block_io_guid; /* GUID of the EFI_SIMPLE_NETWORK_PROTOCOL */ extern const efi_guid_t efi_net_guid; -extern const efi_guid_t efi_global_variable_guid; extern const efi_guid_t efi_guid_console_control; extern const efi_guid_t efi_guid_device_path; /* GUID of the EFI system partition */ @@ -336,8 +335,6 @@ extern const efi_guid_t efi_guid_event_group_ready_to_boot; extern const efi_guid_t efi_guid_event_group_reset_system; /* event group return to efibootmgr */ extern const efi_guid_t efi_guid_event_group_return_to_efibootmgr; -/* GUID of the device tree table */ -extern const efi_guid_t efi_guid_fdt; extern const efi_guid_t efi_guid_loaded_image; extern const efi_guid_t efi_guid_loaded_image_device_path; extern const efi_guid_t efi_guid_device_path_to_text_protocol; diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index fb6653b23a3..db5a686ccb2 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -32,6 +32,8 @@ const efi_guid_t efi_simple_file_system_protocol_guid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; const efi_guid_t efi_file_info_guid = EFI_FILE_INFO_GUID; const efi_guid_t efi_u_boot_guid = U_BOOT_GUID; +/* GUID of the device tree table */ +const efi_guid_t efi_guid_fdt = EFI_FDT_GUID; /* template EFI_DP_END node: */ const struct efi_device_path EFI_DP_END = { diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 8ba42ec4544..0f9a654ca03 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -68,8 +68,6 @@ efi_status_t efi_uninstall_protocol /* 1 if inside U-Boot code, 0 if inside EFI payload code */ static int entry_count = 1; static int nesting_level; -/* GUID of the device tree table */ -const efi_guid_t efi_guid_fdt = EFI_FDT_GUID; /* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ const efi_guid_t efi_guid_driver_binding_protocol = EFI_DRIVER_BINDING_PROTOCOL_GUID; From patchwork Wed Aug 20 00:40: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: 49 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=1755650491; bh=T56m8dPjTHI2bXxgdEx4pjbU4DyQ/l9rzPsqXWhHo2I=; 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=kf1NLjel6ZYRXLFjzJcEuizUMGC5ButIRl0uW20cgif1QQ0/gsZTwlezd8fx7gFoF 98Gx7YXfbzg2U7Bf8//WG1CPFswzFgGIpEHDBRr6ZxbDh/T+yzuuBy6BmREs6fyyBj UchwTvKj+06GwmnbkLF01j+ITQUrxp+00dCHn5C3946QtLosvgWViB79GLlHgWPQaH xHTdgsdL5zPZb9BLoCi5tjYSEF2mqsN4KuHFHlL9gXsJz7K84pEggwkJ4edrJgzlHG Pi6oPmQvC+TV5wPsoWg1p6DYi6+z/D3PuyqDechZqP1HiUXlSsorGdJpXqM7yDJn63 E8PFga9ofHuMA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A4C7675C0 for ; Tue, 19 Aug 2025 18:41:31 -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 xuE00jNEjdMN 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=1755650489; bh=T56m8dPjTHI2bXxgdEx4pjbU4DyQ/l9rzPsqXWhHo2I=; 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=eSlFo5ipP5mX5flDd0zjve08BjhEbTpEoaXqJXuemWisjU7mo9VlrAhF5DuDfG0/L dCL8m2hDGbwB25zqawD1k3mdGoRc/UTY+ezqPItXBQyFypuAU47Bt3cI+hcs1iqe+F W7s5xRoEhNCVyQxn/SZTYT+iDwHM9EaDtknIQbkkLTqdOeUIm8A6H8Qb2x651Zf7/h xebxAzVBu140OQ67XA39gVmV6EYfYafyGT+57JggcipHOruoWH3eYK8Cl9r4/5g2jQ fvnZi4Ld5NBwQY2ur140N6BSA4zNRsxe/aS1bCPvNoaITA13JD32CfceBS1voyU27T yF+qX4d4okCyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 506496765F for ; Tue, 19 Aug 2025 18:41:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650486; bh=QarTifUHaafadFLq2e4UuMX1IlBYWnwQbQMkykCxGjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s8XN+w8An4OjZ9Tw3mLw+W2RgwLyV0yjxn31vOdw7lnBBto0GjPEw5EgsZuui1bei IWTd8I78OmZgXURFtrHEBE+Y4Bmjx0lgDrg+AhcSLqkWNxGGM4cG7FXRyNOsXPbF0U eNgHoJ/8OalkKAB4ZV0i4sE3dmN4f6eTN4t3KGcB2qndznPi0fTPLY2+qUCRVPYgZK DhbeosIJpg91dVU/6en2dUfb5sZLN08TF4PvsqzoiCheS9KW1EUtoomcFM03vZvmZv IvQHsf1dY1Qh5JQg0Fa6vQrUjW+ejH5IkFq2lLXG4uz/rluSnOd+Atd7WDNH8wLfgs 9tO4YjAO8FBVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 69F636728E; Tue, 19 Aug 2025 18:41: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 10026) with ESMTP id plFofeU37zYR; Tue, 19 Aug 2025 18:41:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650484; bh=U5bI96oGa2TXkNTpHiVr+nr0r3RWYoUlEShzoksTbnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cpev9YuBwAIaTf7bL64rZ5PPzR4m9LyXzpsdQfmdyRDOsrq05yg5B0GC7+0bMHPYt ELRQgsOo0gMJHTYEIbsym1mEX3YC8LyayjbEdUBbE5Gzvm7d0QfBiMEhsOyNUI/bKT rkU5UlWcpzju9uMxHd/bsWVym7/vCn2qGMDbr8LNgfKGGo7/A9XQ/NmzEB1MauuGHG niGm6JdSdXP9eCIs39zu+PBpa5XN/ned4ARIRM51jOfTSFU5RhRQxkrhhXsEPxErJk X/qbc46PW9lnftH5gJO5lRXYsjQvru6/N1xi45r1gQ5VKIS8CDOUtkqC5vv/52a1+q TZmMAWsCR4dVQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9319B675DE; Tue, 19 Aug 2025 18:41:24 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:25 -0600 Message-ID: <20250820004039.3920254-12-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: MV4OFIC22B34NUBY5TOG5P3WZG2FBQNX X-Message-ID-Hash: MV4OFIC22B34NUBY5TOG5P3WZG2FBQNX 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 11/18] efi: app: Implement efidebug boot dump 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 Seeing the boot order is useful in the app. Everything we need is present except an implementation of efi_query_variable_info_int(), so add that and enable 'efidebug boot dump'. Signed-off-by: Simon Glass --- cmd/efidebug.c | 6 ------ lib/efi_client/efi_vars.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 2f1fecf494a..a48e0de1208 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1234,9 +1234,6 @@ static int do_efi_boot_dump(struct cmd_tbl *cmdtp, int flag, efi_guid_t guid; efi_status_t ret; - if (app_not_supported("boot dump")) - return CMD_RET_FAILURE; - if (argc > 1) return CMD_RET_USAGE; @@ -1615,9 +1612,6 @@ static int do_efi_query_info(struct cmd_tbl *cmdtp, int flag, u64 max_variable_size; int i; - if (app_not_supported("query")) - return CMD_RET_FAILURE; - for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-bs")) attr |= EFI_VARIABLE_BOOTSERVICE_ACCESS; diff --git a/lib/efi_client/efi_vars.c b/lib/efi_client/efi_vars.c index e652ee3f243..4fc48b90d6c 100644 --- a/lib/efi_client/efi_vars.c +++ b/lib/efi_client/efi_vars.c @@ -39,3 +39,17 @@ efi_status_t efi_get_next_variable_name_int(efi_uintn_t *variable_name_size, return run->get_next_variable_name(variable_name_size, variable_name, vendor); } + +efi_status_t efi_query_variable_info_int(u32 attributes, + u64 *maximum_variable_storage_size, + u64 *remaining_variable_storage_size, + u64 *maximum_variable_size) +{ + struct efi_runtime_services *run = efi_get_run(); + + return run->query_variable_info(attributes, + maximum_variable_storage_size, + remaining_variable_storage_size, + maximum_variable_size); +} + From patchwork Wed Aug 20 00:40:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 50 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=1755650491; bh=3XwlsFFjouK3A4G3xCZe+oNFMm0es/LFScUZJJTXa0k=; 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=T1RviexRcSe85mCI5oHDtsdjEijtlf5inogyRXWMPJOrXOwgvdbA4N4loQOzev0TU hHw0wW+LD1Vh1n8K0m7R6A4ESnnt5BnD/ANNotKcNTaksRMSKl1WJEVwfc8cVlFpM6 aE2oKn+DG1dIEhs4k9UkX4UDiVxSJ16lMcyjEcObkeEWRy90KqaBHdEJK0jnqLSeur ffmxuklbl2wVCHKYwoZu3X6ufT1swj4CTG0KXyHBBzbMpp0wjbNLoOLRufIcyKHK8x RPWFs9tOv1jQ7ua1JGfZG6q2X9a6lVA9g4jKnazkwPhjIAeuldm4tFWoQhPts+ed2A S08rLNPsS0BBw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF02067662 for ; Tue, 19 Aug 2025 18:41:31 -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 mDd7IepjRw-9 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=1755650489; bh=3XwlsFFjouK3A4G3xCZe+oNFMm0es/LFScUZJJTXa0k=; 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=reBSv8zo/NlbTmnBf6mMNJTcy51pOqJjXtut1AGt+Xjo48dclYld2p5CHRjPL85XT zQWOFNu+EY744Cs4DyL4vA9B6Dn3yDgfZkQj24yY2GW4eBV+ITme/9g+dR3QWM20uA fpoxJdN0DmYOdh1SYCVsBCNYIe655ySYMNDEBB4H6g043bc0P7xXj4Cl6twaqfZnye UKGOTUW4O4Iy0DFOVSXq0KN/d6lLHbp8Bo3MgfCwBB62xEtCBtp20xp6k1XMRKVGKv 4HL1fwkI82swbiD81rgIjYh1tQnAetE0DFsY+smm9iTCn8eJGTWzyv9k9AVFsD51xk 0GjhvCihhPmug== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A561C67665 for ; Tue, 19 Aug 2025 18:41:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650487; bh=tWl1Pm6dxn8sCQKTTKlqKJi6wFjJtBBj7Vter9McWso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JpsX51p4yJgfjE1F3gp66ff3H016exLg2ctkXP4cNMIEqUt2SFK5dAzcZUrUCzY+P GEMY4VGMykpfX30THZXfXMOtCAGJYfrRcboevNkhCXofLv+2qoC9Wchi9uT0LhnfsM Gjtxb9l+Q+9fFuudvG9zXeIv0JXJGSFr6+sJyR2Dy1Bn4V2ILtSqQffMTuCYJNUIAU 4Za4mNpE0FdJyQYoiDvzsiiRZO9dZvLi07/yP33+sc8OqSPqNtxCA+fODqnBIQRYr5 1QbDlBqtTa09oQVwR/YDngmAKvhBemfv/yU7ho0QQ6vbZOJoLlXpNtSHUyjvmA0Z6h YNxEB8+l/03jg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 98184675C0; Tue, 19 Aug 2025 18:41:27 -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 mQ-B5wVO3eL0; Tue, 19 Aug 2025 18:41:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650486; bh=9pL1A2U02rNpGOss+W70HqrRGsazdgJ5eKVlPxBTV5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8mUZmbmwKLWENA4kJVaggdUuaGJWNcZUyMJnlR/w9gWK4U6j43WhwnTKe65d2PHC lZmhunVbdHZsy824iexH8FBct2XdijC27KvZg3XRppkp+D4caOPGqjrQLprb7CQUbw UWowl/dTQdV8LF5QPkJgvHh7PAe4lpcCmhG5i/MhNAsDcxBefcRMZq8qQyRdbIDsju cDINrgg4auaPDzMnY0XX6LPD1A2dvT0fezGlw9mvS5FBvRshcLf65LFIM0FoTA75f0 KJtQzmQswhYzrht0PfjrrHvZ3hVsmeFN4hcxqNMfJ9kaKh0qhTV7eldWeXby7+VQe9 OH18tuEq+06rg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9BF5A675B8; Tue, 19 Aug 2025 18:41:26 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:26 -0600 Message-ID: <20250820004039.3920254-13-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: FCCLRF6EQJQB22ZA6EVQ6WCVRIYQXQNE X-Message-ID-Hash: FCCLRF6EQJQB22ZA6EVQ6WCVRIYQXQNE 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 12/18] efi: app: Find the device-path-to-text protocol on startup 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 Some protocols are generally useful for the app and it makes sense to store these in the priv struct rather than requesting them each time they are needed. Add a new function which locates the device-path-to-text protocol and stores it. Signed-off-by: Simon Glass --- include/efi.h | 2 ++ lib/efi_client/efi_app.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/efi.h b/include/efi.h index ed22ff9a5a4..28c297d87db 100644 --- a/include/efi.h +++ b/include/efi.h @@ -471,6 +471,7 @@ static inline struct efi_mem_desc *efi_get_next_mem_desc( * allocate_pages() and free_pages() * @ram_base: Base address of RAM (size CONFIG_EFI_RAM_SIZE) * @image_data_type: Type of the loaded image (e.g. EFI_LOADER_CODE) + * @efi_dp_to_text: Pointer to the EFI_DEVICE_PATH protocol, or NULL if none * * @info: Header of the info list, holding info collected by the stub and passed * to U-Boot @@ -496,6 +497,7 @@ struct efi_priv { bool use_pool_for_malloc; unsigned long ram_base; unsigned int image_data_type; + struct efi_device_path_to_text_protocol *efi_dp_to_text; /* stub: */ struct efi_info_hdr *info; diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index df51c5a4de9..7c9c156e006 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -176,6 +176,14 @@ static void scan_tables(struct efi_system_table *sys_table) } } +static void find_protocols(struct efi_priv *priv) +{ + efi_guid_t guid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; + struct efi_boot_services *boot = priv->boot; + + boot->locate_protocol(&guid, NULL, (void **)&priv->efi_dp_to_text); +} + /** * efi_main() - Start an EFI image * @@ -211,6 +219,7 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, } scan_tables(priv->sys_table); + find_protocols(priv); /* * We could store the EFI memory map here, but it changes all the time, 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 From patchwork Wed Aug 20 00:40:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 52 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=1755650496; bh=roYmE17Zcw+XoC9JNcAC9bfWX0q7RssTLsw9zfcbTaY=; 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=S1yItoHuWmUYDUJvefk7Zy7aMjY/+6WrD/o82k8g4juO7+KGuZ4zqkTjphAxgfShK RIvf9dt2igtQdEzJGH8QfufPIyJYJwd9V5fUMBU9XTuvGHd89By1oeVC/UP793LTZ4 NGsTrUuKuX9OBSBNmQwCcJ/5wKYtIvXuO88sfVsbErxyrJyHvJTf5nam6anolI+KJV kSFYnYdNEwcpz/NeGmUq2PmEAmMwemrtBV5IVYNgopEDDyPAGxLQixNwrHZGTWQ+ZI hjgoo6WOqyJqhArWrjt5AymiKh7zog2KVrnh8Zcm7JldbyWQDuNF4w0fQwd7Yqcse7 O+J7ui7NZvOFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 379B9675C0 for ; Tue, 19 Aug 2025 18:41:36 -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 SfK8VAcLgg58 for ; Tue, 19 Aug 2025 18:41:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650496; bh=roYmE17Zcw+XoC9JNcAC9bfWX0q7RssTLsw9zfcbTaY=; 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=S1yItoHuWmUYDUJvefk7Zy7aMjY/+6WrD/o82k8g4juO7+KGuZ4zqkTjphAxgfShK RIvf9dt2igtQdEzJGH8QfufPIyJYJwd9V5fUMBU9XTuvGHd89By1oeVC/UP793LTZ4 NGsTrUuKuX9OBSBNmQwCcJ/5wKYtIvXuO88sfVsbErxyrJyHvJTf5nam6anolI+KJV kSFYnYdNEwcpz/NeGmUq2PmEAmMwemrtBV5IVYNgopEDDyPAGxLQixNwrHZGTWQ+ZI hjgoo6WOqyJqhArWrjt5AymiKh7zog2KVrnh8Zcm7JldbyWQDuNF4w0fQwd7Yqcse7 O+J7ui7NZvOFQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 267CF6728E for ; Tue, 19 Aug 2025 18:41:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650494; bh=vJB292NCi1/30lTUMW+j0XSREwwSdiystguK4zWs/Ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eDAtio2TYUHP83Q3glqlJKuu6i5s4rG9dpdm4koEhBShQobpCnLfEmml+sJRj9LdQ WN47chjF+SAVvp2GXGgnKU0bHesYt2xXRy/rkIfhlNAuY1ivZo2LsWwZnFUqL4NX7a cL5xM8LyMIN2L1DvG9+xEevd6/rqadRdZucSVPtvOjAvVKEHBaEWgrP+CgH8tK0vuh cJ19lh9vB5zjIQ32YwOg8HJ8U9qc7wlPTHp9eB3YxkD7XLhXQtGM/X8CsDVJRS+hZ7 1f8G18RH/6qq/AKcD5SPt1GqDzxdAWxy3+FFvhl2xdS7/GqnnHhjdTphphGNfJW1QY VQXs9bSysYXqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BF856675C0; Tue, 19 Aug 2025 18:41:34 -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 DEMHNV6HHGUI; Tue, 19 Aug 2025 18:41:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650489; bh=dqaqdTiSfbBa58/+FXEiWwz9QIfdbzHoVcoFsOnTjqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bQ3lvbwpWrFPPIOKfiShwa9T99uXya8detD1riS8LhQo0GYKJhND4rho8CPJKCT+R RkUdgWWREpjlOJqQAO7Z49pfl5j2LPsnLAOJHBK4Mlm5A5OsJEYADmWzhn11oWYSrH 0U00H9rjp1a02fLD1etuUU1YZmhwWI5EeprdiDREpgRAclXmStw46n0wv+0O1ZPYQc Nmxu7jHT3iGMa9dQ2FJVgR+gBS72yZBqYBOx6Qb+w4ypkcSaBsZoefR1g2lh2PxaoF UcsKGN9slEkmpbiWeMMG423wSU1FwRsRcy+AQq429pQpImvF6vsDicURoJR0B8Ya0w yVgiWduh9vERQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C16656765E; Tue, 19 Aug 2025 18:41:28 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:28 -0600 Message-ID: <20250820004039.3920254-15-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: NK742TBLBZQ3B76STW5NUA73IB6I4QFW X-Message-ID-Hash: NK742TBLBZQ3B76STW5NUA73IB6I4QFW 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 14/18] efi: Move efi_string utilities to the common directory 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 file contains some useful utility functions which are not specific to the EFI loader. Move them to lib/efi so they can be used by the app. Signed-off-by: Simon Glass --- lib/efi/Makefile | 1 + lib/{efi_loader/efi_string.c => efi/string.c} | 0 lib/efi_loader/Makefile | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename lib/{efi_loader/efi_string.c => efi/string.c} (100%) diff --git a/lib/efi/Makefile b/lib/efi/Makefile index 9b65cbc0dc2..842067dcab3 100644 --- a/lib/efi/Makefile +++ b/lib/efi/Makefile @@ -9,3 +9,4 @@ obj-y += helper.o obj-y += load_options.o obj-y += memory.o obj-y += run.o +obj-y += string.o diff --git a/lib/efi_loader/efi_string.c b/lib/efi/string.c similarity index 100% rename from lib/efi_loader/efi_string.c rename to lib/efi/string.c diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index 2b232940bc3..180b83d2fc5 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -43,7 +43,6 @@ obj-y += efi_memory.o obj-y += efi_root_node.o obj-y += efi_runtime.o obj-y += efi_setup.o -obj-y += efi_string.o obj-$(CONFIG_EFI_UNICODE_COLLATION_PROTOCOL2) += efi_unicode_collation.o obj-y += efi_var_common.o obj-y += efi_var_mem.o From patchwork Wed Aug 20 00:40:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 53 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=1755650498; bh=VaT8/GuHG7ndzI9LyerQcuPJGQvKYdbQWf36pipaofo=; 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=Uvi3X1TjUN1SSgJ/aI2POEWM2F3mO6rN5rt9Q39pzfn3LjxHq4R0TaT4D55XKGJ8+ +52PdeyL2dB1i/IgokQzk3wBZ6OXF7ZCH6ydF/j7TwOMXz74Tp/LVH8XzlIa0L5ZSy 8lKreOEM0DGGMEEG7CrfOpvac5Zf170u7s1p06fn7fyQMqV4AxHvpAU8kggRswco5s FUinK6BQwGUdpi4jaj8BnoDDK2kjHxZ2QV0DpvnqqbC3uzF05921731S+pB55s3rCS Q+dgSLmbvHgwbMdqBtPYyiFrfkY8cFZDxKnnhxzFk/dbhQUfGvv9pwD/pRlOutWaQH DAN7kLgbjTNZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 95051675EE for ; Tue, 19 Aug 2025 18:41:38 -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 A_QoYOoSgcN9 for ; Tue, 19 Aug 2025 18:41:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650496; bh=VaT8/GuHG7ndzI9LyerQcuPJGQvKYdbQWf36pipaofo=; 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=Ar01m1pstQH03dIJI+3lect8rAO5AzzW/cS2gI1YaZdI6+zfQ5ojfQQygiaflaely IktjWZrQm340lGYijNXO3bjjIv40hAW1Y9NOtZGaxsXZOi3NIwsYXeH8hdbYW9nBiE X/QZ9AKjVWYsNwPjW0+XK/NnOZykRjaIYNyo/XTnLbTGgQ0lE/xKdNDGrOcThkSEV+ tfhEi+GhXyNvf+Dpu8nW89Qbe3sTEwX1/nwAQ2sSalMGelXiH3ctQH6RfET6a6iFxi nyq5Ke0i+eQ0Qwc6UDeGYNnK5oibcpxNoKMlPI27mW2Sply+ojgrwzwqVnSN9U7KAm szM9BpVfSVjJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 911826765F for ; Tue, 19 Aug 2025 18:41:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650494; bh=bDF/M87EW15F8YhJJwKRYwDZqE2W5Sv+wWlaFvvxw2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=db8WOIxZxIy/3vy/hPpoKxP2We6fylUPqNgNaCN6us5WS9zz2QKfhL51sDKY830Bb Z+7GlkdmQ7UdJ2EPEckUXAc9plK9I7DNXh/bIicO+rYuYnO5EPoUfBtKXISV7KM9bu XNbFchYhvPUkoov5B/gV1sdlTytxbpOsIc1sw1bAr9d+skxXHVEESMEB7skhhSeR+E prAjZGG8zwG2qVcMxJlj2PmGptXBZyx9GnLgqUpAaQwC3iyy+9A4O15/kRBI7ABIP8 FnrfoizCcdT1bDCa3ddQLrBbmAy4yg59huJksAtZOd+5dEnmOuc/u2arDykX9bBPch UTB3NcD50E93w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BF844675B8; Tue, 19 Aug 2025 18:41:34 -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 9Y--jvD-qQ5u; Tue, 19 Aug 2025 18:41:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650489; bh=ZlX0fgRnHv+tJl6lmoMT+B2JILZq12z9ss0aOLnnsWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ocl2CG/7JrbWlzq1VgqRxiO1HuxVXoY5lu0JOJhwCOJT383TpQ+iqTpzw89FReyQJ rjwAdzvHJBIcZ90DwPDWdvxsq4NGbpMUiO8iySg3M0Bj9kTNfWbUFsxAjhs5gAMYdo liI6atiD/e14fYwpaCV09cmSwVQy76vpuh4sttVyjBJDcHo3M+6RTdIcZVLCBG1tbh OGvx40BZ7pJa8ZjCvmvCoOHUCvGB4uoLq5y5+jeIoNIXChh2nCS7zf9ZC9FKZGvdVd Onh81hW0D0u7Jz+dM91bwNGIxBtiqwOnXNGpIOZfDl6jMDgZ/NEj99H2xV2X0p/ekU TVx39KGq7xj3Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A487A6765D; Tue, 19 Aug 2025 18:41:29 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:29 -0600 Message-ID: <20250820004039.3920254-16-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: GP7MQA7Q5CZDYTGSBXQFS7P3E2BAELSK X-Message-ID-Hash: GP7MQA7Q5CZDYTGSBXQFS7P3E2BAELSK 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 15/18] efi: app: Use the same efi_free_pool() signature as loader 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 The app has a function of this name, but it does not return any value. Return success (always) so that we can use the same signature. Signed-off-by: Simon Glass --- include/efi.h | 8 ++++++++ include/efi_loader.h | 8 -------- lib/efi_client/efi.c | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/efi.h b/include/efi.h index 28c297d87db..54da1540d0b 100644 --- a/include/efi.h +++ b/include/efi.h @@ -662,6 +662,14 @@ void *efi_malloc(struct efi_priv *priv, int size, efi_status_t *retp); */ void efi_free(struct efi_priv *priv, void *ptr); +/** + * efi_free_pool() - free memory from pool + * + * @buffer: start of memory to be freed + * Return: status code + */ +efi_status_t efi_free_pool(void *buffer); + /** * efi_puts() - Write out a string to the EFI console * diff --git a/include/efi_loader.h b/include/efi_loader.h index c4d9c4f1c7c..2d5e8de0132 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -891,14 +891,6 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages); efi_status_t efi_allocate_pool(enum efi_memory_type pool_type, efi_uintn_t size, void **buffer); -/** - * efi_free_pool() - free memory from pool - * - * @buffer: start of memory to be freed - * Return: status code - */ -efi_status_t efi_free_pool(void *buffer); - /* Allocate and retrieve EFI memory map */ efi_status_t efi_get_memory_map_alloc(efi_uintn_t *map_size, struct efi_mem_desc **memory_map); diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index 739010e60e3..12a646a36b7 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -190,11 +190,13 @@ void *efi_alloc(size_t size) return efi_malloc(priv, size, &ret); } -void efi_free_pool(void *ptr) +efi_status_t efi_free_pool(void *ptr) { struct efi_priv *priv = efi_get_priv(); efi_free(priv, ptr); + + return 0; } /* helper for debug prints.. efi_free_pool() the result. */ From patchwork Wed Aug 20 00:40:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 54 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=1755650498; bh=o0R616c9H6p+pbY4K/Q2K81RK/+I6VSMAfQbqaHxJq4=; 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=cxElRtdpZ/erEAV2EVB4KiupKTmmRJUvBwZ9TyLYeHciipKThEujMsdbPH8RxE6VL 2LgT9jMtV4DQuPI4XkHVN51gzdcSBW/bYkF4KUe5Wdk81vFBZxOXvu1L5z8kN+Bgvb Bj8lo1+FD/Bt6UXrEfmzhYZ47jhilN1vRln5x5veOQJ55FJMhi1vkjmxd5v10UNwSP h37AOpotPIC4dMCYEdiR5Hq/5XeHMDKlIOx7EEYgEnd2aFbzW7UqCXIummEC01xQ6Z jqJMGLu09T8Fao44EUQZp8fSEqCrbAE5PnM7c5Tb3jUfz8jniemJdIywjQ5eYZlg5B 2GeiCyKEJk+1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D0BC467663 for ; Tue, 19 Aug 2025 18:41:38 -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 srrja1fqWjvf for ; Tue, 19 Aug 2025 18:41:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650496; bh=o0R616c9H6p+pbY4K/Q2K81RK/+I6VSMAfQbqaHxJq4=; 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=f47z7m8G55CteuG8XNaPfbP4VionCpWqn9BUAajp6sJnHXrcVrJO/yse/MmWEatCH d4gSdchcdlEUaISX5AHEQW7htgR7BnPX9ZmFFDFBeL8XCfXR3+W/dc7pJnDIG/O1gU P/CNg8YSOWRrjPBMRU0kDmKLH7bE+drWn44bITTV6/tmp2+7lD6UEwPJ9IUn+rpqEo s50NVwxHIXKETptJ534/SHMe5v7Gow/DJWRfeT5j8cZXIZea2sFtmmMo8u3ZNuLXhL aJcDVTmuF3OxbSEKTFCuW2hvuZaRwO0UXYqjBlOLVCbrqLRg2RJJp36okpHa7ALukn sfUo4S55mJANg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB567675C0 for ; Tue, 19 Aug 2025 18:41:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650496; bh=6nAJ/0gRFNAF6IKf0Bb/AIrnMHO4T/g+qatBPpdMueA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K8vidhX+IAKQotTwZ0i0t4Co2t3pg7k012Zt94BnDBFz3rOfsANtlQTU6WHUGsGbv U0lx2dUqtN6E1XW+E2np8F+mfVGZSm0ix5IKj3muNsNcqYAbhmPkG0qBlNquds9BVG COgT142ijC1klUtC/nemHF+qFuBreKXo8kQiBeL08A1SffHtOb5802NxUBu08QzMiR DK6cQtOKaeEUFGlQFBzM/mWReiFIR4uITavA9Flgf44O6nJe12wu7c1NBL4cr/IfSK N0GwqQEwtZ48pPkJf1zLo3RYl+DLXGFRyBe9t3kvfxucHQakBs9ZmKT9o8z6WdVWpV hM3u6gA+YBQQg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0B7FE67652; Tue, 19 Aug 2025 18:41:36 -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 a-XjitBcYpr1; Tue, 19 Aug 2025 18:41:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650494; bh=8PoKXDJzyFW7Z1L0zIWvijgz0ue903afSpMQtIdyrTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fI4j3JtNqb4zjq7RJ5YnIYH/YRKhX68kPDvfnWEK6ABkFHjCUeb5h+uTYUWe2y46h 1AjExjKtrf18WoBCkcfnXydcXYmMngL3bjSehu3TSLMohsqH0egydyZyCsd+SRKMMG E1//oxEXugcRncpgNaGiKYBGZiU5h1ifsvN736CSZkXu+wzyAv66uRK60cn7Cb/p73 TWLyPtTl6FkkawkCF+y/B7lCku8Y1k+nRacSURFs/ii1yLdSI2EcHcNEBsyctRk9w7 HRGmf25pLJQgu5GSfqgSDVtAmj0K1e8f4PEJA7KBczr5cmR7BAVeD8cr6OFHGQszTI QRvaRXlvXz3sw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4DA216728E; Tue, 19 Aug 2025 18:41:34 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:30 -0600 Message-ID: <20250820004039.3920254-17-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: VITRKXAYS4NFCGN7PHQ2DDHBNP4N4RF4 X-Message-ID-Hash: VITRKXAYS4NFCGN7PHQ2DDHBNP4N4RF4 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 16/18] efi: Move efi_load_option_dp_join() to a common file 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 function is useful in the app so move it to the common helper. Signed-off-by: Simon Glass --- lib/efi/helper.c | 46 +++++++++++++++++++++++++++++++++++++ lib/efi_loader/efi_helper.c | 44 ----------------------------------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/lib/efi/helper.c b/lib/efi/helper.c index 34cf3f49f95..85a2a270f20 100644 --- a/lib/efi/helper.c +++ b/lib/efi/helper.c @@ -5,6 +5,8 @@ #define LOG_CATEGORY LOGC_EFI +#include +#include #include #include @@ -40,3 +42,47 @@ bool efi_varname_is_load_option(u16 *var_name16, int *index) return false; } + +/** + * efi_load_option_dp_join() - join device-paths for load option + * + * @dp: in: binary device-path, out: joined device-path + * @dp_size: size of joined device-path + * @initrd_dp: initrd device-path or NULL + * @fdt_dp: device-tree device-path or NULL + * Return: status_code + */ +efi_status_t efi_load_option_dp_join(struct efi_device_path **dp, + size_t *dp_size, + struct efi_device_path *initrd_dp, + struct efi_device_path *fdt_dp) +{ + if (!dp) + return EFI_INVALID_PARAMETER; + + *dp_size = efi_dp_size(*dp); + + if (initrd_dp) { + struct efi_device_path *tmp_dp = *dp; + + *dp = efi_dp_concat(tmp_dp, initrd_dp, *dp_size); + efi_free_pool(tmp_dp); + if (!*dp) + return EFI_OUT_OF_RESOURCES; + *dp_size += efi_dp_size(initrd_dp) + sizeof(EFI_DP_END); + } + + if (fdt_dp) { + struct efi_device_path *tmp_dp = *dp; + + *dp = efi_dp_concat(tmp_dp, fdt_dp, *dp_size); + efi_free_pool(tmp_dp); + if (!*dp) + return EFI_OUT_OF_RESOURCES; + *dp_size += efi_dp_size(fdt_dp) + sizeof(EFI_DP_END); + } + + *dp_size += sizeof(EFI_DP_END); + + return EFI_SUCCESS; +} diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index 56ea7d1c7d9..3030e6f52d4 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -99,50 +99,6 @@ err: return file_path; } -/** - * efi_load_option_dp_join() - join device-paths for load option - * - * @dp: in: binary device-path, out: joined device-path - * @dp_size: size of joined device-path - * @initrd_dp: initrd device-path or NULL - * @fdt_dp: device-tree device-path or NULL - * Return: status_code - */ -efi_status_t efi_load_option_dp_join(struct efi_device_path **dp, - size_t *dp_size, - struct efi_device_path *initrd_dp, - struct efi_device_path *fdt_dp) -{ - if (!dp) - return EFI_INVALID_PARAMETER; - - *dp_size = efi_dp_size(*dp); - - if (initrd_dp) { - struct efi_device_path *tmp_dp = *dp; - - *dp = efi_dp_concat(tmp_dp, initrd_dp, *dp_size); - efi_free_pool(tmp_dp); - if (!*dp) - return EFI_OUT_OF_RESOURCES; - *dp_size += efi_dp_size(initrd_dp) + sizeof(EFI_DP_END); - } - - if (fdt_dp) { - struct efi_device_path *tmp_dp = *dp; - - *dp = efi_dp_concat(tmp_dp, fdt_dp, *dp_size); - efi_free_pool(tmp_dp); - if (!*dp) - return EFI_OUT_OF_RESOURCES; - *dp_size += efi_dp_size(fdt_dp) + sizeof(EFI_DP_END); - } - - *dp_size += sizeof(EFI_DP_END); - - return EFI_SUCCESS; -} - const struct guid_to_hash_map { efi_guid_t guid; const char algo[32]; From patchwork Wed Aug 20 00:40:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 55 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=1755650502; bh=G/feBUUZCichkD5qTt/vKw6U2aQTMqmb+g0AhM2QaCs=; 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=qAiLIdECmy72aUkpMbAned85C3wyfSyFFzvVRP5v4mi9P8mseAhJi6VIKWFFaP+e8 O23FZWp6cxrtpaMfJPd31ryuvYrY3b88rdpDlcpxfnNxgnJzDg9sr2YgG+bgLjMMqd XJQ8fJVHn/Q3hoxTNIwnZ+fdwDjB6h1xTyRAKsWnE7Rip2oaM41r7897hOy5jbPXEh yXxIOFEw5UH88X1R1KZUT+vnMhswsTpw0cH0VxpwK0e+B6OjQf4bMFHSxZ2Lxs5han go/83zuRF1nfgEHUfWqCSHCrMivmiBG3Is02P4halnTIO5eqsKfl7h8FZLn6Bv7ceY KheENHrfuQLcA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C4C66765A for ; Tue, 19 Aug 2025 18:41:42 -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 B08chH_NsPKT for ; Tue, 19 Aug 2025 18:41:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650502; bh=G/feBUUZCichkD5qTt/vKw6U2aQTMqmb+g0AhM2QaCs=; 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=qAiLIdECmy72aUkpMbAned85C3wyfSyFFzvVRP5v4mi9P8mseAhJi6VIKWFFaP+e8 O23FZWp6cxrtpaMfJPd31ryuvYrY3b88rdpDlcpxfnNxgnJzDg9sr2YgG+bgLjMMqd XJQ8fJVHn/Q3hoxTNIwnZ+fdwDjB6h1xTyRAKsWnE7Rip2oaM41r7897hOy5jbPXEh yXxIOFEw5UH88X1R1KZUT+vnMhswsTpw0cH0VxpwK0e+B6OjQf4bMFHSxZ2Lxs5han go/83zuRF1nfgEHUfWqCSHCrMivmiBG3Is02P4halnTIO5eqsKfl7h8FZLn6Bv7ceY KheENHrfuQLcA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4B6C267652 for ; Tue, 19 Aug 2025 18:41:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650500; bh=1X+mfUUIYGU6toMUrklFiGy7hZKPd2bv1Y7L+TlGQus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dLmPxHtLaG2+9nonF6hOBNU5CWiD6az/D3G5DsY+A42JfwSfP7JgxodVeAG1Qxvzb O9T2709uwRbbQPhLJZm6MgqrzpYwoaM0uHknkwya2xOADjhz/2PQJLwfu2vEkuQrWG 48xVy/gtHUk5MJz1617A/oLH0SNJO6PFy+KoAaJ5dyxNJu2mLCA9+HGahtKaCOKv53 zwz/86xoaGOSUQl7qkxKf56wS+nGaY3/BpP5oyL39leO0gV1tYs2hhpdqYLgAhoxgd gx8fWG2wjI/Ufdh0qN1QFVQ1VNI1xnpYSQo1TKFbN7n53rX23NvdQv/Ox1otIrcei7 wn58iKaTWgbOg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3417675C0; Tue, 19 Aug 2025 18:41:40 -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 ouHPOsmlbDTq; Tue, 19 Aug 2025 18:41:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650496; bh=RzyuhgD2NuQZ8jZSA+EQ8jAPAMtYuTAFRAzsuwbYRD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=erVpibe2Gb6ZV5Bt7nIi3/02yJHCGrcDB4Oqsk6MF2aotIG0wob/erW8JU+ckHvit 9fl64n4+lX4/rdv0j8OGrqTYgf1B0+h91JTMg2fWqudo7rwoS4aUSb1RPfbnhEBgoi iTaVwTUvm/bi6ra9AhdHTthEICK5qQ4btHPaVyk4ikdrSdYDJG2JL4junRpPR27QAK u9fVbf18sdxGAv3D/i0lDOlMFt6ZxvMn1NkYdIMbG9Ql/SxU1gJDLTV0XTwv/wph/I u+gMoJdfi5cN0zylualyLp+lXGaNz1SYXGxv/KtOucwXIq27EU6T5zc6HovHMFwal1 x+0eWUToM5Frg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 57F8F675B8; Tue, 19 Aug 2025 18:41:36 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:31 -0600 Message-ID: <20250820004039.3920254-18-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: AYLY7UZGZWKTEBPYQVJSEI4FXC7T77OP X-Message-ID-Hash: AYLY7UZGZWKTEBPYQVJSEI4FXC7T77OP 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 17/18] efi: app: Support efidebug boot add, rm and order 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 Enable these commands in the app, since the requires pieces are now in place. Signed-off-by: Simon Glass --- cmd/efidebug.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index a48e0de1208..7755585c778 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -922,9 +922,6 @@ static int do_efi_boot_add(struct cmd_tbl *cmdtp, int flag, efi_status_t ret; int r = CMD_RET_SUCCESS; - if (app_not_supported("boot add")) - return CMD_RET_FAILURE; - guid = efi_global_variable_guid; /* attributes */ @@ -1105,9 +1102,6 @@ static int do_efi_boot_rm(struct cmd_tbl *cmdtp, int flag, u16 var_name16[9]; efi_status_t ret; - if (app_not_supported("boot rm")) - return CMD_RET_FAILURE; - if (argc == 1) return CMD_RET_USAGE; @@ -1290,9 +1284,6 @@ static int show_efi_boot_order(void) struct efi_load_option lo; efi_status_t ret; - if (app_not_supported("show_boot_order")) - return CMD_RET_FAILURE; - size = 0; ret = efi_get_variable_int(u"BootOrder", &efi_global_variable_guid, NULL, &size, NULL, NULL); From patchwork Wed Aug 20 00:40:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 56 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=1755650505; bh=+5PW6caNWLrhD2IhqeHaJ/VncUPM7yUbAX+eTtPldh8=; 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=wZu9z1A/wCrt7HAC2N7yme/KYlBkLw48LVeU8n1eUePSo99Sx/RQzXuc8ZpBMvZvZ utx5WYapHCQWw0s3xq1EYlPNTmzttV4NRoosx/SNY+z6Fsn7RMvV/1zH8k1Ne97+nO wik6sunX+FIkIxSwhQzMqrhDC0yT26oYF7bpDJt0V8Lzmh4aj8z/XY6aCvdE2J9ypr mzQ0dBTPo6WVX66ZKLDrPzjlHw1R920IKl3s84Caf98JEDcp3p3PiuB99RzNarDBOA 5tQ9FS0h65Ovl8matG1JUOKUe2+XtDbzZNb/7PvLF2pOe5Bx9FHqsLuRpqKHo34kEv Ah+sALb++IKIg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C25A67659 for ; Tue, 19 Aug 2025 18:41:45 -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 gvg6y1IdiiAO for ; Tue, 19 Aug 2025 18:41:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650504; bh=+5PW6caNWLrhD2IhqeHaJ/VncUPM7yUbAX+eTtPldh8=; 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=ROhk1R/fSnMhy3CtQk9CfQMGRIS/KzJRhgmKPkMNIQtuNeCNHH2UjFGRxVek0yWpA bvssmK18baBZYfj3oz1VMBk01QOejBE/tLt+uX63BoqykGWeVVL8Nn/xi1bKS4SfSD hN0NW1znXTK41Zv6b+RWQNaNM+drxlGCgtXF7cH03PFx4N/6eQrPAUGmvxaHD2+dgb Gd0hkUIcVL79t84WpJlugpEXBZfMd/1l7EmoTzCEDMIMq5+AqXJEP7Uaw9JpBiGimB f1lzxpSQfsQt2N8+U2v0NNJo0mj8g9tW0C9FMPGzSuP5cbcJO7aMTfgPa2c+ttQVWQ 6l81gufmrf8Tg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE313675DE for ; Tue, 19 Aug 2025 18:41:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650502; bh=oymPt7wWZapbNt4fiZ/BLT0HwX5eP6dodRJlaCKhEIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vtnr3SLX2SaiodsXNmU/jMl5VzVzILFzZDg3KuLcexfqLQdPrqkHGNyxZLOkQkjwb djBQmDvSs4GjeW3TRiDyUDr2bqxnbcZvES53eYydFSHVfsrVDx/vke5XFlWgS5YmNU JtxfefhVw4rRm3VTW1Xs7S9JHo3KSGQWBjDs0FB305WMHkkN7718g/sJvwYZO4V4Zt Se2b87Zcqy+hJ8PURvPSZNMbi1BRqfqMSFnWGfjQGK4bWuaoRxpQ91ncqLfkKZUtsi GgVCsSR6kZUqMhOqe/436Bgfj7UDMbMXvjGwy+xYvyT5F/W0TXZKdFXuGUCOnMPlV3 Nb79yM1EfqbCA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A64446765D; Tue, 19 Aug 2025 18:41:42 -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 9HznwirYPWyl; Tue, 19 Aug 2025 18:41:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755650501; bh=Qg3pgFkbhcg0hwAo2wuw7p3Q9MymPfc95S2uVRJmCJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RBpvg2hWhZc4zF8L9Sv+/6M+p1mnBE2oqlbJQ6ZQiPOU/QghTXBGN3IQ0n+yF3gwc hYSz9F+EEcmGwiu0Qs+OBG7N0d+2m7iGwGFx17u7A9aqGk2LrMG8U9KAq+FE/FvbSV yYTsB+nRYNL3vI4z/ef1+49qA1I1JD0SYf9usyIiOpQemqPPspW6bnWHuREgIBvGHn kTyPnBig53GncqrJbSjh3QcRdwxQhsvCX6+COuMyGduI/vFZUXtGv1atexEUE3ph8U Fmm+0aFCvlz8JeIQwx2CnG8LlG9yWQEjGwGOPTkEqkdMaHL7Q4N01n7gL+YWVVjwPE lbl7h2Kmr4Y8A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id ED85A675B8; Tue, 19 Aug 2025 18:41:40 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 18:40:32 -0600 Message-ID: <20250820004039.3920254-19-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: 44GIITWQ2ARBKNUQM65XU7WMHIAXECSW X-Message-ID-Hash: 44GIITWQ2ARBKNUQM65XU7WMHIAXECSW 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 18/18] efi: doc: Add documentation for efidebug command 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 Mention the efidebug command specifically the EFI-app documentaion, to highlight its usefulness. Signed-off-by: Simon Glass --- doc/develop/uefi/u-boot_on_efi.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/develop/uefi/u-boot_on_efi.rst b/doc/develop/uefi/u-boot_on_efi.rst index d20d5b00ec6..387ace48f5b 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -143,6 +143,27 @@ enough) should be straightforward. Use the 'reset' command to get back to EFI. +EFI Debugging Commands +~~~~~~~~~~~~~~~~~~~~~~ +When running as an EFI application, U-Boot provides access to the 'efidebug' +command, which offers a subset of functionality useful for debugging and +inspecting the UEFI environment. This command allows you to: + +* Display memory maps with 'efidebug memmap' +* Show EFI system tables with 'efidebug show tables' +* Manage boot options with 'efidebug boot' subcommands: + + - dump - Display current boot options + - add - Add new boot options + - rm - Remove boot options + - order - Display boot order + +This command uses the EFI system table and runtime services to provide this +functionality, so it can help with understanding and debugging UEFI +environments. + +See the :doc:`/usage/cmd/efidebug` for more information. + EFI Payload ~~~~~~~~~~~ The payload approach is a different kettle of fish. It works by building