From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.37550.1656679233862656911 for ; Fri, 01 Jul 2022 05:40:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B369E1424; Fri, 1 Jul 2022 05:40:33 -0700 (PDT) Received: from [192.168.1.11] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7A8243F800; Fri, 1 Jul 2022 05:40:32 -0700 (PDT) Message-ID: <77d31b75-4288-e397-7b9b-3e18667e62ee@arm.com> Date: Fri, 1 Jul 2022 14:40:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: "PierreGondois" Subject: Re: [PATCH 1/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Correct translation value To: Jeff Brasen , devel@edk2.groups.io Cc: Sami.Mujawar@arm.com, Alexei.Fedorov@arm.com References: In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello Jeff, The patch is correct, but there will be an issue if AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress < 0 AmlCodeGenRdDWordIo() takes an 'IsPosDecode' argment, would it be possible to set IsPosDecode to FALSE in such case ? Regards, Pierre On 6/30/22 17:48, Jeff Brasen wrote: > The translation value in ACPI should be the difference between the CPU and PCIe address. > > Signed-off-by: Jeff Brasen > --- > .../Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > index a34018151f..f0d15f69a4 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > @@ -621,7 +621,7 @@ GeneratePciCrs ( > 0, > AddrMapInfo->PciAddress, > AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1, > - Translation ? AddrMapInfo->CpuAddress : 0, > + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0, > AddrMapInfo->AddressSize, > 0, > NULL, > @@ -643,7 +643,7 @@ GeneratePciCrs ( > 0, > AddrMapInfo->PciAddress, > AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1, > - Translation ? AddrMapInfo->CpuAddress : 0, > + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0, > AddrMapInfo->AddressSize, > 0, > NULL, > @@ -665,7 +665,7 @@ GeneratePciCrs ( > 0, > AddrMapInfo->PciAddress, > AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1, > - Translation ? AddrMapInfo->CpuAddress : 0, > + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0, > AddrMapInfo->AddressSize, > 0, > NULL,