From patchwork Thu Aug 28 02:07: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: 151 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=1756346882; bh=Ch2ze1OMr/sLQuWLv+NULcAs2cuRguOVO5OfpxxfRPo=; 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=RV+pvNLnkJPRLSLYXPMkaZpzL0JD2PSfRLgH66MLIhGAzqK7vTsVrGP49BOoUuVE2 fO/deTinurekzNkpVb+UVDNf2KhbDHt+i3KdamzsMI+aBCIbjaAP4IZjwz6gl8Hpew Rp03prEbrY+/5HkQ3Kpjup0XFO6QU6FU6wy/TntK5Tv0d+C/RGjIS1xokwLBxbKz/c G4DZEEe7hMza3tjyDC3ffmixHyIGyYt6hMDKC+xcsnNr289qsCNEB9JPW9SzVzWCur 0j48bn0SfiUOgmhftF62K2+5qXregjVzYTKcKIektCu/r9w5IuIzgIdPuWeL1iT8wf tXzydgZXnhxPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D2BD167828 for ; Wed, 27 Aug 2025 20:08: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 Tb5TY6cb1edQ for ; Wed, 27 Aug 2025 20:08:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346882; bh=Ch2ze1OMr/sLQuWLv+NULcAs2cuRguOVO5OfpxxfRPo=; 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=RV+pvNLnkJPRLSLYXPMkaZpzL0JD2PSfRLgH66MLIhGAzqK7vTsVrGP49BOoUuVE2 fO/deTinurekzNkpVb+UVDNf2KhbDHt+i3KdamzsMI+aBCIbjaAP4IZjwz6gl8Hpew Rp03prEbrY+/5HkQ3Kpjup0XFO6QU6FU6wy/TntK5Tv0d+C/RGjIS1xokwLBxbKz/c G4DZEEe7hMza3tjyDC3ffmixHyIGyYt6hMDKC+xcsnNr289qsCNEB9JPW9SzVzWCur 0j48bn0SfiUOgmhftF62K2+5qXregjVzYTKcKIektCu/r9w5IuIzgIdPuWeL1iT8wf tXzydgZXnhxPA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ACD896777E for ; Wed, 27 Aug 2025 20:08:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346879; bh=88Pp5usihZnlBJ44HFpLBQQ2LaKxhRq8OkYWlaEPWUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hO1zf7RIMZcZbG7EEksFPIVILAbvzTXNmmehpiuvzYt5h5d/gCm8l+HezW4ITbVN3 TfEG90GmNKncnjFxhSff5QNn3S3cQwwa+E9rOxVDj3z3b8onOst18MhGXgCnsWqLyq 4aCXrSWyIJ7g0g4Zo6migV3dgp2HGGmCpCx3EsNCb4SLk0pigDIZy4KEmKYRHHE18i /3hdeLF3ceQt5ebbQ8KobiFrn030F4XBVqinPZhLTAaerTIT2G9Wgpjo1OWmiNJajZ ltByJDI2GV6GolU3usiOXMZf149KGLadu2O0cEqXmEjbVlHnUqmkno2idQSuGY3A2w TZdS109QprkEQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CEC6A67810; Wed, 27 Aug 2025 20:07: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 10026) with ESMTP id eA-q10Wqaiyn; Wed, 27 Aug 2025 20:07:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756346876; bh=cldvo3RpPsOKljR74dbMxMv28Tgb20t14zwTc7uX5X0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dAtFH6dS7mDUbHABqtfEYTx9UVJ7xfaId8F9J8lWFOmuNK5FwfihrR65AvWmo5Uz5 1aYQ8C/BHYtKBH4bquuYRkTxS2YHxv/ATVcjy0PbK4BEb64dDgQamAcvp6VPWi6DDD yTh7GFV/1KGuT7lC0bD+FKki6M77dBDWeDV+0Jcleie+7uWyrVUOltsoQ95aHKLhyS DiiBsuFz+DpQTqFK14JTxduM8nAFKPhUV+uU5DoZo18tWrAhqMqYDokJbYE040P8ZX GCuC/NxQPTk9oMoldZNPn4XWnDjyzyCU3GTd0ejcwaaXGyEjL8/54PF+1ekl+6gjYi B+fJGwNm6F6Sg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A9B256777E; Wed, 27 Aug 2025 20:07:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 27 Aug 2025 20:07:10 -0600 Message-ID: <20250828020732.981415-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250828020732.981415-1-sjg@u-boot.org> References: <20250828020732.981415-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4VVESB3TWT7KADQJWHUPZN5DTTAZWIZX X-Message-ID-Hash: 4VVESB3TWT7KADQJWHUPZN5DTTAZWIZX 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 07/20] efi: Add a uclass column to efidebug media 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 Add a new column to the 'efidebug media' command that shows the likely uclass for each EFI media device based on its device path. This uses the new efi_dp_guess_uclass() function which looks through an EFI device-path to determine the corresponding uclass. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/efidebug.c | 10 +++++++--- doc/usage/cmd/efidebug.rst | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 1d943113054..9c0b6b084cb 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -1606,6 +1606,7 @@ 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 * @@ -1631,13 +1632,16 @@ static int do_efi_show_media(struct cmd_tbl *cmdtp, int flag, return CMD_RET_FAILURE; } - printf("Device Device Path\n"); - printf("------------------- -----------\n"); + printf("Device Media type Device Path\n"); + printf("------------------- --------------- -----------\n"); uclass_foreach_dev(dev, uc) { struct efi_media_plat *plat = dev_get_plat(dev); + enum uclass_id id; + const char *name = efi_dp_guess_uclass(plat->device_path, &id); - printf("%-20s %pD\n", dev->name, plat->device_path); + printf("%-20s %-15s %pD\n", dev->name, name, + plat->device_path); } return CMD_RET_SUCCESS; diff --git a/doc/usage/cmd/efidebug.rst b/doc/usage/cmd/efidebug.rst index 90e0b9c4546..903293ad3d8 100644 --- a/doc/usage/cmd/efidebug.rst +++ b/doc/usage/cmd/efidebug.rst @@ -34,11 +34,14 @@ itself has called. efidebug media ~~~~~~~~~~~~~~ -This shows a list of all EFI media devices and their corresponding device paths. -Each EFI media device represents a block device that was discovered through EFI -boot services, such as hard drives, USB storage, or other bootable media. The -device path shows the EFI device path for each device, which can be useful for -debugging boot issues or understanding the system topology. +This shows a list of all EFI media devices, their likely U-Boot uclass, and +their corresponding device paths. Each EFI media device represents a block +device that was discovered through EFI boot services, such as hard drives, USB +storage, or other bootable media. The U-Boot Class column shows which U-Boot +driver subsystem would likely handle the device (e.g., "ahci" for SATA drives, +"usb" for USB storage). The device path shows the EFI device path for each +device, which can be useful for debugging boot issues or understanding the +system topology. Example @@ -47,10 +50,10 @@ Example This shows checking the EFI media devices:: => efidebug media - Device Device Path - ------ ----------- - efi_media_1 PciRoot(0x0)/Pci(0x3,0x0)/Sata(0x0,0xFFFF,0x0) - efi_media_2 PciRoot(0x0)/Pci(0x5,0x0) + Device U-Boot Class 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