From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.96.140; helo=cam-smtp0.cambridge.arm.com; envelope-from=sami.mujawar@arm.com; receiver=edk2-devel@lists.01.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8D5EE203B8CB3 for ; Fri, 27 Apr 2018 08:54:05 -0700 (PDT) Received: from E107187.Emea.Arm.com (e107187.emea.arm.com [10.1.211.22]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id w3RFs2s9017663; Fri, 27 Apr 2018 16:54:03 +0100 From: Sami Mujawar To: edk2-devel@lists.01.org Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, Matteo.Carlini@arm.com, Stephanie.Hughes-Fitt@arm.com, nd@arm.com, evan.lloyd@arm.com Date: Fri, 27 Apr 2018 16:53:55 +0100 Message-Id: <20180427155356.7596-3-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20180427155356.7596-1-sami.mujawar@arm.com> References: <20180427155356.7596-1-sami.mujawar@arm.com> Subject: [staging/dynamictables PATCH v1 2/2] DynamicTablesPkg: Update IORT generator X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 15:54:06 -0000 Update IORT generator to conform to the IO Remapping Table, Platform Design Document, Revision D, March 2018 The generator has been updated for: 1. SMMUv3 - fix on proximity node. 2. PMCG - added page 1 support. 3. Root complex node - added DMA mask (memory address size limit). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar Reviewed-by: Evan Lloyd --- The changes can be seen at https://github.com/samimujawar/edk2-staging/tree/259_iort_rev_d_update_v1 Notes: v1: - IORT Generator update for IORT Rev D specification [SAMI] DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 6 +++++- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index abbd624eb026d14d2280d766bf68633c60436829..93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -459,6 +459,8 @@ typedef struct CmArmRootComplexNode { UINT32 AtsAttribute; /// PCI segment number UINT32 PciSegmentNumber; + /// Memory address size limit + UINT8 MemoryAddressSize; } CM_ARM_ROOT_COMPLEX_NODE; /** A structure that describes the @@ -530,7 +532,7 @@ typedef struct CmArmSmmuV3Node { UINT32 SyncInterrupt; /// Proximity domain flag - UINT8 ProximityDomain; + UINT32 ProximityDomain; /// Index into the array of ID mapping UINT32 DeviceIdMappingIndex; } CM_ARM_SMMUV3_NODE; @@ -550,6 +552,8 @@ typedef struct CmArmPmcgNode { UINT64 BaseAddress; /// GSIV for the Overflow interrupt UINT32 OverflowInterrupt; + /// Page 1 Base address + UINT64 Page1BaseAddress; /// Reference token for the IORT node associated with this node CM_OBJECT_TOKEN ReferenceToken; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index cee960fba4e4c19a9c52f2c38e887741a074e2a9..2b43066245d5dc225a9942677540f01fddec7ddc 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -12,7 +12,7 @@ @par Reference(s): - IO Remapping Table, Platform Design Document, - Document number: ARM DEN 0049C, Issue C, 15 May 2017 + Document number: ARM DEN 0049D, Issue D, March 2018 **/ @@ -843,7 +843,7 @@ AddNamedComponentNodes ( NcNode->Node.Type = EFI_ACPI_IORT_TYPE_NAMED_COMP; NcNode->Node.Length = GetNamedComponentNodeSize (NodeList); - NcNode->Node.Revision = 1; + NcNode->Node.Revision = 2; NcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; NcNode->Node.NumIdMappings = NodeList->IdMappingCount; @@ -950,7 +950,7 @@ AddRootComplexNodes ( // Populate the node header RcNode->Node.Type = EFI_ACPI_IORT_TYPE_ROOT_COMPLEX; RcNode->Node.Length = GetRootComplexNodeSize (NodeList); - RcNode->Node.Revision = 0; + RcNode->Node.Revision = 1; RcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; RcNode->Node.NumIdMappings = NodeList->IdMappingCount; RcNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE); @@ -962,6 +962,10 @@ AddRootComplexNodes ( RcNode->MemoryAccessFlags = NodeList->MemoryAccessFlags; RcNode->AtsAttribute = NodeList->AtsAttribute; RcNode->PciSegmentNumber = NodeList->PciSegmentNumber; + RcNode->MemoryAddressSize = NodeList->MemoryAddressSize; + RcNode->Reserved1[0] = EFI_ACPI_RESERVED_BYTE; + RcNode->Reserved1[1] = EFI_ACPI_RESERVED_BYTE; + RcNode->Reserved1[2] = EFI_ACPI_RESERVED_BYTE; if ((NodeList->IdMappingCount > 0) && (NodeList->IdMappingToken != CM_NULL_TOKEN)) { @@ -1247,7 +1251,7 @@ AddSmmuV3Nodes ( // Populate the node header SmmuV3Node->Node.Type = EFI_ACPI_IORT_TYPE_SMMUv3; SmmuV3Node->Node.Length = GetSmmuV3NodeSize (NodeList); - SmmuV3Node->Node.Revision = 1; + SmmuV3Node->Node.Revision = 2; SmmuV3Node->Node.Reserved = EFI_ACPI_RESERVED_DWORD; SmmuV3Node->Node.NumIdMappings = NodeList->IdMappingCount; SmmuV3Node->Node.IdReference = @@ -1271,10 +1275,6 @@ AddSmmuV3Nodes ( SmmuV3Node->ProximityDomain = 0; } - SmmuV3Node->Reserved1[0] = EFI_ACPI_RESERVED_BYTE; - SmmuV3Node->Reserved1[1] = EFI_ACPI_RESERVED_BYTE; - SmmuV3Node->Reserved1[2] = EFI_ACPI_RESERVED_BYTE; - if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) && (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0)) { // If all the SMMU control interrupts are GSIV based, @@ -1355,7 +1355,7 @@ AddPmcgNodes ( // Populate the node header PmcgNode->Node.Type = EFI_ACPI_IORT_TYPE_PMCG; PmcgNode->Node.Length = GetPmcgNodeSize (NodeList); - PmcgNode->Node.Revision = 0; + PmcgNode->Node.Revision = 1; PmcgNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; PmcgNode->Node.NumIdMappings = NodeList->IdMappingCount; PmcgNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE); @@ -1363,6 +1363,7 @@ AddPmcgNodes ( // PMCG specific data PmcgNode->Base = NodeList->BaseAddress; PmcgNode->OverflowInterruptGsiv = NodeList->OverflowInterrupt; + PmcgNode->Page1Base = NodeList->Page1BaseAddress; Status = GetNodeOffsetReferencedByToken ( Generator->NodeIndexer, -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'