From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web11.40538.1656693151472058301 for ; Fri, 01 Jul 2022 09:32:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=VvF0eCM7; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.236.40, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bo+l/LR5WOhdZch2RseFdAi0wlIQTIjtMaogoikNqpf8wpkZeaHeJUGDOm95wIg66Xf1X5mEv0MtSPWCKbVMCwd/ah8Hobo/OOyXn7Ojk3nRbnyx28g6jD7Oy46DlOnRfVbx8tZiiOgTuw0XjNcIbzVI/j0hhOZ261ar4s2/IyVBR7X7RoYMjIeVVnYXIPLsrzAPaOXFfx0EBbwNfosCDalsE50kgTTelfG3uivl+OHyvPYnECsX1UtDRrygSn6wA/FnSY4UB94KVA7fWes8SnKHVJixaPdfvJWBnTOfhXnD7epE8gRnjJT8eFsqKvJMSCHcXaQc3G9Idj+wfuE4DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MjjxvJTNL0sXW+Bjdw2xGbkdZJgSg5iSJZiVnk5iJis=; b=n1N46xUZJ+URSMeL5sfcqOZDcBAONy+mcSSKdEm3tnhqT/CiJcIHxZw/ncVBZnz7gxQi0Kb0brIXQHK5T8wfWWAmQU6MzhL2TKcb4oewlGIqN4z84uj1z0mLSPZH6Si0iTZ52UIGm8dBYzPNb8vT9AAyEWxQ87jCURE0aHApBvqCodyXlyZRae+Yzwu/0dJec48iM3KeCQUEJQINyqKlam3cy5slxgptQGPz8hmamoG/S4ZsNZhy64rfneqns49dsxEA0BCv1+FaBEI8KJ8QaCKrlhQ71u4GCxabu/hrf6VMze+5bR8xKa7QwoDffFH/F/BX6kZc/7Qf/k/GTbQe3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=arm.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MjjxvJTNL0sXW+Bjdw2xGbkdZJgSg5iSJZiVnk5iJis=; b=VvF0eCM70FOmoSO+e3pw5ww7UmdmK8X0L84L6DDGhwYdxExdCZ6LmJr3USxvTIVjJojeSM9fJCmASii4dKDBAQ65s1Bxufci0O9hm+9X0KyKvdDeAh7uHS2Th+abYwrUrG8gnokVj4JLMu9DPRC2hRdnIjV3z1eWMW7TG/zvqEOQMUxmUzvsR/rdOAYzT+pKs0/7fr+NHskAQirKymUL69RuGVdPK9acugyVQDl/eUjhtsN1sqiZN/NCMl87cmgIM6RGbdQp+/e5WJCDh9/uWc0ZnPaKzBkugLLuIKLMduJPKz11DOfs1+pN8vj2yjUuKjYQSTBM87K8sSYPnJBm7Q== Received: from DM6PR03CA0097.namprd03.prod.outlook.com (2603:10b6:5:333::30) by BN6PR12MB1186.namprd12.prod.outlook.com (2603:10b6:404:1c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Fri, 1 Jul 2022 16:32:29 +0000 Received: from DM6NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::ab) by DM6PR03CA0097.outlook.office365.com (2603:10b6:5:333::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17 via Frontend Transport; Fri, 1 Jul 2022 16:32:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by DM6NAM11FT051.mail.protection.outlook.com (10.13.172.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Fri, 1 Jul 2022 16:32:28 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 1 Jul 2022 16:32:27 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Fri, 1 Jul 2022 09:32:27 -0700 Received: from perses.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Fri, 1 Jul 2022 09:32:27 -0700 From: "Jeff Brasen" To: CC: , , , Jeff Brasen Subject: [PATCH v2 1/4] DynamicTablesPkg: AcpiSsdtPcieLibArm: Correct translation value Date: Fri, 1 Jul 2022 10:32:34 -0600 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public Return-Path: jbrasen@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 483958c4-930e-4f6d-e93a-08da5b7f49f8 X-MS-TrafficTypeDiagnostic: BN6PR12MB1186:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3OSxy5YDSvB3paacZ+DXZDc2HgPC2agpaFXAb6AbX3C6zBEZ/FuTCTSTotIdOSO59YOpARRKDzoSy32NQJ5xSUvDe4FoHtfZFd14vmj9P8F5DkDWtUb0Ci21wVZhz/FM9IS9FtRQh8hAkvySEwS8fKDBZR3fQvAVJq5J3rZbHWm4z/SPODVVMTSKhwnofXECo0cShFCP4R2HU95VFhSBio3Ufo1B6ScH+iDZsM2kDz1J/B5FnH+xDHeNw00wbLCM16E0iADQFVUPqySsoMkBTnBHgTOFGJa823C5gOa9gNUJKkFaLZy7r3h64oH+t+SYq/Xa1f/g1zw6NGuLyIMIWE3+ILHpAjBY9vTMSgUfx7fU7vNnssAAYJb8T+Tm95hWI2MM4ZrzfvdFJdkgjwWJnwl8SKZb3Ospb1XPqvaQCwC4A63WTsevcL0P6jGsLFt4vjnDe+tZCN0ATPz4tFdVMqMcSnTi85XR4qNp2gwGAoPJfJeH2YMkBRKSlcGtYuhQmogPBDP9T9UFTHFOgIpcqHKu5IDDRE7aNl/cp66nogDFjxzmsRKjkJ1zhViKWWi1O2Bd4jmJWv/r03elAq6wSHxfqoHPjcoJwp+8mdwHXRPKVRQ6LweE94VKzEG1cQd8LLqzHJRfQdM0xHpPrvHHodl9mig23bZydOJLtLSBanuLWsD3ES227AzVI4iMaiYv+pTenL7j5B0VJHxrtHbA4RhhbkdjKizQJIMtZbLQCHanwTLI2Rdv+dwVLUE90cE774Tz0A6yQ7ooREbnM94vwTQsghKM9w79LAzJNR8KludErYSocZIF0i0Tt3eiu333X+4hZEV5sAkjKzD3u/4mOytv41oKdXTpyMss3uMDPkeBq+fv2StiZPnMvLBwaJdq X-Forefront-Antispam-Report: CIP:12.22.5.238;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230016)(4636009)(396003)(376002)(346002)(39860400002)(136003)(46966006)(36840700001)(40470700004)(7696005)(2906002)(6666004)(26005)(54906003)(36756003)(70206006)(6916009)(47076005)(70586007)(316002)(82310400005)(4326008)(40480700001)(36860700001)(8936002)(86362001)(8676002)(81166007)(186003)(5660300002)(426003)(478600001)(2616005)(107886003)(356005)(40460700003)(83380400001)(41300700001)(82740400003)(336012)(213903007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2022 16:32:28.5276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 483958c4-930e-4f6d-e93a-08da5b7f49f8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.238];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1186 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain The translation value in ACPI should be the difference between the CPU and = PCIe address.=0D =0D Signed-off-by: Jeff Brasen =0D ---=0D .../Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 18 ++++++++++++------=0D 1 file changed, 12 insertions(+), 6 deletions(-)=0D =0D diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG= enerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieG= enerator.c=0D index a34018151f..d4c5f47b07 100644=0D --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato= r.c=0D +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato= r.c=0D @@ -540,6 +540,7 @@ GeneratePciCrs (=0D UINT32 RefCount;=0D CM_ARM_PCI_ADDRESS_MAP_INFO *AddrMapInfo;=0D AML_OBJECT_NODE_HANDLE CrsNode;=0D + BOOLEAN IsPosDecode;=0D =0D ASSERT (Generator !=3D NULL);=0D ASSERT (CfgMgrProtocol !=3D NULL);=0D @@ -609,6 +610,11 @@ GeneratePciCrs (=0D }=0D =0D Translation =3D (AddrMapInfo->CpuAddress !=3D AddrMapInfo->PciAddress)= ;=0D + if (AddrMapInfo->CpuAddress >=3D AddrMapInfo->PciAddress) {=0D + IsPosDecode =3D TRUE;=0D + } else {=0D + IsPosDecode =3D FALSE;=0D + }=0D =0D switch (AddrMapInfo->SpaceCode) {=0D case PCI_SS_IO:=0D @@ -616,12 +622,12 @@ GeneratePciCrs (=0D FALSE,=0D TRUE,=0D TRUE,=0D - TRUE,=0D + IsPosDecode,=0D 3,=0D 0,=0D AddrMapInfo->PciAddress,=0D AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,= =0D - Translation ? AddrMapInfo->CpuAddress : 0,=0D + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->Pc= iAddress : 0,=0D AddrMapInfo->AddressSize,=0D 0,=0D NULL,=0D @@ -635,7 +641,7 @@ GeneratePciCrs (=0D case PCI_SS_M32:=0D Status =3D AmlCodeGenRdDWordMemory (=0D FALSE,=0D - TRUE,=0D + IsPosDecode,=0D TRUE,=0D TRUE,=0D TRUE,=0D @@ -643,7 +649,7 @@ GeneratePciCrs (=0D 0,=0D AddrMapInfo->PciAddress,=0D AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,= =0D - Translation ? AddrMapInfo->CpuAddress : 0,=0D + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->Pc= iAddress : 0,=0D AddrMapInfo->AddressSize,=0D 0,=0D NULL,=0D @@ -657,7 +663,7 @@ GeneratePciCrs (=0D case PCI_SS_M64:=0D Status =3D AmlCodeGenRdQWordMemory (=0D FALSE,=0D - TRUE,=0D + IsPosDecode,=0D TRUE,=0D TRUE,=0D TRUE,=0D @@ -665,7 +671,7 @@ GeneratePciCrs (=0D 0,=0D AddrMapInfo->PciAddress,=0D AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,= =0D - Translation ? AddrMapInfo->CpuAddress : 0,=0D + Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->Pc= iAddress : 0,=0D AddrMapInfo->AddressSize,=0D 0,=0D NULL,=0D -- =0D 2.25.1=0D =0D