From patchwork Wed Aug 20 11:23:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 57 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=1755689048; bh=eMsow8NYEFPTkV4UkDUKbBp0wLcCtbOIqBmZ1gGl8Bk=; 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=AFm87SflhAJtXZw4AIMH9F4LVFbb2EaIsmUOJOihy6vtXfI+dhVq1tn2OG2apU6ut 5kbA3Ywf1y3tBv4svmwDEqOm/nH+mlvP+xNzMr7/z3WT+73buq1uEDbWMTzqUe+uvw nJzQWF2NKT3KtgQq5MA8EzGUwZqfFOehD2wsUkkW/byw8yfGF3z/xsBX/XHuQGOFr9 2XXowXNgXaXd7NLLHCNU9/VgA7cu1IUX2IoiTnvgdK5hodpCGc0N1Orx6c0dlzf9BB kF0Nw4NVGDtvsDb+ceDcZ6Mfp9cHeEC1i5Xw0Hu4awEdr4MtARGBN0U4z8YhJaH4kU MHgm730LxKX2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C079674AF for ; Wed, 20 Aug 2025 05:24: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 10024) with ESMTP id LbQykQkq3PKo for ; Wed, 20 Aug 2025 05:24:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689048; bh=eMsow8NYEFPTkV4UkDUKbBp0wLcCtbOIqBmZ1gGl8Bk=; 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=AFm87SflhAJtXZw4AIMH9F4LVFbb2EaIsmUOJOihy6vtXfI+dhVq1tn2OG2apU6ut 5kbA3Ywf1y3tBv4svmwDEqOm/nH+mlvP+xNzMr7/z3WT+73buq1uEDbWMTzqUe+uvw nJzQWF2NKT3KtgQq5MA8EzGUwZqfFOehD2wsUkkW/byw8yfGF3z/xsBX/XHuQGOFr9 2XXowXNgXaXd7NLLHCNU9/VgA7cu1IUX2IoiTnvgdK5hodpCGc0N1Orx6c0dlzf9BB kF0Nw4NVGDtvsDb+ceDcZ6Mfp9cHeEC1i5Xw0Hu4awEdr4MtARGBN0U4z8YhJaH4kU MHgm730LxKX2g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4BF95674B4 for ; Wed, 20 Aug 2025 05:24:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=CdXToqTdz3d/ir4GZ735iQau/Y6bjrmDXCcSY4QCORo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qjdo9zceY5zgyvKYndIOmjKLkIod9nlLO3o3O29jawvbtsw7uoDBXEyltWyElJT8N 23yN2RA+tyCmhnGnSsNzJTlSpHdReHE4MKqUi8NgyZXkWNDdkvtugys0WgfgTlePZg 5OnIYtRMzqH3DV3xerxbUbM/FYNdwHlkHpII0gOug3nK9OSLwQk6W3XUANqETsOuao epgViaxeg+xzG4zq5f0Qyw3wxZE4+S1/LzjHNfP8idgNSKQMl493Fn6b08V+QgFlG+ ucpcrGK9OxUAOqHIOw7/Aw88Z+rT4mld0iBEj9PZX2isPfC3VONtygZyoFK06I6GYc PhBCqyqXPejPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A9EE67669; Wed, 20 Aug 2025 05:24:07 -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 OBq0a1Qj4BWv; Wed, 20 Aug 2025 05:24:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689045; bh=IwKaVw/LRVW9nXrmRmP8cXAjB+AwX0JsAJLUraq/M54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dfsq4DKFlxOBI7josjDc3x+ZoS8hODvg60Wo4lT7Hno20zeDzRfBykMJijxAeVh7s 4yuqbZ5ByuVKZbut/G2QjCx/dDVC8xlcKkclPPA2YL/qHooP9JqyeB9SvbYbO8HVxv q3gPBtgc61hLwzAL5cptpnGuaiFHBqn9Ew1x8OnKrOw+VswHa477DIETNpM+FQIEmu 7Z3b9LyHEE0qZYN9EDzJynfaYLQoXVpKzW02wa7W4ngrv2aEBcJqaklixVIXPBTdii qy0/XAcU1vXaNI/CM3fU8QhHtHvH0tV4XXrxSSUNSeH+Kn0YOygIxEGjJzGq3oN7Bg TN1Ftq7ZIUKjQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 669FF67671; Wed, 20 Aug 2025 05:24:05 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:13 -0600 Message-ID: <20250820112340.147082-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PXGLWGBZRLCKBL4Y5VMOZSB2EYSHUKAY X-Message-ID-Hash: PXGLWGBZRLCKBL4Y5VMOZSB2EYSHUKAY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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()") --- (no changes since v1) 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 11:23:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 58 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=1755689049; bh=OoQGryiJ/Y8/qsEoGoROluBMdVYWj9hJb+PdANjjkiQ=; 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=hOykyv/zB5vBvxSZ90bWK9aATtOe/Q7IQZssJCci6eLd2u4w6qgzcBw71TuabVPiz 9JKAgYMGZI8Ss4YS5Uu8SLaFD73HEl9bwx2N3n4Cp5IEWqjpopLGwBrQXZ4t+G2lfc CXhUTMIseVJDv5vYLRtRLQI1gmZD1BwMpJNTlaen5i5Mj2fOxJkosUH1OD3PbBvNem 91ylMsD8JLoM1meSTZu9d8h8r5eOwwPX2HFAdRyd5I15EzMLd5VRyAWOlp/ccru3Mu s0zghf9H0dh1E93hh03GOGrfefNxyvBsJI2z9n0Z7gH1dEJFDlm6B4fUKcdq1nQXLw HwsEA9FMERhFA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B193B67676 for ; Wed, 20 Aug 2025 05:24: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 qAcK1xlRHHsy for ; Wed, 20 Aug 2025 05:24:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689049; bh=OoQGryiJ/Y8/qsEoGoROluBMdVYWj9hJb+PdANjjkiQ=; 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=hOykyv/zB5vBvxSZ90bWK9aATtOe/Q7IQZssJCci6eLd2u4w6qgzcBw71TuabVPiz 9JKAgYMGZI8Ss4YS5Uu8SLaFD73HEl9bwx2N3n4Cp5IEWqjpopLGwBrQXZ4t+G2lfc CXhUTMIseVJDv5vYLRtRLQI1gmZD1BwMpJNTlaen5i5Mj2fOxJkosUH1OD3PbBvNem 91ylMsD8JLoM1meSTZu9d8h8r5eOwwPX2HFAdRyd5I15EzMLd5VRyAWOlp/ccru3Mu s0zghf9H0dh1E93hh03GOGrfefNxyvBsJI2z9n0Z7gH1dEJFDlm6B4fUKcdq1nQXLw HwsEA9FMERhFA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7EE806765F for ; Wed, 20 Aug 2025 05:24:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=NzsOpWph3wlv9rFkENoaeH0XxI+0r810lnnqJUkrPEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tUEB3J6wCl+PTz5G+fb5xpqwdjqdDrUCo6m6uIwsUQgnEG4MfEDGuS0JgVeRLk5DI o7cbDX4UzP/x795wLiY59ksTN2AnXSLJ1M3zET+VJtMHQXSaPI1hv7QbwcSdAghw7m fbrKtzW9nrQzkbzzlQRecSMHGbtoYFZnxBrr1ent6gD+S3I8J74pA5prxZutGO+M1P SRZ3JVolxm0yD+6oP0AdyIfIOVuaFX6hUb2wfh24QIA9wmmD6zMDCouVJh0QJiKnAr mpZTCqcITdnurDIDGwsQOc9km945yBit2Am1shTY/7rJeyr6m/0e4Eh7YGPq7gmh0q sTmsLE0TvwX+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4BC856766B; Wed, 20 Aug 2025 05:24:07 -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 vHRUtqepRTaU; Wed, 20 Aug 2025 05:24:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689046; bh=yoO8CZ4thglsj3cw0V/lEo5zra2yZWPNYKtZO1NR3XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9hSGYbVzMY4aVi8P8qGqYYMJN4gDtq9odk7WY1ANK4C2KSL7zIE5TvPiCOTQb0II TB9JKNB3e08bGoxBPlmrFr04ZmemofK2Bw4my1d41iYdltQkTZ3ENVUbK1NUxnrBvb fd3nXxr4jfojWYwYbv2ds/WM96uZrAZm/aNCdGeBGr9AjSjE+w7kPP6kb4ST8SiTz6 7qkpzZ5Kkan7kXuwOeVpyIzAV33yiWUbY3HQaMPK+1lqHgRzTTVnChH7otu28itdpH eVClyH0NNpYlCsPMxmlMoDp7Houn32M53lWZEqey4eNtMW/lua+tmoNP5YH/PDyGs3 7LRh3YTYrtWRA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3DD616744B; Wed, 20 Aug 2025 05:24:06 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:14 -0600 Message-ID: <20250820112340.147082-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TSE7KB4DI53LTKCQGV2ICF4TMBAQMLRU X-Message-ID-Hash: TSE7KB4DI53LTKCQGV2ICF4TMBAQMLRU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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") --- (no changes since v1) 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 11:23: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: 59 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=1755689051; bh=P0QHDu8b7ldjK7VoUNvESk4Gf9QeEVOqsNjKZsEykGc=; 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=qJezZtY31yURFWwgjT2XhRz3NDeQuMmG/dMrck2McUYNwA3Ks7qrNZP2pNmtB93d2 7T0JBAiLJj+idUKcKRZuW+ZNvvwG9qU4qxJYy0/XT+A5rcIPoCJPYQpaHyH5rRtTYm jpI6h0fWNcnA5zhubmezArYTuW3XPXuHJ7j+44uak8oHaH7uRdG17Rm8myjFtp9rZS 52J5LW8eAvy7puBA95OmVRvQ3PPTyMSNooSu+WblPU5tStfSW3P7BJFXXf8Ty2jK30 k+j9+CwzWVbQtt2UXNdDDMXR4LY78Y8cOhIGwiwGCXHR0JVTK+pUa7O6cTyRJ3LBan OtzQSrU76S5Zg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 600916768B for ; Wed, 20 Aug 2025 05:24: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 vUe-X_8lFKl8 for ; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689050; bh=P0QHDu8b7ldjK7VoUNvESk4Gf9QeEVOqsNjKZsEykGc=; 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=W2oYktaCxKb7iK9hczFHoRsT7SgikkDoPTnKIztUusstv9fuImosoQW7oy46hF+Ti lDwlKMHPQfKoUsd6EQpiIGr6F/RaJj1sVE/zRcT2pkAasNVStXDNXaAaKOdlXNcVaf fDON7NPjpzEFLDFVzsbq92cVo0/bsiPNgYalxmvk2nFxDQgmM+QvpdVudO65qRe7tP IiPX1Ypu1R/v4Oq6DJ138iO6yM7EyrXxZVTzqg4GdfrPi2ljHfA87Q0HWT3eCEbmBZ 2GF/BhhrhIWgrnrJB8v0xrGjrSjORTKIA86d1QCcaqeNbhtNiA4nsSyFPCBR5MNTGo ToqaEWJv49HcQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 133086765F for ; Wed, 20 Aug 2025 05:24:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=BYsYss3COU9kdIFx6Ov/dHEqrgke2HqEbR37LxYmoDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ng3b2Svo6PTtEUThoPtMcz/M/gYl2ZjpxlOjlbvF/M/7DbF4l/p5QBaSbQe/HyKMH m0AF5yIHCb49dd4zTkOr/REHFSsi5o+Q/kDqjfhi8lZ1Mw1u7wEDlc8ucdOLLK+hsW ILt4jaqjWNi9tcLQU6uMHQs2erTMI7MmKMak0eJqWybaOrKKjRuNBR7r9P+MKskyfV j0xGOnHNmJt5a3xkhzFTBWAAMgVyLn9+VgFNIYnh32qFY4f4lTIrpzrWp5/oVpdxEd 75JGDcZ+uRz6bWxigONSb8sJVWEsp+ci+QVBErWic6+seaImKDEhvm8Y9L68sjTmmk RFhKX5wbT4MMQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 839056744B; Wed, 20 Aug 2025 05:24:07 -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 p8NAS9adZuzd; Wed, 20 Aug 2025 05:24:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689047; bh=qVRx+ATiMIxH4AevfUqidg7Ec4kKdacS9Y+glWFJn58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AA2kVJ7vqe6EWM+XypfCTIIJwx2pdmc0GJRBff7bLtd2pMofSiPYDkzCruQd/ALTX NxJvSw41owwFhCY6HcTtIuMHVvD7hOXpHn9+MMlcNJP3++ufj0j83oVLwJ/S3Wqwlh gCH+F6yU0LYzhVXx5RLZPI/8mk9ObZ+emZFaUFijSYqaaS04vT3vE25kZs2Xa2ArZp WDRHRQbjPPLF9VmawOGqHl+lVNdRUXz6krYWaTmoJi7miBYw7XDzR9avbwvx03JT1U bYkUjSJ3GXC9FgPOKMz5UZKfZPppg/cgf8Mv0v3plVPR70buq9eHKxXHw3b/svzJ5N eajpJRjCO2CvA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0C5EA67666; Wed, 20 Aug 2025 05:24:06 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:15 -0600 Message-ID: <20250820112340.147082-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 66QYTNDWG43NZXU7HRN4R5YAAMT2ZAPU X-Message-ID-Hash: 66QYTNDWG43NZXU7HRN4R5YAAMT2ZAPU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 60 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=1755689051; bh=ViA8i3e6yv+F7zYiAK4g9mc/6C5WcFNoVrVuQidqnD4=; 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=uVjxLOe7+yG143BfKJH1DNJMl/I6cPFZxZxVzUQ0JHBp/sBnITtL85pVaLPC8jZEl tTBK45mGJkzz9CqwQ+V49xpiVRQmT8Eyx55KxCtEGWR+K+aSVf27yi/vTfE0HnoGAW /mCIxUed3dFSXfiMkRHA+PxVYrF8oBkpP3ZconfSGiZxAIsn2PidXFdH+fdK8ZST3v SAZHuQgj0VXW1qK96BL7TzM0tzwKjEsJMuHJTRRYmFXrnbUuMui91ltsPfaqwKJctG OBf9dNw8bhoB3XrYEC6jxztkbGrJMgeUA4h38X8VBpezVPIgeGHym7hVhw3/l4nTLh 4jtjXVbQqtlDw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AE696767F for ; Wed, 20 Aug 2025 05:24: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 BK8kN_raIOhw for ; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689050; bh=ViA8i3e6yv+F7zYiAK4g9mc/6C5WcFNoVrVuQidqnD4=; 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=SodMUKDZR0+k/207hcUuUzak3JGONbC50uWPxt1E7puPJFjlzFh6rs/cUb9N2h5vG HPBzsLJJn1phva7wpzRbYWifvgHS6yOOyVKfxy/f81uhRh8hEUzrX9DCEcbxw6ySHL zGg2gje2KJBRbVNs55Fn2OYWIv1fJsEFn2xQOWSdQCbGMDvXroRoiwTh0aIEx8MhTd Hlej2tQk6sFwgmduusXTtzCWCnUr4L3banWeDIZmWaFnBXDGm7uXDqj02N9zGib4u9 Hsu5nI9AYeVc4eEaK1R0mq11z5/znr14ejI11LYzPcvVIvVMb/6WUo+edVJ4VP+Y2Q Rp/rSzO7zhQkA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F66667676 for ; Wed, 20 Aug 2025 05:24:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689048; bh=gSUtWh3IB25etTvCL2+mTkqxujRTc7xbbDd70VzqM4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAjoGSFK8XW4LQtOxxH7R9UboWeNNC6LV4vbCNe3Q/oF8BRmYAsSWBg9YyvMANO57 cLK0Nln/KqKQxYIFur+55YqC07ZjlTed71FgJTJYR792uhBwBJQjLB6ZMKfPxUCARn AHMbJUq8itLa4AQGDLR8KY0zz/Mnrq8867xC25/m81TQ5dW37GHjMuJR2KS2y0e8wd ELYNbcJk1QW5xtZI0hCapiGXcRm5qf7h0UYA4i0lszlB6WGzWbbefrs4cm8La6Oy6H Tq3TBK/1iiMSHRnGjIX4MTIv9XlspoM1fxKCON7avhkbP93U0yaKC8fVYhD/62qUP3 Sy17FhmPVpkeg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 72DBA67678; Wed, 20 Aug 2025 05:24: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 0CFGkuc0LD2d; Wed, 20 Aug 2025 05:24:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689048; bh=z5PwpIZCM+lW3eoEETIpzSU7CU7gMPeou8hPZ5ByHBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=htuahupgpaAEMBe+DbukGCDkn2RBxSU5vih75PZ1F9VjiAIlKBomDysJUo9SWVAFX 96lxgmI7k20IWwEH6n2JAZFtxin0d7BB4PkUw5XbOVx3htSXt2Hp/jkbKSADjkApJD KOx5jI0C9sSwpDRFMpH2H5B/Q4MmBTJt/Nw0CpN096Fbf987prngnBrQeLEwJzvai7 /q9R6eVwmDanS/8MqqHH+xJDYJc0zrU9zh+6t6LwXGAThcyKgwiiMMadUtr9sF+62C UxOg2BbaoU4wZ2dFxH9/cYHwb9fU1veKX/50AGdab+aax8XZto9rQH9UOP++Rb4NrJ 88/yJpfLhcLvQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CB6B367666; Wed, 20 Aug 2025 05:24:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:16 -0600 Message-ID: <20250820112340.147082-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UZ3M7N6HI7OBAV5XONPCKCIRBJZG74S5 X-Message-ID-Hash: UZ3M7N6HI7OBAV5XONPCKCIRBJZG74S5 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 61 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=1755689051; bh=MTIQmhHQbgnXC1NHV9dxxvsEDD9FP8BPCi9hJtGrmsc=; 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=Dy4Wsb60QNZI5UDZFxPWk6UOS0I/a4igphdW2dS/cD3Lrc80E1BCCbRq3zkj/p8Rp 9OCEUcSrjue5o80qJzhtbnyjd4faKrRs9PZT4NkktbuSuPzKjqIyDkpgq9sjA224q8 rGHLPFyrp3o4puAc901p4GIunPCt3mL6MVvF3sTLKHbRJWpoWhk/2fpkibODRSGb7g /zvRym3fqb0E6kBVxK6f/SiMnk40+jxAC9O+Vcpm6AdGisqg+XTeAMoGAPyR8HJFak 64BD2ugqMjbB/N1x3VBvPVQ3dL5XmWfOhQC+pbAkCf0pacx6nzDPaFhsDI8T7HA3jK jaDga4Gp4iYBg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CAF4E67680 for ; Wed, 20 Aug 2025 05:24: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 BDOC2uJvlIbR for ; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689051; bh=MTIQmhHQbgnXC1NHV9dxxvsEDD9FP8BPCi9hJtGrmsc=; 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=Dy4Wsb60QNZI5UDZFxPWk6UOS0I/a4igphdW2dS/cD3Lrc80E1BCCbRq3zkj/p8Rp 9OCEUcSrjue5o80qJzhtbnyjd4faKrRs9PZT4NkktbuSuPzKjqIyDkpgq9sjA224q8 rGHLPFyrp3o4puAc901p4GIunPCt3mL6MVvF3sTLKHbRJWpoWhk/2fpkibODRSGb7g /zvRym3fqb0E6kBVxK6f/SiMnk40+jxAC9O+Vcpm6AdGisqg+XTeAMoGAPyR8HJFak 64BD2ugqMjbB/N1x3VBvPVQ3dL5XmWfOhQC+pbAkCf0pacx6nzDPaFhsDI8T7HA3jK jaDga4Gp4iYBg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 06E1967685 for ; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689049; bh=18DHpggzn7N2R8vNk5zms/N8G23hLUtP7zR/SlrrJy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uasQxcE8Nz/JfhuABlw6Ol/fRYlil0MExKx7jXOV1vaUPZkYmMm417p5NoIVzkZWu jw8eQRdhPXOz8f3dkULu20EhqzT1Vn66fpTnUTa8nwFdAAqsTYb8B1QF4l4mLAAP7Z rzNmIhrP/N2O/D0fL7xN0wlSBCbZ9Ay9mONw/y/rU1Kj+uV/jc3/xOAvRXvQ+r3ea5 6XIGgjrUCWwMcn3DQybW98jz5jAYFTu2M0iJYdz3myE1L+Jt2YL8TqFUKOoux/5eV2 VnliUrMt8cV5P9Kgpd2REF+YTTOndX+N53rEquMRY+oLiKcTydFqT5m1fY0itesUIC yrai3t3A7U7JA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 708F5674AF; Wed, 20 Aug 2025 05:24: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 SG3HGPJnBMdy; Wed, 20 Aug 2025 05:24:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689049; bh=z9Qwoarp0iJqrSvaT3cA40YPEEq0WPijVbEShKzzNEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnAQLQVxsa8OME0bfq+e++0/a10AHwD2ahVfNs+YFPc4k+z9I6QqFm/hIUZ3RvXzD h2dQb4n5eCpxHG+fLcSpsCSEodookIFtMDByx4E7dkIw48SkK+upz20jHT7lLbIDi6 KdKNPtVwuztN1P1Bt9AaoCplQ9rVOrAL5dBwq4wjY2g/viviDxXSibhX8UEf88uW5r o/A/O5Biqfhkl36OfdNhlYOtoTxTxPJIOfUVS+TlRGfhAefTnYN5IcZI0xc/GLrbCT 9U4W69W4MW5eYZYCbhjcZVr4wQtWxTuMg+ESoZaU72dOxdzvWwVZLqrDZg2qZW8NPD yzKtmdP7FJxJg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AEEC7674B4; Wed, 20 Aug 2025 05:24:08 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:17 -0600 Message-ID: <20250820112340.147082-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UA6THOQF3LWPH4G27DHZ3MUT7VFFNOXW X-Message-ID-Hash: UA6THOQF3LWPH4G27DHZ3MUT7VFFNOXW X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 62 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=1755689056; bh=jVFFYv0IQG+d0xjZmQ05D1s92tleAwNnQCul5AUO+pA=; 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=eBYJ9GJCKAfljzqQFLFB1N48L990AjwTZ7FFlj4c+ygHdPgC95EwwXKqnh9fOmZpf KjeK0Ew/ijm67NpiKZr9Q7Sdt/9wePDjqPp7wRwu634/PPvMuoGeVncXyUibVC0VD2 IuOtr0f7glRl7Kxz/OMisBuWLn5o2t0YORT/KIQg9sy1O/nvODijBTbaT2SgyynT9Z 4HqMKknWNerxAi/7Nf+flalXFQMFFCDkcEDCYgUa2MwtLHRvtGH8J+nzEJu295K4n0 Uup+f9TH8LWl9QkjDrfjnff528GrVTVM1mdYn0Rn3j+kU0IomKWlz/tTwRqn0sxF+g SgbvkhrhIhfcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 767E96767F for ; Wed, 20 Aug 2025 05:24: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 gDbI8dlVyLiC for ; Wed, 20 Aug 2025 05:24:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689053; bh=jVFFYv0IQG+d0xjZmQ05D1s92tleAwNnQCul5AUO+pA=; 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=BmDN/ZLGVci2DAuetlCHPvBs9RUcrPnCYHWAAiID+D3O1wIOOuTujig4hZcplPro3 anFXMU2T1ZbvTaKdmwCJ+eQHXZJ+T2mfqMophzBN+GWXsqeUMKap/qy3PTuAmAA7vq U0agwNRPR1esdyZ2QAPePRkWplxjyWJKNx5v8wHioejiyYnhIr9+ZNAR6Nk3dBOQOz Ng7bauM7DUvg49R6wKBJXJzPJjF4Z9YNlRP6QnMcKzZBn1HMWF81/EeQltm/MaoFSd UF4r0NGbishbAxUcaX3WEo9KqODm+EauCm+Xj7P2uTi/SP/2Br36o5VV11D5ehQ7y4 0f3iocyBf2Efw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 682D9675EE for ; Wed, 20 Aug 2025 05:24:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689051; bh=SOYyCe+suLq/vXiUQ4hCZMwK0O3JsJT10/Vfjnddct0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cVKx1X2+kOW+j90wEgQKmVQDsubT+wG8Vxot00iDxnvVZa9lxutCkhoKNc38DEB38 DlVzpllIWPYULiAcWLZO8LHbN0+kuqJQnMz3R4lEJBuD1et7CJoKjbGrBdkbro63JT emHcCFR9iTVqbZ4a6kwTS0ZpEkbFLPnW6hczt1bcDjx6ELxt8+ZgFyIT8Til8r3gKL 80THV9IuqtZ+Ul66AkAatNuNjXLAfPCA7GsN7imW/1Ybcur3O2w6XlXo+STpFfOS/0 DOm8xDIRgQ75YWowp1uFg1oPnWDnVUyelbwaGYSLsYjSzTX1E1yQ6YxZI41vrD8IER RHVGZIvOdSsmw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E2826768A; Wed, 20 Aug 2025 05:24: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 10026) with ESMTP id jyy6QrVcXbPx; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689050; bh=bXWs6JiCMcNr52qnJ0GzMHdyU2SLIc5IyjtXPlI9cCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkSNftzpqd4to4JSLEi7y3kgK5/mvaZZdDjbc/pJg/rkZ7DdHypfLIVM1Si9xom3/ GFoKrLw9RI9QqYv0OJb4o6HC3wE6YoeIKNn2TBKHNtNFSUpjiU9GvHG5Y632d0Kxmi BaTqYpT6Elisq6OhruFJoC0eq7EgCy1CHTu1b2eFxzaWJer2F648DZIA2rsHwCAvAV VvKIWgfBLF7EYr8dRQ3ZUPYqDUHNdzkiZbbCBuzpOpgm1yZAiEevri1LNHGsSKbD/X YwJoKJzoaN/NciwDLlRplrswEHnkMOYqrz+uxNpa+SfzHHxzUNX/w5biDiV/carSgd gqgrDjMbaCxYg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BA6EB6767A; Wed, 20 Aug 2025 05:24:09 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:18 -0600 Message-ID: <20250820112340.147082-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZBQXIV5DNVOI7GBGVL3BPGSFEDTAI6B5 X-Message-ID-Hash: ZBQXIV5DNVOI7GBGVL3BPGSFEDTAI6B5 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 63 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=1755689061; bh=qrsgZ6SjHN12M/N0bQdQXGVy3m45urDYKw+JrQJvZjg=; 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=NLKkVQl240MtXFXA/zKG8AiQfosGRj5PZ2LXsUvy76+pZw+zD1iSnRF7USMbHn1uf Q4Gm23M41TOW3PUN1ckyuFi6jYbtjTR1OiZwwVEY8jq1ioN00aeuNQ1D7NWbjpxgCB UrdDJPGMkNfdKfC3zBQFrHWP++8zcLjIJwIyJrq8j2gFN3bP3TVSFN1U/NJ8jXVM02 n/GjZx/FpLhAQvd82WhOzj8d0qtC5p0DRymj0oaQFayi/Uu5epEPc28np3HafNUQ8p 3eTv3OUlY/hORLCkYaQ8QHmq9s0h1ITn0+tr1A2Cz2wRJCc5bB30495a+v8zBoIQYr L/jUbx63QzXUg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0607B6767E for ; Wed, 20 Aug 2025 05:24: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 dsVyrFEwWvFi for ; Wed, 20 Aug 2025 05:24:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689057; bh=qrsgZ6SjHN12M/N0bQdQXGVy3m45urDYKw+JrQJvZjg=; 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=Bhaii/SvzT24vtV/EdZSNrEoyQc77vhWx5H8gKtTcgBv5nBLUwMvb08scCFza/GS5 nzo6TcZc2J0xC9nsInMvSV0LOB1jhKvnrgUNvwVssg6YDVuMqVuglucUm8XEBYEK5T +Ajgf6UrtlLpJIIfe2mMUcP1dsy0aU1b4SJqEN5pFf0omEaCyq2xpH5K9RpZU78S6W ich0hrA1J2X9Y7Z+dQlM2L2VACFqBTYWUggGxM7VfKJQsHSbCezb3X9zUlEQgJUIp8 IIwk/m23BOJXyYkXl3GBMqf1fwh58wGJcLKaEkgiT7aeOwn7nqpdMYTylnNKN5T1E3 JbWxtlCv1gsvA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 51073674FA for ; Wed, 20 Aug 2025 05:24:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689054; bh=C0zk7IWh0RNQIkMlRnYsCgQLpPwb7W6EJnjlgGHc3Yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnaLGFzeBrE7paR0K7mum0CIByrHzvHi1E/51irmn8F6+912nmJ9zUVWLmNbpzFNG Pj9S0YY2ZMRUUXWatt6aDSp5oFAhBnHMRAWLObHaczH6PQHQkkeNptF79xi9H5C6n7 UnR8WvPLUQ/iwmH+i79fJdLzElqW8mIM78yoR/bSXvPP/RcNUKOJh/XNer8LCCX3t/ KAukBsnxsQLHU0PXHVDiVD1Z4UuBHSQpQ99aDMLchIx69Kd8p87xWKp4Rs5JGlZ6RH U3EP9kNhyqi0O/qGpKkstwQU6DQQ/Gbm9Cmv/DMyz/8/ZDtphJYwujSgODqHX5phu9 2HujvFERG8GwA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4BBBC6767D; Wed, 20 Aug 2025 05:24: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 TfdRFt7Qfchg; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689050; bh=FgZQnXd9WvoIdyGw7I72u9O00ZXtGyDzlbE7g4LzlBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XC+zrN0kTa4/TAc8NMakNU9oFIKmCOhvzys5+ICV9G7ZFoCNgzczWSxD1H1ehKa6S lH3wkv9xeQjttG+rElGGkyH3ZoE1t8Gc8GqwC0pt9I0nYfzv4G8E43LNDw6f8Ji4aM SwMtVI9T30M2qG0AXL5TFo9HuoFcsAeFZ4Wmlnv8s0zR9RMcVAhqfa981wsAfC/glo CcvitAjGlRYU439p6666+1WXDLtPEWxWaQTSCR/QgEhE50l8g0GKQCfAvSU28zfFJb MrgJfGweMn04gCgcHTlqNWrXxsoDYng05Kk08Sx7ZJ1YYEzaYUYW/wgUbgMxHWQB79 vsicjMQYam55w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 88E466766B; Wed, 20 Aug 2025 05:24:10 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:19 -0600 Message-ID: <20250820112340.147082-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: G6TVFNVIOIDR3ZJ3P56TAHE2J2ZPODZN X-Message-ID-Hash: G6TVFNVIOIDR3ZJ3P56TAHE2J2ZPODZN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 64 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=1755689061; bh=eiDgq/Go2O2H4VF574q2Nc5WX1EzG+84/W9NoWicG8k=; 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=PHTDe4AbZ35hQxpWDgusbQl1dvVnOhhd37TCuG6newGdMPihnJgz2V6ZiXSa7tNXT 7M3E5cIMHD7P2QIC44LXxQCN8ae7PlOHK4NraberwleU5eWl8UmWLCaTfUImFgNlCX 0EZ7M4zAq2okdBKXaPdPlIlHvCn9U4KK9kJu/HrHW9HdDNEsqqZVQC0t1gTydHKwOS AXHgMLBPAXAuxxTlUKcaoTWdXTrU3MMDU0KCbgTzyr2GAXExGE3RVt3ZXKm9D82Jvv ExxtCghKvIYTgu3ks0nLXQ8MDAZgWE5xU4tEamWbel4DxvncLhGgmhTKlpnixgz6sL etckgL1auqNdA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6071667681 for ; Wed, 20 Aug 2025 05:24: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 eFROaR_ww_D0 for ; Wed, 20 Aug 2025 05:24:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689057; bh=eiDgq/Go2O2H4VF574q2Nc5WX1EzG+84/W9NoWicG8k=; 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=GHYt+wCN59V12u6wVi/4+eDGNTeFrQoxnXAKA/agMY6bpf4cq4FE6NUx9cUdOnNaS tlijGlJdJhR0+M9Pg+sBGLskPJGTHbHW3UCsFPx8olTNHp/cLYqnoyaJIfeFTz5OBr Xv3yK7WA/ZX8EdToEUCxZHB/7XVsQsRQ4AWpG0+84a5AdwKj0zRx+UKp08tjWYAG0C uokkb54ePlJ8VJY150Dx0tHVlTNfSuLMeWhsB8UF3Afsas+TCz0cAX+qAI1ZMEFMS6 +FXhnep+wJcn7GYNjZ8zdov/9InAhN0E4g4VrcAXxHCwEXn7IsUxYG/MPwR2+OPhAF RF35cTAWbb1nQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AB9AE67685 for ; Wed, 20 Aug 2025 05:24:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689054; bh=U6LxrGBguOKhvOngbDpFNFEyA6tkzz77PzVbV2SCO1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hU7rQexgAeohN7/ik0oG/oE6mECm9Sh/KO1USpjcgcL0zjcSQi7+kYQMK3AeuLXx8 vsA+Eob8agnVJ8D/tfV/ndw4U/vhQHOTRJ8tXtXW4p/UTen7cor2OjcXfQzQO8/ecY Y0jQfwYWAdaooRfW6tqs2tcBZWyl7/dT+zl1gBLNSQe3kEekhZEkEg/PhVwHg0lH9e 3C8MIpj8mVq4TsNKmIh69S4ctrITJlNNTPJ8RnugieFwXP9bQV3aCrJH/57OmrWz7r 0vZk4gaLd8EavV5lDxcQaQXnxqmB61jnfQu2jRtvnf1IOH34bA93Hyp0Gme/Te7fAf YmusexFo3dX9w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54B566766B; Wed, 20 Aug 2025 05:24: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 VAMPfcv1xZXy; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689051; bh=r2S1wS33XRCdSfKn8e/EGs2DLXZSNSzhdTSkgHzysr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mfw4b+/xJjZcWPz9om+OVS/p23ho0eN9eo8krQYwH5+OCjgjrCySbGRApECMbj9gN Pk/VmtPLF0IadCpaRebtpbV0+VXPUi1pEnspJXCHqQTnxyqRFhw3YuQOkq7+qOAD4A gnDLgM3bS6xqMHcoMz/5cIj/XDDYnAZGzCr5T+gR1/O7KVJZEHVzdu2wMHYSx0BAyK obL4JzWYAn3fumJ3/QZudugET7T5Zfgp2xc0p9bCt2i5uVrqFID0aJgqKrCqpp/fxW cSERQE+1wtrixykOHCWN401+f6kT0WkKS1wzG6IuXCKJnBZjff6C5ThbvjAs6JCBv+ Qt4WTPu78HlVA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 645DA6768D; Wed, 20 Aug 2025 05:24:11 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:20 -0600 Message-ID: <20250820112340.147082-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AVJ7OY4VAB3C3GD26IJ5FEWBOXOBFEBE X-Message-ID-Hash: AVJ7OY4VAB3C3GD26IJ5FEWBOXOBFEBE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 65 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=1755689061; bh=cVN6yMYcgXpItIa4pu8O5cLXrwZ1jEMoAJ3upUgTG1I=; 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=iAl9LCgSbcPGeSh9edSKy3fYHHWh/N6nQ2WWUBW+DOEBMdxuoTm8qn0b055/j5Tvz yJfQ2Tavjn43v3Y7T5Pt3V+V3/S7fpmPURaBZT9JkxFEQ+/zMUg44LprYw0KY/jId9 7sXVGg4A+zTaksNh2wxWwQUDv+ERXaN+kHtumrNlX1GSjwGBxz4NUOwXoEsXEvLOI4 ZZtvUc3EEwZhByNjiLFOkSIS9GU5UXCWBOgHZFj85uVm62JWh5GGHMW3hU9p4my+Xx ESw5yipok06+AF/hUopQ2C0TcbUriQogOU8aA8mLqsjsfLCFgsiJWrH1iylSZbAZDH 6voTLeASN5jog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E43546767F for ; Wed, 20 Aug 2025 05:24: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 pdG-FodI_NIg for ; Wed, 20 Aug 2025 05:24:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=cVN6yMYcgXpItIa4pu8O5cLXrwZ1jEMoAJ3upUgTG1I=; 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=hhw2WB1qHVgn2fixyDn8rDOBzVWgePaE/jVULL2uwhjumQoiuHKX4pY3+wv3pnV6j Z07QNzH14DdoD9F+PDlobOSE8ujHsCsbukvTn0IdX+hRvLygaOIWAGTHgqKcKJ7t/i ZPq7rcLpWWGV5Xb3l+Sqe/xEhhamyKwMOMEK987iNs/rO7zSeSoQIr3PEF+x4p2gRF hScdvdyk6EYCTADqaXr6Zw9/MKNU/CcE9MgTd+QsSR+M02bk6VIOE2slNPDzpwRkVC VOQl0pRztBYfWFFq/PdF4qa2156KvAIPQo6XIgM9wIJLzRMrnSspJ4r9XHg+Zl+OVm EzkDLwlJSUKgQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 137786768B for ; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689054; bh=xb/1MIRg07Oh3P/6r/nbIvsCo55G9DxAovTovW26h30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yu//JbWGutJazwX+Cjd91aLa+IWmVhSk5v5nI4BC0dPL34n9rdsOLU/xlP5GLGJXB hvhHcXOve3iT4ZAYZ1BCKKs3r1C97T2TqIZWgzapKijNBr1k2YdkbPYaUvYoAznLtp TObQLGdKGcp6g2eOueKL94xGZjmvDnkUqN16SqHEGNLBngC5J3KBN1an357ABmLnig T2bUy7y+hzXpam4iA6kbyChwo3E0pxuvzFY+iTrY9EyGUC/gfOVxofQ1urDKgS99GB Va6tX3LJtcDnIWN0oGu8qnL/tx6ehATwRzHNXbkkTQS/mwk89HMWlqkpVBDtBHWOGQ bzCLGejxXtlcA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5E4D76767F; Wed, 20 Aug 2025 05:24: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 vJtC27BzTWUt; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689052; bh=LUJee695KEKTZD3tdBjQuh2Yay3k9nhxyj3DEclkT2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iMKpZUE8+kyLRTXzOabcvthkuKTglIsPoTYaNaB/mNjN69rqfIwBPIUzGEAiEw4Q7 KQ3On4sNMghTHAQAQo8KvIQ8p6qrZQzgFxZlIbgcbi0a2aFI3BhxgWL7cRAxaH+4kK WU0YI9dERHT/RltOyJ8rU+CqW04DJu6I0n2c+eTIctxDv6vUs+9ML7kEQHQHwD1kSO Ebks/LO3+vfVtxVRgqNaaLFLU2+42XWVlPWGlJrnx3u63nT4SmohwP3bvl7QyjEhAm VILn03OqrRFCbO4OYnXG0xhV8Su2vxra62rCp/k5mouNr5tPYpvRbPqpF9qVBQo618 nfA+RrOWzPRzg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5B5C0674AF; Wed, 20 Aug 2025 05:24:12 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:21 -0600 Message-ID: <20250820112340.147082-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VENKZVR5CTMHEHSYZOJXU36OSMATU2LI X-Message-ID-Hash: VENKZVR5CTMHEHSYZOJXU36OSMATU2LI X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 66 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=1755689064; bh=m8DlLqe/iyfD3wp42KwqdG0DxXLpXITVS0Mxb8fC/fs=; 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=ULTpJrrLPAP9QLAvcpJtgsKaUERGqpEoTvOE33664O/h/90+lpaAC3WuOcbTRqGUo pBJjmklyHNxC86D2t10tNu1ci8+ZLR/pE+KWi9HxwIzFJr6AmafgXfZ6lLdI/pQVl7 H01MSN2n8/OKhvuDv4wwc5B6r4MBH68yUXKqiLgaUD6KiA6DU3fZi05OGv5XY1uEDY Hd18PGSjBmYh4a3Ni3g7eNVGHi+LijkChvBuCGqfb2Wq7RR8/ZklsbU4iI5H8ntOoE 8gRD8e3paiWQd6St2Kx6q70Ogi3AwP9S/KfDq2xNlWm4PeiIs3TbdjU08vrmlAT0Ht nmrEp+KNahxqA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B00FA67680 for ; Wed, 20 Aug 2025 05:24: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 niRgGaW6j9Bq for ; Wed, 20 Aug 2025 05:24:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689060; bh=m8DlLqe/iyfD3wp42KwqdG0DxXLpXITVS0Mxb8fC/fs=; 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=R1BkTOhkBDKl//nTaf5kuurQJAuT3KJbt5ISU6ZPhfU8S/E3Gj/sxCEph1EuOyB+t 6ak8AwKFKcIDzkLU71aMxn7UujM0gVpFyOCh4TNIkwByfqQNPERUCQHOaT87hcnzy3 xa+0D0H5O2dJQyvp3SqgL6QApx/d8nJ8vXO3hKsyHRz7zpbFlAhLuU45M9NMWvQ4jW y+EuX2hevQgxRShmDBJhjrNl49DJgt8PFWjdjcopUZx+iQ7DCD/xfRq1CgLjYD6H7s 1SBYyQxnvCuMDfdL7EdHz6hzP7KoPpwmM8hsFFahBsqKFeZqWodnKaiP2r1Re8RmCv +gjm4oudY92kw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C66ED674B4 for ; Wed, 20 Aug 2025 05:24:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=BO3kcWejZsS5MlrOfQb6frqsrwQu7d4+yuxoyEZk3ws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JJgVNYxN0Rz5wAjpbDcL86okiEZGOGcufTbtDuzenvaKzflewStw4wEOj6+0B4IYb R1dRcJ8D0k3UVcIzgfC/4H3b7hxwr+EQ2/n0pZkN2N6DnvisNuK1zlX9AQRWLvk+3Q O2O2HU/kIS3IcXPwbzfCCa/7DXYmL/YRMubrS6YHzm7SgXDa2/AQXnHyPYMCfc96cJ 7iAz7ZRtOoMZnDVaxMXnx5M8FaOt+Ucrxr0pF9Vl+7glF2Ft+aCqp3bn9vY3twXzIT tvW0ObopJJVhW5Q+lKlJrxSqgieXjEh6FYv+9z2vqZmuseudpYar7e000ZRkFjcuEW JZZWv7Jyan9mg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BACCA67692; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id kI5VnucqNBdT; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689053; bh=VT0fZRKhY1MVrfSyJU42TG6wzOXcWcYiiM+L82X8Ybg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pUeOy1f9jqZ0D5APE7ivGYuftStkOB9xkVIDMbg2uexAq27aiNERcHgxav8rp5erS Y8z5RtesXjielL7CePg5H9QObOSm5jmUx+TCjRIh63X6EAQQgpe5pYwtXcV9YA8mWD aQkhywhqAV7MgJNRUKLeB+pqqxjPWNUpD6F19DFtdETAWORq8MChKIuQP55CtLyxI8 jW3STO0ReqltzbQEYKl/iKOFLCS2EYO8wOvm4x+cCyuoFdnuje6XqdDQiDRndxc/XQ NPO3tT0hNxI4iRDKT6bpFBkZVEI0xoaYoD69e48niI6UU9ZIdkGZ0lACuSFbMMenKV 77NsbheWfT3AA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3927D674B4; Wed, 20 Aug 2025 05:24:13 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:22 -0600 Message-ID: <20250820112340.147082-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2FAZQ2A7B5RDE4CQ7WWHRE2TBXCW6SXN X-Message-ID-Hash: 2FAZQ2A7B5RDE4CQ7WWHRE2TBXCW6SXN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 67 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=1755689065; bh=UvgdkXDtK725nkYW5EFcEPnbYgA/jx+zHN/EdhlBlO8=; 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=pyrX9uHaaCwW8j7nMsclxEt8GcwhT8ti4ubaor+KwRrhHbfSslb/eNEIdbZB0Ibu8 rdBPWSyBUfDhtAF9P7fqqR0Nn+GOLQeQNQfipVSFX5ExcQSDGulbxb+DFiVNqpR/Xj EP6ye5VXk7T8Mcezz1zHEQEYqMF8U5tXhG6EX9bc9fDLHXfZpkf4keNGlqqAh3Mzar UL7GJ77n+MEjSvjfjHSkgJlE5T4X8/9FpgF7gFblgi0W2MRm3X6dIYZG29ndBJJIhF VSrvlKrBMmRYMSfwjB9lc/kZYuoM8dxhy4EFmcimNdsxLS1fNhp0f3hTnGtcgrLDx6 uelsmCiKm0Bdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 17AE86767C for ; Wed, 20 Aug 2025 05:24:25 -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 1TeHyDmYwWhy for ; Wed, 20 Aug 2025 05:24:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689062; bh=UvgdkXDtK725nkYW5EFcEPnbYgA/jx+zHN/EdhlBlO8=; 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=O2Op7Lze81Gd/HNlAFoJgJY1NEP3Ew5IstZKDVBCJkaoWvRzXI+b5oKQHg8wBkPz3 byy6+oaKS15ptempPanDcsJPDMmpqAQgcIgKBsdO2At7sE2oiLqDHFS0lUTLnlbNkc krIuG8Lfq1jQmDiMDLhf/Qlvi6RMySbJ8MLjI3WeoISO8a/ESMhIM+ZaeQ0N/AKJ3q za7UOyZYohOQkr68/DBlj+uq6V++NSDkDHwVPzlh0lVjTZAVH1ivW7hqT5UzhEOivc bzeerphh01BsRuEUIw0cNZnC+zq/FJ+zJKcszq8nJPOfNN+N4yzOj7ACHKYHcq3/QR LJzF/doEEEmlA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8B9B674FA for ; Wed, 20 Aug 2025 05:24:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=NuOVz7kt46eHehj46JN7w+KN4Gq6ocX2OlP86Ubqy5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=prdQdz5WXRWVbvpqgyh6XI0A1XMITMQzEB+inst51OqM5gDa7BBqr/cI9ySv7kGmr w+CdCPkC+pjfNkH6G4SKqCw4lYPY5BqkvjUAMkd7eXrI5FzJYIy80xkj7g7cbQf/fN kr31n4dp9Jmhc5sXrvpdz2wxOlsiMLEHbNmO2mNIf7CKyIdqCra1ufBLMQBBuV6cP+ g9yhXktndk2zWOo0g5MHqknEtrq7x9ccbAOzLi30MzGfZEyySKmD669F+Fu+lbnYO7 lM9GYyE15sFzhAq596r5vAw/ACnvg8UwBf/zy90/zAPH+AP+2g2MNTH7kZse0uvNdT smtJ7BzLv3WyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BACB167691; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id hEBftxqbUfdq; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689054; bh=V/F5RunSfn3AEg0CmzgSgG6SmIw9fwVbxMXg1psos2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fab7O4Z162lIMKYKDDcVTS0v1tZeP1889Qr3+JMpXSrJqsZcnjEQDNHIbbHVUz3fs YNsgjnm7KQFlAA0b4JO1KDyxwlmBO+tey0RJfV0DAxV0m+hPjeLgHpddMbCxKzmCrN zrHJKutIztHSXOqptZ3Eqtt1yNd4K7WWKHdMSG6u1pUQ4sEG57j8giV4tnENC5hiWM 3MAyqjPy47ATyhZiQRAczXSjqshKsZZNfsQECm7kVwXm5CnCB5W/iNy4e1qFU1gjPL 22JJGbzS9ax72oM1hVRn+uz/xu9oBpXEV3ltJfQ1qvuwwojkupBcoIgHQN27rL1xLn yoBNyIV/kqx1w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1D9A16767E; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:23 -0600 Message-ID: <20250820112340.147082-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6XUHLBKKOMJJ3IVVDJLWY3AWWV4PLEK3 X-Message-ID-Hash: 6XUHLBKKOMJJ3IVVDJLWY3AWWV4PLEK3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 68 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=1755689065; bh=FxYqQ9EnC0m/UpmrMzMmwS3l4/0n7On6PIrlv/Sar9I=; 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=sw8tqYbJBUFND4zZOjQ34ygsP7Xg63kOZTItNm6r44S5TIsW2vH4fOc5TZRUwh+GN Cv3NIlUoX7qef1kQwUJByCw20rphZP/MMy9t4K7iampwb92cps9QwLr7AaXJOeUpsZ dWI08dkj5UtxB3UR7mwiFaAt4M12FzBMTtPxGu1D2G8KdOGhpItjXNCsVT2UfXdb2O n67hzH+Bm5zn1M8910uecc/U4TGXvE6ooShMFc1szOoA4aLbipW3sncUJ/JZ1GAw4E suMY6aAnmZkL2TXEYQTfypSotxBAjvnPzzE+4sxywxCnjeRdDnBPGEQfMiZsWPDslT rRf2nda4ENJVw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8E5016765F for ; Wed, 20 Aug 2025 05:24:25 -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 1tHwIp2mzI50 for ; Wed, 20 Aug 2025 05:24:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689063; bh=FxYqQ9EnC0m/UpmrMzMmwS3l4/0n7On6PIrlv/Sar9I=; 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=UvnZxhDSLl5Db553ORzBqtfmwPt0ORnwYY+3pWyJ5wuGLv7FGztP5uJDurfgV9AJk 0d1ZSpZg3Tg/4kXGvj+ab8i/34kKCv1fpZ8xXprOS2jMROBW6TgkwgJPb0k+xcWeBF tRHkoetG7zJCgopMgTwBqBNpRz7cJ612CDwe9GLgLmTc5Wl94T343P/8gnpi+uC3gF OXEJqEXivBZka4c3ukfFNBBBj7+K9uA3yLblDBU4oE0bpHqVEbuzqji4ZAOWjjxvCy 6Pt37o8XbED0Mu8FYkHETeRYUxLAz5mrb/Di5Xmo7cMxbxeO6KeUmtpTyGSKhSd4fJ 2hW/5jqaiyK3g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 478C367669 for ; Wed, 20 Aug 2025 05:24:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=vXvc7L8j4KVAJJP5QiXH904AQL62MsnsfyhCMosb1H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=giEK01KUoLWs7QbQjoXwTfcfW+CU9H9ofdl0cC9fE8dUiS70KleOwTm/KRg/r/6Ja P63F9hvlyLAhQz9gt3FTissIOIQvXdwMgJHHNK/WwoS4B88nWdL3jxHrBjbM5vVDPZ FCoyVY6clrz6prDnbEXsPNr1pd6Y0QBoT7U/hQjpX27CSVWiWean2PyLgoPgjFym4m vk9g8Uy+1SV5GCpedCICwXdPp9QYd2Hb8go0oqeBFO5XkLQ9oZQ/7TKdq0NfOtuesv VxC52jbxXgZDq+f3VIQEsid4tqUVCdgeS7mNruAkOMhk0sHbxrdPSKKuAA/8JYAt0Q Qffwo2BWO1MUw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D00D2674B4; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id vKJaoN82awTG; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689055; bh=Sr8fKAWwfuwCAH96P25oAPzhvST7bCjuvIWfcp86Rzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSZ/TuY2bjz7x19NjNabSSWsHxktYb+94UHftqh+er3Bjkm42/G1ZCUnbNEZ+WOFP SCR8RnDun0AOjcZyrypd+SO3AbJcHbC78B0e7hrzDrNkYoywEJFSr1b51kAC3CBzPc 1D1o6riCFyksQFrM+zd4jJJD7Uz44DsYdaNp5GhxKPde5PFLueCDl6PQ3nzcuT/8Jq gVgEM9qo3YEuaMD4cI1KnX+MNwcwawsFC8nDmqmWVZjK5mzvCf/1RluWs3Po+E2t1o u9dtHe21NXPdMRKHvO+EuomJ3tqiuiTcAbUlbhmBpQfLKUq3HOiEUqF2FCEJKxgKvh drFoRpO2PPvPQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E3BCF674AF; Wed, 20 Aug 2025 05:24:14 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:24 -0600 Message-ID: <20250820112340.147082-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IJK3HP7FW4ULXC7FC446IS7HDBLKYR4Q X-Message-ID-Hash: IJK3HP7FW4ULXC7FC446IS7HDBLKYR4Q X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 69 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689066; bh=7W+EeHWTnvzU5WuEEGI5DUaMS6g5cfUJawrL9/y6JQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=f2iaCUX6lq/StZ80JWhizbe3DYZCiIxXJCe3OkwGxrbOtIEo+3DlUXK79phDLe0Ie cCCziyJ+fkgGGDinjT1Uamcpz+zAIQkkxJHKu/NbTyg9BnVqZkHmBySsoG04o6WA96 kzNcSOL5BLj0COgQPF/sv96yOG45XraSoqxM7/TNXZYzrDpdDGdk5NW+Nkp88TR58W q61F3thW/bth64hUhZR1EcnhwGVSkZFW4ycfx0sik3/p5KWsHEdvHxnFN66qUe+FYr S70ImsDuMm3L8X4KD9RElCwxJTtDwH1Ef9ijOQVjXovApIwgw6aQzVdfKnCbZtHu8s A5BPcRsFOdGJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C64D674AF for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pFixjN2XbAUu for ; Wed, 20 Aug 2025 05:24:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689063; bh=7W+EeHWTnvzU5WuEEGI5DUaMS6g5cfUJawrL9/y6JQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ROqtQZ5SriTjqu7bKPEmSo4qR4CUpoi+gbUGqyVjSIXBYbjDOViokCJx0juZRtMTd 9YbB74AJdiLr0qfYNUmgmeJVLEnQBAFRR/jNOLBFYlXOPJSr4ERqgxyqbfuE2sYw0Z Ij04FaNdeFaLTAAXjAiK9zG5Rzl9eTK7sNX/xKQ5aosIPVXWXzCKgJMLzSzGKKavyn XIKeXy6ml5jC7UGw7uJQShr7DcmJxp7OfGssUDhwixSfyffM4TxAcaT138M7+x5WI3 7rLFRAOo/lVnBNcZ+WmTChpRbqWeIp/xsRhxe8iEPH3sMHCLXyPc+ICVfaPz6Baanr PIe4oloAB2nvg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 97E1A67693 for ; Wed, 20 Aug 2025 05:24:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=GMmAZIfVbijSIXw0zcIUSjsB5gqQDZ3BkhDcgvHoOK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ToeCV2zxFMndRhWoJQtfo36TxHBVnt+Nvci2odILsRi0ygLbZ6aL5dz/e4/psBPxk 9tJ6NH00D9kOIfGY6Fp8kaIkj/4mEpGXkkizIyjorpyf1Sx4QUcDws26NbsWX1xCzX X2yPpYcGayg487/NETLVveIW9HdDJ+6Cw9N7bboxUmht5eC6w2ZhkSg/0FrgohC65F drXW3G/yJNk6SlfC7Ta5idbJUSHexnH+1cfJmGaF4ZCjW+R9OHPQVSsFhjqasyQFPS Z28dt8lc/b7jU8jx1noRqPEVznTBwyz0swIr8pDUA365xDsFiUglW9zlwqbWTmnxDu vJ/u7tkZVa/Tw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D02026767E; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id oEbnP2Afd-hX; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689056; bh=LgYAdMU08sPXAxtVmCOyM91Zq+SDUoY9ThvLeD6FgfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ON9AiJXgvhcveW2nZUZABCz2iT48GXbXITqycYFEQ2KMrtLxBAcJjo57IVM4KI2hf +qraXvInSgy0+77PDWLS/v53OUA3ecvZ3qIgyp9rutWo2L9SM4XTPE4hz6CvzUo9ZA 3RzIGfevZWQTel/lwzxNUWPRzv3tSSsQ0asAjhvixe86pmINK5TeiZrb1bZyhMgnSz AQMNmGfUiabncMbq3SOqBNoTyOHSYhWVE23cpwN80ung1c7ExwD4tLxNOFlfve5Bu8 /Jt73JsAK+2j4LQjwL7n/zKAIZPpqPCHybHvyqMS45UDUL7iz7CJjq3q6NLNrRdUp0 OgkvH9fK1qtVA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BCBE46766B; Wed, 20 Aug 2025 05:24:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:25 -0600 Message-ID: <20250820112340.147082-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DBBNYCWMB3I625SFLLMDZPFYFPFX4PNJ X-Message-ID-Hash: DBBNYCWMB3I625SFLLMDZPFYFPFX4PNJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 13/18] efi: app: Implement %pD in the app List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This printf() extension is useful for the app. Add an implementation of efi_dp_str() so that it works as expected. Signed-off-by: Simon Glass --- (no changes since v1) lib/efi/Kconfig | 12 +++++++++++- lib/efi_client/efi.c | 15 +++++++++++++++ lib/efi_loader/Kconfig | 7 ------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/efi/Kconfig b/lib/efi/Kconfig index 16de786b1e2..ed12741f61a 100644 --- a/lib/efi/Kconfig +++ b/lib/efi/Kconfig @@ -11,12 +11,22 @@ config EFI This is used to provide libraries shared by both. +if EFI_LOADER + config EFI_BINARY_EXEC bool "Execute UEFI binary" default y - depends on EFI_LOADER help Select this option if you want to execute the UEFI binary after loading it with U-Boot load commands or other methods. You may enable CMD_BOOTEFI_BINARY so that you can use bootefi command to do that. + +config EFI_DEVICE_PATH_TO_TEXT + bool "Device path to text protocol" + default y + help + The device path to text protocol converts device nodes and paths to + human readable strings. + +endif # EFI_LOADER diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index e2cc9d3eae3..739010e60e3 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -196,3 +196,18 @@ void efi_free_pool(void *ptr) efi_free(priv, ptr); } + +/* helper for debug prints.. efi_free_pool() the result. */ +uint16_t *efi_dp_str(struct efi_device_path *dp) +{ + struct efi_priv *priv = efi_get_priv(); + u16 *val; + + if (!priv->efi_dp_to_text) + return NULL; + + val = priv->efi_dp_to_text->convert_device_path_to_text(dp, true, + true); + + return val; +} diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 6f67e4897f3..c2bb9375df4 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -356,13 +356,6 @@ endmenu menu "UEFI protocol support" -config EFI_DEVICE_PATH_TO_TEXT - bool "Device path to text protocol" - default y - help - The device path to text protocol converts device nodes and paths to - human readable strings. - config EFI_DEVICE_PATH_UTIL bool "Device path utilities protocol" default y From patchwork Wed Aug 20 11:23: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: 70 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689066; bh=EEbQVBEWP2QWhFwYrEbYTHqOVKTFDphnDOsCNU9MZ/s=; 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=rZuGnfNKfly6n1kmamllOhZ3RZfd+0NOVSIlT7F+2ksi1jfJ0dc4DtSq2IYWxSFWy fp2Lj+rm7vWBLMc+avfiAvnZipx3BjCKsp2WdgVrmE6WqnBJZ4toPey8pjw3ByY96v 5YV4lfjOHax74YPCQHVAVGG86Xz/EiGIqWy3Qle4aUhjQ3n2J+xiTVjLY5wU0Dx2Db Y5rS47Zjo+8MubNeCBXMPA5rFGiJawI1TTXeO6EII2T532H7bLrjer5nMQ5gNodOmk POvAkJPRGdtxg273dHVlc6WaLKh0Uwk4WkOv5SOGGqq6fj1ZtKGN+Cirp227wD8S9a nilKSNz/3YUZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 597256767C for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7VZspas9MpR3 for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689063; bh=EEbQVBEWP2QWhFwYrEbYTHqOVKTFDphnDOsCNU9MZ/s=; 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=EtpM5fOhXhQQhkxY2GoiefYerh3mSM4WF7+5Lin/SlS1juHQV2QO2Vf21oq4CTkPJ qTtuorpaS8pwGQB+OR7Lvo/zvgUqYC8KkyOYfvtlV/FYEe4EzKihPJSmm2FPNr9nvu w975dmE/cIdgSV+vPVuv0bjqZLbBtWE0512Yptt9YJYisdh+6yxDwz5WTFyYE+o5RC J+txf0bd3VCyCPUdQ7xjk3R9irGP7puwrlBdl4bJWGxx0ld0U9eV2XPie9YT/bAHNW EjUEQ42lbOmN5D8oJtyTeKCAkPRtiwN5KlsTS+becKik0Sf+7ogrogTThWgM9DhpSk gJVFM3xQeRpJg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E4C81675EE for ; Wed, 20 Aug 2025 05:24:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=bZsFi6OnyXDqq1A7dbbxqsXQ281oDD71bNgzRYd8FQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVJpa92xuGTYKKGlhBSEr9gPCtZqfuuthiXV3MnT6MZiWcdvzivYjW1UjQ5lDAVCS XX3BNSafNcGxt/FGUDLmZSa4DSB74Oul6Xygh3AeXLU8G5+wxEnW+AfwDCKkzUcIoF O73Di7oF2zNX2iLQ8JX5fqRVVksqZtmYYK62cEweCem3qvUSy88P8uTkZeoRWj/euv m082s6oeM+RQtH08K3rNpbwVchyNgFzdLm/fslJ1LoYXhcpQfYmGMkHYY8dvJWhFyw ZXljrmSNOovicLR2j03wNi/t2P/Z/oa4+zTaxJdAqtCOR62dvyKeU6Lf5ikICS7681 CgG+b6ayMcXcg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E2A4B674AF; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id SOV48xNgvotw; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689056; bh=EKMSwhworiVlSKo2g+/4BwtHUVH7UZ8+ck6RL1r++LQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RennkZg9f6ZQmk5/ByhLtG/13mPKZnxGvpyIatqkXI7CAjvnO+7omygvPbGEpla+Y UDkVRHrsRcVeoapr6ES/weQ1H5MhLzttMWn2a4BaU3ixalkZ7Tl8+LtapFBdkMMTSl p5X+C36VQm9/t35+ibiWIKHOCuRTfpCXTkKUkpcA/DtWvQP4iImhk9TexszkcZUjFb or/mUeadrvFSDe43CqobmzSuZNvgOZX5+b5KCRnqb4KteJNmpNJWG5mr/QoGpDUG8H HJ5AKmss5Qe81sz68cQJA41npODZSTxO6f0Mg9n3pCl5S/wFcjpeL0tCenTFlKYjQf 8HHcU2B3ubTuw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9743467680; Wed, 20 Aug 2025 05:24:16 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:26 -0600 Message-ID: <20250820112340.147082-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FTCLJMP6QC6GN7AFHKNB3PAZBQBMNDVU X-Message-ID-Hash: FTCLJMP6QC6GN7AFHKNB3PAZBQBMNDVU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 71 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689066; bh=1OOXL8Hm+PkoGS3VM2VBqSCGABAf3AxbQJxNpCcunoY=; 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=IM2x/904jTE7hijPdVFxSiwdMtql8QsaXnwODbpmDwoAApK5HPGcPZXYX0F9uEmdA jioBBYuw2Zvjr1BvnJpUOCxJHy5rco0Hkp3rKw3icthaRcGzUDGL72wyg3vD5L8Bnx FVQgv2ifjQtK19ZwOUDbsGn9L4Dt/r+e1mG2KlqSMLlsbwQ4mCcGGxSoWLjI1wN2jn du8FznRxHaHGftQ/Q1sEEtKQOowxNL75xwxvjc4gDKCiU3pM4x+sjXkvgLiaLfCsPn FTtGI7/TJauPs53bCfagjjq6eFDNxiUHIjUTxlziyQb4qxNNkmCoQxVa7CG2bxaL5F RzCaeMnVWQi5w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 93A9967691 for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id w4F5KBIq3Xfn for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689066; bh=1OOXL8Hm+PkoGS3VM2VBqSCGABAf3AxbQJxNpCcunoY=; 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=IM2x/904jTE7hijPdVFxSiwdMtql8QsaXnwODbpmDwoAApK5HPGcPZXYX0F9uEmdA jioBBYuw2Zvjr1BvnJpUOCxJHy5rco0Hkp3rKw3icthaRcGzUDGL72wyg3vD5L8Bnx FVQgv2ifjQtK19ZwOUDbsGn9L4Dt/r+e1mG2KlqSMLlsbwQ4mCcGGxSoWLjI1wN2jn du8FznRxHaHGftQ/Q1sEEtKQOowxNL75xwxvjc4gDKCiU3pM4x+sjXkvgLiaLfCsPn FTtGI7/TJauPs53bCfagjjq6eFDNxiUHIjUTxlziyQb4qxNNkmCoQxVa7CG2bxaL5F RzCaeMnVWQi5w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4DF3567680 for ; Wed, 20 Aug 2025 05:24:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689064; bh=eFZXgFXCRA/YgaOjyujjHLq6P/I3bayush8D+6FytpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Frb0J8qlanVHE4qA+yA4PEFUCHMKgYJTkHX8guICu8imTQPsiXWZ/nuezu2bizoOb iEiD2+uZq3DUq3cGUHmoJ2AYptq6ZCWD5wiXmSIqVC0Iu/x019JkkNuADztNCx8jBQ ED8Hla8uKRzjlT20soQF7xhDsVkwkTMfPqBbOwwzG+ExDq1lOzrYpdj/mgtSpCYj9F bt4ZOp7EM2nI9g7VvuEyzxIKb9nop2zYL9pd07YZmXEVlJA//b9BAaq9G8+E45aMpn DyusepdVDJ9ls7CTpbW2XpEoCajwTZNrX/amcmv2wo8SfmXxjAQZT5l+gNiyj3X71p zxJezN3hOM70Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 80D8D6769E; Wed, 20 Aug 2025 05:24: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 10026) with ESMTP id qXfAmOE7W5-P; Wed, 20 Aug 2025 05:24:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689057; bh=sNsOC+XUJQs/fQlYkJHAgs3tMjuGSB6zSRiO6opSKY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SO++tnzQl7yv5+W3DZj0QSVDRF8rjYcIvqbgb/4t6dFowl7pU1xsp68RTE8CCF8ep unVsfzTz4srppBdtEjFblLDnctjKr+VamccQPIJ0E7i204BQ2/AZ+0Am7jUAf6FSU9 6zBtxjejBJPhJ7EAW7hyv1IRXsqixkFyjBBSFM5LTysOsILTF1RFZR4Pw52ZfDwijY mX6zlibfC6k+1ieCsBe4JEsoZvYUaXp3Lk/LdoUxbyeNNACcuM4gXnvCum+X4AysTX HmSwJZRTrdG0AijOyhrQQFc5UYKiBosmoFbGGoEDYNKhfrSBvN3bsEws4q/aSZoT/6 Oi87YwgVwHVDg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 75A746767D; Wed, 20 Aug 2025 05:24:17 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:27 -0600 Message-ID: <20250820112340.147082-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CFZJIS7UQIVI2LFJI46PURIG6A4IFXLC X-Message-ID-Hash: CFZJIS7UQIVI2LFJI46PURIG6A4IFXLC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 72 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=1755689068; bh=MvYubXDvIkyXGyIsHu3gxXXnY2HjrGPt024yrRQt35M=; 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=ZN8yV9Zohvg2A32LQlFjbWMe2g4DIzS0rjQvBpxOyzHJ8NFUxQrQraT1JQuXvuM/u 3MCiZvAfgERskZqy3cyccnEyTgDVbraVbnkerkq72EDWYjwRzR6rhio/GTGw8tOTay S5BXgDwnkzfECWV4Mpg+74g4DHTdKUyWQqnk2ifiJV/k7mzC+B1cPs88GIu3PImB5W jWK7ED+6+jFeRTUvxcizqBjvAHvqLX1IL+lzaPnF8vZMA++TLAm/ld8BJGFz53aZhe 6lUGdcOAngYDt4GBrA9V6HA8uYWjVrj1xerYjtsgBYwgPecPb03iWnJguOkZ6LpSm1 6MbbHBNy0cpYQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E8DDB6768D for ; Wed, 20 Aug 2025 05:24: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 95H_CtEKimlE for ; Wed, 20 Aug 2025 05:24:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689067; bh=MvYubXDvIkyXGyIsHu3gxXXnY2HjrGPt024yrRQt35M=; 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=gR08vPHGUp3W8T+teWTvYNSdBr3Q4vxyvstmWPpluEvd0YEUwE9viKMt8mTOSFxfA ywxzkRFsxMLd4fdYBH5Skb2HE1eZ9K3D3pmgVCv9M2BRoln04azjSSpHruc2vdcO8u 9UYmVTiZuhkD+GDdj8LMWrGDGcK7keFWsCDIjjryJtMXQKhrdVRQRIVJsnBGwKnMH8 E79nmmq3AZ6Ekge7YlMAZof5cHmSctFuhdsyYRD2yUY6zMEMJqzxHb818zLhUv3FaX FjT7iB0ENAQ0rXnREORlopc+zphu7jIh+vG8cya+FW3Qoexh2iuMrxEdZP84ndfDJq PAMsO6l/fgPyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 14F866748C for ; Wed, 20 Aug 2025 05:24:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689064; bh=qbekrCK/e3nRpL/DHy3fnL4saeLKOzG9aBW2rJgAYqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HMb+gnGo/2DDMTnxSwdeqlDUO+hOK7G76CAQBxCBz6Oy/XaRkowXhpEMqfTETXxBR jIrCySDMTXyBVcyXfbLmPnq+mNkxU+cX24OFgp8b26ENw61ZjFCb6CN2MePLj1Mkxt GqKZa/kTRLiIhbLya1gBbCgllfijUUGmf3A+R03jnexUMXq7YMrmd1mMErW2v76Yb2 rIl1HVpawj3jHkQANGi7kyfgEhihiYCcSx9W6nIQrWQIBTiNA7C9gcezwA45uZbtFn 6ePih8pmlErQqTOSSbzpsByttPUjivDEK33zpgEILMR6qj9iQMKyg3jP0/Ngs/P0ek a1pooI3dyBOqA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8A7216767D; Wed, 20 Aug 2025 05:24: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 10026) with ESMTP id xHzeLgntdHtN; Wed, 20 Aug 2025 05:24:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689058; bh=dtABPST/Rtc1kJ5M0/izlT1SdJnrLk84SAyA8Tdft0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phDwQO56Wboi/76PJXkduIq+8Nhb/zMjtbm6JfrYcEeiOwVrU0u+8zlghHSnpBwZ/ XtaNW6/OqBAc4xT30jCa2daZ0/W1jbdki0EISCtjMR0u8Wg/FQrcUkRdO+EuoQhlPa YIyEtb+6mm2dN0+TUZYlfuYAdT9eQN70rNEzrS29WYZXJlTnL9rLhcx2vDL2aVr0C5 AREQGCh+hkbVihJshSXe6XUZKO4cJ2Ccgt2OKAb1DxEfdUJip6KvqzilzEUe97bkNE JaXOFpGTiLUdjgBlFHgsE3egrU7FtLxziP++L3fbpuCIT/3pbvj0Ugi8P6yxm7B+Lq 9L1FmgxL4w8rw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4759767690; Wed, 20 Aug 2025 05:24:18 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:28 -0600 Message-ID: <20250820112340.147082-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 43KB3OR5DS7N7UH2QSKQCIMNJ6XMDTO6 X-Message-ID-Hash: 43KB3OR5DS7N7UH2QSKQCIMNJ6XMDTO6 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 73 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=1755689069; bh=4PWj/rXtv0/kTXlSLlN8+yE3sbQi9bNPbPhAKZ/6deY=; 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=OmZqA0upcYOjMT0vMI3vMOTrZTJ4dsvhuJ8kO+62DAn4D31ubbmwq5Mg1I3kX1vN0 I8PfXq9W+rcZh9vGWdd0vmCCCfEybys9BVKXciTLmUpefiq159BSUYH906nBejiDhi XL1I4TJPo10SAsFh5OiCQysKUMhmkI3jSY0YkiWcffO8IlRwHiz8o2K1urntkfFR0R FnSWlUzaK0FMteGqUHLjuALEL/dLT2cN61p1QcfF9rXZ4DzANr4EWqRP7JaM7T8wNi /90WEpqzY8efTVIKnybdVHe3Tq06IeptbamhRix+/qRsWUthSEflLRK71CnxF89fri i/qRQ6XIAgTfQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4FA1B6766B for ; Wed, 20 Aug 2025 05:24:29 -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 n0klqU3gRxwO for ; Wed, 20 Aug 2025 05:24:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689068; bh=4PWj/rXtv0/kTXlSLlN8+yE3sbQi9bNPbPhAKZ/6deY=; 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=t8d786IH84bS8Uc7gGBZ0K8PDNObo82RcZq8f6m/CQEWWxGQqXuBIx7heZcHnOTA2 JBg8A5Qiyti2mvlZDxAZTt7wyBgcxz7pGahgpI2VpCbvEre9ryOnJ30xU2Uqigi72j tpAMGnL6CfKDwduwdWOlCpOW6MbU62247s4bytEAMWJonUMjYURsZ+DJUsodtmMdGu y1J8AC1SlkaFobNNiwkfijwXEEGzPQtam1nvWc1MnOOzNrvxmkGP26SSvSu2LNY3UH B+TBjfrqWpxPAmDgiTZX7QdiMEHZ21aHzSsXdgwmxk0PCoK/N+tPWiP+zhHZM9sIdT k/38xg9ucHicw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 740DC6767C for ; Wed, 20 Aug 2025 05:24:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689064; bh=NcszcWh+Lr9QHz/tZjDIopD/J7tHAXVks3zY4BxufSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XhndPPX/BcFZxrkFVcz+tXu5y7aiu5zJPBS7L2zthPWhSJsrc5fWybybjJvqESr5y MRzhtImqjCrX1QBZM66scUqJlP2Yo6FpF/ZE7mNAXLRMciTDZ3mGsU3B/RQUX0+8ZP Jk+SmbcmjaRBYB18i0/VIzT9iplgXE0h63Vr1HorOJdRDMvEIILjC4mzo0cxz/7L+G nMbOR555hGoJMyjwFoqv2DT+8+E2P52XraFL0C99HNo51CHFE2Twzyqo0G0b2V+Djg 6jdiO8pBC/WFHZ6WjquMw8sLtRaRf2/BIXwJjTgUYBtzs+J4tYrkXs0o8cavQuklYO KrlSV1Vzf0J/w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9633467690; Wed, 20 Aug 2025 05:24: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 10026) with ESMTP id AE4YxJC8hvhW; Wed, 20 Aug 2025 05:24:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689059; bh=NqhwK8VjSvP9ORwpDxhtMjDIL/H7wM0ra6Al+XyH5sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+1SZYtZHGg/wPakp9cEzXFEoHGBIB49HLKaBd9j26wL1SWKHNRglANnu+q5Xw3RY D0LbKn4TgiZHnOODHoDijUZ0syRTBPlXukMOX8PtqaNsB+WTbaB5vhDK6d03PqzjFs NQ2iSnQPwnajS3eTnn6QcmI1eKT3thQvgXlYF8OOFDbNqlBC0BquU2/nDHIrk+pnuP nKizuxFg0VP76B8K26xCiLnfl1L3+VzHTyd6B3xsJWfCxAxqWVaGelhkLsvyHPlKJL kQEE3A3WWK07dZV6LTW3/cFLKrMUTNqFadRrqQjExPkA1WjoKy8XlnPd5yRhcuBGML lGGT7a1/WpzoA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1E3AA6766B; Wed, 20 Aug 2025 05:24:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:29 -0600 Message-ID: <20250820112340.147082-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5P7K4RXYKAWMX3NKWOKAS2YFMCEOIOCV X-Message-ID-Hash: 5P7K4RXYKAWMX3NKWOKAS2YFMCEOIOCV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- (no changes since v1) 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 11:23: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: 74 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=1755689069; bh=MCbqvL122+nDlptHAvWsUNWPCsoR8SrKBMU5qGS/g+c=; 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=CpjrJncF0oPpF5cZWfXHZKTdJDyx8yRjLA+rN7nvaWG51YdpVK9TeIZr+VZ0NH0fU j04l5ODa4MCGYPHjEE5EW0vOOkP+F7Wl49nalb9yd2GBPHFuc8LZ94KB+As7Zx/Y9f IuDNpb25zBKlZXct5bnJYbQ7J4lGqtkITuT/7L/pwJUAMg0U6Y9Rc2aqzf7rklbRQQ oYmxdQ2oWZaKgRj5PX+9znvT2Bqpo8PP9ER2+RxUMRqr/qPvtqY5o6EC/O0fEL/KSH euatUGeob02l9lgDAvPFNvyFpj2kHY0j0UIoRrhrJnd4eltM7wNbjyC6xzeZmbAhVz gISpz1t2r+LXA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C79D46767F for ; Wed, 20 Aug 2025 05:24:29 -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 HRI2wkoK5D3t for ; Wed, 20 Aug 2025 05:24:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689068; bh=MCbqvL122+nDlptHAvWsUNWPCsoR8SrKBMU5qGS/g+c=; 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/5ruWUIF+xqVXSEmJM80rkV0Odk0FWqMaEK3UFE3WM6HJgvW8gR/6Cb4D+TbNGq/ Ng/dmZHW+rtEFiLEwn+Hm+x5tj/m3OuuKVvPYTTNlAJsHW/iIjA89n4RE9QwPmZRDS lz7HYFGE87UHLELnSBdobvl93gQEOpemnB3a5Cp+X7OfKdvbS1vuq/9kMlB9R5b2aa T17DJMtHtwKCSoeK938P5JAa5qm3vP+xm0hYDPh2KgKwanwq7JPAyqeR0WQRizZTpi MpO6IUiz+CAcsl0h9KP/P3ONEv/rgfrN8NmRfct+1bbKKPGSgOflAnJkHhKtxc64R9 DEyuDBYXC6mvw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFAA867689 for ; Wed, 20 Aug 2025 05:24:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689064; bh=sXdpVQ4INkdO0YsspInzavDxKrFcoynISIPL8ecClwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cy4HTxTMfkjBorLE7+aE95Zccoqca9D/CPHRbW/2AmGunQJ9ieW8QmBGO/9RPh6Pr BrQH4TSSvyiu1KR0rtBkjBI/UQTOWg0MavFTrjl9onfzfkcJcqRowqcAQNwt5Zq+3a bRu0kE+VBN8VWklMO6amzm+KFUOBdMxXYBfNVSTxQbnlK0zJY65+3cRqfLMpX5mlBQ fIVLH4RIr7Uu3ibzHK2z0yFXeIuXYXeREXB1Knk6U+ionhLkkvZq0p/YD3o7P9wZ7S Z/mDETBpwHFx5Nj979iSAt6HwzrrrWW85Uc8GXhgU7gtmv+4mRc9bfeniBEgH0BKif vU1uq/nkwns9w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A8A06674AF; Wed, 20 Aug 2025 05:24: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 10026) with ESMTP id qdRR1FXe9Ec6; Wed, 20 Aug 2025 05:24:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755689060; bh=Mq/bTxOpt0LqdJ0PvskpXV4HRU/m1e0c9b9ha/9hLnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pyqy4jHjIrt4UcNru7EEfeDaypckg400HvwtVhR94HpvzloJHB9zSbv0arL77g3Xo /D5Pw89hAY3O8Pckal63pzWSyLX/GOdAxrug+D25RT3tjV3VaM82lEorL6B7D/n5L+ ChNjUUxvF7m4xeteLOP9mmOz7t2IQ6g83Pz0EnFkavdf7mPFqStVjWpRVNFntrHnJ6 aWbx9u2DGZA2us+Hz2vj14znoVfsb3BqNg2dWnnRBeKR+jiOkssvtqhDAtN6gTGzUk IHCwDH/q6AbT7bPY4Oyjv6VbTiA+htNPbf3EN0hzGN0prJ9Q2SvjhepaX42PPkKyFL QETLoGlmVii2A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DFED367680; Wed, 20 Aug 2025 05:24:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 05:23:30 -0600 Message-ID: <20250820112340.147082-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820112340.147082-1-sjg@u-boot.org> References: <20250820112340.147082-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HHTQN6BI2DB5PSN2Q2EADXO2LLGZAAHG X-Message-ID-Hash: HHTQN6BI2DB5PSN2Q2EADXO2LLGZAAHG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 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 --- Changes in v2: - Mention the 'dh' subcommand - Mention that 'order' allows the boot order to be changed - Mention the eficonfig command and the underlying UEFI firmware doc/develop/uefi/u-boot_on_efi.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/develop/uefi/u-boot_on_efi.rst b/doc/develop/uefi/u-boot_on_efi.rst index d20d5b00ec6..845d04d7826 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -143,6 +143,30 @@ 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' +* Show EFI handles with 'efidebug dh' +* Manage boot options with 'efidebug boot' subcommands: + + - dump - Display current boot options + - add - Add new boot options + - rm - Remove boot options + - order - Display and modify the 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. + +See also the :doc:`/usage/cmd/eficonfig` for controlling the boot order. The +underlying UEFI firmware typically provides an easier way to manage boot +options. + EFI Payload ~~~~~~~~~~~ The payload approach is a different kettle of fish. It works by building