From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.11531.1632821327768287593 for ; Tue, 28 Sep 2021 02:28:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=Y6QXBw27; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0905a85297=abner.chang@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18S91tbO011535; Tue, 28 Sep 2021 09:28:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pps0720; bh=lNcTESlUoA55hVosg2YYNZOp2P4Pu5hxkQVU2nMbtG4=; b=Y6QXBw27VZmva8yAT1FmGsaASNpDwdPQg5YICSRociAj65P4Bs+YjyC28738KybdUW/s WYQH8OGiFp/Troy0soC3KB3mFDRoaOHcyNzV4lcv1uoNnvvWYY3vYmwgcBCIZsZ7ug06 y5kOUIviF76U6nclY7BFbFXKjV3NCSEDNFPmjSUx3erEJ3mw9aUaQPuMQRrpYtGkP5Vr BOSVu9Y9T2RhZaXQBq78F9S5rLZI8lpmGHDpevRZ1E+pwzp+N8W9oPaTXyhM99IDIfAs Ui3ZAVozXP1mlYnnmLahUItflbuvAUFsp4LIAPtxcB9268ZnLK0TtQzxakC9I0q7piIR 5w== Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 3bbed2gp38-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Sep 2021 09:28:44 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 1DDD14E; Tue, 28 Sep 2021 09:28:44 +0000 (UTC) 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 37EED45; Tue, 28 Sep 2021 09:28:42 +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: [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt Date: Tue, 28 Sep 2021 16:31:06 +0800 Message-Id: <20210928083107.7418-9-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928083107.7418-1-abner.chang@hpe.com> References: <20210928083107.7418-1-abner.chang@hpe.com> X-Proofpoint-GUID: TuY0J7_U2BvkPRXv-yaSqk-u2EiXeRn1 X-Proofpoint-ORIG-GUID: TuY0J7_U2BvkPRXv-yaSqk-u2EiXeRn1 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-28_05,2021-09-28_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=624 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2109280056 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 => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (81%) rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 12584fb319..8a512b7035 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -338,8 +338,8 @@ # UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space # # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase; - # PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base; - # PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = 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 *modular* @@ -358,9 +358,9 @@ # TranslatedIoAddress = UntranslatedIoAddress + # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation; # TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address + - # PcdPciMmio32Translation; + # gEfiMdePkgTokenSpaceGuid..PcdPciMmio32Translation; # TranslatedMmio64Address = UntranslatedMmio64Address + - # PcdPciMmio64Translation; + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation; # # The modular arithmetic performed in UINT64 ensures that the translation # works correctly regardless of the relation between IoCpuBase and @@ -371,10 +371,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 # # Inclusive range of allowed PCI buses. diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc index 4470fa3b14..0f26c10aab 100644 --- a/ArmVirtPkg/ArmVirtCloudHv.dsc +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc @@ -51,7 +51,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index 97fc98d778..0c5da4427e 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -59,7 +59,7 @@ PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 6c949fd559..4624b6ec36 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -79,7 +79,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf !if $(TPM2_ENABLE) == TRUE diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index 64035a948d..426e0ff1fd 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -77,7 +77,7 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf similarity index 81% rename from ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf rename to OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf index f149693fa2..e610e3d03f 100644 --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf +++ b/OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf @@ -20,15 +20,13 @@ # The following information is for reference only and not required by the build # tools. # -# VALID_ARCHITECTURES = AARCH64 ARM +# VALID_ARCHITECTURES = AARCH64 ARM RISCV64 # [Sources] FdtPciHostBridgeLib.c [Packages] - ArmPkg/ArmPkg.dec - ArmVirtPkg/ArmVirtPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec @@ -44,8 +42,8 @@ PciPcdProducerLib [FixedPcd] - gArmTokenSpaceGuid.PcdPciMmio32Translation - gArmTokenSpaceGuid.PcdPciMmio64Translation + gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation + gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation [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 -- 2.17.1