From patchwork Wed Aug 20 14:46:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 79 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=1755701205; bh=suyemF8hjYcGmAldocH8Fi/lCEZXYT1YYRE68o+2mzU=; 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=Re1mjXyDC3a++tbE85fjQD2y6q12fAposvMZUGL0t0daFSWmQNMXmfpNpOMnWCkBL as6X//U4w9eFMbasnq2KhzrzdbVzSDBR4zbqEIrRGx+nC1BlxdBahbzztCCZr13VOd Y1C4mdkCPKHL/eSFxT/Vmpmntx4WVq7Xst0hePWcFObmMeaQjmF/Qg9T0ASds7KoEd V0FIhY3GpGlCmQgSCQn3wvgHYKOBMCnyKLdorn4IflmbT6HzqGHqIF5XbrtlHuzrOd 17f3rnz6sJn9RuyYnFOp+yaKECpqluVTu7J16S9Sk0YE+otvHzS5Rhp5YLHsU7TXda a4Gva/FeuCFjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D72267699 for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id l1MgQQMU9GTr for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701205; bh=suyemF8hjYcGmAldocH8Fi/lCEZXYT1YYRE68o+2mzU=; 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=Re1mjXyDC3a++tbE85fjQD2y6q12fAposvMZUGL0t0daFSWmQNMXmfpNpOMnWCkBL as6X//U4w9eFMbasnq2KhzrzdbVzSDBR4zbqEIrRGx+nC1BlxdBahbzztCCZr13VOd Y1C4mdkCPKHL/eSFxT/Vmpmntx4WVq7Xst0hePWcFObmMeaQjmF/Qg9T0ASds7KoEd V0FIhY3GpGlCmQgSCQn3wvgHYKOBMCnyKLdorn4IflmbT6HzqGHqIF5XbrtlHuzrOd 17f3rnz6sJn9RuyYnFOp+yaKECpqluVTu7J16S9Sk0YE+otvHzS5Rhp5YLHsU7TXda a4Gva/FeuCFjA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 020426768B for ; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701204; bh=WtNjXJbvR5pW7vmlqHnRyPThB0bUwusqR4S5TXGUfpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1mc5rMDvDnWZRE1hl40f3ASrM8cITFaScoSGuu1/sXiMetvR9v/pD3RL8BtAI28d gOECyMtspItTPJSkC5GNQoXad9b/3Qa7YgQxV5/wqDsH3WAy5WfIHN+JKWcgx7NHXv nD5asyXeNsL/9AMsOKjOhTIKajZrf0nN0qpUHRssnuVDLCBkDUPtlnJokhdZIbYvf/ byH1HQn9lS+2uBliGysUuyJqylQGIMvkZBox9SfECQtDt7wI8Ozv5g8NWzdVlw+cgW KgEAk3FlbdsqHk+xKgsrI9MPQTK90LCzJhIM0OOwTappA+QvJLQ5Huyy9rvqjsXbP9 0rVhHi36Vrkzg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0857667694; Wed, 20 Aug 2025 08:46:44 -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 TXvoJUMBwnbF; Wed, 20 Aug 2025 08:46:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701203; bh=uH6zz9Au5TgsIa4bzXKsSpXGcPMcZwoI3MHek2nb3XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWTz4dSTIGDeMVAUKvohlGJFCaT34VgNOVByOoEb1FHSaLFYAjdfC8wlpHyl6iIzE lt1Bssd1+D8dbl31GN609uaRqiwmiru5G5dq/c973nRc6yYfkvTQYxfpGOkcWdNxnN 0ozsndRrcdyUSkRs4t+C23nGI4TR4vZ+oLIDvSeXI5rZP1nI1jyxvoJ4wzK+jIDZgD 0gs0C8e1ZFvl3N7veeByhsufCRKcjC+bixb2QoB4JV00Gc3keEZ2aucNxCczPMpUCi B4aTeGVDh+Up56+6/xXZq8wTTO69ltup+JtXjvZGLajnmHhKhtKPM5Zu8C5yNVbPRC LMvTQO5JjFY1g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6A4A5674F4; Wed, 20 Aug 2025 08:46:43 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:03 -0600 Message-ID: <20250820144621.1073679-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KB6C67ILG26FJO6LXHDTAPC74PWCFLIU X-Message-ID-Hash: KB6C67ILG26FJO6LXHDTAPC74PWCFLIU 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/14] test/py: Support a timing report when max_count is 0 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 If only a single test runs, it does not set the max_count variable, so it remains as zero. Handle this situation as a special case. Signed-off-by: Simon Glass --- test/py/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index f0101ed6b3d..2baceda51b2 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -579,7 +579,10 @@ def show_timings(): value (int): Value to display, i.e. the relative length of the bar """ if value: - bar_length = int((value / max_count) * max_bar_length) + if max_count: + bar_length = int((value / max_count) * max_bar_length) + else: + bar_length = 1 print(f"{key:>8} : {get_time_delta(msecs):>7} |{'#' * bar_length} {value}", file=buf) # Create the buckets we will use, each has a count and a total time From patchwork Wed Aug 20 14:46:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 80 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=1755701209; bh=07Tn2b+h6kzOdaE9u4yfEmiQ86x4hxmpfzUv8Aqu23s=; 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=B//SclfTZzAhb4PnrUq7BJTitkt8lodtnQ/3cFRyOxcLcXqJIIFC7H86EoJwLr1ED 3EAZ2+qvZEHBHpT0kj81SnkCniie/QG8V8ngTYpkmgR1ARkwCU2nNDbrN4JzhH04Co wxWcQkDdSHOjPA+GI3kxcP77mMSf1+XJkV1WwvaJA5C3HGENK5zZgmjE3Z+2BvwCOE 58pNeyrATyBecalPC3UTsKlFq2MbbQu0Rq7odv97FDiGXDr3fxSpb+vtqR50jPN5ve 1CFNHpshEEqbDcsvLdtft/WS/znr6Ve0x1x6M3+wIyYfU7NKkFek9sTdnBopvAwWCi 1+7uL/xwOH6rQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A802C676A5 for ; Wed, 20 Aug 2025 08:46:49 -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 xErBAEWQOPPn for ; Wed, 20 Aug 2025 08:46:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701206; bh=07Tn2b+h6kzOdaE9u4yfEmiQ86x4hxmpfzUv8Aqu23s=; 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=R5OFhOEsmXx9/IfP7WU++dy56pzTF8XJbic4Cuavg8QUSvaiipENR1KspOP18w6QM u18pSdZaxw6u6oHMmxOOHtts8orMyHS0Ozyz//XCV/uOnBAcBFQltRC4Ji88xEg6AD lRbYrLFamQr5BQKwcP7xkeKewpF5hoA/E5EXV7txrhxwb7aFuxC/H/NrmcTYvsl987 iwIsiJXVomW/GQXzHkX0tlYH4Tvijjluv+WBt+RFTGqotaHbujK5oNtNPeulPNaDVL KQlHugk63b/kHJIBwB9g4EuX3Sdde3auEDvg5NcOJ0P9sIC2lNHTmDZgjanNgC0Mhl 9kFCI6aNkABJQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6CA8D67694 for ; Wed, 20 Aug 2025 08:46:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701204; bh=SBEbK9QkjZyfrlc/tRKKl7BAjg7U3kN322VjaVuUIS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tpD29qEPPe8RI7n2VzM3hLx9NEaBv1lBP9diqBLGr+u0WNPRq49hdo2P+Vv6AB8RF iJ06evdy+KF39IjdExDVfb9wZh4U9FyLfJ2cqeFS1ghMXi4PlXCc+CyCIpX7FVEdZN 6R9tvQ/u7VFoeADuwW3Optfvef5w0RSWdUVezf7n3ZrBvNpdCWkMnisXW8fFMjQIyy qJl/W2uqUdSEl4o5GnnEweRbc5GO5RL9NfvC5cC18x6VSnuc+9Gz6G5e/Fzbn0wfag +/XDcqIlF+kjfSthWYX2/qYIV1+1toTa4i2GszJdQrLMEy7IpoHjbkQv3APzjObMU+ 4R+UOprBnPM/w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C9FB8674FA; Wed, 20 Aug 2025 08:46:44 -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 El3VCce-6IhH; Wed, 20 Aug 2025 08:46:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701204; bh=8ZlFHaaI9XobFhwffqHJUISUVyDB2mzIkxeNsgJFiBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gT0qhwNU5A8ymMw2GMJScqEuJT21jb7JCTge4rpnFIxI9qTAcLoD+J1bvr+qos9Zz aYnPDbYmHkzKsdYSPIJNXStGq/vzRc8rYn6uZGreKFQqcnqxo8ztZ3fS7VdKW+q2Kf bNI6aUa0c+t7XXXhCJbyheUoY5ReFpz7g6ercQVTaZj1P9YSaqemfQVHtH+AVd8/bH 2MLEqZTd5b7sH0qSEUdq0LroOSyr4CjwOuaQlQxCU3txFyu7cr1TioRXM58KHiGJ4S bk94y4nMHqqeDcGxrLLxcRNEjhqpZ00dg6i0F2eGbb11qME7/x4antl3cAWVW7HGbD Co1N/ZvKyUiNg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4D982674F4; Wed, 20 Aug 2025 08:46:44 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:04 -0600 Message-ID: <20250820144621.1073679-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SXKQLIKVS4GV4P7PDY7AKVMOU5EGT4MU X-Message-ID-Hash: SXKQLIKVS4GV4P7PDY7AKVMOU5EGT4MU 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/14] efi: Drop EFI_CALL() from 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 The intend of this macro is to debug calls from an app. But the efidebug command is not an app, so it really doesn't make a lot of sense to call via that macro. Remove EFI_CALL() from do_efi_show_handles() so that the app can use this code. Signed-off-by: Simon Glass --- cmd/efidebug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 7755585c778..2df0fc4e221 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -474,8 +474,7 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, if (app_not_supported("show_handles")) return CMD_RET_FAILURE; - ret = EFI_CALL(efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL, - &num, &handles)); + ret = efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, &handles); if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; @@ -494,8 +493,7 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, &handler); if (ret == EFI_SUCCESS) printf(" %pD\n", handler->protocol_interface); - ret = EFI_CALL(BS->protocols_per_handle(handles[i], &guid, - &count)); + ret = BS->protocols_per_handle(handles[i], &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) { if (guidcmp(guid[j], &efi_guid_device_path)) From patchwork Wed Aug 20 14:46:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 81 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=1755701214; bh=HQt8vOZoUGzEMfGzZWSCbX39a1UQIY2tlzlQuh6aJu0=; 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=szWxME4f8ApvHZGh+LmNbePyv82M8UxaomvSJOGaEpKYKrYhMG12U7SdZ1iyUXelC L8CTbZ7v3m9g4i4c1RGAPuhXPkJZS0MmKmdrQ2BR2pImUYs/uOrrNm55TKd+0DAG4N fp4aJbebdwOzvm7Fmy+vjK4f/4krvp9hHSbcg2/xGv7zOYFGdl5LTgzO0cHSqomiBC GkG82eDDk0APm9ehr64N1U84tpLIVztizRq9gSYKj/uhRxOoeBa/ze20MoRHTCnQ/s vpqJy+QfxMhkKDV2Vl6+vEqUeQfNJI5hJNCD9Aizvpdt/fT0wR5mAS2plTv2X4BuCO zngQZcgalD8Ew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 39CCB6768B for ; Wed, 20 Aug 2025 08:46:54 -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 dhrTO0FAoPcf for ; Wed, 20 Aug 2025 08:46:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701208; bh=HQt8vOZoUGzEMfGzZWSCbX39a1UQIY2tlzlQuh6aJu0=; 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=WiTulHh9LAYtRu4bPgoClg3qEAamWkz9v9jI3Q+lxOrkb7VTHUjbap3S2xuuDYz4L cqhB3Uocm98nsTavxZK5Adu+F8vz1fXwxmNJhJ4a4Ub3RduacVjXgm92R9mFZ0cHVE HGxXuvnTiqozIp6zJBf5QZSAhbKesRZuRKVEDyDdBG+pBeXevwdgAQWvcfvLs5batM pZ7FjJkkzAL5/fTGB0h5QXAYtZsEvR67ThQIItPWcCCgZ5Ueh7Smod3PLWbBeZE4tT zPeJE4PJfgvT87lXMZXWsKUNLsIq2i0SbJ9zPHdBSseYpufnkIbw0x3AKGhgTxavO1 +vUqLL87ZiOkQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8C1D6769B for ; Wed, 20 Aug 2025 08:46:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701207; bh=O+JfAt+GWHm88QVBJvHvYzSvFRMi22fqN1B5QFrCIXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=osYWJMOHgudXxgY5nq6ozdMX3nezWxC4rnp3KBbhP/kGtrmn1Xt57Q91384KwLtcU ucd+K8DS/D6+w2/kFhZygRKqQxNqAr/zAldVpGIfeWgtUTqGlRmxq56i54qSJIL7gf ZD3DDhm8vJz8ax+mA8VSKCEvMC4Xzl0rMIrtEpH2ch3oi4t47Z2ONG8GmrhvGjn1rI INAB/7pSEy64w6QHLJtBBR8ERvTL0wQe+IOhkkMN7vESNPW3H8yFoNrJZ/lnb3+qe1 9i2eSC0BpANUo3fq2aRHVynDjj3d/3onxGONZIDsSGwYVzCjKMu7I54gQO5fz1ODjB uS8VEC5NhCHqw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6AA976768B; Wed, 20 Aug 2025 08:46:47 -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 aUjdv3WbZZAi; Wed, 20 Aug 2025 08:46:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701205; bh=e4nldg+cphk8AHA8p3F5WwIp9UcGlrISlBjDiZMYSKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GoDFmy86UGkuo3Jt4g+In+xcygnEvGtzd0fMQO+gWw2M8IiABmZek96ly3X/wF12F KO8CZO5veNU1Yd4SHFZh6rNHQc0Z6AzhGjhMLWlzB1oDkejo7XLN7sU3Cew142cxp1 H+n702EbDiTJFlWzz+BPwde0B+zCwGgKyaZ7N9ofyAvrevJHbEW/SZudMzh2U7HGAT J5PpBDxaAm4d3sPyMfUHKurbHQttLNYxMNcm2h6PYiaGSIdbTyEW7yAOTehstmcUzw yA4uLTNr+WN5/H0zPTb/lRZDKzL21SkaF46sGNxYi90v9dOOFzL6oIP9zRNnHZuOqJ eykPjROVIOyMw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1EA456769B; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:05 -0600 Message-ID: <20250820144621.1073679-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EASM47PFGBA6BP2DAC3NTM6FOQ5EEOIN X-Message-ID-Hash: EASM47PFGBA6BP2DAC3NTM6FOQ5EEOIN 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/14] efi: Move driver-binding guid 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 Move efi_guid_driver_binding_protocol to lib/efi so that it can be used from the app. Signed-off-by: Simon Glass --- include/efi.h | 2 ++ include/efi_loader.h | 2 -- lib/efi/device_path.c | 3 +++ lib/efi_loader/efi_boottime.c | 3 --- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/efi.h b/include/efi.h index 54da1540d0b..60afb18784d 100644 --- a/include/efi.h +++ b/include/efi.h @@ -154,6 +154,8 @@ typedef struct efi_object *efi_handle_t; extern const efi_guid_t efi_global_variable_guid; extern const efi_guid_t efi_guid_fdt; +/* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ +extern const efi_guid_t efi_guid_driver_binding_protocol; /* Generic EFI table header */ struct efi_table_hdr { diff --git a/include/efi_loader.h b/include/efi_loader.h index 2d5e8de0132..a475ebb5413 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -321,8 +321,6 @@ 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; -/* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ -extern const efi_guid_t efi_guid_driver_binding_protocol; /* event group ExitBootServices() invoked */ extern const efi_guid_t efi_guid_event_group_exit_boot_services; /* event group SetVirtualAddressMap() invoked */ diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index db5a686ccb2..3fd5c75aeee 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -34,6 +34,9 @@ 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; +/* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ +const efi_guid_t efi_guid_driver_binding_protocol = + EFI_DRIVER_BINDING_PROTOCOL_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 0f9a654ca03..6c5ebdad95e 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -68,9 +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 EFI_DRIVER_BINDING_PROTOCOL */ -const efi_guid_t efi_guid_driver_binding_protocol = - EFI_DRIVER_BINDING_PROTOCOL_GUID; /* event group ExitBootServices() invoked */ const efi_guid_t efi_guid_event_group_exit_boot_services = From patchwork Wed Aug 20 14:46:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 82 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=1755701217; bh=hBuIGTVtEAIp3CqNW5Uz2r/XqwaH1GkOCd+lV8UlgCo=; 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=XoMaKPWlLoRmPXwIsgG1G1bG2AdV//0DqyZouS7a3NqfFYZ3zymqFxYU1sHQg8RNY WAZaubcvHa28k8SZe1NZN0E/NrzNquaRxX193fPDteGt/HKYLJg2YB+t2bFekQzvy4 oc2OsTqH0Mx+t+zRIDySwcCILk4nrk5+fQLrXv2iHH/Z+6oldqVq70ip2fYNOy9mm+ iJh5I3gfb5ee4NS/wUEXLdcKie/Wq5hWQAHDQhhdLoTCsRpacSa1YeVk4z3QSZ2V4y LWJ6lRM6wFdCa3Dm7svcZkmiRXx4bv4RbcoLYKjKzR+LEdjdJ3VI/MmVaYSE26eS8i sk3LjzhARnriQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C277467694 for ; Wed, 20 Aug 2025 08:46:57 -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 MvrFzE7b-k1U for ; Wed, 20 Aug 2025 08:46:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701210; bh=hBuIGTVtEAIp3CqNW5Uz2r/XqwaH1GkOCd+lV8UlgCo=; 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=hSF0QLJlJFlyFF38iMELi0eGAUu9REI/7Np3nuLon7c8jFAmMFZILQPUE+NtCxDf6 ORXd/ykfthvurCphPlxbWFcFyNaHFk/AOl1YWDz1LdtZ8q2lAeBMvza9Fg1RkJQpF5 kIRMbmSWJxOGWPlKZEQKvzmB3f+HuAGjpwXOfI1WewFvxBFyWmAXh1tNKcocU68+ca DiKffahRPpQP5kNVg0HotTvxORYFCqX9g72HerzfFKtEEruPhug7PWPJ3VdN6pr5PW PS9R2pdcw4sFvQzsaKPzEmgcVeSIaTgGgL8pfOeWs+0M9nHAjktJFdCJHoBaBJEb7x llAyCpjLS24vg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 47A49676A6 for ; Wed, 20 Aug 2025 08:46:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701207; bh=PEgLgzXFnOdepyffMYVKa8iKvacFQPIEwphhpFGJcvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzNNhpEPsT3hYd5kVIB4WE2ahBYcpLtU6ZPD1651IcAye5vCNMbCcAcvLs/vcZ2mV tgh0GlRHwgpCsCpFa0Du10js7PCsWbInPmEOwtrF2OTmo8xhJBbVH7auJmU6IfW/YY iwM3mumOmvAz3C6rptqtYZJb3l3xMfdhw0KJZFBuA7JAZLA7Khm1BlZV4iC3r6Hzp8 v++UlUenVelLj3HDFsnNTO8W4wy9Gad2+0q3jjkArjqeupk7tjWcyNd0KSxrSxtCXe oUOrCB/xoja3rU/9hoiJS3iDJFYhwl8uXZy/8vJ4YozKsPnqFYhYXDJt19DsL7/jkK GxbrvA7jbkYAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96684674FA; Wed, 20 Aug 2025 08:46:47 -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 0VJib2vZoPhd; Wed, 20 Aug 2025 08:46:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701206; bh=WdbB4dIl9Om7Btn53M0UrYpPtu/KezsnKZFKHpjWfcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AHPFGlVJXUFGH0a/E56SwBL4kONNaN8PtL94wvxERbQjP8KD/TX4aAAgcoD55lfa+ BTvHb1wjo+7wtLBRMofnSDZGKvz/LHbO8A7mLHqi1AyLRo8Ufr9OZ6bIZumXk4kH0H 7czYs1iaXfFHMzOVq2RLBvE2uZIm0AtXknC7DcPhgqdNQtFfrP6X3pY18pZqsH34Wu NSY62+cOm3LAQB8Ap2NlfM5Nx5eCm9BrisMcPpGLRYqjHc2kamz6tJwU+e+HSPFFkE urYOBEIw4u++Ke8XCXBvthAYoBxsfByyl7HAHzSK3YG2ptZzLDeB3dG2TervjQxleb 5HY11GjfRZpGw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EA316674F4; Wed, 20 Aug 2025 08:46:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:06 -0600 Message-ID: <20250820144621.1073679-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HP53UFNNIMVF462QX2VLHDHR7UOH6ZJO X-Message-ID-Hash: HP53UFNNIMVF462QX2VLHDHR7UOH6ZJO 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/14] efi: Drop the BS macro with efi debug 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 Even if this is a subtle dig at EFI, it is only used once and there is not much benefit in retaining it. Access the system-table directly, instead. Signed-off-by: Simon Glass --- cmd/efidebug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 2df0fc4e221..3a4429a3928 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -26,8 +26,6 @@ #include #include -#define BS systab.boottime - static bool app_not_supported(const char *cmd) { if (!IS_ENABLED(CONFIG_EFI_APP)) @@ -493,7 +491,8 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, &handler); if (ret == EFI_SUCCESS) printf(" %pD\n", handler->protocol_interface); - ret = BS->protocols_per_handle(handles[i], &guid, &count); + ret = systab.boottime->protocols_per_handle(handles[i], &guid, + &count); /* Print other protocols */ for (j = 0; j < count; j++) { if (guidcmp(guid[j], &efi_guid_device_path)) From patchwork Wed Aug 20 14:46:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 83 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=1755701218; bh=W89LOPRu+YTAd2xiZWBApprB+GvDKfdTiMpAHeSrpKY=; 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=Eq26cxNkp9H21SQxjNVkAk1yK3IF4wDycOooxeOBkL/7lo0AUvRI/AP46LlpLPDJA nl7KWmWsDzVWG9+kG3bRAMQInatayDD+ZMvoaATbwCBZrp4ar+apNb/ks5jD2xi3Ic cqTv3hTx4L3N1sf0Mr1dCOUPEGTbKVQ1HrSVmrVKRfQ6ROSSmAP9plPa4iWeCTdiLa 7HVA+Rw0pKz3sFzNyoM1eX4nLUJdZbEzV2fPjobOuC0iXjhVei7V8wI3zWKqnS7Gxx lNBAUoJQj60DP7J2QW1dLkJiukhUKlTAud1gQw+YEh+ickVInIX9/z+4CYVGZW/bMC DQ3igSkEuqXhg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CA31B6768B for ; Wed, 20 Aug 2025 08:46:58 -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 ldP8Z8o_-5h2 for ; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701215; bh=W89LOPRu+YTAd2xiZWBApprB+GvDKfdTiMpAHeSrpKY=; 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=WRoWe3absm+/Gk0JKCSxXqLqNMUv6dulbY/u58PuoTqk16/Go80sDiYp17O3ESD8m q4Kd4H9iBwRJzefN5uIAPMG/K4KL4tCp696E6aWwGro8WTH3u0OyZXRpPJhbmR3w1z i8GcaDI0+zJpOiKrFH54l71Hz5D8QLGhOFTSOA6Y1410xrS7gQj3SvcXucto0eXG2+ 5IVk6EFKbVZE88LG+mCbbeppBumQmeOdhp4OgKfn9LWiPcpqlYW/YoEX429MAONm/u cBJSxtf1xybJ+arxY1pGoWAPprBvZmOjZsl8nDlw0qkF3xfUX7F47O0zcnY9B+Nzjq om6G7HKyTHNuA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABB746769C for ; Wed, 20 Aug 2025 08:46:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701214; bh=0h0x2rlx1W8FiEeFXdSl4U81YrDkUmYrqjuC/4m0mps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESOY0mPJpypaEG0lVFsXvTRwHNkMMHSvkkEZIvksbYdnmskQD9xy8dF6fT4WekCQo zlky0CrITnVaHv669jFClmw83uM8WncoewwGOR5LAFKzBxySIZnOIl/g31GpWmbS0I ooTe4BsrKsPL4rO59ZqvOMp/lgSEpD+GvdBzoY/xHuE3SULYIW7lYt356cNN3vLBPV EeRg4TvtjwGP9Sn074FVZRNtpZiWYUy4dPRX+pmI1kE3y6Sq4nAyEMB1lGmaHlQysC zWTcx4CmAL9qWXE2mYVg9L4TuNrW5kshjIptNMO/m8TUJDumDFjGwqN/csJusj799Y CAhPVB+l3EVPg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 14D3D6766B; Wed, 20 Aug 2025 08:46:54 -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 ZPdvCTPilCfK; Wed, 20 Aug 2025 08:46:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701207; bh=zIRT0mlsBbkFGq1AffGtluTBhfRAzSqnYGUwbsTwLb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fABBW2DVJXruZA0DXWx4Z9vcEqsHv4NU20ubIJw5IzRhigo0sH1K4e1w+y/6/v9hj KT6U6EXa87HGtyvP+GKKePj9eU4W5H6bDMJmrRIyaPKPvIxqUUx8lUPQt+USey12sU 2D4JQA/3cjHs4tXHmRoXOj+4I+YCvOVWj3XT3eDdIB9UfdCXWxSFSwOiBkUQUhVMm4 lS/SoPUtN6tQP3xKdsendED1jLLwVbDYBzxQwgJJbqOO0vNkVX35IBwW0oCAwE0iQL VHhppu2MyLt88UNTfQXX3tWvlCPuzpLT7xp0LfRRFyLxF2/H8whF1p2JrrVCBlz8st G0+OKQhgOp+3g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C86CB6769C; Wed, 20 Aug 2025 08:46:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:07 -0600 Message-ID: <20250820144621.1073679-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7NPRJAKSV6UWKOHBH26ASI32KPYSR334 X-Message-ID-Hash: 7NPRJAKSV6UWKOHBH26ASI32KPYSR334 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/14] efi: Use a function to obtain boot services in efi debug 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 Rather than accessing the EFI loader's structure, create an efi_get_boot() function to match that used by the app, so that the call to protocols_per_handle() can operate in the app as well. Signed-off-by: Simon Glass --- cmd/efidebug.c | 4 ++-- lib/efi_loader/efi_boottime.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 3a4429a3928..d7f88692d8c 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -491,8 +491,8 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, &handler); if (ret == EFI_SUCCESS) printf(" %pD\n", handler->protocol_interface); - ret = systab.boottime->protocols_per_handle(handles[i], &guid, - &count); + ret = efi_get_boot()->protocols_per_handle(handles[i], &guid, + &count); /* Print other protocols */ for (j = 0; j < count; j++) { if (guidcmp(guid[j], &efi_guid_device_path)) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 6c5ebdad95e..8b46e43f1ea 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -4026,3 +4026,8 @@ struct efi_system_table *efi_get_sys_table(void) { return &systab; } + +struct efi_boot_services *efi_get_boot(void) +{ + return systab.boottime; +} From patchwork Wed Aug 20 14:46:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 84 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=1755701219; bh=AGAWeMnmwEE9V/d5POC9ZK19MmwQUdO5AsEdijcszM4=; 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=w94rm1DoaIu7upAyYbF2e7oQS3554hoVO6C+zVuVZ2aU4KUPW0tXZoTCRcXy83zK7 qXotXYMBJsAjoZZvv/5yUqfsyzCFD9VPcLdj+eaE+bqHe9Pr6E0kE2K9/7pNqFDsQq bXfrn0rS5NxOJNvuG7LZDuzUYNhOGR/IFVrkLnQYzYmxYF58XlitMFV9DsrVRRIHQJ vC11mKDXeHfZ2XaQ3xj2dkCAzIvGdG1MJe5YeVV8o3tW0m4ROVIwHikifco8BSn8mU C3U1ce5AOGw/fscOwPcRO07EeNZoYrr4VBCU7xQTROfoskD9uYq7MMrRG0NNTBkAxE Wp2g8EBcI+eYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D97A674FA for ; Wed, 20 Aug 2025 08:46:59 -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 fqPcILIV1_D4 for ; Wed, 20 Aug 2025 08:46:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=AGAWeMnmwEE9V/d5POC9ZK19MmwQUdO5AsEdijcszM4=; 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=TuniXniRxah5AIayu5UecAobRy2BUIuCyahBXArGLZ2ydZML0UENQB0HQUl6zz6L8 XJ+0QfrHQG7XD6Bkl5LD1nlnDycVJgtA70snndMdXQOmHZdLDFfTcdgXhaAhdYyHEV ytApuNZB+Wb6Jo5XjodSc07sxJCefdKEMqmzDvnMzylcB1mEzLk/RPWaasQRq9S/KG mUU+fVPZr7XiV4SMMQlBA4WoTNZXG7qcv/1mkC25JnmjNIHh56xLSJPQER4INIWP7z SGZiBtsryTArm3WJ09rQKPxWSV/D/BceZMIqXaVKaxFq29R3QKGVszUGM/ReuJIoEM 5VVPV4vM/NILg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CFF6F6769C for ; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701216; bh=Z7KPzbKB6H/lIdj+NIapULdeIpoZAu2sTxnTc/V7nwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEz0aOexHn6PlRq/RIzdwE1Mh8p4gQVyTpEHuMRjycZ2Prz0wVrrU8ADvAt9TLgz1 wynFckSBiWLS2Ojl7gIazaGmk3kLougGHfBtl9dy629ryRZy5RsfyP3mGJ5xXRKQhe g0ofZWAWTPIffVdr3wJ9l4UzE3VOgUE63zxdqR11OO1/ZDTWrIcMBlTzOW4mPy5SSS QL/sjGZbEqzJo52X5E1H818mHePpcQaZ++nLqZanfgN1UExSLCcaeAygh3Ytpz9sKJ 5xT1s9D9JA+PseAdijqxUIQo3NrsEWoAL84DzY/uTIfhsSYkqoeWArlcYU5i2YtQOL H4jYAxAfSlm6g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E574676B0; Wed, 20 Aug 2025 08:46:56 -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 Q_TIjbrfkoRB; Wed, 20 Aug 2025 08:46:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701207; bh=7xYvvLiMl3aBestEOLRYt6p0RyOmckfvEQg8fFx3MEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRErRIvqYQzqdu8H+/G/gWDZZvTJ4IexJmQYNGthLl2KEcWXFXD8enChAysvqTZ6k ICaWJS0zxyJsOwtzhTKtP2vyhN3dYE/RhAAf4HoP10UkHJlt+ezpwo1qh8l1WtpvqC 8YI+YgDbnpL/Y6w7hZPfNO4YxcNFplttDPCyv8LdC3Brx8mYyTEOg139Ma23NCJ4bN WI2IMWHm4VrMWKSg+Pki1kmzjisKmwasAjGIuH0euRJ3/EPILQApOmkFVTJFJyGCvB cXc/hoBY8wY4Pg5HofiKYlOK6dpq25NMqYq2I/zjs1R9FeASYDkvyuNTxDeyuM9uK+ Nzohpa6CclGqA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 987C9676A0; Wed, 20 Aug 2025 08:46:47 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:08 -0600 Message-ID: <20250820144621.1073679-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KA5MTEC35SFTJ5PXZYR2ROWVA5IC5UV3 X-Message-ID-Hash: KA5MTEC35SFTJ5PXZYR2ROWVA5IC5UV3 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/14] efi: Use a local var for a handle with efidebug dh 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 Rather than repeating handles[i], put it in a variable. Signed-off-by: Simon Glass --- cmd/efidebug.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index d7f88692d8c..a6a0e877798 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -480,18 +480,24 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, return CMD_RET_SUCCESS; for (i = 0; i < num; i++) { + /* + * this cannot be dereferenced in the APP since the format is + * defined by the underlying EFI implementation, which is likely + * not U-Boot + */ + efi_handle_t handle = handles[i]; struct efi_handler *handler; - printf("\n%p", handles[i]); - if (handles[i]->dev) - printf(" (%s)", handles[i]->dev->name); + printf("\n%p", handle); + if (handle->dev) + printf(" (%s)", handle->dev->name); printf("\n"); /* Print device path */ - ret = efi_search_protocol(handles[i], &efi_guid_device_path, + ret = efi_search_protocol(handle, &efi_guid_device_path, &handler); if (ret == EFI_SUCCESS) printf(" %pD\n", handler->protocol_interface); - ret = efi_get_boot()->protocols_per_handle(handles[i], &guid, + ret = efi_get_boot()->protocols_per_handle(handle, &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) { From patchwork Wed Aug 20 14:46:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 85 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=1755701219; bh=ypIuGurvelJFVUHCxE5O2/PZ+TQ4HWfmQCYc+Nh9Yso=; 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=tqIrOoXdhCQJeKcuYnQmBeZTOcdJilvbv0QsbC7p0uM2OIlCpyUga8Xs8qQ22OGhe oezyijxqbDhRhgd6PNpvPYFRbTSSDha6kryxakjRuZ/DRP1G2qf2gGI1drnAY08045 5cAmpEM7rX3yS6WAbJ2x6MhMMe8mBqUXTnOoGubSuIOuGVzYTEkTVTRvEbrji1PEvg JOs9efno96kH0WZvXpgnBQPrYXZ240zSASghLgQlFmyDpuYaeRdnQzexFTbvcd7Kmz gJPxQyA8ZfHBrDXl5J5E7ExJwCkZUK0Ia9GqcvadPWFztfB6jo4ADQ2i2O1QSMwGoH O3cg5FeRICoXA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D78D267419 for ; Wed, 20 Aug 2025 08:46:59 -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 x3bGPUHgfiji for ; Wed, 20 Aug 2025 08:46:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701219; bh=ypIuGurvelJFVUHCxE5O2/PZ+TQ4HWfmQCYc+Nh9Yso=; 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=tqIrOoXdhCQJeKcuYnQmBeZTOcdJilvbv0QsbC7p0uM2OIlCpyUga8Xs8qQ22OGhe oezyijxqbDhRhgd6PNpvPYFRbTSSDha6kryxakjRuZ/DRP1G2qf2gGI1drnAY08045 5cAmpEM7rX3yS6WAbJ2x6MhMMe8mBqUXTnOoGubSuIOuGVzYTEkTVTRvEbrji1PEvg JOs9efno96kH0WZvXpgnBQPrYXZ240zSASghLgQlFmyDpuYaeRdnQzexFTbvcd7Kmz gJPxQyA8ZfHBrDXl5J5E7ExJwCkZUK0Ia9GqcvadPWFztfB6jo4ADQ2i2O1QSMwGoH O3cg5FeRICoXA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62259676AE for ; Wed, 20 Aug 2025 08:46:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701216; bh=2pQiDz14ObtUtsIddGY0djTBCuIGlxP/s108VYj7mrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j+TAJ+4oGFBeVLGKOKrCHnDPhy8Ijxo1M220FxfZ6nmpKLvKzVBXsPsW+CwY+mqyB +Ep6BM8SqK/YomYah+3ADYZFsXPB/Sk9s3OJLgS0I1p7Vs6/d33R5fkTEypD5qe+Yt PJh1ukRM1u5DEm6tr6aqOG3Pql9Fh7UxbHclF7hKygVlWVkTOwBl2ZsSU0dxoypsfV /CQNqhXM6urbtw9gS4ioRjokz79cq1nZuA3XxWemAMmrHUua70cl+CLkWlOu6IzayR RHzsc/+CTx1TrURqqauCG5YRyEHNeappPmk6Oo1jUqQYvEw5FZRrrJlRWS+EG/gy6r 1NMUymT8uA55A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62A05676A0; Wed, 20 Aug 2025 08:46:56 -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 E22OIqrIpnMf; Wed, 20 Aug 2025 08:46:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701208; bh=jLjHB5LKqInYpTdhmWcC3zLYmZpCRp2270QtSwUy97c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JgM07kDHfq025VPfR5rkWwIs5bVicyE0mHzZvdF6YhHJ3SwqMglTs2hJHdeEaawV3 uJ8FYkfp9qdWmii4EVla17O3er0udvEhqMcIuFyZlGe+W8IVWyIIiC9KghqcZRHJWN 1rkQtk7D2UiQe0FeS/ExtoEn1kcegS+acVYfGuhqzwAlkUA6GykvyExrnRcZq2bq33 HoSHrQf/mpl06Tg/uSYPPUlXtehMYg75ET3kRk7MEXON2Rpgfs5IXUoQ8nfLj5sKMH jWkpVS6JLYn9EMselFaI409hZ++z9OUpwxwBgD3Hu0kQdZ5b+6gLHCVxcOXwbkF5fj 3wPTHxr9QxbsQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 74673674F4; Wed, 20 Aug 2025 08:46:48 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:09 -0600 Message-ID: <20250820144621.1073679-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: G56IFFMFUTPHABDM3LHNDGP35I4XKUA7 X-Message-ID-Hash: G56IFFMFUTPHABDM3LHNDGP35I4XKUA7 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/14] efi: Show the device name only with the EFI 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 'efidebug dh' command dereferences a handle to obtain the device name. The format of an EFI handle is not defined by the spec, so when running in the app we cannot assume that the handle can be dereferenced. Even if the EFI provider happens to be U-Boot it might be a different version. So don't try display the device name with the app. Signed-off-by: Simon Glass --- cmd/efidebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index a6a0e877798..cec4165a5e1 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -489,7 +489,7 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, struct efi_handler *handler; printf("\n%p", handle); - if (handle->dev) + if (!IS_ENABLED(CONFIG_EFI_APP) && handle->dev) printf(" (%s)", handle->dev->name); printf("\n"); /* Print device path */ From patchwork Wed Aug 20 14:46:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 86 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=1755701220; bh=QGuowB/43o4kQyaZdnwhJxBbrjiupWimHyB6Q4lmtUU=; 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=BAjNbqu1NrmUogA3BjoeWAj59wMvBq0sUWsHgALK4BXW5aFo+oLmnXOE2Rbj5ZjHm Daj6tNooQNr0pgSHSFKdpXzu5FwJK05QpQMA++r3zpUDRQWGZleqk8GxWYwfWjcdwl 9pQy0kI4h3W0FHqY/r30q4vCbvMdjq/SiNnemznkBrJRMslzckt7bSv8PJO+zUxnqR 6GVOzUSlVPPLVcVsJ4l3AZQ947cbnFMk1oOXRUg01O8JeyU7bkQz+cm4klSxQ6pXKo bp/8Mfzx79EqBQAmSVs9Z5lX7IRp0Pw4Ku6GYXMa50MRf3LRRG/Smm/acFc191luNt y/o+VR+Ru13kw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B5416769C for ; Wed, 20 Aug 2025 08:47:00 -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 8JFwl-q1FtJN for ; Wed, 20 Aug 2025 08:47:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701220; bh=QGuowB/43o4kQyaZdnwhJxBbrjiupWimHyB6Q4lmtUU=; 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=BAjNbqu1NrmUogA3BjoeWAj59wMvBq0sUWsHgALK4BXW5aFo+oLmnXOE2Rbj5ZjHm Daj6tNooQNr0pgSHSFKdpXzu5FwJK05QpQMA++r3zpUDRQWGZleqk8GxWYwfWjcdwl 9pQy0kI4h3W0FHqY/r30q4vCbvMdjq/SiNnemznkBrJRMslzckt7bSv8PJO+zUxnqR 6GVOzUSlVPPLVcVsJ4l3AZQ947cbnFMk1oOXRUg01O8JeyU7bkQz+cm4klSxQ6pXKo bp/8Mfzx79EqBQAmSVs9Z5lX7IRp0Pw4Ku6GYXMa50MRf3LRRG/Smm/acFc191luNt y/o+VR+Ru13kw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3F9A967696 for ; Wed, 20 Aug 2025 08:47:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701217; bh=bVskN/s5pJGVnwD1J6W/lA42+FC6gyc/uaDVZzfET6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPgGnoCh8hbZJ8yc3t9uAknYxH44HRAuyLPLKz/wmlT0Hp0RcIO9BflF8ahKk4EvB 865vU5FU0H9mWTALmRg9KnfmcLbky/8tk4Zm+XOZWzya8d9639G12krrV75ekGgn53 PLq+l8doaQZ1I0DgZXAqBTM0Cr80uZTJlG1IY28dpLcx8xDVGEjqEKgJdP6+mUaKBz Sb9u/MFdDySBeNhraOA++oVppdjXcPDWA8U14iZWiY/2OzrYiu64HqLUvMSAwntlox PqJtMMJOBu0h3PGz1qlpAZGFAPZV15Mmb8OfwCvlbqokVntcaVeke1EFCX/H9dUj/3 8BXaQ5E8EJ4+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F9CA676A1; Wed, 20 Aug 2025 08:46:57 -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 B6oxWZ61zRiQ; Wed, 20 Aug 2025 08:46:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701209; bh=sVpWwmWuhZPyLY6SIdm1nhSatblcXSBoDuHhUBGF9ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KeILtu1oXQAbu2FZ9yz0FF3Mh56mEEy30I3htDoST1JKX8owbEFAQGHkmGtEYB8YS ZPaEKq+YQwjjtlV2k1yI+8THJncQG11F8LkCIqyCzNL23h8wzO23Kr/82yBfhbe1Pf Xig3tVdSSJ3P/WQk4QIQD7tjb2Bbl+QWNdwbWkcOA8XolFmbYiwR7dzwZm4Cv6wl8p lcE2jQbeHkoFiT+MSHBMm1pMUnHBnRyNOPR3OrZp0iKywi7UZsxc5k8vOaF8uPi9e9 Fx1/qw+iCCKQFVvfWrNM7gZ9/9SnmKYYynDxKWfAi3SVRVBnJnaSkWskq9E6UWiDkw 6BPdDZP2bUSAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4BBFF676A4; Wed, 20 Aug 2025 08:46:49 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:10 -0600 Message-ID: <20250820144621.1073679-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7U2S5BMMGZG2GZI6SN2D7KE637IEFY55 X-Message-ID-Hash: 7U2S5BMMGZG2GZI6SN2D7KE637IEFY55 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/14] efi: Update efidebug dh to work with 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 Make use of the boot-time services rather than internal functions, so that the app can implement this command. Signed-off-by: Simon Glass --- cmd/efidebug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index cec4165a5e1..dee0fc7efc2 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -464,15 +464,14 @@ static int do_efi_show_drivers(struct cmd_tbl *cmdtp, int flag, static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + struct efi_boot_services *boot = efi_get_boot(); efi_handle_t *handles; efi_guid_t **guid; efi_uintn_t num, count, i, j; efi_status_t ret; - if (app_not_supported("show_handles")) - return CMD_RET_FAILURE; - - ret = efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, &handles); + ret = boot->locate_handle_buffer(ALL_HANDLES, NULL, NULL, &num, + &handles); if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; @@ -486,19 +485,20 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, * not U-Boot */ efi_handle_t handle = handles[i]; - struct efi_handler *handler; + void *iface; printf("\n%p", handle); if (!IS_ENABLED(CONFIG_EFI_APP) && handle->dev) printf(" (%s)", handle->dev->name); printf("\n"); /* Print device path */ - ret = efi_search_protocol(handle, &efi_guid_device_path, - &handler); - if (ret == EFI_SUCCESS) - printf(" %pD\n", handler->protocol_interface); - ret = efi_get_boot()->protocols_per_handle(handle, &guid, - &count); + ret = boot->handle_protocol(handle, &efi_guid_device_path, + &iface); + if (!ret) + printf(" %pD\n", iface); + else + printf(" (no device-path)\n"); + ret = boot->protocols_per_handle(handle, &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) { if (guidcmp(guid[j], &efi_guid_device_path)) From patchwork Wed Aug 20 14:46:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 87 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=1755701222; bh=MMdEov9HQ/hOCrQ8FAugui4zCVtcwtL2tz7FF4jSEbg=; 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=Fr1St6KN6zrFOJECa+q+17faGgkR1FroEVliNU8YV5tsHXrNglzXIlf4OPtn/9FMg EA0ao7895H0P9nxI/4uoi+RHAf1Bo8EqYG2UMXrOb6PZo8FPiCOwVlAKbHLsZ7WBnX AJFnHmYDY7+JKJouhJqzk8EfAlSy4yU+XthgjCUJOj1+CnZiBaiz1d89HoBzUAbDSI njP8QNhuBjT3dsAXgC8KTKwge7XXkrm+WhZPm4B1mTw5B8lA5NMD3+cz796oyu+WHC P7O2zZXQ7gO6j91ypnFS2LKsnGWzB7DuS9xU6lBj93HVBxhFg5f2PPILIJCqvGYHUP +SRWC2jyf+Hjw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB47E67699 for ; Wed, 20 Aug 2025 08:47:02 -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 72T0ttmOGOWh for ; Wed, 20 Aug 2025 08:47:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701220; bh=MMdEov9HQ/hOCrQ8FAugui4zCVtcwtL2tz7FF4jSEbg=; 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=EnqTSzzcMyIjTYTXF/piGTxuOyY970rX/Z4481xQxKMrcI7mLokteWRhw+JudDZ8S SzRIzNQx8fIW2Vj2ROReL3p/1l8oEdbYKD7CCRuiFxOWjhrSkoFPyihbfEgPjXU26v fOqXse03DFwfSTo62yS+pFRIhy60qKkqcp9yMv4GTSSX1y/9q2LxSljdNwFAJgwt6V O/VK6YkeEReT6wYvI++5qOOdEza3E3d6CpiFk5AuE/3ExQci28wfLJ3zLSpNaCYXg9 zX6TCLExZZpBjZz7gOnbSuzaJJ/+LYoIbv32ajNjasTmMU/ZbUIpyHhbmSH6JaUoeS fkY2Ajm6NNCvw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF43A6769B for ; Wed, 20 Aug 2025 08:47:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=ewVhRbyJQim593I2+a7KTw1I7EzK+wVcjOVuy7F1J5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZJX3gtO05BY/pND8Ej2YFZffZFI1QWGCaq5ie6nqt6yDeGyG7MysjDnozo9cQRN84 8+qOsmzh3yjXcwiZ9k8+VWFbU2qHldKVLEzSjcYP6xEBxgJYU8lOCExcKGIhcCDEi5 LH18DvD5L8yQpqBaY/4/9Crw5fwfopbhqPQ4rc5KEtin8zJ04E+7owxUFeArrqE757 u7zHoNE2NIrTKj/uGH+RgEI1ykjh8aUGTh7E8nyYW5W44aW5VgrIL8BWaGtR04qq71 lxRrQBES4bWG79mzlRqZopERx52NyXigww6lN27FxvH1UHxIxt1XpAp6j8KXm9lcb+ hv+AioDqpzNSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2974F676A5; Wed, 20 Aug 2025 08:46:58 -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 U8g1iilPmhLl; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701210; bh=3pkuNCyTuxuc5WrL4eNic2Nefob/eFnxeyP2gyE1icM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fE0lcWTRfeH3La15iAJdWgemgNkDcWtFGVXj0W84qCeCUYxz2cVhoxa509+5EqYLb 84rLyZMSU+p1pdry3QT9vghBGiZJYym2ZFLUvEhOo7dKc042bLUbQjT0LhlmM8oBWl HkGGmkdz2wAsJTUlw/0I34MZ0d8AlVoPJGXNFwBPFHUqGpRHHvxA40J4XikAsXQg+V 1fmmWySzmzllCuJ3zLDH7ee89gtIiqJDdj4X7Yzaboa7kPwS6xj7e8wrx2uwbjBymv J07kpNDizY8bsGuReOoy4dAw4Q2Fco/JQZHy0t1Irsis4JICA+BJ5dtNwEs4bSx0kQ Pkmm43G5uX1aw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 250CA67699; Wed, 20 Aug 2025 08:46:50 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:11 -0600 Message-ID: <20250820144621.1073679-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EX5EY4X5VZY62UD2NNW7IOWJT5UOKANY X-Message-ID-Hash: EX5EY4X5VZY62UD2NNW7IOWJT5UOKANY 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/14] efi: Add the component-name2 protocol to efidebug dh 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 the GUID and API for this protocol so that we can use it in the 'efidebug dh' command. Signed-off-by: Simon Glass --- include/efi.h | 1 + include/efi_api.h | 15 +++++++++++++++ lib/efi/device_path.c | 1 + lib/uuid.c | 1 + 4 files changed, 18 insertions(+) diff --git a/include/efi.h b/include/efi.h index 60afb18784d..5e15a87ed3b 100644 --- a/include/efi.h +++ b/include/efi.h @@ -156,6 +156,7 @@ extern const efi_guid_t efi_global_variable_guid; extern const efi_guid_t efi_guid_fdt; /* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ extern const efi_guid_t efi_guid_driver_binding_protocol; +extern const efi_guid_t efi_guid_component_name2; /* Generic EFI table header */ struct efi_table_hdr { diff --git a/include/efi_api.h b/include/efi_api.h index dfc13588213..876c1ac2bbe 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -483,6 +483,10 @@ struct efi_runtime_services { EFI_GUID(0xd719b2cb, 0x3d3a, 0x4596, \ 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f) +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + EFI_GUID(0x6a7a5cff, 0xe8d9, 0x4f70, \ + 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14) + /** * struct efi_configuration_table - EFI Configuration Table * @@ -2426,4 +2430,15 @@ struct efi_disk { void *buffer); }; +struct efi_component_name2_protocol { + efi_status_t (EFIAPI *get_driver_name) + (struct efi_component_name2_protocol *this, + char *language, u16 **driver_name); + efi_status_t (EFIAPI *get_controller_name) + (struct efi_component_name2_protocol *this, + efi_handle_t controller_handle, efi_handle_t child_handle, + char *language, u16 **controller_name); + char *supported_langs; +}; + #endif diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index 3fd5c75aeee..0b2eb7561b1 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -37,6 +37,7 @@ 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; +const efi_guid_t efi_guid_component_name2 = EFI_COMPONENT_NAME2_PROTOCOL_GUID; /* template EFI_DP_END node: */ const struct efi_device_path EFI_DP_END = { diff --git a/lib/uuid.c b/lib/uuid.c index b5f486182f4..3f7885d0877 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -279,6 +279,7 @@ static const struct { { "Debug Image Info", EFI_DEBUG_IMAGE_INFO_TABLE }, { "Memory Attribute", EFI_ACPI_MCFG_TABLE_GUID }, { "Random-number-generator Algorithms", EFI_RNG_ALGORITHM_GUID }, + { "Component-name2 Protocol", EFI_COMPONENT_NAME2_PROTOCOL_GUID }, #endif #endif /* !USE_HOSTCC */ }; From patchwork Wed Aug 20 14:46:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 88 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=1755701223; bh=c4opK3azzvDaIFg6z+SmugAky5AWjJ7E7cfpaEIa1og=; 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=ink1s+hM2sXgVbW0AhlfcV0R5hSdUugBX5tH2kGHyuDJBxM+FKkpxAGD1FL7+fTNI epV41qJfh4IurF+jWizvkTrFZT5fVc0beb+gPYaAKiPYTprfqXkpRkb9VzBAnSb1nr BapxD/z5kuFaRcjqEh87EiJGXq3idDf/IN8GRELbXWrKTw2q4nasTuSZaMA9NpAHaC oLWOWjFxrhL8ZKsdYqzUEF3Zn0UgtQyKuyR7XYdxpFoZLHw7DfIMb+dqUdMPBIyslz DkwyTndVQz068WOjJm7b/EzwiJsVksGnF8XM25Xj7Pq1zYhCRsdMSPRPiJm3mzpJX+ /p9vWjGPHy1lA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3EAC2676A0 for ; Wed, 20 Aug 2025 08:47:03 -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 owsw3yHFg3Yp for ; Wed, 20 Aug 2025 08:47:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701221; bh=c4opK3azzvDaIFg6z+SmugAky5AWjJ7E7cfpaEIa1og=; 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=BtuAavS2O7qQiUyI6amawE9sKu26KrWRf1KsLvtcMFIlA8/3T5wLML2YBg5RBOtSx L2dFTcFc4K3dZZDpQzPN48HBrUMdN10OXEzVuaf198zdjCaOO+j0G5G/Z5Prp3JKcM y/PIL0eeEZpnpjtR9LMJ5g5pnUbk8QNfNjV3EOmfdi9NQqneXRxerPLQ0WsI61U9RL MrczEz9LuuHeDn7c1L3WhtuwNgoD2LYW9WTtUl1FOXED99ZQpjaIWFYmTSKQy2eOu3 VnsRNLbBPe/T8IVCSK3jwu55H6LZ6BEpCz4uzPgUSqnMT0U0sUaVOejXK21zlhCX0R XKCHXWdTeDzAg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC490674FA for ; Wed, 20 Aug 2025 08:47:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=T4gtNueA3/QoYblHudl4QhwB+8dhiIQfnoi/xt/1EdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RthOWMjQi1ARsTW8y6cjSAyhVJGf1Qmr00E24G5sigpdovR/C5a1fWiXAIyHMuKIP nDY4upEhDSZ+smOzp9PLZ99tFMFZHeZ+XLYTWVlBrIfQvbUkD8v2o8POjY1XOaRBm7 d6tD4/T8muUmgD/BwN5nAXI8hVd9jw5AIX27bNGTmNW20xE3NyW0AALrSu32ieWHcd tWW4T6crHLrQNnC+NSwJ1wzaIpuM+JJrdmyJIVpgrQH1IsjL3q7QC+zMoOx3Ipg2g2 u7Fwm9sayCOwZ8dyioMgcZAW+241DGEyVJRi5iDeWRUZOchcRvvZkWY44Roxyo+c4O b4C/zEuWM2x5w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4044C67699; Wed, 20 Aug 2025 08:46:58 -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 RUiIBlDM3ywa; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701211; bh=yCOsQ1uBYHOeg3yoCY5zoCFmZM3e0UFRqelK9wbH9XE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g8APi26eUhTEssQi501TqxPhs4teHjskIjJ/7tYWcKjfue+ENLtMKZ/lNYamdm0HI EfbtskurFbvV6Rie6PiJhXWTPxknMt8zcCFSLf94RqZBJnwJGv12sR6qBKAdVMKOPn 8XhwHp8j5KfPkiJMzcynLn/Ipw5R6cu9NvcxX6ooU82h1wimh55sBCm1y1Idqu8DW6 79nC8x9R293/AdP7W7gEaAyK0/D7rDFztP6BlREH0Az3t40GDQRiHNPQjkSNK+fbgH oHjKvqHhY7HEgiqD3h+gcBZ/CuGIu5Bk8H9Mfo0KCKRXOI/YJAJOQFN+qOdW3HroyC Vk3qvZiax3qVQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3B956676A9; Wed, 20 Aug 2025 08:46:51 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:12 -0600 Message-ID: <20250820144621.1073679-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AQPTHQDKJBWC44CPEMPWGTXRAHQZOX5W X-Message-ID-Hash: AQPTHQDKJBWC44CPEMPWGTXRAHQZOX5W 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/14] efi: Show component names and other info with efidebug dh 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 If a component name is available, show it, along with the supported languages. Also indicate at the top if the handle is a driver, rather than listing that protocol at the end. Signed-off-by: Simon Glass --- cmd/efidebug.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index dee0fc7efc2..1515a508e2d 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -488,8 +488,27 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, void *iface; printf("\n%p", handle); - if (!IS_ENABLED(CONFIG_EFI_APP) && handle->dev) + ret = boot->handle_protocol(handle, + &efi_guid_driver_binding_protocol, + &iface); + if (!ret) + printf(" "); + if (IS_ENABLED(CONFIG_EFI_APP)) { + struct efi_component_name2_protocol *comp; + u16 *name; + + ret = boot->handle_protocol(handle, + &efi_guid_component_name2, + (void **)&comp); + if (!ret) { + printf(" [langs: %s]", comp->supported_langs); + ret = comp->get_driver_name(comp, "en", &name); + if (!ret) + printf(" (%ls)", name); + } + } else if (handle->dev) { printf(" (%s)", handle->dev->name); + } printf("\n"); /* Print device path */ ret = boot->handle_protocol(handle, &efi_guid_device_path, @@ -501,7 +520,9 @@ static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag, ret = boot->protocols_per_handle(handle, &guid, &count); /* Print other protocols */ for (j = 0; j < count; j++) { - if (guidcmp(guid[j], &efi_guid_device_path)) + if (guidcmp(guid[j], &efi_guid_device_path) && + guidcmp(guid[j], &efi_guid_component_name2) && + guidcmp(guid[j], &efi_guid_driver_binding_protocol)) printf(" %pUs\n", guid[j]); } efi_free_pool(guid); From patchwork Wed Aug 20 14:46: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: 89 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=1755701225; bh=Mi390UkZ8K0gcIFgCdDNh74r1y0bpogUKXDcYgLdQjU=; 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=MOEzFEp/qokMRq1Fn64RqO2fYvKw66eXRdO1sbC9dI1L20sjnkpTM3O8oJhp19BAJ J5ni0GmIBjZvUgEkF8DrkFvBK/hjkkntKUGwLyZGpI8/hpdH+tUO9OOwLbnuv8EhvZ 515OcOO+apvBDpzvb4cWg854SRD7qySVK7ol0OFvgyEWMno1vxhj8PyTuYQlC/bnjy zHK4tY+sSd8qlBlEC85tGvG5cHEtOb583iLGAvCMDcPmDYDzlR26K2NVOvf8lVQfnZ +yP845CLLxcPGiNcrZXgHGJ+7j0G5ZO8zEfzn002rLrnEXB+/6fB+54g7pSHrT/StG 8dFVd5c+W/84Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DAECB674FA for ; Wed, 20 Aug 2025 08:47:05 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id u2ySafTtNvxM for ; Wed, 20 Aug 2025 08:47:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701224; bh=Mi390UkZ8K0gcIFgCdDNh74r1y0bpogUKXDcYgLdQjU=; 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=QET8/36D0OZSWU5ry9OuMDfeRiz1RSKWQ2NcghctRzNyhRdx2SVVt8L1vlL629Iqn CFnMVjZTIWt2NNO9PwFjMvNGCIGxTRf5inr7EYSsp4zy8q8wwG/ncIHiah64NS7G4/ Qn1j6cgTGmbhplOw/aIeNQ7qJak9IEYxHfMbU5QiUL3+w719gsSqXtbYpS/CjTwtXR BdVbuz9w9dqU9KlxVlR5/Ht0buW4VN0Dg2oWeKtZD+S6GZAXI2YyavfzhtZvDk4T1t XYj4ceRDg/uQQegfSJxSwCr8nv5LDtC/lS+Tmk71NmjLmQDymQmNqmdPH7LMfP0QrC bl3nt6XXdrrVA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 30D3767695 for ; Wed, 20 Aug 2025 08:47:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=KPJDMUHLatah6F5ABF2XxJ6FWaCDq9j3Z9ZW6wID4W0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i+LcX9Qes8ZsqED1OH6xtZpN1qm+5ZmJUOreojX/94oX7Zp/TgvSGaIafNaEjNItl PanZTC8g93HzJiki3LkZpdNC79jiUq51kX2ygdVF6Bz5p2lGPXPmwk3YnrnLjss9A4 5tTO3WMQb76dVyNJRf2u5sWnetYqJyaaiQ4If2u2lrgCezzU12EippYE1f3VJoh+Zg 3emL2yoRrw/gUrgE0iYiS6pzZLR4qyQrdD/kVQ8cKutNiBttDkzjpTGWdK3uG0ghtp 2RjvpAZzwksqZo0/9+UYXqrXsqlVedmOVTIrOPsBUy/FGXZzSL7V4d+KVhxCQz340B X33F11ODUosuQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 58F1F676A2; Wed, 20 Aug 2025 08:46:58 -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 tmyEL7Jpiewz; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701212; bh=7NW4yY6VNmzPYcB7AYp7Ry4CBW1G0FfwiKS7RYAFkk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vnjBVyejZuGEPxkR1PNkI9USUDTqdDI6Is/zZ+O8GWkJaK1HhnlsxpV2BfETZpzgb cxOEv6Ca4cyNWc3NEB1ULLg1MaaK9PMjwuv0TcXpwya1DaVBhe6QVVxJppMYrRIXEq Bg2rjQ/JYCyySgFVhMkg1Flxp5xMSn6Hs0FwRdHIJ78oebBMAiN5Ri2BrLK7a37IOU IdVU9Y+MVCOQ5JNZ4n0BOwwaBEWYgTlkcYYLOnTuuEnnVbWqYdfLMkRschI+oMTNYO TftVmX80Luvvi+yV4wnaY50Onen7jZ//+Yrwtn5m6zy9aU52oX/Gz1a2WHJ528ZomL j1h27ANP/2/Vg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 466AB67695; Wed, 20 Aug 2025 08:46:52 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:13 -0600 Message-ID: <20250820144621.1073679-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Q33X7FTB5T3NQJW7TT3QYETTV6RYWO54 X-Message-ID-Hash: Q33X7FTB5T3NQJW7TT3QYETTV6RYWO54 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/14] efi: Add device-path support for EFI media devices 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 proper device-path handling for UCLASS_EFI_MEDIA devices in both dp_size() and dp_fill() functions. This enables EFI applications to use firmware device-paths for media devices accessed through the EFI block I/O protocol. Add some debugging while we are here. Co-developed-by: Claude Signed-off-by: Simon Glass --- lib/efi/device_path.c | 116 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index 0b2eb7561b1..449b9d4239b 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -375,6 +375,10 @@ __maybe_unused static unsigned int dp_size(struct udevice *dev) size = sizeof(struct efi_device_path_controller); break; + case UCLASS_EFI_MEDIA: + /* EFI app */ + size = sizeof(struct efi_device_path_udevice); + break; default: /* UCLASS_BLKMAP, UCLASS_HOST, UCLASS_VIRTIO */ size = sizeof(struct efi_device_path_udevice); @@ -389,6 +393,9 @@ __maybe_unused static unsigned int dp_size(struct udevice *dev) case UCLASS_USB_HUB: size = sizeof(struct efi_device_path_usb); break; + case UCLASS_EFI_MEDIA: + size = sizeof(struct efi_device_path_udevice); + break; default: size = sizeof(struct efi_device_path_udevice); break; @@ -519,6 +526,22 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) return &dp[1]; } break; + case UCLASS_EFI_MEDIA: + if (IS_ENABLED(CONFIG_EFI_APP)) { + struct efi_device_path_udevice *dp = buf; + struct blk_desc *desc = dev_get_uclass_plat(dev); + + dp->dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE; + dp->dp.sub_type = DEVICE_PATH_SUB_TYPE_VENDOR; + dp->dp.length = sizeof(*dp); + memcpy(&dp->guid, &efi_u_boot_guid, sizeof(efi_guid_t)); + dp->uclass_id = (UCLASS_BLK & 0xffff) | + (desc->uclass_id << 16); + dp->dev_number = desc->devnum; + + return &dp[1]; + } + break; default: { /* UCLASS_BLKMAP, UCLASS_HOST, UCLASS_VIRTIO */ struct efi_device_path_udevice *dp = buf; @@ -1013,6 +1036,86 @@ out: return EFI_SUCCESS; } +/** + * efi_dp_from_efi_app() - create device path for EFI app + * + * Create a device path for EFI applications using firmware device paths + * from EFI media devices + * + * @devnr: device number string (format: "dev:part") + * @descp: pointer to store block device descriptor + * @partp: pointer to store partition number + * @dp: pointer to store created device path + * Return: U-Boot error code (0 on success, negative on error) + */ +static int efi_dp_from_efi_app(const char *devnr, + struct blk_desc **descp, int *partp, + struct efi_device_path **dpp) +{ + struct efi_media_plat *plat; + struct efi_device_path *dp; + struct udevice *media_dev; + struct blk_desc *desc; + int part, dev_num; + char *ep; + int ret; + + log_debug("using EFI app firmware device path for devnr='%s'\n", devnr); + + /* parse device number from devnr (format: "devnum:part") */ + dev_num = hextoul(devnr, &ep); + if (*ep != ':') { + log_err("invalid EFI device format: '%s'\n", devnr); + return log_msg_ret("eda", -EINVAL); + } + + /* find the EFI media device */ + ret = uclass_get_device(UCLASS_EFI_MEDIA, dev_num, &media_dev); + if (ret) { + log_err("cannot find EFI media device %d\n", dev_num); + return log_msg_ret("eda", -ENODEV); + } + plat = dev_get_plat(media_dev); + + log_debug("found EFI media device %d with firmware device path: %pD\n", + dev_num, plat->device_path); + + /* use the firmware device path and append partition */ + part = simple_strtoul(ep + 1, NULL, 16); + if (part > 0) { + struct efi_device_path *part_dp; + struct disk_partition pinfo; + + /* Get partition info */ + part = blk_get_device_part_str("efi", devnr, &desc, &pinfo, 1); + if (part < 0 || !desc) { + log_err("cannot get partition info for '%s'\n", devnr); + return log_msg_ret("edb", part < 0 ? part : -ENODEV); + } + + /* Create partition node */ + part_dp = efi_dp_part_node(desc, part); + if (!part_dp) + return log_msg_ret("edn", -ENOMEM); + + /* Combine firmware device path with partition */ + dp = efi_dp_append_node(plat->device_path, part_dp); + efi_free_pool(part_dp); + } else { + /* Use whole device */ + dp = efi_dp_dup(plat->device_path); + } + if (!dp) + return log_msg_ret("ede", -ENOMEM); + + log_debug("created final device path: %pD\n", dp); + *descp = desc; + *partp = part; + *dpp = dp; + + return 0; +} + /** * efi_dp_from_name() - convert U-Boot device and file path to device path * @@ -1050,11 +1153,22 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, efi_net_dp_from_dev(&dp, eth_get_dev(), false); } else if (!strcmp(dev, "Uart")) { dp = efi_dp_from_uart(); + } else if (IS_ENABLED(CONFIG_EFI_APP) && !strcmp(dev, "efi")) { + int ret; + + ret = efi_dp_from_efi_app(devnr, &desc, &part, &dp); + if (ret) + return EFI_INVALID_PARAMETER; } else { + log_debug("calling blk_get_device_part_str dev='%s', devnr='%s'\n", + dev, devnr); part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition, 1); - if (part < 0 || !desc) + if (part < 0 || !desc) { + log_err("Failed to find fs: dev='%s', devnr='%s', part=%d, desc=%p\n", + dev, devnr, part, desc); return EFI_INVALID_PARAMETER; + } dp = efi_dp_from_part(desc, part); } From patchwork Wed Aug 20 14:46: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: 90 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=1755701226; bh=82plFbYH/e3GXlLsU0Z0nV/BLBa9Vihl3fV05HQGyfA=; 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=gnTM5qoSAQpSdl5lumthOyRdTaQVf/KQLphVaot29bYFDzLR8FLhRY8XDsO2orFmJ xQM88Tb8ygUyOv3Qfw7JN2PA6jpmCUuIPUbW0SJCTli1CVCdFLGS4QjphOgBR7bjbo UEng6PNBbZ9csGc+75Q5durZYe8S0dGHTnF6Viv663FJldho3GpQvPI7lXB1bNQNqd nDuHk9ureiAg5EXsr+zUNwyZHaiGWRftnhkz/IalzRI2aDG3y0qhyjOHpGhG/DqIcR UKrSm+1Qy78qruD4dd0xAI8jZNT/Buyx0IUIKOeMIE1jKxS/f1/W4sw2Siz3Kbhfm9 OrAxa2/82Qq1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1C23C6768B for ; Wed, 20 Aug 2025 08:47:06 -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 w_P3qGvftgoJ for ; Wed, 20 Aug 2025 08:47:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701224; bh=82plFbYH/e3GXlLsU0Z0nV/BLBa9Vihl3fV05HQGyfA=; 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=rLSDinpMfcVeZMDuCCU84WjTmR1jhOVLmtXWWyGKRxcyfPQNRby1F0NlV7oLA6wQ4 udxvhhm/m2hX74eRILkD+MVu+YaVyyw5q4uX+IS9/2USAcsOin6Kp+HioPpS0Bvmhi 5BSjo4tUshxKIrdfmHkQ8RSqSAYLjq45WHbd1o4dAEV5TqRcj+tvaGyj/Qe0LfSEZa 8mJW934ocBHyrUTapbnjNJVz6vv3F3VgmCInu5B1WdFp8UHT8QuOz0+xeMD0Kxh2cx /Dhf9FBYvL3dH2NkhCSUY8ztTJ0QA2jPFtw8G66ZwedaCy1Wl2u5PXb0os1GgOfNbd WA47TskCFmfvw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AA907676A0 for ; Wed, 20 Aug 2025 08:47:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=xC2ysOX6ikCzRmFVHcPCr6g+hpy4WD4IMh+1Cfixoeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JZ8Vt0+B2MnVvIpIppOZiMmUCXM0+LVA8GMxbCxFv+YDNVpUB06k3aazWQx9N5Qgt ZGgeCwoJxnKz2x9jzoHsGHJtWYMKSdFSe/1SqioECMlO4dGRoZ8pNBd4IuJ68b2AIp +7UsoUadRc4ot9CISpnwU7Ld9SKtkxa6vt4dWLif82aYuWbIjzlFr1zvqkdpQHDLLq Bwi2gqFIAWikR1gBiYKG3Krrf7qEvlPplTVvDRoRuVGhX3dfIbYXXW94HwTwoi9/Yc qwNwZmpIpZcJEJCc81PyN39Ds34LHD+Wk3JQlj6Ls+5kiEkrAY0pWYkJfbLEqpx+0D +v4Vnvhje+F5g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 71AD567695; Wed, 20 Aug 2025 08:46:58 -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 7NeyGw5C7ct6; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701213; bh=sSTpkrOZXOP/zz3L/FGs+vEKwilgICflbGo+4GEi6es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TznnkZgMDGaiJos/x7svpvK7LcIxeB7MGeWav1gCpMHVCCfWdiTIsPlPwVg4yVR75 Rb9hoGrpKRpblFVEdK4PVHEsUwo6eUphpEnQoOHwFRBgBCol46bisxsFnRpkhat2hC ar7etjMIk889ZKgbsC2brL+nlL01Y16BdOWsIBJeB16pEmA9u4zy3+op8CEC5zM5Nv mokkShhkhypbutfjQomp1JKsIhVQpctYnwibW+cz0fEZOfyIMcnaALItxM13dIKn2P 37gGj7EMErWtSaxQ3V0LHJH1u6WIayDR9oT8t0dIfQhj35bnJoc/zWgr1QN++VXEGW IEj9JRahm91dQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3B8DC67419; Wed, 20 Aug 2025 08:46:53 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:14 -0600 Message-ID: <20250820144621.1073679-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VGMAVWAGM3IQQNUNNIMWYKPEHKLYGOTP X-Message-ID-Hash: VGMAVWAGM3IQQNUNNIMWYKPEHKLYGOTP 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/14] efi: Add a little debugging to calculate_paths() 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 some debugging for when things go wrong. Co-developed-by: Claude Signed-off-by: Simon Glass --- lib/efi/run.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/efi/run.c b/lib/efi/run.c index ac2b73be0f6..4f47743476d 100644 --- a/lib/efi/run.c +++ b/lib/efi/run.c @@ -41,7 +41,7 @@ efi_status_t calculate_paths(const char *dev, const char *devnr, return ret; } #endif - + log_debug("dev '%s' devnr '%s' path '%s'\n", dev, devnr, path); ret = efi_dp_from_name(dev, devnr, path, &device, &image); if (ret != EFI_SUCCESS) return ret; @@ -74,6 +74,9 @@ static const char *calc_dev_name(struct bootflow *bflow) const struct udevice *media_dev; media_dev = dev_get_parent(bflow->dev); + log_debug("bflow->dev='%s', media_dev='%s', uclass_id=%d\n", + bflow->dev->name, media_dev->name, + device_get_uclass_id(media_dev)); if (!bflow->blk) { if (device_get_uclass_id(media_dev) == UCLASS_ETH) @@ -88,6 +91,9 @@ static const char *calc_dev_name(struct bootflow *bflow) if (device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE) return "usb"; + if (device_get_uclass_id(media_dev) == UCLASS_EFI_MEDIA) + return "efi"; + return blk_get_uclass_name(device_get_uclass_id(media_dev)); } From patchwork Wed Aug 20 14:46: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: 91 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=1755701226; bh=ukdB7tB0yWc7cNA90obD3XkWvlk+Dp6WRR5p0JgAlyA=; 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=DEibTqhUFGDZNExqffuusyKL4wVHXyo2NOYOnWlBOy7ID+ZNubRKVuSpOwoAoPTMu WhzPGKfTYulMgRlFwvn9vnXsGY7rsEEfk4YHjP58/bNAY6ed/5fvcOBszNeb09siDO TTl0P2OHdsHOR9AhrCNmGnIpjHYxetHLfUzjtzsnq5Wvk66WqCxI5iGZwF1t92xzDe eWW2MBROFWmqqhtByi/ZBLb3BI4+arD5+1jJX1RX7wHZ09mjj+Xsou3nerRKgTPIgk eOaM/3/3QCoxeMWvijrInDRt1mg4Ham70HL9EiVE6dLPh6f3PAjJt7EqZAtyZc9HSO ENQkyFYSnQgyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 51C86676A6 for ; Wed, 20 Aug 2025 08:47:06 -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 pPAYD3fXReg3 for ; Wed, 20 Aug 2025 08:47:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701225; bh=ukdB7tB0yWc7cNA90obD3XkWvlk+Dp6WRR5p0JgAlyA=; 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=l//XsWIZ135qHmTdh1OuNour70M/UgQIKlPnKQlNT1Z3vtKVoqvX8Z1XoHfFomDLa ufovNV+rqb6VoBV9v/vrS8/RWAK80iAQ83441/9F+KIwh9x5LrDQcfvlPW29rqEiP+ oRv6WhlSNsP17a/D0ziUYYZttS0d+Bj1hqqbRedCeuMf+aaFWC1ZoCcTN73gKMX6k7 WRT/Oz6GRHR6Gb0YY26HUd5jLr4gyYpicldCvbb+y/Kmd2M1n7K08Z2dcJpazyzrHv /gcRzJziE8DwLrfmoRRZwWrgc/ke3vqnXX4m0HW/YJUC9ePinTojnfGFBxf2CTAVV7 wmhcXXYeiwJ6Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 175E1676AC for ; Wed, 20 Aug 2025 08:47:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=jch5KLWp8J4zb7yinbcJYRCDu744g9FS7os7uTppCAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ox16oT+i8ykLToSo+QHVzlPXJej6xnjG8yhIPcmJaAaa1nyd3v+TWB988o/vSH7kg rPa1kqMYpxAen1bhkGFdb4OKiK0Q1U8tg5prjYgxggHlBismMCogYCNQ72JeyR6lTX TQ7PF9Mex0Gfqd3mK+J/BDyqvhT9vU+XkGuXKyhZMF7S7RU3vMK/Vw04UCuUDKujyV ugI0va0nCOPA1O6hGFebrPTxq3Sq2JT6Rgth4bgbZF9L7MHPhxTMXu5Em7MJt3XDB8 0mb2/eOHOltfobdAa5kl+PQ9ZTDJtpyQ5mYj/cElmwV+Gux0KabBBQkORlEPdusJV8 /ItZqhh8OH/cg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 870C967694; Wed, 20 Aug 2025 08:46:58 -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 URkhQ4eGasoK; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701214; bh=8Wr0C1pvoWvPG9QAB2n2UftEGAkv+kW2vLSiPKRQlDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z48yyxvBfpSBfNEsK9dgFQ63jacG9rfGMoDhOOB0g7uZGf6EUnYQ9LSqjeTKKzO6m 0eKk3yFazEUwoCKP/L4EyWAg81oouJVxOfxt6JknGtsQOnBQnPFU2plqXFwYxHJApo wvlfEfMCAElPGUyhERfeTBLkfsmEQJKFydP27e6LtoJNEpKye9x+SuvS7SnF1yfTzc sYKD6YUkqrldTFBSXigdzHs8CJA3ctZbhhSk5/bIjG7WAIX7uElxN0c30ULxI8d0Mn SmdR0/OJjnML3WiQ8aghQrErSa+NplTd4sjbH2PcYt0g7lf0zChliWceccn9MhPTWB l8rmSxRS4gY/g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 557ED6769B; Wed, 20 Aug 2025 08:46:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:15 -0600 Message-ID: <20250820144621.1073679-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 42CK67R2EDDO7GQ44ZGIX7ZZNJ6AFAB2 X-Message-ID-Hash: 42CK67R2EDDO7GQ44ZGIX7ZZNJ6AFAB2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/14] efi: app: Allow booting an EFI 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 Enable booting an app from the U-Boot app, since many distros package their bootloader as an EFI app. Signed-off-by: Simon Glass --- lib/efi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi/Kconfig b/lib/efi/Kconfig index ed12741f61a..1570741db17 100644 --- a/lib/efi/Kconfig +++ b/lib/efi/Kconfig @@ -11,7 +11,7 @@ config EFI This is used to provide libraries shared by both. -if EFI_LOADER +if EFI_LOADER || EFI_APP config EFI_BINARY_EXEC bool "Execute UEFI binary" From patchwork Wed Aug 20 14:46: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: 92 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=1755701226; bh=gSMDlb9gGNJe5NcwuaI25PAcL4vgy3pRWPyMsIS8wvI=; 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=ZOiZLH/+cV8gnJHOabRpmF+pHY39/r4fyJs6rZITDnNdvuT1MD1zLBQqUyanl+A/m YCjIg9Q+VWw4e2bNq8wyvpDcA2y87ZoUaNnB+6dj4/jKbEYHnNKW9egUjfy2Htro9o sW2GS5dUMM1gmlRhKNG42eoC+cATu5Q+QfNOv1ZfoKO2r8iiVGF4HjJ9LNoimYdaJm n3j+jpe5ph4ls9rKp0Re9OxLZkPIqP6dogskJDUC+vgxQwBEHSdtMYwrud+VeCXemw JqqsAu6+SXgSbaaNaZhj/N8nBATqvBnMFmbhNPYtaZFibG9TUiesOYarDc9D66Lua0 IeDOF6a4BiYuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8BF8F67419 for ; Wed, 20 Aug 2025 08:47:06 -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 rnVR7Rem2gzi for ; Wed, 20 Aug 2025 08:47:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701225; bh=gSMDlb9gGNJe5NcwuaI25PAcL4vgy3pRWPyMsIS8wvI=; 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=IJ1h5ISywOvK9st+e7Y96MDgkdvm/VJ99dtg+AumyyBfTwimDSzcQ0/W0hKTW81Ye R5a/7OJEbvMeqWgn/qu3foiT8v+C8aQLebIX46ScN8kA/Pc8fv/5MUJOQvwg8rRT/k 6S2CyxI7zG6VGVqRBt/YSnzKi5V4lxhjo2c6Iio0yCmguaiV1OsjQwbwexBtjieoDm UzVwKMnH08Zr8pC9qu0oK6qR3RAic5XlOs/x0WDlY/xASPY/DwJN8ebFBtVn72D9Uz reRLLwmGYTKFn2oTMKjXxxCb50GVo2jTIoDFV3t7LTJ9hhZvOmGAS6HlQy6VgpW9Ek gfAA2VvWoBkIQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6EC13676B2 for ; Wed, 20 Aug 2025 08:47:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701218; bh=6Wbn4Ter9zaM1CO9pdMIxkXdp8CT/v+9fdaY2XnmnYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cQcJlSt/he7zGyZq83IxK9DXc4dvCfhy52f8xEqTmrMmBz83dk8cUyQcN1eruZV5h paYheGEWemNPusjCRMjTVhwyJLzTuckfYA7Je4jvdiOrpBCEH5N7awayfyjKXNTVic P7pKK1F3hE9iFsI30vStkmwQ032nLyU/dBQMAPn5DJrauYyIJ0S3eyI8Xc8sw2o995 JJ1Ix5m91oyE4o7GFbjJs/LR6IGkFdKKyGbYJk4oRYvxjPiET+j93W+b5Ql/fB7Pv+ PqnWZQDw3pFmcO41HnuGFuYXL+6uWgArSbNH7Q/rsqTpqqYi1iGVukFKkVxBHWN+Rx y+Olszo/nSBSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B4F1567696; Wed, 20 Aug 2025 08:46:58 -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 9FbWSPU8stti; Wed, 20 Aug 2025 08:46:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755701215; bh=iCFH0hmo01aGvC6ikUhOQx2/yjbMvl8LMw8hmzyny7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jPk5MqlIks2kXyBvQTIXJ0EvSzBdJQaRrTA+WxJpT4bZ0gj234H2RELPBJumhjU5I 6CLyVtyExAZpCMPEZBSUgUirvbXPErj4+O1OC+RKlYsEoH0oGm8K4K7guEEVIPRO84 TY2t+2rhO/TtvI7YrUJfkqwe0/C9L98g4xjpphsWVvnvn16boEk3fCus3JMToMm93p kjR+8i7UepX2q+9UKtGfx2wr8epoPZGFxwUmYFvM00vS1BZS/6bG4JyMHwn/U9lSb8 DZQgwERwzMWV0EJZ3gIjhpDgeVJaGVd2tjwk0szwE9H6p4gc5SB1uJfeXOtQxaTFjg ZZWD480F+44yg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2FB536768B; Wed, 20 Aug 2025 08:46:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 20 Aug 2025 08:46:16 -0600 Message-ID: <20250820144621.1073679-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250820144621.1073679-1-sjg@u-boot.org> References: <20250820144621.1073679-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 56KZCAR5RXQLUL2BPWTE4LVC3YDUMU7U X-Message-ID-Hash: 56KZCAR5RXQLUL2BPWTE4LVC3YDUMU7U X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/14] test: efi: Add a test for the app booting Ubuntu via EFI 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 Now that the EFI app supports booting Ubuntu via the EFI bootmeth, add a test for this, for ARM. This uses the sjg lab. Signed-off-by: Simon Glass --- test/py/tests/test_distro.py | 57 +++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/test/py/tests/test_distro.py b/test/py/tests/test_distro.py index 17190b7205b..77caf32145e 100644 --- a/test/py/tests/test_distro.py +++ b/test/py/tests/test_distro.py @@ -78,11 +78,10 @@ def test_distro_script(ubman): @pytest.mark.boardspec('efi-arm_app64') @pytest.mark.role('efi-aarch64') -def test_distro_arm_app(ubman): - """Test that the ARM EFI app can boot into Ubuntu 25.04""" - # with ubman.log.section('build'): - # utils.run_and_log(ubman, ['scripts/build-efi', '-a', 'arm']) +def test_distro_arm_app_extlinux(ubman): + """Test that the ARM EFI app can boot into Ubuntu 25.04 via extlinux""" with ubman.log.section('boot'): + ubman.run_command('bootmeth order extlinux') ubman.run_command('boot', wait_for_prompt=False) ubman.expect(["Booting bootflow 'efi_media.bootdev.part_2' with extlinux"]) @@ -94,3 +93,53 @@ def test_distro_arm_app(ubman): ubman.expect(['Welcome to Ubuntu 25.04!']) ubman.restart_uboot() + +@pytest.mark.boardspec('efi-arm_app64') +@pytest.mark.role('efi-aarch64') +def test_distro_arm_app_efi(ubman): + """Test that the ARM EFI app can boot into Ubuntu 25.04 via EFI""" + with ubman.log.section('boot'): + ubman.run_command('bootmeth order efi') + ubman.run_command('boot', wait_for_prompt=False) + + ubman.expect(["Booting bootflow 'efi_media.bootdev.part_1' with efi"]) + + # Press Escape to force GRUB to appear, even if the silent menu was + # enabled by a previous boot + ubman.send('\x1b') + + # Wait until we see the editor appear + with ubman.log.section('grub'): + ubman.expect(['ESC to return previous']) + # ubman.expect(['The highlighted entry will be executed automatically in 29s']) + + # Press 'e' to edit the command line + ubman.log.info("Pressing 'e'") + ubman.send('e') + for _ in range(10): + ubman.ctrl('N') + expected = '\tlinux\t/boot/vmlinuz-6.14.0-27-generic ' + expected += 'root=UUID=e5665fb4-e1de-4335-86da-357ad5422319 ro ' + for _ in expected: + ubman.ctrl('F') + + to_erase = 'quiet splash' + for _ in to_erase: + ubman.ctrl('D') + ubman.ctrl('X') + ubman.expect(['Booting a command list']) + + with ubman.log.section('exit boot-services'): + ubman.expect(['EFI stub: Exiting boot services...']) + + ubman.log.info("boot") + ubman.expect(['Booting Linux on physical CPU']) + + with ubman.log.section('initrd'): + ubman.expect(['Freeing initrd memory:']) + ubman.expect(['Run /init as init process']) + + with ubman.temporary_timeout(200 * 1000): + ubman.expect(['Ubuntu 25.04 qarm ttyAMA0']) + + ubman.restart_uboot()