From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CFFC606A322 for ; Thu, 3 Dec 2026 05:04:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=OYFIt3gB; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=EcsqXAh+ Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7023B6F6DF; Thu, 3 Dec 2026 05:04:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8TB0GNp6DRsp; Thu, 3 Dec 2026 05:04:02 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org A253C6F67B Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796274242; b=l1C7JXAgpW8NTN5FWPB+W4V2Khp+7IFNXYHvEAeyWnityBodOuYs+kO+xQIO5vyxPzI1 pZbPDUdRWyx/8hH4OEX5AhY1G4mwJy9q3BT7B6wDDg3he/lm1ZDvI3+yUKx8TumvmyEF0 Ch+E59R/DW6XJcs6qfnKB8RSaY6bFgCJ2LU7PSJfLmVX2Bs6tGrtinKPlPa4p8Fn4QDDs OMSl2jS7ulI2AzAPSI4EwDyeNY4oyQw9hu9/hXXlwFDlWmfZUoGrByK3KZAp5xsnasPwA nDK56+s+Mu0Iakey0YeurtjgTe86PA1Dr1Lzvzwmjq/aHd+N1GEgo4TGnv49xcuzpxA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796274242; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Received: Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To: Cc:Content-Type:X-Mailman-Approved-At:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=PhodZjqiYZcEuVryV9uwIRUweDNpzqKVAZoc9NtuJlM=; b=DkVO4QDxwVOR3yqS/bWpePqjFG2BYHEW/YjYcEpcSsZWxKzkMkPwRdz3Mf4NIS7M+LSL eAvzVXOYmcxshbhoJzQWf2gCQRlts873v65JxliPJPMOix8MfPgi7/zVwWydoDDyoh+SC rXPX+JUfii5pqFg8+nVm4PkGz0w+xh2rG5aMUQMhplTDdRn33OE1YhprCGjVnGp5FRD/0 s/TLpWbRm5ZdPPrEiQT30cZcgZNy12wLi1Kg/rxL+vmov+KQXX4cQaU7fY4c/vVNoVstZ nbvU6QZM93OUKg2qcPdwaKjDtY6p/XYjzNFHNXu1mYzK1eYOOQ70PPFB+KSGDmRlgfg== ARC-Authentication-Results: i=1; smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796274242; bh=PhodZjqiYZcEuVryV9uwIRUweDNpzqKVAZoc9NtuJlM=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OYFIt3gBojJ8tfmzmF5sNVpvMczMmohwYbSDJX57IF7zGzHKil2Ha2Ww3X5YRBiPb yaO7PARchbFnGc2LptcUqlisP/xFZNnSZpiW48cPL85Aq84XJgRINcVA/Uk0HIYd4q Do6RBLWfycJawKVXDOsBN4u/1lVPOrfn6uGKYrXgN0pSBlBLy5MBvbdl24D1NcoIET pNNvLr0wDs8Kaocg/M+XWsmRXUge11QbeWbd51OxzWgAAZpxZMFsLfWzG4WAhX9NYz 8Aj1sOd2lf9SDyfKoTi94ekmt2zAp4cX8Or9e5evdPQj8xp+cZNwNV6YxhlsYu+qmh IddXvvEJ4XyjA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id A253C6F67B; Thu, 3 Dec 2026 05:04:02 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id 353F7158 for ; Thu, 3 Dec 2026 02:22:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1BA1F50480 for ; Thu, 3 Dec 2026 02:22:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5hM9C899SAto for ; Thu, 3 Dec 2026 02:22:22 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org 5E24C50479 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::1345" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1345; helo=mail-dy1-x1345.google.com; envelope-from=3xniqawgkbqmgkrophvpjrrjoh.frpx-errwolvwv.x-errw-surmhfw.ruj@flex--dholmesm.bounces.google.com; receiver= Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=EcsqXAh+ Received: from mail-dy1-x1345.google.com (mail-dy1-x1345.google.com [IPv6:2607:f8b0:4864:20::1345]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5E24C50479 for ; Thu, 3 Dec 2026 02:22:22 +0000 (UTC) Received: by mail-dy1-x1345.google.com with SMTP id 5a478bee46e88-33713e5e6daso20262213eec.0 for ; Wed, 02 Dec 2026 18:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796264541; x=1796869341; darn=lists.u-boot-project.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PhodZjqiYZcEuVryV9uwIRUweDNpzqKVAZoc9NtuJlM=; b=EcsqXAh+ZB8W+r99iTj93dLjkFDCg2FuKQwGtbmkykG9mtMRMt04ziZL1c6pdQ641l DIAlJfO88tKrNctCHKOj99knt6HwAEMg3703mOwrc2SYVRhLBaB16eeTV2lgMBoCViqs a6QXbASildh3uT80ziPkHIy4KHDxVQcAjWEnOkGa0qFm3v27J/gGIfgKlwyO5gXGoXY8 kCwEp3hKUGvAAub6aMbVibsmigOXWIytVfrYBttOKOrV4lvPwoxJiHg8+pp5Z5DlNik7 6zgu5VkPMoEZSb4FMm+/AlhYqfjZAeBcoVTMFOTw+yZ213jdFkABBt3KckyERoSZVQ/7 P5PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796264541; x=1796869341; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PhodZjqiYZcEuVryV9uwIRUweDNpzqKVAZoc9NtuJlM=; b=TXi1AbRPthhYu7ZGtz8zWcV9gxxAvAOjoISfJSHYS6WpMVvIsB6Bf3HrpY8+wxJx/3 +6Xx9vIkbT52MgvJFkCNVQmu8MytmocNqxmUxJUHVfNOkrsQX70+WMk553/sHb2kNFyB MPsMBAi1SV4YuIy7YIFBmtgZUfkeT9Vw+7Viow2ifSCKrHBInQRzyIPJZZ4tUq63Sx3v Wq7hscM4YEVZLOCZTC3RKnBvNIFvIlEOZOcCqHGdiZ77EO24SJq4IYsPTEX9I4QzQFeF JpDswIa3IWVXU0P7H//WeqXTmBsfKsq1eO2xl78GuETt7zc6CzunHKY1kGkElBIaIJb2 yqbQ== X-Gm-Message-State: APuU4Z/mN7is+0K5PY8O1YCB7AFQuUSftmndo/mWYnzwzmivetAmlOaU O0+q8ZaPeAtyWP3IW+YSugkt9l+DkeQQBTKkXfyPz/PQ8gNCEYIVz5AcviKiB5/4IIUklvRv68i +oLn1VcaV4j8F04ok0np9xvV8C7HtBieVAHms62f57WGctplwo6PU/mQlpYbOXjWfDQPoOMqKZw 0+6KoMeEskWLIYb4xBdne42BI7XiNELPAsqu8QKnwOGnSgJIMTTxevbaQsGys= X-Received: from dycqu1.prod.google.com ([2002:a05:7300:df01:b0:387:4168:a9bb]) (user=dholmesm job=prod-delivery.src-stubby-dispatcher) by 2002:a05:693c:414b:10b0:386:9e32:a65b with SMTP id 5a478bee46e88-3869e32aac6mr40744359eec.1.1796264540807; Wed, 02 Dec 2026 18:22:20 -0800 (PST) Date: Thu, 03 Dec 2026 02:21:19 GMT In-Reply-To: <20261203022028.05-00-dholmesm@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261203022028.05-00-dholmesm@google.com> Message-ID: <20261203022028.05-01-dholmesm@google.com> Subject: [PATCH 1/2] efi_loader: Add PCI hardware device path node and text conversion From: Dan Holmes-Mitra To: u-boot@lists.u-boot-project.org Cc: Heinrich Schuchardt , Ilias Apalodimas , Tom Rini , "=?utf-8?q?Vincent_Stehl=C3=A9?=" Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 03 Dec 2026 05:03:38 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-23.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Define DEVICE_PATH_SUB_TYPE_PCI and struct efi_device_path_pci per UEFI Specification Section 10.3.1.1, format PCI hardware nodes as Pci(0x,0x) in EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, and add unit test coverage in efi_selftest_devicepath. Signed-off-by: Dan Holmes-Mitra --- include/efi_api.h | 7 +++++ lib/efi_loader/efi_device_path_to_text.c | 6 ++++ lib/efi_selftest/efi_selftest_devicepath.c | 33 ++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/include/efi_api.h b/include/efi_api.h index 646581150b..6b199ab8dc 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -646,10 +646,17 @@ struct efi_mac_addr { } __packed; #define DEVICE_PATH_TYPE_HARDWARE_DEVICE 0x01 +# define DEVICE_PATH_SUB_TYPE_PCI 0x01 # define DEVICE_PATH_SUB_TYPE_MEMORY 0x03 # define DEVICE_PATH_SUB_TYPE_VENDOR 0x04 # define DEVICE_PATH_SUB_TYPE_CONTROLLER 0x05 +struct efi_device_path_pci { + struct efi_device_path dp; + u8 function; + u8 device; +} __packed; + struct efi_device_path_memory { struct efi_device_path dp; u32 memory_type; diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index 452ec1b2e8..01e0b4a6e2 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -53,6 +53,12 @@ static char *dp_unknown(char *s, struct efi_device_path *dp) static char *dp_hardware(char *s, struct efi_device_path *dp) { switch (dp->sub_type) { + case DEVICE_PATH_SUB_TYPE_PCI: { + struct efi_device_path_pci *pdp = + (struct efi_device_path_pci *)dp; + s += sprintf(s, "Pci(0x%x,0x%x)", pdp->device, pdp->function); + break; + } case DEVICE_PATH_SUB_TYPE_MEMORY: { struct efi_device_path_memory *mdp = (struct efi_device_path_memory *)dp; diff --git a/lib/efi_selftest/efi_selftest_devicepath.c b/lib/efi_selftest/efi_selftest_devicepath.c index 8a22a5d4d9..09f2de2bb3 100644 --- a/lib/efi_selftest/efi_selftest_devicepath.c +++ b/lib/efi_selftest/efi_selftest_devicepath.c @@ -405,6 +405,39 @@ static int execute(void) return EFI_ST_FAILURE; } + /* Test PCI hardware device node conversion */ + { + struct efi_device_path_pci pci_node = { + .dp = { + .type = DEVICE_PATH_TYPE_HARDWARE_DEVICE, + .sub_type = DEVICE_PATH_SUB_TYPE_PCI, + .length = sizeof(struct efi_device_path_pci), + }, + .function = 2, + .device = 0x1a, + }; + + struct efi_device_path *dp = + (struct efi_device_path *)&pci_node; + + string = device_path_to_text->convert_device_node_to_text(dp, + true, false); + if (!string) { + efi_st_error("ConvertDeviceNodeToText (PCI) failed\n"); + return EFI_ST_FAILURE; + } + if (efi_st_strcmp_16_8(string, "Pci(0x1a,0x2)")) { + efi_st_printf("pci_node: %ps\n", string); + efi_st_error("Incorrect PCI device node text\n"); + return EFI_ST_FAILURE; + } + ret = boottime->free_pool(string); + if (ret != EFI_SUCCESS) { + efi_st_error("FreePool failed\n"); + return EFI_ST_FAILURE; + } + } + /* Test ConvertDeviceNodeToText */ string = device_path_to_text->convert_device_node_to_text( (struct efi_device_path *)&dp_node, true, false); -- 2.56.1.911.g883d8bcb20-goog