From patchwork Tue Sep 2 15:21:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 172 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=1756826538; bh=kfcVighx6xCdlrqUKpP+Pw85nyAVMfzAe7Isa7nlv3w=; 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=iMT+NM6UondCf4B4PlzjI+BxSy66AIpRNu0I2ZE6oIMQfVbyuWl20c5urLN/GVwi4 jlTqmO2ApCHJkoJhaJJGooVptZTY73W9reYs/xI5y0RdfWFjZR2BCdIEqvV1U186zr YzhPZwKmzwboCS3A5D2LSbFTKdiVgQTtmvahk748HdN+mkL76eHmFyVnzXmH73/9kc qnvPf593Hyniu++K9MG6d7uATUayVB6C50Ih8+ChiZKzerKQ7O/m9994mBEr/xKS15 7HwdFZlFyEpMR/Y+LAR11cm4DY2C9otW6STdgZZ/BWYXXsTr8/8Dh9DUqYQX/TwM70 slSk04VzyTFhA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0E6A5678F0 for ; Tue, 2 Sep 2025 09:22:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5AoUvocMFtCg for ; Tue, 2 Sep 2025 09:22:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826536; bh=kfcVighx6xCdlrqUKpP+Pw85nyAVMfzAe7Isa7nlv3w=; 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=UVp9O0mpVBdSV76cJcsWbNcE2HaRhEyaXHJU4kLfuLC2ToiCbE0ArojC4R3w4EWQW GVNxZd4S2Kw7CyRZAl9qg1d6eyAGh6fuVegaiKvVrn12J7K4UhZTkoOhhPt37ZZ46V Y2dSwQVtx3KZtzvpsTKQStT8D4uSuvNR982dSQmStjBD51/qocVaXsPTHP7Y8CA//M D73qo+HU8XOvLuNDh9PhT7w3jfqxhUBrCbLc9nde2Mx6ZdVKlkXFK5V8845f38h9Fn sruCIzB+B4CwTqnDXShrtAv01zXlwb1LhMpsOWqVPgk6GCg6/9KZsvMmwowkaUXTW9 UZ5a6z8Ci2uTg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7B1306788A for ; Tue, 2 Sep 2025 09:22:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826531; bh=DJfbNLfAolVDMGCM9hsPnt6s01KVCKDFsqI5F2dKyPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NmMJbBtPyQB7OTPXn9494KRuy3kB31KxhtQ+LN1s9knCsE/dSCEyz05Naq3DGU8JZ f1SnjNE7VaU5BrQWl/qE3wt4Spmb27As9BBl25Oyr6QdrpTXvboUfBGr8xGNzWatP4 zdJaW95mcYi+aLKYGW4h1keAbIAtJCRI5GP7sgYNFm0rW4Wb89MKCS1jQweyLL0Y4d 7hSaG4uRlV6kmrnUl2XWbtgEkA7VvKuNdZn/ROKY8bsvIotSHj5LooKFEgQ7ciuFSv fjdeLna8B0ptRHfgFztLL2+cSmiGuCUh8+onFmSKrbWfaxJnGDTd/RSrMSIFbZnTRD /rlH9O1zWzPPQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 67B3C5FE1B; Tue, 2 Sep 2025 09:22: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 Tv8Niu5-qFxh; Tue, 2 Sep 2025 09:22:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826530; bh=E4spLM9o5d+VKe8cMcf1Rp2nj2j4H56z8bPMC4jbx10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WkWwoDnAycW6ggvVq5wYqynhDPFbukkLS3LsANrkS+LKIznz6Wo3vHN/Uk2sD/hAi 41CLGctJkJnS/unwMeoIlIs4hc6OCI3mwNflGA1FKfIhK2c3eecTtHa0b8fe6XtfoR W054/eczAdkVMbYItGRZGNZhwGFKQNDVDr+k9UCIoHBND3iA6RXkZjwoiDUXDDS1KI Bh4j8RnQUeZWD8lnyhSG1KP/XpnCyhjL48MyE4tWDyN5M37InKHqBh9uOigy7B11Nq AKzGcP0iDY1hu82+7DawwOAG6TlnRS+YLEfPtTqW6L2Oh0AxmyTHHRuzPiJ2Vb3oFf IV0PQdFoxipnQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7A1B9677F7; Tue, 2 Sep 2025 09:22:10 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:33 -0600 Message-ID: <20250902152158.2285264-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HNOSU5VKXW6PPCVA2JGFJJAOQREBGUMB X-Message-ID-Hash: HNOSU5VKXW6PPCVA2JGFJJAOQREBGUMB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/18] efi: Correct calculate_paths() when an image is used 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 device path is updated if an image is used, so move the setting of *device_pathp lower, to take account of this. Signed-off-by: Simon Glass Fixes: 73ad2d99093 ("efi: Move efi_bootflow_run() to a common file") --- lib/efi/run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi/run.c b/lib/efi/run.c index 4f47743476d..1903d6f0b9a 100644 --- a/lib/efi/run.c +++ b/lib/efi/run.c @@ -46,7 +46,6 @@ efi_status_t calculate_paths(const char *dev, const char *devnr, if (ret != EFI_SUCCESS) return ret; - *device_pathp = device; if (image) { /* FIXME: image should not contain device */ struct efi_device_path *image_tmp = image; @@ -54,6 +53,7 @@ efi_status_t calculate_paths(const char *dev, const char *devnr, efi_dp_split_file_path(image, &device, &image); efi_free_pool(image_tmp); } + *device_pathp = device; *image_pathp = image; log_debug("- boot device %pD\n", device); if (image) From patchwork Tue Sep 2 15:21:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 173 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=1756826538; bh=/ETr8s5upHjRaj9yMqgEc1NaeZufUHFydPEFW1mYHr0=; 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=FrwzFofcDB9M9GyjTPzjty1Pf7Zl1aDahDfnIIugeXXKmV+pCWJi9GvBi7CQkB3Xh v3qjUZLCVrslFc2QMj1A2u1DJRbbsFuxwZQYg/EjCAwcG1jfDLbaDVynx8xrlEUKn1 RM8G7E58an+NT2iMZakD9VzZA8gYun/RTdxlOq7ROyHiM+tz9zHklJJ1t69fHh5jNX uDsd1VD98OGRpZdMmOisLaFqqi/U3Fr0l1tJO++6q0/K71loLnybnczCyNGDHakYou 5Y0UAM/kpulviV5jMrLob8mAra69xT68X9I7a92od1ZgrIRvLSObFjc8mixZz/Nwg/ RDRtTVHwJtrcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D714678B0 for ; Tue, 2 Sep 2025 09:22:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WlN5T3G-osvG for ; Tue, 2 Sep 2025 09:22:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826537; bh=/ETr8s5upHjRaj9yMqgEc1NaeZufUHFydPEFW1mYHr0=; 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=fHUYI0cE6s251YHU/B47KcVtzpS/LVXurnSUNQTHftP4mO8pHtnft1nT8DZsubIYQ 8EDNSqpY8MeTA3lNHqdHj0LUJbx7U77pg0pDnXfLIshRmmKorB+jTjjK14IBNG8s3x DBahMsu3lirHA9oZFZuQJUi7OomRfzmrqYDhjFJ237ap8HkFwCSdzHwHmUaelRkzWY aJlx9jWI6k3TEuUBBCuLGHToOa01IJrNaim3foQKxUeLkGdlDJ0l8vx0pSo5A0Kg9M fZ8gGrxyaW08jzOQr/83rDOTGDnHgL3XQRg0m5KzaZu0ho0phmDwC9Qyi4LlEVBuI/ mFlUDzdIQmamg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 61A46678E2 for ; Tue, 2 Sep 2025 09:22:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826532; bh=3goQRx/j29x+F1rQwT3s5SeD0gCSsR3j1KneYyDOimw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aAbJwTSWtDLgbo7w5bJPdwpedJV1CX+1wD8aCPCXjsMuzmrpSTFNM0Gnno8zhBvlv nHGNAOkOzDnO2mxKuH2mYs9xBsytnGrUKHk5lOJmyfoorYn76zeGxjzFskY15ogSEa UxbAbfa4byTkYZWhJJndosvAVhR9RI/AVPfdkdlRbQHXnU+EXezgcXrwQUPv0PT2AK HsXX3Y1GSOB5U2egOA4ZIwPf8AlDDGmN6xrvk3oC2wJbnbpgtULeKIE3uWbfAO/KPY HYVsm1hERxlvWHOV6SniqRaW0m5EZ6h4lEldpouGBas/SNm2phRzo6YBQVicRd37x4 nmuuhPm5kZdtw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3507A67878; Tue, 2 Sep 2025 09:22:12 -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 B2z6247bFY1b; Tue, 2 Sep 2025 09:22:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826531; bh=MopKLvDS9lsFzB4Stau5wzQUTpw9uRNgxhcZ9uSgku8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wpkBPlBCBTmHcfVAEIGE4svMn5n1BYgxGTLlIibokb4LV0jrKwQtiKClDufpJgDnt 1g7kCjiOFT0YE/r7Qfg+qBTr3YL3gCkcqk2Z+a42IKMOsNXo1G7PcCnCz08MTVDoQY R1o+kdkujFEkhUn7B9gj3WUGS0bbLOmKGqlSVdEH+h7WdaAEXZnGZLg8sgCvlD7G+7 3QqsF41ntCDK8EyOgO0x6BdaAt+qzMzhQckpAMJdJ9kGwrp2cO9bLfikq8EzBaUoES PeraVV4v6KCvc0QQnS/L6gXM46L2qGOc1O1Z9mnLeCPTf4SUGxoilApPNQqpWevITH EsF9tEGj2jZ7w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A614D677F7; Tue, 2 Sep 2025 09:22:11 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:34 -0600 Message-ID: <20250902152158.2285264-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AUL5QE7Q3JTJREZRO56G5IKFQYO5747T X-Message-ID-Hash: AUL5QE7Q3JTJREZRO56G5IKFQYO5747T X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/18] efi: doc: Mention some EFI commands in the app documentation 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 not obvious what commands can be used in the app. Add some links. Signed-off-by: Simon Glass --- doc/develop/uefi/u-boot_on_efi.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/develop/uefi/u-boot_on_efi.rst b/doc/develop/uefi/u-boot_on_efi.rst index 845d04d7826..451a6e71fc3 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -431,6 +431,15 @@ board/efi/efi-x86_payload common/cmd_efi.c the 'efi' command +Available commands +------------------ + +See :doc:`/usage/cmd/efidebug` and :doc:`/usage/cmd/efi` for useful commands +available in the EFI app. When Shim_ is in the bootflow, the +:doc:`/usage/cmd/shim` may be useful. + +.. _`Shim`: https://github.com/rhboot/shim + -- Ben Stoltz, Simon Glass Google, Inc From patchwork Tue Sep 2 15:21:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 174 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=1756826538; bh=SGtC4GtEjmwwmSG3tuMHSloggvLxuwrjE/RCB49vXQQ=; 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=Co6avSZ0ha1rAjwSqi351I3tlWA3pj3eUiGbhM7jOSuC0drpKPymcN/zsEHsK//Bq BDlwx4NvgaMKfoPOZRvYxyS8hrq/2DdMOi9L8+4ffMJVnZK49IL1z9brqAKQBRYefd 9X5+XFRFCf/zT1x/ZcieWaMgrqaVIX65QLhUHRpbC/Mji+ilWXF0FaKZhJWMoKgcy7 /mtuAK2N19Dnie/FtwBbQzqxMJOZRoFWHPRWQWJKN7JkvdhSOROBV5q49C+hwXlGtB EenvzWZEXN6IHcE5YJxupgZ6hxiR6aTTjh2YL2mDj93eCZ7/YDJ3lQi8sJNsxgkJi5 MKrlIcyhlaeUQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A467A67867 for ; Tue, 2 Sep 2025 09:22:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id oKQjY0JsL9mM for ; Tue, 2 Sep 2025 09:22:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826537; bh=SGtC4GtEjmwwmSG3tuMHSloggvLxuwrjE/RCB49vXQQ=; 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=NA6rD9ki9Aso4adFO6sOa8fSaiwU95dpX4DDdSIAJBTkS/5xA7qxMWNaLq1JVhRmw GkYpmWwlSc/8J7ma38/aKl42Rq8UgFsl+yWzYYLtUvKwaBtqB7KzO6dOcisvLto13n VaWpsr5VBwWIIw/bjpPrROYqlw6qOAKvstCmveIT/VB74L/3sJkQQC0tAWNzorIbeR 9Ihx9bN7GLffNdQrmU2NDzqRVlm5LKtAdU2vRWON0s7LROS6eRRdfg+h9PzLzsLMxA B3l5wc8UFKI8QmBbk6Zk+OVPjH8bavZ+aSU+zgNEf0P7aW4Fz47OmjWoSnUF9iNOcZ zkYG9TzKPhWaw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B86F3678EB for ; Tue, 2 Sep 2025 09:22:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826533; bh=9EHZeJ22uPY8NbsHORorBoSiHyGUF/Z3p181QMB6mcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMIFAHmKxgmVTyWwYP683OZ9/HNR++GyQmTI45HStyefza/xGQRqN2isI2UN2wdhw BAFeBxx3FPtJA69XGCbbuFewj5A3lsa6P97oIqOYEXc36gvOz3Fw9yH9gK2ZYAgXbP dBTbgKX2RL0MMZW4hDPpaeoxRVEDp9bhN88UFw127Fep86RTk1qmP+AOqmq6rbxnYV U+0nxK4v20qmS7v7jPIXAPAWJT8xnumJVncSl2KFlWe3X41YeaB9fuPo8t66oL1dVX POuYm0zAvwVATLGvw+k3v5e0ehWkW2C0bkIh2HlUd8kBr/sKnGQZY815mGFSHcByAI fBykbEEodj2Xw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0719A6788A; Tue, 2 Sep 2025 09:22:13 -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 yds1zBJcCU4d; Tue, 2 Sep 2025 09:22:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826532; bh=4Eb3rJ7USdWWWgiky7uGcfviS29T7b52gTcWblMb72A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f8Rp085RCRCMSwZkw972VNpAlNjJb9Rs5ZJgu7H8Bgfvk8wh6Rm+TFQJtUijQxr3r t6L/9rl8wPhpcAsXMuH7rMprMZOIbWqvPRqpJE3JMzokmBmT0bh8z2EFH+YRnSm1n3 i6xMjb8SALASL3e4HTXLztQ5Xxs10j1DnQY5fCBlkNts3f1GunBBIuCvPEhbvsajaC TIBZp714Koq6NUng/OkeGTbTSMe8lG6d8m74YslGxChB0jPifmAkcKAD+uuE2YJNVB c1Ia2F1NDlfTq7X5izDZlzs5JhTpryt2d0hSb6Hw2jsLBQlVDwM3k+w+pHjU2y6liI WOAcAOiIO4Fyg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7817D67867; Tue, 2 Sep 2025 09:22:12 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:35 -0600 Message-ID: <20250902152158.2285264-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5IMVOP45DLI2RZMP6DXO54TN57Q5MFMU X-Message-ID-Hash: 5IMVOP45DLI2RZMP6DXO54TN57Q5MFMU X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/18] efi: Allow inclusion of EFI-runtime headers 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 headers use the __efi_runtime macro in their declarations. With the app we do not have a separate runtime sections, so define this to be empty. This allows the headers to be included from the app. Signed-off-by: Simon Glass --- include/efi.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/efi.h b/include/efi.h index 6c2c1f815dd..6caa51c38a7 100644 --- a/include/efi.h +++ b/include/efi.h @@ -58,6 +58,11 @@ struct udevice; #define EFI32_LOADER_SIGNATURE "EL32" #define EFI64_LOADER_SIGNATURE "EL64" +#ifdef CONFIG_EFI_APP +/* add an empty value for this so that efi_variables.h can be included */ +#define __efi_runtime +#endif + /** * struct efi_device_path - device path protocol * From patchwork Tue Sep 2 15:21:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 176 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=1756826545; bh=viifMwawyFRpRFb05iEJbL54E70NmeFPCIFzh80odt8=; 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=d5za8Y9u+S5sBAPZnXzGZdq3nOGHrHToaPs2s2TTL8ziUWoqK4BBuJ3MHMIu9XlUn B2JwP8VxfWfgiibx2sLshesuE5lIaDG5yCHKKL2MThbS78J67sWIFQkara9aOACfWa YE3gV5oWlziJJlZiX995AwPJ9wG74VJ7Z0cisZaURnvAGUKecuIh8wFtuwFw+Kn0B2 V1nlM+b+7lZaeQmQxveU7n9gBrVR9aQDXtixpm97VXgTWJKMoufzjzl+U9J8nSsmoZ /e9IGbYhAz7UREEs0M99iBgBTFYTWO9cyXqE1zFW1O9yyg5CfnyckhnTdR8z8EhnEh VpfWwPUlCk54A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A426678E9 for ; Tue, 2 Sep 2025 09:22: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 3mVD0EPC8FNi for ; Tue, 2 Sep 2025 09:22:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826543; bh=viifMwawyFRpRFb05iEJbL54E70NmeFPCIFzh80odt8=; 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=onSyKdn53NnwoGB6+9MKdCX13aUfGpLvnXS/Ik2fPYG7bONiuQnlVmt6wA/oA2lGf waP+/BV2ABjSKuKri/f+mva+e/xqA718wYuq3rFZgcSGMNUroeYljN2DQfYBmCrv5D bipqYyuf7H6QWGLcql+RnRGk4GhhsZEyIW+3S9lu/DpwzQtQreN6CCgc0PP+NGadwa E3nuTd/4vWEhqVLIIULkHZTeb0zuOwhy5kMhedMUKvuvIuP9/wWBDXg4lWEUpTM+kb nRhxqnhDi4GTMlZkYzefNhacY1FKYNtRu7rQc/lyW7WScOfnPA9c5tjHS/XFpFGqPi Z+yUU1kh0SXnw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E8B4867864 for ; Tue, 2 Sep 2025 09:22:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826541; bh=Kw/wjk4jK0t/DU5kAbS7vZ9IijDru5BRSoFwRAuZSsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppigznM93gFV2JkFky2JjC40w8WOzLzQz/rc9S+MwCFOKAJYk8nYOOG4Mb3Xht4P4 R7ecZg+L95JFrv3VDI2kJuSlgN3/7jUUk1nXL7sF9p7Ryifcc9yV/RzWbLOp5KiNBX h7OXBB3uPOD8AcwwbGqnWTdLJe5T2cFCJtDFCZ3/1eRNiMJya/0XUnwJmXzqgeQgEB +bkzt1kpBNf/K3/UJ8tyfffRFV/4N+D6c14psbBPaCXvtKVZnkBCZYTLM5dYvvSdTC x4ZrGRw7rDVyzwaxpdCCmBi43gbvaQpcHwL+qZJVIcKqDltJQswr0eeKARuiX1vwrw me7GJS+ZR2drQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0543F678B0; Tue, 2 Sep 2025 09:22: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 10026) with ESMTP id f1sSMZwyJ5qh; Tue, 2 Sep 2025 09:22:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826533; bh=1eu0WVliwf5PbFs4pbFIB/ZijhGtOswvxEFP/KPXyuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n7PL56T+67OuEOJsSf3y+Rc2cDcDH72UCvnV8OHRQm/tOOl+ICLL0KIjyum/sKyZJ 6r0E8CWEYyEBuccZ7MSgT6agP8PVCa1neKj+HIqY2AAbKRcZci13UhBvIKb8scylsU kfRVBPKgrNKfP2Jqzwb3slXYSoDwLamOMl4qmIzOkzsoRVYn3d7cOCwVqShL6Lr2J6 f25sCFsJfuqw/BTPqMnzsAdAFgZiA4ZDSTZNgdeoMNsWUBzIvn3lRxhRY7tzcqaki2 qCkFe/+T7uhdZCvPNARgcA76lmiFo5GZdkIrtlx0ghNDBxYg3j1o2JLyF/ptaFArhe xzaPu8iJtV2Ng== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 482275FE1B; Tue, 2 Sep 2025 09:22:13 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:36 -0600 Message-ID: <20250902152158.2285264-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EETN4HBTUFSIICWTZGCJ2IZ2ZIOIAIK2 X-Message-ID-Hash: EETN4HBTUFSIICWTZGCJ2IZ2ZIOIAIK2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/18] efi: Set the log category throughout lib/efi_client/ 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 All files in this directory relate to EFI, so set the log category consistently. Signed-off-by: Simon Glass --- lib/efi_client/app_run.c | 2 ++ lib/efi_client/efi.c | 2 ++ lib/efi_client/efi_info.c | 2 ++ lib/efi_client/efi_vars.c | 2 ++ lib/efi_client/sdram.c | 2 ++ lib/efi_client/stub.c | 2 ++ lib/efi_client/stub_arm64.c | 1 + lib/efi_client/stub_x86.c | 2 ++ lib/efi_client/sync_dt.c | 2 ++ 9 files changed, 17 insertions(+) diff --git a/lib/efi_client/app_run.c b/lib/efi_client/app_run.c index 9fc753ceed8..de2c6b8bdd2 100644 --- a/lib/efi_client/app_run.c +++ b/lib/efi_client/app_run.c @@ -6,6 +6,8 @@ * Copyright 2024 Canonical Ltd */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index 12a646a36b7..083ad1f423c 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -10,6 +10,8 @@ * Common EFI functions */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/efi_info.c b/lib/efi_client/efi_info.c index a0d7d3b5d7d..5ff98e8829e 100644 --- a/lib/efi_client/efi_info.c +++ b/lib/efi_client/efi_info.c @@ -5,6 +5,8 @@ * Access to the EFI information table */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/efi_vars.c b/lib/efi_client/efi_vars.c index 4fc48b90d6c..9764a9802a4 100644 --- a/lib/efi_client/efi_vars.c +++ b/lib/efi_client/efi_vars.c @@ -4,6 +4,8 @@ * */ +#define LOG_CATEGORY LOGC_EFI + #define __efi_runtime #include diff --git a/lib/efi_client/sdram.c b/lib/efi_client/sdram.c index bd59dfade0f..357ca095f86 100644 --- a/lib/efi_client/sdram.c +++ b/lib/efi_client/sdram.c @@ -3,6 +3,8 @@ * Copyright (c) 2015 Google, Inc */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/stub.c b/lib/efi_client/stub.c index 01d62c3e5c9..3e3ea91f915 100644 --- a/lib/efi_client/stub.c +++ b/lib/efi_client/stub.c @@ -8,6 +8,8 @@ * Provides helper functions for use with the stub */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/stub_arm64.c b/lib/efi_client/stub_arm64.c index 0e579a17a75..3184be64cd0 100644 --- a/lib/efi_client/stub_arm64.c +++ b/lib/efi_client/stub_arm64.c @@ -9,6 +9,7 @@ * Call ExitBootServices() and launch U-Boot from an EFI environment. */ +#define LOG_CATEGORY LOGC_EFI #include #include #include diff --git a/lib/efi_client/stub_x86.c b/lib/efi_client/stub_x86.c index fac55fa8f32..b223c36c798 100644 --- a/lib/efi_client/stub_x86.c +++ b/lib/efi_client/stub_x86.c @@ -9,6 +9,8 @@ * EFI application. It can be built either in 32-bit or 64-bit mode. */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include diff --git a/lib/efi_client/sync_dt.c b/lib/efi_client/sync_dt.c index f191a31125f..44627451dae 100644 --- a/lib/efi_client/sync_dt.c +++ b/lib/efi_client/sync_dt.c @@ -5,6 +5,8 @@ * Copyright 2025 Simon Glass */ +#define LOG_CATEGORY LOGC_EFI + #include #include #include From patchwork Tue Sep 2 15:21:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 175 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=1756826543; bh=er1gtHJUz56J56dC6eV12bbOcMY+OP00ZbFyyrIDPFY=; 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=Yy4+RxxcyQpvcBNK+SZUYH3pKFSAG7WAfw+SSOZ3X/RXI/5WnU/l7Kg5cZYAdD/sW VsOVtFgJUUtFde7nGFMoEhbSotWfZZxU+myzsXKolbnIaEsDc9T8tHua4Uk3wMIqxu BkAWvI2/6wsHTQcptG6SRb0k7gH7aZepmyInHSBRbdw+YEzUD5crdiHwi7o15Kcb4h 8ij8ImxIIGxf8O45Okmqn+F7pGgMXr1Ks0KRVRwNMeVXgNUN/GGrh7+F+F6q7JQ+tJ +KLMPvPaleYhzMLxy6MifIsRK+S+rkXYV/42LHPQ+e3kOLvDWVSt8v6Ybc5m05Ndby MDV/mpR7iZSDQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2666F678B0 for ; Tue, 2 Sep 2025 09:22:23 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id slwennvdSKky for ; Tue, 2 Sep 2025 09:22:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826543; bh=er1gtHJUz56J56dC6eV12bbOcMY+OP00ZbFyyrIDPFY=; 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=Yy4+RxxcyQpvcBNK+SZUYH3pKFSAG7WAfw+SSOZ3X/RXI/5WnU/l7Kg5cZYAdD/sW VsOVtFgJUUtFde7nGFMoEhbSotWfZZxU+myzsXKolbnIaEsDc9T8tHua4Uk3wMIqxu BkAWvI2/6wsHTQcptG6SRb0k7gH7aZepmyInHSBRbdw+YEzUD5crdiHwi7o15Kcb4h 8ij8ImxIIGxf8O45Okmqn+F7pGgMXr1Ks0KRVRwNMeVXgNUN/GGrh7+F+F6q7JQ+tJ +KLMPvPaleYhzMLxy6MifIsRK+S+rkXYV/42LHPQ+e3kOLvDWVSt8v6Ybc5m05Ndby MDV/mpR7iZSDQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 123E86788A for ; Tue, 2 Sep 2025 09:22:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826541; bh=lRLQOvLRfjLrILJnMvQZt3Ot9/ZjKlsLqGdTD6agemE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xi9LsQ1oCQo9Xfq7Vd/f1+CXBJCB7a9t7zXsKdFui2CN9SWJTOz0hM7jODNXB5NQv 1hu4uet90W2vzX0fJNQAjabkAWWzDOLBTAyr5BLE+juvqjN1xZ8ana2fGAZFN/0hzf Lc8xlU6Gf2WUW8Zi24cs69tfBzKemYZDYju+ULKhxuAtfrzNBbAWlj0gRFMf3M9HeY 66e2vnYGBCbfSJ44B1Wqv8O7VBhTkT0117VOHRROImAe9IKf6XlTt4uJTGlFX2r1h5 jK4WJAx+qXVjaNPWcjo3em4T5ciadrvnbyXQSrxekK5wHYZIozmq4Wu3iPKBLuWC7a PKqqtuF9y1Q+A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 055D0678CB; Tue, 2 Sep 2025 09:22: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 10026) with ESMTP id nwAGJ0swQw4X; Tue, 2 Sep 2025 09:22:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826538; bh=CZXjnFDBVPSgL/AAfpdse4WmLkBTjusqu0cV1S9l7gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AmQ1DkCE6QxqARSocpdsnf2MR3W/Rh8IXfHmYX8dK87VpOCCL1awyarKrgccnEvkU F72v31pcaX3osmrh3bxHxGGar2qZyP8swxZF3QbMXcP8t4DlX9mrn5Fs8YaAirQ0+4 RJZaEy9gNSwQ/ohBwZBITIQ33hjUqEY/i/ZMCZBpj71BbdlIXKoGRQ+/ZXrQbLGR9t RN2LvRv34fMTPMQoZExTaMuHMphKmbdsg/B3p4wwL2cTPWvG3zM5iQlvfeVwi/eY44 ulxvx2EFQuKTgfiicmsCwNhWoJP66GJ0D02/06zwFbUOU1xeyfHG2uYcA/O3XrLFic /vOOfuwyVgI9Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D9526678EE; Tue, 2 Sep 2025 09:22:17 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:37 -0600 Message-ID: <20250902152158.2285264-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4EN7W2IG34CUVNX3J457AWEW4WCYLDVF X-Message-ID-Hash: 4EN7W2IG34CUVNX3J457AWEW4WCYLDVF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/18] efi_loader: Drop unnecessary efi_dp_str() 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 declaration already exists in efi.h so drop it from this header. Signed-off-by: Simon Glass --- include/efi_loader.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 52314c33533..57bf508adb9 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -302,8 +302,6 @@ extern const struct efi_hii_config_access_protocol efi_hii_config_access; extern const struct efi_hii_database_protocol efi_hii_database; extern const struct efi_hii_string_protocol efi_hii_string; -uint16_t *efi_dp_str(struct efi_device_path *dp); - /* GUID for the auto generated boot menu entry */ extern const efi_guid_t efi_guid_bootmenu_auto_generated; From patchwork Tue Sep 2 15:21:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 178 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=1756826550; bh=1Qh/4CVz/kyNVwgY5a+ZZ1Q2ZcXTfXeyP3GGUSBy3Pc=; 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=itjom3F0CtHQU2O91mmArEau7WQj0lddqYEMm0PbyVL+NbyenKuNEPN9D5n9quZBu K4UAtwsUPgPRm+FmiKh5LRZVqxry1zXdzICyBUw3PmdpX8yyXh+d36DvNIcXNiKC2e t5Qj3ahgbRs/qEYE+X3ZYYZ6A4EzMSx+C/pERqNZ19c3NujbBFroz6BFsmZJsIQmMu uEbaAYQvC9jxe4QFoudzuFZwJ0nWxl/FQYEzhonRWvEb3u34OTDC9B3hak1E+np21D BsyipjNunMWNoIkk3JNtDsnD7sKQ/pEpF2MHcwzrivuuP2X2Xto479Blr5Lc3AEYnn H9cABMEHHG12g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6E53C67867 for ; Tue, 2 Sep 2025 09:22:30 -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 Zz3NI9lCCg45 for ; Tue, 2 Sep 2025 09:22:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826550; bh=1Qh/4CVz/kyNVwgY5a+ZZ1Q2ZcXTfXeyP3GGUSBy3Pc=; 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=itjom3F0CtHQU2O91mmArEau7WQj0lddqYEMm0PbyVL+NbyenKuNEPN9D5n9quZBu K4UAtwsUPgPRm+FmiKh5LRZVqxry1zXdzICyBUw3PmdpX8yyXh+d36DvNIcXNiKC2e t5Qj3ahgbRs/qEYE+X3ZYYZ6A4EzMSx+C/pERqNZ19c3NujbBFroz6BFsmZJsIQmMu uEbaAYQvC9jxe4QFoudzuFZwJ0nWxl/FQYEzhonRWvEb3u34OTDC9B3hak1E+np21D BsyipjNunMWNoIkk3JNtDsnD7sKQ/pEpF2MHcwzrivuuP2X2Xto479Blr5Lc3AEYnn H9cABMEHHG12g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5AB77678D3 for ; Tue, 2 Sep 2025 09:22:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826547; bh=u+X83B0UVnp2mP3OsUOlMTDfUaRAyJ7vJW4yOvYjf3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ih8uK1Gelg5ACivBdMAdBAdZJV/do7c5gN5e3zUso5RWf3OYZ2rVVhzal/gooFtyi ZhYJzKKgardD/jdV6PhY9rLa7OwnkW07mIB3Pg3sGpGNYp/1b4KIGyxZrLzq0WLw7A LYozO9+BEzyOdnsNJTJDhc5WPZiyNSCknM50ojDB7UmMh6aHxTQU/0XtnGO6i25BqC 1LYNL5RYA3cl8VHoop51yExC0tyP5yeVR0aCS2+mQWZOVbgKtr6kAyj8EXXS7J7qEX UEWm6S81yOK4H0fEyZUfxZfHhG1Lw4Yj7qOgHH2lIMs2qS3SCbucO3Q9PijdK25S5P HmrLsWL6b+mtw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2783678C7; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id XhfKeSLH2BFy; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826540; bh=5xVG1MbIkA/EHRhAca7hq+2SKFtbk5hI3x4K0PUA9kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUXFUI91U0AFwedNsNN7WVKVrYqujJy+iJ2IH7SWd1SgvzlZZxeIgAfiRdZVL1MWz as1gy51MoD6kNl8qVcbZ0pNAuks66SHfoCV1s2+8qkQaqoe0QFmB4eBU77/lpHghvJ rK+a7lw57hZZSTP6Nu3LK6RFF6I6bMugxcH4LxNYUk8K/QHI6SSXXCs1dYntIAojSg bZTp9PEg1I6yj7xmCSbIGcTYSVdGaSdfmIgrYSBO+RIdMSPz8JLYcpI8S9moJ6pySQ KTb4uYgmHnOI+kKFAtLOWQUm/m+ImBukyxCA0We0sZRgmhvcoQxCsXAmb/YRZ6LCMb ExkLXhh3vKesQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D6FD267867; Tue, 2 Sep 2025 09:22:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:38 -0600 Message-ID: <20250902152158.2285264-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XLNBPDOCVI7YTW5D53THA5ADN2DDFKAT X-Message-ID-Hash: XLNBPDOCVI7YTW5D53THA5ADN2DDFKAT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/18] efi: Move loaded-image, fs and device-path GUIDs to common 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 Allow these to be used from the app, when EFI_LOADER is disabled. Signed-off-by: Simon Glass --- include/efi.h | 6 ++++++ include/efi_loader.h | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/efi.h b/include/efi.h index 6caa51c38a7..e9ca4840352 100644 --- a/include/efi.h +++ b/include/efi.h @@ -171,6 +171,12 @@ extern const efi_guid_t efi_guid_image_security_database; /* Access to Shim variables */ extern const efi_guid_t efi_shim_lock; +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; + +extern const efi_guid_t efi_simple_file_system_protocol_guid; + /* Generic EFI table header */ struct efi_table_hdr { u64 signature; diff --git a/include/efi_loader.h b/include/efi_loader.h index 57bf508adb9..2caaaf56e3e 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -316,7 +316,6 @@ 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_guid_console_control; -extern const efi_guid_t efi_guid_device_path; /* GUID of the EFI system partition */ extern const efi_guid_t efi_system_partition_guid; /* event group ExitBootServices() invoked */ @@ -331,10 +330,7 @@ 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; -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; -extern const efi_guid_t efi_simple_file_system_protocol_guid; extern const efi_guid_t efi_file_info_guid; /* GUID for file system information */ extern const efi_guid_t efi_file_system_info_guid; From patchwork Tue Sep 2 15:21:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 177 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=1756826549; bh=lQoBuoUyWt1IpdzAAnGhrlJyJ++SDFPIOu6kTo220VQ=; 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=u5n9SoWqTyMsZkuyd+2v7p/dYEVOdvA0XZRxs1XELoeFti9sgeG+lmPLO7YsULRYD BKNAe0YT2jM0R27NA0FlhseZ1lDULv9LhT+bPi5ySdRRVsACCe9c1W5PNpm87PPIRP Pv12Jaz+1hpLeSHEI58jCU4pvifwjcCOhwYxlxtuK4++sNGkpGlaqpxlLdKWP93SYQ TgbpMHRwQ2lvo+0af79545MjG+dSsdAcf9JP36dMACfgRHV5KxjXtea5soM6vk2O/r 0FpfMSgM9ECdIbATkVakSpk6yf2aSmNSttJT5YIsHxSNs2WHh/kRxgUm6OgJ5BRgqd tPLH2BSWgagew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE724678B0 for ; Tue, 2 Sep 2025 09:22: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 5Wv2kFI8dsIi for ; Tue, 2 Sep 2025 09:22:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826549; bh=lQoBuoUyWt1IpdzAAnGhrlJyJ++SDFPIOu6kTo220VQ=; 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=u5n9SoWqTyMsZkuyd+2v7p/dYEVOdvA0XZRxs1XELoeFti9sgeG+lmPLO7YsULRYD BKNAe0YT2jM0R27NA0FlhseZ1lDULv9LhT+bPi5ySdRRVsACCe9c1W5PNpm87PPIRP Pv12Jaz+1hpLeSHEI58jCU4pvifwjcCOhwYxlxtuK4++sNGkpGlaqpxlLdKWP93SYQ TgbpMHRwQ2lvo+0af79545MjG+dSsdAcf9JP36dMACfgRHV5KxjXtea5soM6vk2O/r 0FpfMSgM9ECdIbATkVakSpk6yf2aSmNSttJT5YIsHxSNs2WHh/kRxgUm6OgJ5BRgqd tPLH2BSWgagew== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC4B65FE1B for ; Tue, 2 Sep 2025 09:22:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826547; bh=NhoDKAIBM0DZGTZy5qEzbwUd74atBNr2GbAt0LYwwS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MeKd+6w0ksPQeCq+ToLtIZL6XJzSOJbMBbsomhBol2RVnvAEMoJQDjfkDVLMxf3Df t9sYf4Fqv9mo5PU84/xlhOlXARYX1AdjOQyrsck/9zF8ImtLlXw+0DDPktKOoEfJtt 174ErTkKVI6jx3t048ejwcvHnjoScdkGIo8uOTwYKASp00JGXDLzvpwKMh2t3y6fpT nV0PG/8AnSBtqWsVdDkiZkvaNKSx5OracFQA9S85P5zOaLNH8XNqBmn/7cpehKbbnF zsBdO7OqxgnyIDTcTXrkvTu3bCuOjZMis8//kPQebCwlrNaLsTGAVraSAd6RXzXRn6 eXRusLX8kNRiQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A168D678B0; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id vFlATmvV9Wij; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826544; bh=botqfGuJrgX9J0c6KEwxStfn69CRLSyx8HKXy1mz83U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nu9M4lVecJ/cDgL6kmfmAJApGEEi4UbvoQB4k8E+9yN/GBjT2w48Z7850Agqlnahs 1XMGXJ5y3MYqWA9DEoQbcS8zbAAh93JUPPwmdsXaO4zz2tOoWNv6SrVLeOtJNWOYoh s9NDz7zK8zoQbh1HfzxM+bWctW374s9jUkJPjm3s5296e9NBOIj2doY4XCKeq2Ht/7 3Dg3i5DiObemUdeOE959L8mjj470If8tQNjGBEeBmeyiAtt3XHUR0xPhCCzXna1rwg ClZ5g+vJJwoPeHcpyLCpPw036kAZLpQ3lYwoxDGnRsl3oyC9dq8MMB5CHn5KGtKsYO julg+t7tT7IcA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6C488678E8; Tue, 2 Sep 2025 09:22:24 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:39 -0600 Message-ID: <20250902152158.2285264-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LUFHN7AN43DRTEWD6TU7FTODJJCZ5BSB X-Message-ID-Hash: LUFHN7AN43DRTEWD6TU7FTODJJCZ5BSB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/18] boot: Move obtaining the label into 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 The 'bootflow list' command supports looking at the EFI device-path when available. Move this piece into a common function so it can be used elsewhere. This updates the output from 'bootflow list'. Signed-off-by: Simon Glass --- boot/bootflow.c | 27 +++++++++++++++++++++++++++ cmd/bootflow.c | 16 +--------------- include/bootflow.h | 8 ++++++++ test/boot/bootflow.c | 4 ++-- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/boot/bootflow.c b/boot/bootflow.c index c088300ea96..c8391641001 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -1024,3 +1025,29 @@ int bootflow_get_seq(const struct bootflow *bflow) return alist_calc_index(&std->bootflows, bflow); } + +const char *bootflow_guess_label(const struct bootflow *bflow) +{ + const char *name = NULL; + + if (IS_ENABLED(CONFIG_EFI_APP)) { + struct efi_device_path *dp; + enum uclass_id id; + int ret; + + ret = efi_dp_from_bootflow(bflow, &dp, NULL); + if (!ret) + name = efi_dp_guess_uclass(dp, &id); + } else if (bflow->dev) { + struct udevice *media = dev_get_parent(bflow->dev); + + if (device_get_uclass_id(media) == UCLASS_MASS_STORAGE) + name = "usb"; + else + name = dev_get_uclass_name(media); + } + if (!name) + name = "(none)"; + + return name; +} diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 20fc04bdda3..43335fecb34 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -70,21 +70,7 @@ static void report_bootflow_err(struct bootflow *bflow, int err) */ static void show_bootflow(int index, struct bootflow *bflow, bool errors) { - const char *name = NULL; - - if (IS_ENABLED(CONFIG_EFI_APP)) { - struct efi_device_path *dp; - enum uclass_id id; - int ret; - - ret = efi_dp_from_bootflow(bflow, &dp, NULL); - if (!ret) - name = efi_dp_guess_uclass(dp, &id); - } else if (bflow->dev) { - name = dev_get_uclass_name(dev_get_parent(bflow->dev)); - } - if (!name) - name = "(none)"; + const char *name = bootflow_guess_label(bflow); printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index, bflow->method ? bflow->method->name : "(none)", diff --git a/include/bootflow.h b/include/bootflow.h index ec5baff7e01..422fd32a3ca 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -725,4 +725,12 @@ int bootflow_menu_start(struct bootstd_priv *std, bool text_mode, */ int bootflow_menu_poll(struct expo *exp, int *seqp); +/** + * bootflow_guess_label() - Produce a plausible label for a bootflow + * + * This uses the uclass name or EFI device-path to come up with a useful label + * for display to the user. Ideally it will say "mmc", "usb", nvme", etc. + */ +const char *bootflow_guess_label(const struct bootflow *bflow); + #endif diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 620af312700..14e3326a08f 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -1349,9 +1349,9 @@ static int bootflow_efi(struct unit_test_state *uts) ut_assert_nextlinen("---"); ut_assert_nextlinen(" 0 extlinux"); ut_assert_nextlinen( - " 1 efi ready usb_mass_ 1 hub1.p2.usb_mass_storage. /EFI/BOOT/BOOTSBOX.EFI"); + " 1 efi ready usb 1 hub1.p2.usb_mass_storage. /EFI/BOOT/BOOTSBOX.EFI"); ut_assert_nextlinen( - " 2 extlinux ready usb_mass_ 1 hub1.p4.usb_mass_storage. /extlinux/extlinux.conf"); + " 2 extlinux ready usb 1 hub1.p4.usb_mass_storage. /extlinux/extlinux.conf"); ut_assert_nextlinen("---"); ut_assert_skip_to_line("(3 bootflows, 3 valid)"); ut_assert_console_end(); From patchwork Tue Sep 2 15:21:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 179 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=1756826550; bh=a9ZGPuy+qKlfbZjSk86lzHv5FFttsagJPE23XjFgFRI=; 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=Lj9ayzCEAHSwUJa5whjYyffDqDeK+pq2OYThA7uyvvco7j4rX/GEFOVU33fsr9Yy8 n5M24+mgTa5MATIzzdPU0dzi5oL4LVLdt+Cs6cPT0jvGOU/b06TLROiJVRj6furY5K 15jniwcv2MTmYSYYT2HlkVM0duA4Me3Rn31aytDdA0yAiseRUgdPGJByCVd+6jC7ik INcmSufIbkja2lOAKIYopDGmrTkDrZ0KEj2ro4IuQVYySNZS+l4K7CyXEelsFGgWcQ vpfc6HAJUCv6FcVszSQbk/aL413B6E9+NBqeU0dIGDP/iglkw2rK78tTtXl2IPjaHb Jc2df6EDyN2VQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DDDB6678D3 for ; Tue, 2 Sep 2025 09:22:30 -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 bxNdBM5emXNJ for ; Tue, 2 Sep 2025 09:22:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826550; bh=a9ZGPuy+qKlfbZjSk86lzHv5FFttsagJPE23XjFgFRI=; 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=Lj9ayzCEAHSwUJa5whjYyffDqDeK+pq2OYThA7uyvvco7j4rX/GEFOVU33fsr9Yy8 n5M24+mgTa5MATIzzdPU0dzi5oL4LVLdt+Cs6cPT0jvGOU/b06TLROiJVRj6furY5K 15jniwcv2MTmYSYYT2HlkVM0duA4Me3Rn31aytDdA0yAiseRUgdPGJByCVd+6jC7ik INcmSufIbkja2lOAKIYopDGmrTkDrZ0KEj2ro4IuQVYySNZS+l4K7CyXEelsFGgWcQ vpfc6HAJUCv6FcVszSQbk/aL413B6E9+NBqeU0dIGDP/iglkw2rK78tTtXl2IPjaHb Jc2df6EDyN2VQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CB720678E9 for ; Tue, 2 Sep 2025 09:22:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826547; bh=fauBvHrsGF9bDc17erUbGoBiMQyBUQjIKHvlv3LmFK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miKVrr0GYXlGLul8+CrxfLikAf/KqNitjkkspjtB5LsrEVgc7tQvEgDJ7yd2SPRLp d/hlN6CpvTshMTb7V53Qyq19YlD5L5uF2B3dE2IX8LumVGYYEfjbAzG8vs4DwZCYJh Zxnygmsrlxpoy1nbpaWG0WexfDWIhxXj/X6Kov2AAY+drIdNmKGioMl9t+0IIIAXTU 1BsKDQmqNEaWnVomuvZ/q8YogUm1vzxD5lThfj8PGMNUi6v5UnhxnLyVRXSVpgeX8T U2pP48cplGQzzuX4rBH4zYkXoiDe0I5ze0mWVv8GGbjA53G/cl2rlcaUuwXkeUyoM/ FKC0pcdZ0y2Ug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B45F167867; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id RbL_FwyRiOII; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826546; bh=u943VtJ9YXyyqmaq1S1YkUnB0nLNpPTl8BQ5ynsxxg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldOGCPILBglXGmlUX2RTneB1faiaaQwht2KLlPLq4c1KO9Sv18GrXW+51+iZ02A9U rbP1bjls3fReV+vYpXTuETxwrVvbdTecpj3Ki2fqfiZap0N+UkJzSnWRZ2sBQrtDNq +xmF2otpUnuMr8Gscugew6UuxD1lafRoKJK8lWgQlB9COrz+8S6wXjJMrjudnZ974G MRP1siMknA4d9rZ184F6xQB8MsQ/ofqir7zr0Ftzc0K0zBPNaB8y+4fMc7Znf51PbK uKzcASKCiaXnsu1T9vMD5z9qD1mxZkPT1rNgfqfnfwS17Iz7f6Ssu0gx3KxF9HntyM 3RfLEpIgjVPvg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7FC435FE1B; Tue, 2 Sep 2025 09:22:26 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:40 -0600 Message-ID: <20250902152158.2285264-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EPIPCYJXHVKZAHUA7UHDI5KNDBUCMQBN X-Message-ID-Hash: EPIPCYJXHVKZAHUA7UHDI5KNDBUCMQBN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/18] boot: Use the new label finder in bootflow_menu_add() 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 Make use of bootflow_guess_label() to get the label for a menu, since it provides more information for the EFI app. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 2f08fa54081..5e0e365d12b 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -124,7 +124,6 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, { struct menu_priv *priv = exp->priv; char str[2], *label, *key; - struct udevice *media; struct scene *scn; const char *name; uint preview_id; @@ -144,11 +143,7 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, if (!key) return log_msg_ret("key", -ENOMEM); - media = dev_get_parent(bflow->dev); - if (device_get_uclass_id(media) == UCLASS_MASS_STORAGE) - name = "usb"; - else - name = media->name; + name = bootflow_guess_label(bflow); label = strdup(name); if (!label) { From patchwork Tue Sep 2 15:21:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 180 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=1756826553; bh=K0444hiItk7b1vIPjTu2X6+CHXu+TWaM8ZENXyyZFRU=; 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=Dq51rSEuEjwVYmnardE1Rz/hTnarwprzXrvjZFo+sGqRhLTgv5LDodpF/lZBOdV5l t9hgDyrlsa/dJ5Yhnvm+MwqfcMiC/zTp2Qi2Ak5VnpuxqiWI0fjE7N43Tv+WUSpVPA l3U9RsI1UeJTTVkuY1OZmfHLPbvx9FXVGuRz9K+TjK2ethu3EQSkp+19hegcFtmTmF tBKEDhvFOghHs7dTK7TaL9ni9+VG8RwYBh0f30of8W4R0XRrwtLL2ohr4AkKBwu8IE aE14z0njdCF3XKYo5l72K4hvaGA8dLTrzzp62FI8CfOlJ10OySKLeKNcYhoj1z+WfI jC0QHrkn1G4sw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 301A2678C7 for ; Tue, 2 Sep 2025 09:22:33 -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 BQHlTghCYvum for ; Tue, 2 Sep 2025 09:22:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826551; bh=K0444hiItk7b1vIPjTu2X6+CHXu+TWaM8ZENXyyZFRU=; 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=bQ4DeKghvwhU4YWKj2rk1Mzo/Do4IFTzMqF0ZQ/ckseu7aVl5e+iLwO++qlKnoMpO cgpKZlVPcXn3Gw0fRPauanu90DA4T+Im0oYKOe9CA4lvkXSLUwuzdog+ypbdmhn73X N539dRk4ztwgPbU952Gd4A+tfB8qPCarvg21nZuj6JX6WmSRbmE9AKMW/vnEJPs4cQ z70vatoOa2J8lsLjTY+dfr59HBtJTBeK47CK72lI/Ded8R1QXmMrexVkA5JIuPArVA xdUeybFsD03f1ncbedcpTPLnzhpEPID6LXjcfu1wrvFVujzxeMyaek4aYowrAXdWhW +XUTzivr7HPAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31A4A678EA for ; Tue, 2 Sep 2025 09:22:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826547; bh=DrpJ1y2VXn/GRVJO+jF+DEcpqaW7PFcl9Nf9r7T3YeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOIFXh4OWvBsWGHJhFWmI7t42CXKYwwo6EELmFeFHkQK1bP6q4L/9HJjXlRW5KI28 P3bspS3JCz8/Q3u+2dEDtBtkFMZYKaW4JGGdl8GcpLO7uU6DacMeUIBdCxgvGGb4kr hYLudbKdQg0DZDVuQboG50vqIMIVHQlT0u2b4OLf5wTiF+T0ukTVcKZIXP1+NioKEc 32ok/8YjfvFsrXjOBdgJHOY9UL6i0eZTLyN0/epHyPS9IZEDhCSkeF2Y8NAmhxTUgC B0xH0cPuv3wnuFy50MwvD7LekvC6DoAQsY+VKRy3yjE56cKns1dVv9FJTlxezls+FU vYBxAknQ5EyIw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF6645FE1B; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Se9mfKI6rMih; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826547; bh=KZYJVcubf+4OxjipXY5NahjOPAI4GDQyPYo4Ay1wfM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2kBl3GnLYaI+gVPHMjmdQ9ZXgV7CTVJOBYu0uD8AjwsWUW6gWJUjumZgoWD+5PbX evM4O8czI8izp5p03QEPNh2YrQtG39LV0woHBeauUMBsW82cTOo/gBOzE170R3nnB7 OcDa/yMO6riMKEAK6W3ckPBGz45XniUpLrVg+tLzM8ggdNkbc493RPsLrC5LbLz6hb EKH0zKf2+QQpNWm/bWE6ETwVH9j1wBJTxSVgKmAhyEqpKpQJOrY7qHG+dEn87XKxic xrju5u09oDsG+tYaI14oROgOI4x55GJYOIADTrXr9Y0v3AD7vpkSifHwQCrCjQrK3q 8ug50CoZNArHg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5E7256788A; Tue, 2 Sep 2025 09:22:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:41 -0600 Message-ID: <20250902152158.2285264-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DOLLMRFRVODXLTLGQXFQJQGPW2UOQM5F X-Message-ID-Hash: DOLLMRFRVODXLTLGQXFQJQGPW2UOQM5F X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/18] boot: Drop an unwanted blank line in distro_efi_boot() 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 crept in a while back, so let's drop it. Signed-off-by: Simon Glass Fixes: 184fc0379dd ("bootflow: bootmeth_efi: Handle fdt not available.") --- boot/bootmeth_efi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index 6903734c546..09c4d2c0647 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -317,7 +317,6 @@ static int distro_efi_boot(struct udevice *dev, struct bootflow *bflow) */ if (bflow->flags & ~BOOTFLOWF_USE_BUILTIN_FDT) fdt = bflow->fdt_addr; - } if (efi_bootflow_run(bflow)) From patchwork Tue Sep 2 15:21:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 181 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=1756826557; bh=I5em+6twhCc+RbOzijMCxIEIQSwmcEJdbsT8k8o5q1U=; 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=oypk4AnZTjApIWV3l5gSGHNSkrFEFcSxdZwjRtEZLmK7RsdKq722z/0xHd0OpILuy QCvvubfSeQnFyu8Sk5WAQGQARrRx/PEqZjnIaNP8kxkFgWV08jjbD0ss7pKq5YhBdi XvsHHGSdsn0W84YIksgATCWutHXHsNvu1v1w60lckHYV65svkFtVHVoxjJFcYQHpxx vyVsqtjeTKSvlgFOh+LGL5Qi1HMYCaBXX0EU9IaFLdqKNnIZ4UAhT08tON51vajU5N xhV4roSz6e3OAw6FFTm4+X8BeLgVO8lhBk7ZrgDFYWnvbFvOoPZUKH8/28LcrPOoRf 2LOIcVAHQ/fig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C40D55FE1B for ; Tue, 2 Sep 2025 09:22:37 -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 CB7ZU9wMc6Dl for ; Tue, 2 Sep 2025 09:22:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826557; bh=I5em+6twhCc+RbOzijMCxIEIQSwmcEJdbsT8k8o5q1U=; 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=oypk4AnZTjApIWV3l5gSGHNSkrFEFcSxdZwjRtEZLmK7RsdKq722z/0xHd0OpILuy QCvvubfSeQnFyu8Sk5WAQGQARrRx/PEqZjnIaNP8kxkFgWV08jjbD0ss7pKq5YhBdi XvsHHGSdsn0W84YIksgATCWutHXHsNvu1v1w60lckHYV65svkFtVHVoxjJFcYQHpxx vyVsqtjeTKSvlgFOh+LGL5Qi1HMYCaBXX0EU9IaFLdqKNnIZ4UAhT08tON51vajU5N xhV4roSz6e3OAw6FFTm4+X8BeLgVO8lhBk7ZrgDFYWnvbFvOoPZUKH8/28LcrPOoRf 2LOIcVAHQ/fig== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AF0486788A for ; Tue, 2 Sep 2025 09:22:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826555; bh=GZNXMjV3LyRVDBgcNYuwjEISMsIH+J0fO0a0lQ0PkXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l2p+U6c6++sTxhf2LC7faLGF1EWD6wQiQdCdp4W2Auz+fxOApTcuxYnTc7p87Z1Sb oZUPKjYajf69sCP7MfuxqDurZp/XEjcM7Q+O8NW18MnyKZAWsmxVtKmjARjWVU/kVt gHi/Zni+CLIAzDMSdtRqm/dVTmoa9zWHiTD0tiXqrZVVFpnO4sjbwIF1p1SVpJYVBB 1umrraNeXSuWqUro6Lvnt75tfdqcP6KlZjqW/fKTFkLIPSRrHtwaD7TI4bJ9hi85TT iKf6/fZhji1YIsGmmUoR4JK81Pea9GZnNtczNG1TlHf/k/8MiXdv8nS9Lz5YmCn7ZN hwxJU1ROuczRQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A705678C7; Tue, 2 Sep 2025 09:22:35 -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 S7m8y59dgCe4; Tue, 2 Sep 2025 09:22:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826548; bh=P+JCgz4QGZ+A4HXZLa5qlgLNmXa4MK5TUD5MqqJRw+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DSnDtqQnpf9eTva87gsCNJ/myXQhFH2SuguCiPhN8Rm9jvWZYbIkSB5PnBfP3Aqvi WSF/4nEEd0MxC8OwfHS1MH7syioxQUl7BiPBIUf0osQbSKx9b16Q7Q/OBmGPiNbTwn lzSxB5r6u8BPa48miMX+MxACQ93KvL/0gYI5xVHei9uB3vuX7yD6D/bJ3SDvzGghg9 wlaitmzzgxnR9HbjVxPgEeYk2AxyL3agAEy0cX9pvgDXspLzyUoGYAi4lLyxaTAl25 xSO/GFrXRdefiOg4MR2/YsSTVkmRBgO11KBctgmo6FKbSxJDwyNH2YbDo7xJuV1E2n meFFldwmBX1jw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2C86D6788A; Tue, 2 Sep 2025 09:22:28 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:42 -0600 Message-ID: <20250902152158.2285264-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2AIK22DHXSLH4F5M3KTSCEQCY3MZEY72 X-Message-ID-Hash: 2AIK22DHXSLH4F5M3KTSCEQCY3MZEY72 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/18] efidebug: doc: Indent the media output correctly 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 lines after the 'edidebug media' command are only intended three spaces, but it should be four. Fix it. Signed-off-by: Simon Glass Fixes: 9390344c350 ("efi: Add a uclass column to efidebug media command") --- doc/usage/cmd/efidebug.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/usage/cmd/efidebug.rst b/doc/usage/cmd/efidebug.rst index 29167dfa394..5dd68a689a6 100644 --- a/doc/usage/cmd/efidebug.rst +++ b/doc/usage/cmd/efidebug.rst @@ -49,11 +49,11 @@ Example This shows checking the EFI media devices:: - => efidebug media - Device Media type Device Path - ------------------- --------------- ----------- - efi_media_1 ahci PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0) - efi_media_2 pci PciRoot(0x0)/Pci(0x5,0x0) + => efidebug media + Device Media type Device Path + ------------------- --------------- ----------- + efi_media_1 ahci PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0) + efi_media_2 pci PciRoot(0x0)/Pci(0x5,0x0) This shows checking the log, then using 'efidebug tables' to fully set up the From patchwork Tue Sep 2 15:21:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 182 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=1756826560; bh=7Ny49F4cxoxID6l4I7DE0VCjZvbhf4sUP8XTQ8uhTs0=; 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=SG/mu9QKDzMH7WjyHaE/z8vfqa+ugp70dLijHfWEGvV32JUy2zKkPhN6+HsnnaDRZ nPmqBtUF28s1cmtNBJmjMZMI11R4V7YB5BL/vgyc/KrIPGnm5bmX6dUmfXNQGQVaLy 3AmvLJselwuqaBAWXTh0s7aGu/6DoVeYjV2eS36KXmCn2rCAhkX1JRHvbZwfF0vFdW e01EY1Pbza8mMG6rdu36xMS2WhAG3sVE43JA8kak/yn+rPKXSmXUCuPSO19EPQQkXu n/OM5hICwFihtPmknfsyvHS9q3+4xuPnUg2NeXGF+h6lVOe1cJQfBSnxoLfwaqSq2z 8+eH0Uq/yaWaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 22C92678CB for ; Tue, 2 Sep 2025 09:22:40 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TS-9GLuZQetZ for ; Tue, 2 Sep 2025 09:22:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826558; bh=7Ny49F4cxoxID6l4I7DE0VCjZvbhf4sUP8XTQ8uhTs0=; 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=IcTarRndWvA/Wvm5ZRqnDf7Ox8ebwJVCucb8qDyIADOvvBbby03i+oYHeNmyZD7AH ntiGdMTz5nbQKJVp1utY7NatFYYz8zg8yIbCEdwoRz7ezW2G7TQb9pydw3qTxN0e3/ 4uDP3yPZbMrJlnMo4NwQVO77xzusxDzlLW/d24H7FlDzhSMd6jAvXpdeIRc8P01oPx VU4HCEeKMQou4WeYDbA8vZzFq1jh8H1LM7BsFVNJeZ6InsxcS1IioqGjjHY/qSpmfn 9TTPVDDUNYf1CcSQk9uan11xFF2G3m4Asb309q4pnbPvtUexgG+PKGiej5dCbjzf17 4KzOZVdJh+C6g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D1E2678E9 for ; Tue, 2 Sep 2025 09:22:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826555; bh=EnmhVPAqzoVt3SY/HCT69JokzOg2BKgzwu5ScK0bz0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iprgniwi5ledal0sikveOZ1gygWKVmYFsdeLDwqsnczT4cgfuYg5/+9RJTZM/HDWQ IdawM70osyO47wrSFeuuAiDjnwKg2qdGDLe3idOLuThCa2T7jGMQbnoPjtNMKRqTwX 1mntAfKXZC3SvRLacARNon4qzIerNasgyoZQ8IyoEO/WOD/VuXCnOgRxS7xpSUVjea CF4qYgoqePQ9wAcvxuvmFmpl0eMBL3SettTT3u1aH6l3bIMDlep7iW98RFU3l6AD+x uvC4hxzNKncpsIdmebC2VHqN7OqlNZmUrzirKSQ7IXM/BmqnRb/b5kSmfPYmMZ0zzs RirpA0mK3QgKQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B302678CB; Tue, 2 Sep 2025 09:22:35 -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 ZpET25UOC1Y6; Tue, 2 Sep 2025 09:22:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826553; bh=I1XwoZmykTsanboPJ8oRl+K3SuVXsZNsOLEcInPvZH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtTl3tS1KtGwvWnoEO1FdXpe4D9Pu75dfbouZB7KZvel1J/j0DLwUqaR9RP0GiQSo aCS78juVK9IbDQCpa/SK6qvP99j849ROTkmZtsnOXTcto7yYRFx8D8/s4/Tovlf9Li TuIqUwXFtGu+pMr+NKCzi3EhbWf5D0w6Si4L+HXlSnz49kUYoDuva/wAnpFz3NCXGf CBZbRuOBPEDBH2STE4mFDQpjpwkXHornnYSniNcxYr1W7dzgbknZ/TPbt/vcy8GWLb kjtbWpUFXa+MZc6v44ZdXpofWB5Voj6jaaBYZ6BFqevJoDxqyVJe2sTXazcuReTHVO n+Ufu+TOxoyUQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B83845FE1B; Tue, 2 Sep 2025 09:22:32 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:43 -0600 Message-ID: <20250902152158.2285264-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X5ANWX2ZM5PI2L7ADWB4PE7IGWKIIXZZ X-Message-ID-Hash: X5ANWX2ZM5PI2L7ADWB4PE7IGWKIIXZZ 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/18] efidebug: Support sorting with 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 Provide a -s option to sort the memory map in order of address. Add documentation while we are here. Also fix an errant extra line before do_efi_show_media() Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/efidebug.c | 51 +++++++++++++++++++-- doc/usage/cmd/efidebug.rst | 92 +++++++++++++++++++++++++++++++++++++- 2 files changed, 139 insertions(+), 4 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index f88da42c2c4..627045a295e 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -655,6 +656,26 @@ static void print_memory_attributes(u64 attributes) #define EFI_PHYS_ADDR_WIDTH (int)(sizeof(efi_physical_addr_t) * 2) +/** + * efi_memmap_sort_by_addr() - compare two memory descriptors by address + * + * @a: first memory descriptor + * @b: second memory descriptor + * Return: -1 if a < b, 0 if a == b, 1 if a > b + */ +static int efi_memmap_sort_by_addr(const void *a, const void *b) +{ + const struct efi_mem_desc *desc_a = a; + const struct efi_mem_desc *desc_b = b; + + if (desc_a->physical_start < desc_b->physical_start) + return -1; + else if (desc_a->physical_start > desc_b->physical_start) + return 1; + + return 0; +} + /** * do_efi_show_memmap() - show UEFI memory map * @@ -676,6 +697,25 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, int desc_size, i; efi_status_t eret; int ret; + bool sort_by_addr = false; + int num_entries; + + argc--; + argv++; + while (argc > 0 && *argv[0] == '-') { + if (!strcmp(argv[0], "-s")) { + sort_by_addr = true; + } else { + printf("Unknown option: %s\n", argv[0]); + return CMD_RET_USAGE; + } + argc--; + } + + if (argc > 0) { + printf("Too many arguments\n"); + return CMD_RET_USAGE; + } if (IS_ENABLED(CONFIG_EFI_APP)) { uint key, version; @@ -692,6 +732,12 @@ static int do_efi_show_memmap(struct cmd_tbl *cmdtp, int flag, desc_size = sizeof(*map); } + /* Sort entries by address if requested */ + if (sort_by_addr) { + num_entries = map_size / desc_size; + qsort(memmap, num_entries, desc_size, efi_memmap_sort_by_addr); + } + printf("Type Start%.*s End%.*s Attributes\n", EFI_PHYS_ADDR_WIDTH - 5, spc, EFI_PHYS_ADDR_WIDTH - 3, spc); printf("================ %.*s %.*s ==========\n", @@ -1594,7 +1640,6 @@ static int do_efi_test(struct cmd_tbl *cmdtp, int flag, return cp->cmd(cmdtp, flag, argc, argv); } - /** * do_efi_show_media() - show EFI media devices * @@ -1807,8 +1852,8 @@ U_BOOT_LONGHELP(efidebug, " - show UEFI log\n" "efidebug media\n" " - show EFI media devices\n" - "efidebug memmap\n" - " - show UEFI memory map\n" + "efidebug memmap [-s]\n" + " - show UEFI memory map (use -s to sort by address)\n" "efidebug tables\n" " - show UEFI configuration tables\n" #ifdef CONFIG_EFI_BOOTMGR diff --git a/doc/usage/cmd/efidebug.rst b/doc/usage/cmd/efidebug.rst index 5dd68a689a6..8c8a4895197 100644 --- a/doc/usage/cmd/efidebug.rst +++ b/doc/usage/cmd/efidebug.rst @@ -15,6 +15,7 @@ Synopsis efidebug log efidebug media + efidebug memmap [-s] Description ----------- @@ -22,7 +23,7 @@ Description The *efidebug* command provides access to debugging features for the EFI-loader subsystem. -Only two of the subcommands are documented at present. +Only three of the subcommands are documented at present. efidebug log ~~~~~~~~~~~~ @@ -43,6 +44,15 @@ driver subsystem would likely handle the device (e.g., "ahci" for SATA drives, device, which can be useful for debugging boot issues or understanding the system topology. +efidebug memmap +~~~~~~~~~~~~~~~ + +This shows the UEFI memory map, which displays all memory regions and their +types as known to the EFI loader subsystem. This includes information about +memory allocation, reserved regions, and available memory. + +The command supports an optional '-s' flag to sort the memory map entries by +address, making it easier to visualize the memory layout in ascending order. Example ------- @@ -55,6 +65,86 @@ This shows checking the EFI media devices:: efi_media_1 ahci PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0) efi_media_2 pci PciRoot(0x0)/Pci(0x5,0x0) +This shows checking the UEFI memory map, first unsorted and then sorted by +address:: + + => efidebug mem + Type Start End Attributes + ================ ================ ================ ========== + CONVENTIONAL 0000000040000000-0000000044000000 WB + BOOT DATA 0000000044000000-0000000044020000 WB + CONVENTIONAL 0000000044020000-00000000475ee000 WB + BOOT DATA 00000000475ee000-0000000047610000 WB + BOOT CODE 0000000047610000-0000000047647000 WB + BOOT DATA 0000000047647000-0000000047ef2000 WB + BOOT CODE 0000000047ef2000-0000000047ef6000 WB + BOOT DATA 0000000047ef6000-0000000047ff7000 WB + BOOT CODE 0000000047ff7000-0000000047ffa000 WB + BOOT DATA 0000000047ffa000-0000000048000000 WB + CONVENTIONAL 0000000048000000-00000000e0000000 WB + LOADER DATA 00000000e0000000-0000000100000000 WB + CONVENTIONAL 0000000100000000-000000013c278000 WB + LOADER DATA 000000013c278000-000000013c27c000 WB + LOADER CODE 000000013c27c000-000000013c3e0000 WB + ACPI RECLAIM MEM 000000013c3e0000-000000013c3f0000 WB + RUNTIME CODE 000000013c3f0000-000000013c470000 WB|RT + RUNTIME DATA 000000013c470000-000000013c630000 WB|RT + RUNTIME CODE 000000013c630000-000000013c730000 WB|RT + CONVENTIONAL 000000013c730000-000000013dc2a000 WB + BOOT DATA 000000013dc2a000-000000013e9f1000 WB + CONVENTIONAL 000000013e9f1000-000000013e9fe000 WB + BOOT DATA 000000013e9fe000-000000013ea1c000 WB + CONVENTIONAL 000000013ea1c000-000000013ea1e000 WB + BOOT DATA 000000013ea1e000-000000013ea47000 WB + CONVENTIONAL 000000013ea47000-000000013ea48000 WB + BOOT DATA 000000013ea48000-000000013f624000 WB + CONVENTIONAL 000000013f624000-000000013f731000 WB + BOOT CODE 000000013f731000-000000013fc00000 WB + RUNTIME CODE 000000013fc00000-000000013fd90000 WB|RT + RUNTIME DATA 000000013fd90000-000000013ffe0000 WB|RT + CONVENTIONAL 000000013ffe0000-000000013ffff000 WB + BOOT DATA 000000013ffff000-0000000140000000 WB + IO 0000000004000000-0000000008000000 UC|RT + IO 0000000009010000-0000000009011000 UC|RT + => efidebug mem -s + Type Start End Attributes + ================ ================ ================ ========== + IO 0000000004000000-0000000008000000 UC|RT + IO 0000000009010000-0000000009011000 UC|RT + CONVENTIONAL 0000000040000000-0000000044000000 WB + BOOT DATA 0000000044000000-0000000044020000 WB + CONVENTIONAL 0000000044020000-00000000475ee000 WB + BOOT DATA 00000000475ee000-0000000047610000 WB + BOOT CODE 0000000047610000-0000000047647000 WB + BOOT DATA 0000000047647000-0000000047ef2000 WB + BOOT CODE 0000000047ef2000-0000000047ef6000 WB + BOOT DATA 0000000047ef6000-0000000047ff7000 WB + BOOT CODE 0000000047ff7000-0000000047ffa000 WB + BOOT DATA 0000000047ffa000-0000000048000000 WB + CONVENTIONAL 0000000048000000-00000000e0000000 WB + LOADER DATA 00000000e0000000-0000000100000000 WB + CONVENTIONAL 0000000100000000-000000013c278000 WB + LOADER DATA 000000013c278000-000000013c27c000 WB + LOADER CODE 000000013c27c000-000000013c3e0000 WB + ACPI RECLAIM MEM 000000013c3e0000-000000013c3f0000 WB + RUNTIME CODE 000000013c3f0000-000000013c470000 WB|RT + RUNTIME DATA 000000013c470000-000000013c630000 WB|RT + RUNTIME CODE 000000013c630000-000000013c730000 WB|RT + CONVENTIONAL 000000013c730000-000000013dc2a000 WB + BOOT DATA 000000013dc2a000-000000013e9f1000 WB + CONVENTIONAL 000000013e9f1000-000000013e9fe000 WB + BOOT DATA 000000013e9fe000-000000013ea1c000 WB + CONVENTIONAL 000000013ea1c000-000000013ea1e000 WB + BOOT DATA 000000013ea1e000-000000013ea47000 WB + CONVENTIONAL 000000013ea47000-000000013ea48000 WB + BOOT DATA 000000013ea48000-000000013f624000 WB + CONVENTIONAL 000000013f624000-000000013f731000 WB + BOOT CODE 000000013f731000-000000013fc00000 WB + RUNTIME CODE 000000013fc00000-000000013fd90000 WB|RT + RUNTIME DATA 000000013fd90000-000000013ffe0000 WB|RT + CONVENTIONAL 000000013ffe0000-000000013ffff000 WB + BOOT DATA 000000013ffff000-0000000140000000 WB + => This shows checking the log, then using 'efidebug tables' to fully set up the EFI-loader subsystem, then checking the log again:: From patchwork Tue Sep 2 15:21:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 184 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=1756826566; bh=LcHS8HEjoIf7VE/iWi8ULELbV4eGiq26Yioohv4UlEE=; 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=cuz9EICq8MOaLcyWm/AD8mnAyllQcMdgfI7kaIDpzW5m/0VukXujraxlOcI2SOlz3 e4KhbG4sdAjFVgSLBiZXET0SzsvQnOD2R3NzR/c7JoxrgbLpo6ZPKPPUVxfmzM32V9 wgZ8IG7jbmxW8LIqO4+CXNaY/YkD6ikwimgbfpdPzBWoexRLLKgNe0KratwldLqiRD XuXHQ43+/mMGYY4MCuc9MSH5CzDmMw5UPqidqw1La+c6Cb+qUlZ+4qeRg064HKSnwf z8Lh5Z26YBRYhWOuFnRduuM4XIcpOQhWhYLGfq7LwJRD/byOkEBt5J7gCK09oeOUep OU/D2faLsCXTw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C3C126787E for ; Tue, 2 Sep 2025 09:22:46 -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 lm4Apjtq00_G for ; Tue, 2 Sep 2025 09:22:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826565; bh=LcHS8HEjoIf7VE/iWi8ULELbV4eGiq26Yioohv4UlEE=; 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=nZ4rS7cXKv8cLMm/b6RLoF9bU9HRIudZqshHuWRn6N18TknI51Ud2Fgwf0T3PnqRd B2cyrLhclBh6chcjDqL/4jlBtLIiBL3vFhnZvYZ2eVe/1Lfp3pYDnoUQ9/OrlJ5iux DqmQa8xU85mOZ6Zomj9Gub2iBcKNXQsBLCkI5MaLDjRiMXkO8T3bNoZ0m16J2oBZ8M /wajJ/VqRz2015yCqx5+LECqvXCLrZNs0ga4soLYNZu9kXM+KwEuAc8AXSWTt7CfZw hVYRZ74SQcWs/XdvMZc3/MxRUBk60K1MbaBW2WEaZmchfEHzGUDyQp7VjyCYA5igwD VaXBNwgJKLMnw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 89E1A677F7 for ; Tue, 2 Sep 2025 09:22:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826562; bh=zvzvcp/z3NaOk2qBZKBc2R9xOWYCy23ZNQ1sIexVyHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTUsXTu7i0M+2XuW4CZbapYdi91rofC9Sb17lVRgu2ymcolLo+0To1LRjqWP9lI6J bjDAH9/r/Kf0JSIB7lseedtuXXuFLkzMwG5gc8jWNz+8afmyOS92OLfbTmZSR8+Mab 1LEz+mvVzb3CnIdz7aukJNOhwVR0Yy76ZdkPn0oiOF0VfUc3e1YMVzgTZAqakXP79t Lj7/vTmXoJDp6VZvFxM75vVNFdgg21d5190w28XwWF8LYInb3g6spq7NRYYuq/cera 7bacEf+CxAw2F0bGlP1rvWIifglUSQxZpizug0b/IvOpPyAx2yr8MaL68EHL6pjIf4 8FPBoKNTUUFrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 510B26787E; Tue, 2 Sep 2025 09:22:42 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 5mNbmGRVfLcI; Tue, 2 Sep 2025 09:22:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756826555; bh=XXEEHTCjyt62sXx9IO2gfZH5x16a4Fq2JaBIyCdgEDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSeB697H3/jKuUFLdhJ22pTaCVBHncRgKdiC71kQ1SpHjWKzQsciRcK3GtWqQ98Ho HrSuaoXRiWTNQAiNuTASNRNgTAMnl+mSFRwD4kziVyl/KXh7bU1w8xqdn1cO4oqs6k lvyfS3kaDyirlVn8KEv/3SLt/d61X3M+k2U8Hf2Z4W4fBX7TUk8r8Rwj2/AW1/Ax78 DSzTES1506y5f0obp6JIjpsjR49D2OOCc2dWiknsxrQ0wmO4UP8JucuZjrR7+Z+r0S YuxR2FRCBbgismmwVJJum80nkZPnkQOT7HvsjwH3fN4BS/+Vkvk6Nc6UKimYvvUgUU aadNwB9suCQqQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CA06367867; Tue, 2 Sep 2025 09:22:34 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 2 Sep 2025 09:21:44 -0600 Message-ID: <20250902152158.2285264-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250902152158.2285264-1-sjg@u-boot.org> References: <20250902152158.2285264-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NSZTH4KASBVIA3ZM76R34VO5JWZUIAI6 X-Message-ID-Hash: NSZTH4KASBVIA3ZM76R34VO5JWZUIAI6 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/18] efi: doc: Add documentation for about efidebug boot 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 So far this subcommand is undocumented. Provide some notes. Also show a better error when 'efidebug boot rm' fails. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/efidebug.c | 7 ++-- doc/usage/cmd/efidebug.rst | 73 +++++++++++++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 627045a295e..baa2c73b149 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1167,9 +1167,12 @@ static int do_efi_boot_rm(struct cmd_tbl *cmdtp, int flag, guid = efi_global_variable_guid; for (i = 1; i < argc; i++, argv++) { - id = (int)hextoul(argv[1], &endp); - if (*endp != '\0' || id > 0xffff) + id = (int)hextoul(argv[i], &endp); + if (*endp || id > 0xffff) { + printf("Invalid ID '%s', use '0001' for example\n", + argv[i]); return CMD_RET_FAILURE; + } efi_create_indexed_name(var_name16, sizeof(var_name16), "Boot", id); diff --git a/doc/usage/cmd/efidebug.rst b/doc/usage/cmd/efidebug.rst index 8c8a4895197..deab986887a 100644 --- a/doc/usage/cmd/efidebug.rst +++ b/doc/usage/cmd/efidebug.rst @@ -13,6 +13,11 @@ Synopsis :: + efidebug boot add -b