From nobody Mon Feb 9 21:20:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+67170+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+67170+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1604930191; cv=none; d=zohomail.com; s=zohoarc; b=ckDXmCbiliLO8gKrzRlBmlTB71sHBlK440gWJlbhpOjooYxfqc5sNGaWxzh1sJJa0IeBwQ424huSK+LzhdRD40a2kGRlM6UlmYXytc3dV9ZVshMdhiQNk+SjUVs+KvTiwhEB7pZEA1FpEDpEQ4AbvcwiJ2BJI7+VWPHiw61y9g4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604930191; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bZC24bQA9r2wKAWYMihWYEcCrEfXa87W1bR6DwTlaWA=; b=TpL0Ftlw5JNd+m0sN5hgburYHA8+deFwr9ehOnjvqxTCCqiYMXATux+aPioLd3FBJrizgdhYnaPgJdi5X0yl09ezGUF46jC0Cv2AhJTIlm/ulafShGGE8UNO/IGrkgFOIkXBpW7jW2LuR3ySmxlydXmlmW0VeOSspVtsmR+zils= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+67170+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604930191872905.9593353340106; Mon, 9 Nov 2020 05:56:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Ip1KYY1788612xZWKfKuYuyv; Mon, 09 Nov 2020 05:56:31 -0800 X-Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mx.groups.io with SMTP id smtpd.web10.1270.1604734891055931402 for ; Fri, 06 Nov 2020 23:41:31 -0800 X-Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CSq2B3Plpz72Xl; Sat, 7 Nov 2020 15:41:22 +0800 (CST) X-Received: from localhost (10.174.184.155) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sat, 7 Nov 2020 15:41:19 +0800 From: "Jiahui Cen via groups.io" To: CC: , , , , , , Jiahui Cen Subject: [edk2-devel] [PATCH v2 2/4] ArmVirtPkg: Use extracted PciHostBridgeUtilityLib Date: Sat, 7 Nov 2020 15:40:23 +0800 Message-ID: <20201107074025.2447-3-cenjiahui@huawei.com> In-Reply-To: <20201107074025.2447-1-cenjiahui@huawei.com> References: <20201107074025.2447-1-cenjiahui@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,cenjiahui@huawei.com X-Gm-Message-State: 8WphqlSbjeZeoCrSn03pbGyvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604930191; bh=/9/eqndFsuNKbWMFjrh38+Gi/RX7+R5cH3T7EzUsO9w=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Xrbq6tTYbHgARV1IS6nhXJPbGCth+5u1xXqVhVhhL53JfPZxHgWCFsMmRKyVz7xfnZL q4M/lBAvhjk0mt8td+EWcVz7Sov8V4xRSKhAAT+njXCrAA/NjKS8m3t3xib5Wf8xlrtuB TI6nBfaO3sLyaRexTXZAWYNZQVijWDDVXiY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Yubo Miao Eliminate the currently duplicated code in ArmVirtPkg and use the extracted PciHostBridgeResourceConflict from PciHostBridgeUtilityLib. Signed-off-by: Yubo Miao Signed-off-by: Jiahui Cen Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Leif Lindholm --- ArmVirtPkg/ArmVirt.dsc.inc | 1 + .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 61 +------------------ .../FdtPciHostBridgeLib.inf | 2 + 3 files changed, 4 insertions(+), 60 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 4dafd1fa0f..593a523171 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -144,6 +144,7 @@ PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPc= iSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf + PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostB= ridgeUtilityLib.inf =20 # USB Libraries UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b= /ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c index 496b192d22..3952f511b4 100644 --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c @@ -14,6 +14,7 @@ #include #include #include +#include =20 #include #include @@ -51,9 +52,6 @@ STATIC EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeD= evicePath =3D { }; =20 GLOBAL_REMOVE_IF_UNREFERENCED -CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] =3D { - L"Mem", L"I/O", L"Bus" -}; =20 // // We expect the "ranges" property of "pci-host-ecam-generic" to consist of @@ -414,60 +412,3 @@ PciHostBridgeFreeRootBridges ( ASSERT (Count =3D=3D 1); } =20 -/** - Inform the platform that the resource conflict happens. - - @param HostBridgeHandle Handle of the Host Bridge. - @param Configuration Pointer to PCI I/O and PCI memory resource - descriptors. The Configuration contains the reso= urces - for all the root bridges. The resource for each = root - bridge is terminated with END descriptor and an - additional END is appended indicating the end of= the - entire resources. The resource descriptor field - values follow the description in - EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL - .SubmitResources(). -**/ -VOID -EFIAPI -PciHostBridgeResourceConflict ( - EFI_HANDLE HostBridgeHandle, - VOID *Configuration - ) -{ - EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptor; - UINTN RootBridgeIndex; - DEBUG ((EFI_D_ERROR, "PciHostBridge: Resource conflict happens!\n")); - - RootBridgeIndex =3D 0; - Descriptor =3D (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *) Configuration; - while (Descriptor->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR) { - DEBUG ((EFI_D_ERROR, "RootBridge[%d]:\n", RootBridgeIndex++)); - for (; Descriptor->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR; Descript= or++) { - ASSERT (Descriptor->ResType < - (sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr) / - sizeof (mPciHostBridgeLibAcpiAddressSpaceTypeStr[0]) - ) - ); - DEBUG ((EFI_D_ERROR, " %s: Length/Alignment =3D 0x%lx / 0x%lx\n", - mPciHostBridgeLibAcpiAddressSpaceTypeStr[Descriptor->ResType= ], - Descriptor->AddrLen, Descriptor->AddrRangeMax - )); - if (Descriptor->ResType =3D=3D ACPI_ADDRESS_SPACE_TYPE_MEM) { - DEBUG ((EFI_D_ERROR, " Granularity/SpecificFlag =3D %ld / %02x= %s\n", - Descriptor->AddrSpaceGranularity, Descriptor->SpecificFlag, - ((Descriptor->SpecificFlag & - EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETC= HABLE - ) !=3D 0) ? L" (Prefetchable)" : L"" - )); - } - } - // - // Skip the END descriptor for root bridge - // - ASSERT (Descriptor->Desc =3D=3D ACPI_END_TAG_DESCRIPTOR); - Descriptor =3D (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *)( - (EFI_ACPI_END_TAG_DESCRIPTOR *)Descriptor + 1 - ); - } -} diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf= b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf index 277ccfd245..97e9368c8e 100644 --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf @@ -31,6 +31,7 @@ ArmVirtPkg/ArmVirtPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] DebugLib @@ -38,6 +39,7 @@ DxeServicesTableLib MemoryAllocationLib PciPcdProducerLib + PciHostBridgeUtilityLib =20 [FixedPcd] gArmTokenSpaceGuid.PcdPciMmio32Translation --=20 2.19.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#67170): https://edk2.groups.io/g/devel/message/67170 Mute This Topic: https://groups.io/mt/78135569/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-