DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info

The GicCToken field in the CM_ARM_PROC_HIERARCHY_INFO structure is
a reference to the associated object which has the corresponding
ACPI Processor ID, e.g. for Arm systems this is a reference to the
CM_ARM_GICC_INFO object.
For other architecture this may be a reference to a similar object
that has the ACPI Processor ID.

Therefore, rename the GicCToken field to a more generic name like
AcpiIdObjectToken.

Correspondingly also update the following modules to reflect the
changes introduced by this renaming:
 - PPTT generator
 - SSDT CPu topology generator
 - ConfigurationManagerObjectParser.

Cc: Pierre Gondois <Pierre.Gondois@arm.com>
Cc: Yeo Reum Yun <YeoReum.Yun@arm.com>
Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com>
Cc: Jeshua Smith <jeshuas@nvidia.com>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Cc: Girish Mahadevan <gmahadevan@nvidia.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
This commit is contained in:
Sami Mujawar 2024-03-11 13:17:13 +00:00 committed by mergify[bot]
parent ead3b42391
commit d7a47297cd
4 changed files with 41 additions and 39 deletions

View File

@ -657,11 +657,11 @@ typedef struct CmArmProcHierarchyInfo {
/// Token for the parent CM_ARM_PROC_HIERARCHY_INFO object in the processor
/// topology. A value of CM_NULL_TOKEN means this node has no parent.
CM_OBJECT_TOKEN ParentToken;
/// Token of the associated CM_ARM_GICC_INFO object which has the
/// corresponding ACPI Processor ID. A value of CM_NULL_TOKEN means this
/// node represents a group of associated processors and it does not have an
/// associated GIC CPU interface.
CM_OBJECT_TOKEN GicCToken;
/// Token of the associated object which has the corresponding ACPI Processor
/// ID, e.g. for Arm systems this is a reference to CM_ARM_GICC_INFO object.
/// A value of CM_NULL_TOKEN means this node represents a group of associated
/// processors and it does not have an associated CPU interface.
CM_OBJECT_TOKEN AcpiIdObjectToken;
/// Number of resources private to this Node
UINT32 NoOfPrivateResources;
/// Token of the array which contains references to the resources private to

View File

@ -397,12 +397,14 @@ AddPrivateResources (
@param [in] Index2 Index of Object2 to be displayed for debugging
purposes.
@retval TRUE Object1 and Object2 have the same GicCToken.
@retval FALSE Object1 and Object2 have different GicCTokens.
@retval TRUE Object1 and Object2 have the same
AcpiIdObjectToken.
@retval FALSE Object1 and Object2 have different
AcpiIdObjectTokens.
**/
BOOLEAN
EFIAPI
IsGicCTokenEqual (
IsAcpiIdObjectTokenEqual (
IN CONST VOID *Object1,
IN CONST VOID *Object2,
IN UINTN Index1,
@ -426,18 +428,18 @@ IsGicCTokenEqual (
if (IS_ACPI_PROC_ID_VALID (ProcNode1) &&
IS_ACPI_PROC_ID_VALID (ProcNode2) &&
(ProcNode1->GicCToken != CM_NULL_TOKEN) &&
(ProcNode2->GicCToken != CM_NULL_TOKEN) &&
(ProcNode1->GicCToken == ProcNode2->GicCToken))
(ProcNode1->AcpiIdObjectToken != CM_NULL_TOKEN) &&
(ProcNode2->AcpiIdObjectToken != CM_NULL_TOKEN) &&
(ProcNode1->AcpiIdObjectToken == ProcNode2->AcpiIdObjectToken))
{
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \
"the same GICC Info object. ACPI Processor IDs are not unique. " \
"GicCToken = %p.\n",
"the same ACPI ID reference object. ACPI Processor IDs are not unique. " \
"AcpiIdObjectToken = %p.\n",
Index1,
Index2,
ProcNode1->GicCToken
ProcNode1->AcpiIdObjectToken
));
return TRUE;
}
@ -474,7 +476,7 @@ AddProcHierarchyNodes (
EFI_STATUS Status;
EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR *ProcStruct;
UINT32 *PrivateResources;
BOOLEAN IsGicCTokenDuplicated;
BOOLEAN IsAcpiIdObjectTokenDuplicated;
CM_ARM_GICC_INFO *GicCInfoList;
UINT32 GicCInfoCount;
@ -500,15 +502,15 @@ AddProcHierarchyNodes (
NodeCount = Generator->ProcHierarchyNodeCount;
// Check if every GICC Object is referenced by onlu one Proc Node
IsGicCTokenDuplicated = FindDuplicateValue (
ProcNodeIterator,
NodeCount,
sizeof (PPTT_NODE_INDEXER),
IsGicCTokenEqual
);
IsAcpiIdObjectTokenDuplicated = FindDuplicateValue (
ProcNodeIterator,
NodeCount,
sizeof (PPTT_NODE_INDEXER),
IsAcpiIdObjectTokenEqual
);
// Duplicate GIC CPU Interface Token was found so two PPTT Processor Hierarchy
// Nodes map to the same MADT GICC structure
if (IsGicCTokenDuplicated) {
if (IsAcpiIdObjectTokenDuplicated) {
return EFI_INVALID_PARAMETER;
}
@ -602,14 +604,14 @@ AddProcHierarchyNodes (
if (!IS_ACPI_PROC_ID_VALID (ProcInfoNode)) {
// Default invalid ACPI Processor ID to 0
ProcStruct->AcpiProcessorId = 0;
} else if (ProcInfoNode->GicCToken == CM_NULL_TOKEN) {
} else if (ProcInfoNode->AcpiIdObjectToken == CM_NULL_TOKEN) {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no GICC " \
"structure token was provided. GicCToken = %p. RequestorToken = %p. " \
"Status = %r\n",
ProcInfoNode->GicCToken,
"ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no " \
"ACPI ID Reference object token was provided. " \
"AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
ProcInfoNode->AcpiIdObjectToken,
ProcInfoNode->Token,
Status
));
@ -617,17 +619,17 @@ AddProcHierarchyNodes (
} else {
Status = GetEArmObjGicCInfo (
CfgMgrProtocol,
ProcInfoNode->GicCToken,
ProcInfoNode->AcpiIdObjectToken,
&GicCInfoList,
&GicCInfoCount
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: Failed to get GICC structure. ACPI Processor ID " \
"can't be populated. GicCToken = %p. RequestorToken = %p. " \
"Status = %r\n",
ProcInfoNode->GicCToken,
"ERROR: PPTT: Failed to get ACPI ID Reference object token. " \
"ACPI Processor ID can't be populated. " \
"AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
ProcInfoNode->AcpiIdObjectToken,
ProcInfoNode->Token,
Status
));
@ -640,10 +642,10 @@ AddProcHierarchyNodes (
DEBUG_ERROR,
"ERROR: PPTT: Failed to find a unique GICC structure. " \
"ACPI Processor ID can't be populated. " \
"GICC Structure Count = %d. GicCToken = %p. RequestorToken = %p " \
"GICC Structure Count = %d. AcpiIdObjectToken = %p. RequestorToken = %p " \
"Status = %r\n",
GicCInfoCount,
ProcInfoNode->GicCToken,
ProcInfoNode->AcpiIdObjectToken,
ProcInfoNode->Token,
Status
));

View File

@ -894,11 +894,11 @@ CreateAmlCpuFromProcHierarchy (
ASSERT (CfgMgrProtocol != NULL);
ASSERT (ParentNode != NULL);
ASSERT (ProcHierarchyNodeInfo != NULL);
ASSERT (ProcHierarchyNodeInfo->GicCToken != CM_NULL_TOKEN);
ASSERT (ProcHierarchyNodeInfo->AcpiIdObjectToken != CM_NULL_TOKEN);
Status = GetEArmObjGicCInfo (
CfgMgrProtocol,
ProcHierarchyNodeInfo->GicCToken,
ProcHierarchyNodeInfo->AcpiIdObjectToken,
&GicCInfo,
NULL
);
@ -1175,9 +1175,9 @@ CreateAmlCpuTopologyTree (
// Find the children of the CM_ARM_PROC_HIERARCHY_INFO
// currently being handled (i.e. ParentToken == NodeToken).
if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
// Only Cpus (leaf nodes in this tree) have a GicCToken.
// Only Cpus (leaf nodes in this tree) have a AcpiIdObjectToken.
// Create a Cpu node.
if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) {
if (Generator->ProcNodeList[Index].AcpiIdObjectToken != CM_NULL_TOKEN) {
Status = CheckProcNode (
Generator->ProcNodeList[Index].Flags,
TRUE,

View File

@ -328,7 +328,7 @@ STATIC CONST CM_OBJ_PARSER CmArmProcHierarchyInfoParser[] = {
{ "Token", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "Flags", 4, "0x%x", NULL },
{ "ParentToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "GicCToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "AcpiIdObjectToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "NoOfPrivateResources", 4, "0x%x", NULL },
{ "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
{ "LpiToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },