From nobody Mon Feb 9 02:28:26 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+81178+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+81178+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1632754898; cv=none; d=zohomail.com; s=zohoarc; b=kDYfgG8lRJnUUIlXxFVEg4tOfcFS428HYOS5DFg23bOV41AxLwJfCNm9HJyiwGzhvlt3SOpkVYVotAto9XzPAo6Z/DLLsKAsCy13BVZgA8r5J42QoKs+N2WXpCt6X18HVItb+oqGKAxxVDXZHuLXoIA2UU83iiPsj4C4i60Jj0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632754898; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=o3+UX9607wMPMccEWLjjVhlP925+dHJTriG47mc7fIE=; b=SDIZrJfvHEAyu5B7k1VjmYG5pOEEKE6zYAHNqMvO6dPICTcFpXc+td6j+RNXcQdptIfVBbIXYH47BKDwkbYMk3im8f5P4kG3dB3V13xk2XSrLmQhvqSmkKew/fYjdIaE44IrX0o0PbINQTgZg3XM314vhK4QlhlrPtIMYw5Ubns= 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+81178+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1632754898225865.174029713475; Mon, 27 Sep 2021 08:01:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id alP3YY1788612xM73BYxH0fK; Mon, 27 Sep 2021 08:01:37 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.282.1632754895951603641 for ; Mon, 27 Sep 2021 08:01:36 -0700 X-Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18R8DPr4023359; Mon, 27 Sep 2021 15:01:30 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0a-002e3701.pphosted.com with ESMTP id 3bba8r36je-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Sep 2021 15:01:29 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 60AD055; Mon, 27 Sep 2021 15:01:28 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 7E08D45; Mon, 27 Sep 2021 15:01:26 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Daniel Schaefer , Sunil V L Subject: [edk2-devel] [PATCH 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Date: Mon, 27 Sep 2021 22:03:50 +0800 Message-Id: <20210927140351.29577-9-abner.chang@hpe.com> In-Reply-To: <20210927140351.29577-1-abner.chang@hpe.com> References: <20210927140351.29577-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: 32wJYaas0wNRZMyjUCmy2prX-KXw0y6C X-Proofpoint-GUID: 32wJYaas0wNRZMyjUCmy2prX-KXw0y6C X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,abner.chang@hpe.com X-Gm-Message-State: TpG1JN74uozar7Ef7GmXYJiGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1632754897; bh=UDl2wi+TKosLbw3E96dydqvsuMMDQlLogjYTVmEQUN4=; h=Cc:Date:From:Reply-To:Subject:To; b=VLS8zwl8BEW4vZd78hRPv/u2GBK3Km8OrguBFfVcFjMXn1LhBqf/WBxB1aUptb5BujZ i+AmXfhgPUxjOdg+7TGdAlWsOErYCUzgYiag4cq4ZHyuiAmbK0ByBL2lU+JQS0xEgAlLV zmc5l8WMKP8J6WOavajxTLvtAj/SxRUeVF4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1632754905220100009 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is leverage by both ARM and RISC-V archs. Also use PcdPciMmio32Translation and PcdPciMmio64Translation PCDs provided by MdePkg instead of ArmPkg. Signed-off-by: Abner Chang Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Daniel Schaefer Cc: Sunil V L --- ArmPkg/ArmPkg.dec | 10 ++++------ ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- ArmVirtPkg/ArmVirtQemu.dsc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 8 +++----- .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0 7 files changed, 11 insertions(+), 15 deletions(-) rename {ArmVirtPkg/Library =3D> OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHos= tBridgeLib.inf (82%) rename {ArmVirtPkg/Library =3D> OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHos= tBridgeLib.c (100%) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 5793094fa3..66bfe167ca 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -339,8 +339,8 @@ # UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space # # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation =3D IoCpuBase - PcdPciI= oBase; - # PcdPciMmio32Translation =3D Mmio32CpuBase - (UINT64)PcdPciMmio32Base; - # PcdPciMmio64Translation =3D Mmio64CpuBase - PcdPciMmio64Base; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation =3D Mmio32CpuBase -= (UINT64)PcdPciMmio32Base; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation =3D Mmio64CpuBase -= PcdPciMmio64Base; # # because (a) the target address space (ie. the cpu-physical space) is # 64-bit, and (b) the translation values are meant as offsets for *modul= ar* @@ -359,9 +359,9 @@ # TranslatedIoAddress =3D UntranslatedIoAddress + # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslati= on; # TranslatedMmio32Address =3D (UINT64)UntranslatedMmio32Address + - # PcdPciMmio32Translation; + # gEfiMdePkgTokenSpaceGuid..PcdPciMmio32Tran= slation; # TranslatedMmio64Address =3D UntranslatedMmio64Address + - # PcdPciMmio64Translation; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Trans= lation; # # The modular arithmetic performed in UINT64 ensures that the translati= on # works correctly regardless of the relation between IoCpuBase and @@ -372,10 +372,8 @@ gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051 gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053 gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054 - gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055 gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056 gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057 - gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058 =20 # # Inclusive range of allowed PCI buses. diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc index c7515ed69b..973bf811b7 100644 --- a/ArmVirtPkg/ArmVirtCloudHv.dsc +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc @@ -52,7 +52,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridge= Lib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLi= b/ArmVirtPciHostBridgeUtilityLib.inf =20 TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index a9716fa7b9..c135cdd2a2 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -60,7 +60,7 @@ =20 PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridge= Lib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLi= b/ArmVirtPciHostBridgeUtilityLib.inf =20 TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index cde55af64c..bc8b61a13c 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -80,7 +80,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridge= Lib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostB= ridgeUtilityLib.inf =20 !if $(TPM2_ENABLE) =3D=3D TRUE diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index 4ae5ef3172..008ff2c89d 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -78,7 +78,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.= inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridge= Lib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostB= ridgeUtilityLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf =20 diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf= b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf similarity index 82% rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf index c6eccdc3e3..0562c85f14 100644 --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf +++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf @@ -21,15 +21,13 @@ # The following information is for reference only and not required by the = build # tools. # -# VALID_ARCHITECTURES =3D AARCH64 ARM +# VALID_ARCHITECTURES =3D AARCH64 ARM RISCV64 # =20 [Sources] FdtPciHostBridgeLib.c =20 [Packages] - ArmPkg/ArmPkg.dec - ArmVirtPkg/ArmVirtPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec @@ -45,8 +43,8 @@ PciPcdProducerLib =20 [FixedPcd] - gArmTokenSpaceGuid.PcdPciMmio32Translation - gArmTokenSpaceGuid.PcdPciMmio64Translation + gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation + gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation =20 [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b= /OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c similarity index 100% rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c --=20 2.17.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 (#81178): https://edk2.groups.io/g/devel/message/81178 Mute This Topic: https://groups.io/mt/85902625/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-