summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg
diff options
context:
space:
mode:
authorJeff Brasen <jbrasen@nvidia.com>2022-07-08 14:59:01 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-07-19 16:15:35 +0000
commit6cda306da1dde935e866054ef8b858de768c4cf6 (patch)
tree42b97528f9b35a28823587bbb7fb6480d50d459a /DynamicTablesPkg
parentf0064ac3afa28e1aa3b6b9c22c6cf422a4bb8771 (diff)
downloadedk2-6cda306da1dde935e866054ef8b858de768c4cf6.tar.gz
edk2-6cda306da1dde935e866054ef8b858de768c4cf6.tar.bz2
edk2-6cda306da1dde935e866054ef8b858de768c4cf6.zip
DynamicTablesPkg: AcpiSsdtPcieLibArm: Correct translation value
The translation value in ACPI should be the difference between the CPU and PCIe address. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg')
-rw-r--r--DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 626e53d702..3c20d928ce 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -540,6 +540,7 @@ GeneratePciCrs (
UINT32 RefCount;
CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;
AML_OBJECT_NODE_HANDLE CrsNode;
+ BOOLEAN IsPosDecode;
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -609,6 +610,11 @@ GeneratePciCrs (
}
Translation = (AddrMapInfo->CpuAddress != AddrMapInfo->PciAddress);
+ if (AddrMapInfo->CpuAddress >= AddrMapInfo->PciAddress) {
+ IsPosDecode = TRUE;
+ } else {
+ IsPosDecode = FALSE;
+ }
switch (AddrMapInfo->SpaceCode) {
case PCI_SS_IO:
@@ -616,12 +622,12 @@ GeneratePciCrs (
FALSE,
TRUE,
TRUE,
- TRUE,
+ IsPosDecode,
3,
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
- Translation ? AddrMapInfo->CpuAddress : 0,
+ Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,
@@ -635,7 +641,7 @@ GeneratePciCrs (
case PCI_SS_M32:
Status = AmlCodeGenRdDWordMemory (
FALSE,
- TRUE,
+ IsPosDecode,
TRUE,
TRUE,
TRUE,
@@ -643,7 +649,7 @@ GeneratePciCrs (
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
- Translation ? AddrMapInfo->CpuAddress : 0,
+ Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,
@@ -657,7 +663,7 @@ GeneratePciCrs (
case PCI_SS_M64:
Status = AmlCodeGenRdQWordMemory (
FALSE,
- TRUE,
+ IsPosDecode,
TRUE,
TRUE,
TRUE,
@@ -665,7 +671,7 @@ GeneratePciCrs (
0,
AddrMapInfo->PciAddress,
AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
- Translation ? AddrMapInfo->CpuAddress : 0,
+ Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
AddrMapInfo->AddressSize,
0,
NULL,