DynamicTablesPkg: Update PPTT generator to ACPI 6.4

Bugzilla: 3697 (https://bugzilla.tianocore.org/show_bug.cgi?id=3697)

Update the PPTT generator to use Acpi64.h.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
Chris Jones 2021-12-08 16:06:29 +00:00 committed by mergify[bot]
parent b2bbe3df54
commit e139829dd6
1 changed files with 22 additions and 22 deletions

View File

@ -1,11 +1,11 @@
/** @file /** @file
PPTT Table Generator PPTT Table Generator
Copyright (c) 2019, ARM Limited. All rights reserved. Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s): @par Reference(s):
- ACPI 6.3 Specification, January 2019 - ACPI 6.4 Specification, January 2021
@par Glossary: @par Glossary:
- Cm or CM - Configuration Manager - Cm or CM - Configuration Manager
@ -96,7 +96,7 @@ GetProcHierarchyNodeSize (
ASSERT (Node != NULL); ASSERT (Node != NULL);
// <size of Processor Hierarchy Node> + <size of Private Resources array> // <size of Processor Hierarchy Node> + <size of Private Resources array>
return sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR) + return sizeof (EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR) +
(Node->NoOfPrivateResources * sizeof (UINT32)); (Node->NoOfPrivateResources * sizeof (UINT32));
} }
@ -116,7 +116,7 @@ GET_SIZE_OF_PPTT_STRUCTS (
*/ */
GET_SIZE_OF_PPTT_STRUCTS ( GET_SIZE_OF_PPTT_STRUCTS (
CacheTypeStructs, CacheTypeStructs,
sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE), sizeof (EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE),
CM_ARM_CACHE_INFO CM_ARM_CACHE_INFO
); );
@ -468,12 +468,12 @@ EFI_STATUS
AddProcHierarchyNodes ( AddProcHierarchyNodes (
IN CONST ACPI_PPTT_GENERATOR *CONST Generator, IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt, IN CONST EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt,
IN CONST UINT32 NodesStartOffset IN CONST UINT32 NodesStartOffset
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *ProcStruct; EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR *ProcStruct;
UINT32 *PrivateResources; UINT32 *PrivateResources;
BOOLEAN IsGicCTokenDuplicated; BOOLEAN IsGicCTokenDuplicated;
@ -494,7 +494,7 @@ AddProcHierarchyNodes (
(Pptt != NULL) (Pptt != NULL)
); );
ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)Pptt + ProcStruct = (EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)Pptt +
NodesStartOffset); NodesStartOffset);
ProcNodeIterator = Generator->ProcHierarchyNodeIndexedList; ProcNodeIterator = Generator->ProcHierarchyNodeIndexedList;
@ -538,7 +538,7 @@ AddProcHierarchyNodes (
} }
// Populate the node header // Populate the node header
ProcStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_PROCESSOR; ProcStruct->Type = EFI_ACPI_6_4_PPTT_TYPE_PROCESSOR;
ProcStruct->Length = (UINT8)Length; ProcStruct->Length = (UINT8)Length;
ProcStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE; ProcStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
ProcStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE; ProcStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
@ -661,7 +661,7 @@ AddProcHierarchyNodes (
ProcStruct->NumberOfPrivateResources = ProcInfoNode->NoOfPrivateResources; ProcStruct->NumberOfPrivateResources = ProcInfoNode->NoOfPrivateResources;
PrivateResources = (UINT32 *)((UINT8 *)ProcStruct + PrivateResources = (UINT32 *)((UINT8 *)ProcStruct +
sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR)); sizeof (EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR));
if (ProcStruct->NumberOfPrivateResources != 0) { if (ProcStruct->NumberOfPrivateResources != 0) {
// Populate the private resources array // Populate the private resources array
@ -684,7 +684,7 @@ AddProcHierarchyNodes (
} }
// Next Processor Hierarchy Node // Next Processor Hierarchy Node
ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)ProcStruct + ProcStruct = (EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)ProcStruct +
ProcStruct->Length); ProcStruct->Length);
ProcNodeIterator++; ProcNodeIterator++;
} // Processor Hierarchy Node } // Processor Hierarchy Node
@ -748,12 +748,12 @@ EFI_STATUS
AddCacheTypeStructures ( AddCacheTypeStructures (
IN CONST ACPI_PPTT_GENERATOR *CONST Generator, IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt, IN CONST EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt,
IN CONST UINT32 NodesStartOffset IN CONST UINT32 NodesStartOffset
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *CacheStruct; EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE *CacheStruct;
PPTT_NODE_INDEXER *PpttNodeFound; PPTT_NODE_INDEXER *PpttNodeFound;
CM_ARM_CACHE_INFO *CacheInfoNode; CM_ARM_CACHE_INFO *CacheInfoNode;
PPTT_NODE_INDEXER *CacheNodeIterator; PPTT_NODE_INDEXER *CacheNodeIterator;
@ -765,7 +765,7 @@ AddCacheTypeStructures (
(Pptt != NULL) (Pptt != NULL)
); );
CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *)((UINT8 *)Pptt + CacheStruct = (EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE *)((UINT8 *)Pptt +
NodesStartOffset); NodesStartOffset);
CacheNodeIterator = Generator->CacheStructIndexedList; CacheNodeIterator = Generator->CacheStructIndexedList;
@ -775,13 +775,13 @@ AddCacheTypeStructures (
CacheInfoNode = (CM_ARM_CACHE_INFO *)CacheNodeIterator->Object; CacheInfoNode = (CM_ARM_CACHE_INFO *)CacheNodeIterator->Object;
// Populate the node header // Populate the node header
CacheStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_CACHE; CacheStruct->Type = EFI_ACPI_6_4_PPTT_TYPE_CACHE;
CacheStruct->Length = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE); CacheStruct->Length = sizeof (EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE);
CacheStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE; CacheStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
CacheStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE; CacheStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
// "On Arm-based systems, all cache properties must be provided in the // "On Arm-based systems, all cache properties must be provided in the
// table." (ACPI 6.3, Section 5.2.29.2) // table." (ACPI 6.4, Section 5.2.29.2)
CacheStruct->Flags.SizePropertyValid = 1; CacheStruct->Flags.SizePropertyValid = 1;
CacheStruct->Flags.NumberOfSetsValid = 1; CacheStruct->Flags.NumberOfSetsValid = 1;
CacheStruct->Flags.AssociativityValid = 1; CacheStruct->Flags.AssociativityValid = 1;
@ -941,7 +941,7 @@ AddCacheTypeStructures (
CacheStruct->LineSize = CacheInfoNode->LineSize; CacheStruct->LineSize = CacheInfoNode->LineSize;
// Next Cache Type Structure // Next Cache Type Structure
CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *)((UINT8 *)CacheStruct + CacheStruct = (EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE *)((UINT8 *)CacheStruct +
CacheStruct->Length); CacheStruct->Length);
CacheNodeIterator++; CacheNodeIterator++;
} // Cache Type Structure } // Cache Type Structure
@ -999,7 +999,7 @@ BuildPpttTable (
// Pointer to the Node Indexer array // Pointer to the Node Indexer array
PPTT_NODE_INDEXER *NodeIndexer; PPTT_NODE_INDEXER *NodeIndexer;
EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt; EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt;
ASSERT ( ASSERT (
(This != NULL) && (This != NULL) &&
@ -1087,7 +1087,7 @@ BuildPpttTable (
Generator->NodeIndexer = NodeIndexer; Generator->NodeIndexer = NodeIndexer;
// Calculate the size of the PPTT table // Calculate the size of the PPTT table
TableSize = sizeof (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER); TableSize = sizeof (EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER);
// Include the size of Processor Hierarchy Nodes and index them // Include the size of Processor Hierarchy Nodes and index them
if (Generator->ProcHierarchyNodeCount != 0) { if (Generator->ProcHierarchyNodeCount != 0) {
@ -1155,7 +1155,7 @@ BuildPpttTable (
goto error_handler; goto error_handler;
} }
Pptt = (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *)*Table; Pptt = (EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *)*Table;
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@ -1312,9 +1312,9 @@ ACPI_PPTT_GENERATOR PpttGenerator = {
// Generator Description // Generator Description
L"ACPI.STD.PPTT.GENERATOR", L"ACPI.STD.PPTT.GENERATOR",
// ACPI Table Signature // ACPI Table Signature
EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE, EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
// ACPI Table Revision supported by this Generator // ACPI Table Revision supported by this Generator
EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION, EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION,
// Minimum supported ACPI Table Revision // Minimum supported ACPI Table Revision
EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION, EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION,
// Creator ID // Creator ID