DynamicTablesPkg: Move LPI info object to Arch Common

Move the LPI info object from Arm Namespace to the
Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SSDT Cpu Topology generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map.

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 12:59:07 +00:00 committed by mergify[bot]
parent 0b5abcb90e
commit ead3b42391
7 changed files with 118 additions and 118 deletions

View File

@ -35,6 +35,7 @@ typedef enum ArchCommonObjectID {
EArchCommonObjDeviceHandleAcpi, ///< 12 - Device Handle Acpi EArchCommonObjDeviceHandleAcpi, ///< 12 - Device Handle Acpi
EArchCommonObjDeviceHandlePci, ///< 13 - Device Handle Pci EArchCommonObjDeviceHandlePci, ///< 13 - Device Handle Pci
EArchCommonObjGenericInitiatorAffinityInfo, ///< 14 - Generic Initiator Affinity EArchCommonObjGenericInitiatorAffinityInfo, ///< 14 - Generic Initiator Affinity
EArchCommonObjLpiInfo, ///< 15 - Lpi Info
EArchCommonObjMax EArchCommonObjMax
} EARCH_COMMON_OBJECT_ID; } EARCH_COMMON_OBJECT_ID;
@ -295,6 +296,69 @@ typedef struct CmArchCommonGenericInitiatorAffinityInfo {
CM_OBJECT_TOKEN DeviceHandleToken; CM_OBJECT_TOKEN DeviceHandleToken;
} CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO; } CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO;
/** A structure that describes the Lpi information.
The Low Power Idle states are described in DSDT/SSDT and associated
to cpus/clusters in the cpu topology.
ID: EArchCommonObjLpiInfo
*/
typedef struct CmArchCommonLpiInfo {
/** Minimum Residency. Time in microseconds after which a
state becomes more energy efficient than any shallower state.
*/
UINT32 MinResidency;
/** Worst case time in microseconds from a wake interrupt
being asserted to the return to a running state
*/
UINT32 WorstCaseWakeLatency;
/** Flags.
*/
UINT32 Flags;
/** Architecture specific context loss flags.
*/
UINT32 ArchFlags;
/** Residency counter frequency in cycles-per-second (Hz).
*/
UINT32 ResCntFreq;
/** Every shallower power state in the parent is also enabled.
*/
UINT32 EnableParentState;
/** The EntryMethod _LPI field can be described as an integer
or in a Register resource data descriptor.
If IsInteger is TRUE, the IntegerEntryMethod field is used.
If IsInteger is FALSE, the RegisterEntryMethod field is used.
*/
BOOLEAN IsInteger;
/** EntryMethod described as an Integer.
*/
UINT64 IntegerEntryMethod;
/** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE RegisterEntryMethod;
/** Residency counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResidencyCounterRegister;
/** Usage counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE UsageCounterRegister;
/** String representing the Lpi state
*/
CHAR8 StateName[16];
} CM_ARCH_COMMON_LPI_INFO;
#pragma pack() #pragma pack()
#endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_ #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_

View File

@ -51,18 +51,17 @@ typedef enum ArmObjectID {
EArmObjProcHierarchyInfo, ///< 20 - Processor Hierarchy Info EArmObjProcHierarchyInfo, ///< 20 - Processor Hierarchy Info
EArmObjCacheInfo, ///< 21 - Cache Info EArmObjCacheInfo, ///< 21 - Cache Info
EArmObjCmn600Info, ///< 22 - CMN-600 Info EArmObjCmn600Info, ///< 22 - CMN-600 Info
EArmObjLpiInfo, ///< 23 - Lpi Info EArmObjRmr, ///< 23 - Reserved Memory Range Node
EArmObjRmr, ///< 24 - Reserved Memory Range Node EArmObjMemoryRangeDescriptor, ///< 24 - Memory Range Descriptor
EArmObjMemoryRangeDescriptor, ///< 25 - Memory Range Descriptor EArmObjCpcInfo, ///< 25 - Continuous Performance Control Info
EArmObjCpcInfo, ///< 26 - Continuous Performance Control Info EArmObjPccSubspaceType0Info, ///< 26 - Pcc Subspace Type 0 Info
EArmObjPccSubspaceType0Info, ///< 27 - Pcc Subspace Type 0 Info EArmObjPccSubspaceType1Info, ///< 27 - Pcc Subspace Type 2 Info
EArmObjPccSubspaceType1Info, ///< 28 - Pcc Subspace Type 2 Info EArmObjPccSubspaceType2Info, ///< 28 - Pcc Subspace Type 2 Info
EArmObjPccSubspaceType2Info, ///< 29 - Pcc Subspace Type 2 Info EArmObjPccSubspaceType3Info, ///< 29 - Pcc Subspace Type 3 Info
EArmObjPccSubspaceType3Info, ///< 30 - Pcc Subspace Type 3 Info EArmObjPccSubspaceType4Info, ///< 30 - Pcc Subspace Type 4 Info
EArmObjPccSubspaceType4Info, ///< 31 - Pcc Subspace Type 4 Info EArmObjPccSubspaceType5Info, ///< 31 - Pcc Subspace Type 5 Info
EArmObjPccSubspaceType5Info, ///< 32 - Pcc Subspace Type 5 Info EArmObjEtInfo, ///< 32 - Embedded Trace Extension/Module Info
EArmObjEtInfo, ///< 33 - Embedded Trace Extension/Module Info EArmObjPsdInfo, ///< 33 - P-State Dependency (PSD) Info
EArmObjPsdInfo, ///< 34 - P-State Dependency (PSD) Info
EArmObjMax EArmObjMax
} EARM_OBJECT_ID; } EARM_OBJECT_ID;
@ -672,7 +671,7 @@ typedef struct CmArmProcHierarchyInfo {
CM_OBJECT_TOKEN PrivateResourcesArrayToken; CM_OBJECT_TOKEN PrivateResourcesArrayToken;
/// Optional field: Reference Token for the Lpi state of this processor. /// Optional field: Reference Token for the Lpi state of this processor.
/// Token identifying a CM_ARCH_COMMON_OBJ_REF structure, itself referencing /// Token identifying a CM_ARCH_COMMON_OBJ_REF structure, itself referencing
/// CM_ARM_LPI_INFO objects. /// CM_ARCH_COMMON_LPI_INFO objects.
CM_OBJECT_TOKEN LpiToken; CM_OBJECT_TOKEN LpiToken;
/// Set to TRUE if UID should override index for name and _UID /// Set to TRUE if UID should override index for name and _UID
/// for processor container nodes and name of processors. /// for processor container nodes and name of processors.
@ -749,69 +748,6 @@ typedef struct CmArmCmn600Info {
CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4]; CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4];
} CM_ARM_CMN_600_INFO; } CM_ARM_CMN_600_INFO;
/** A structure that describes the Lpi information.
The Low Power Idle states are described in DSDT/SSDT and associated
to cpus/clusters in the cpu topology.
ID: EArmObjLpiInfo
*/
typedef struct CmArmLpiInfo {
/** Minimum Residency. Time in microseconds after which a
state becomes more energy efficient than any shallower state.
*/
UINT32 MinResidency;
/** Worst case time in microseconds from a wake interrupt
being asserted to the return to a running state
*/
UINT32 WorstCaseWakeLatency;
/** Flags.
*/
UINT32 Flags;
/** Architecture specific context loss flags.
*/
UINT32 ArchFlags;
/** Residency counter frequency in cycles-per-second (Hz).
*/
UINT32 ResCntFreq;
/** Every shallower power state in the parent is also enabled.
*/
UINT32 EnableParentState;
/** The EntryMethod _LPI field can be described as an integer
or in a Register resource data descriptor.
If IsInteger is TRUE, the IntegerEntryMethod field is used.
If IsInteger is FALSE, the RegisterEntryMethod field is used.
*/
BOOLEAN IsInteger;
/** EntryMethod described as an Integer.
*/
UINT64 IntegerEntryMethod;
/** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE RegisterEntryMethod;
/** Residency counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResidencyCounterRegister;
/** Usage counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE UsageCounterRegister;
/** String representing the Lpi state
*/
CHAR8 StateName[16];
} CM_ARM_LPI_INFO;
/** A structure that describes the /** A structure that describes the
RMR node for the Platform. RMR node for the Platform.

View File

@ -40,7 +40,7 @@ Requirements:
- EArmObjGicCInfo - EArmObjGicCInfo
- EArmObjProcHierarchyInfo (OPTIONAL) along with - EArmObjProcHierarchyInfo (OPTIONAL) along with
- EArchCommonObjCmRef (OPTIONAL) - EArchCommonObjCmRef (OPTIONAL)
- EArmObjLpiInfo (OPTIONAL) - EArchCommonObjLpiInfo (OPTIONAL)
- GetEArmObjEtInfo (OPTIONAL) - GetEArmObjEtInfo (OPTIONAL)
- EArmObjPsdInfo (OPTIONAL) - EArmObjPsdInfo (OPTIONAL)
*/ */
@ -79,9 +79,9 @@ GET_OBJECT_LIST (
information from the Configuration Manager. information from the Configuration Manager.
*/ */
GET_OBJECT_LIST ( GET_OBJECT_LIST (
EObjNameSpaceArm, EObjNameSpaceArchCommon,
EArmObjLpiInfo, EArchCommonObjLpiInfo,
CM_ARM_LPI_INFO CM_ARCH_COMMON_LPI_INFO
); );
/** /**
@ -118,7 +118,7 @@ GET_OBJECT_LIST (
One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO
structure of the platform. The TokenTable allows to have a mapping: structure of the platform. The TokenTable allows to have a mapping:
Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures). Index <-> CM_OBJECT_TOKEN (to CM_ARCH_COMMON_LPI_INFO structures).
There will always be less sets of Lpi states (CM_ARCH_COMMON_OBJ_REF) There will always be less sets of Lpi states (CM_ARCH_COMMON_OBJ_REF)
than the number of cpus/clusters (CM_ARM_PROC_HIERARCHY_INFO). than the number of cpus/clusters (CM_ARM_PROC_HIERARCHY_INFO).
@ -696,12 +696,12 @@ GenerateLpiStates (
UINT32 Index; UINT32 Index;
UINT32 LastIndex; UINT32 LastIndex;
AML_OBJECT_NODE_HANDLE LpiNode; AML_OBJECT_NODE_HANDLE LpiNode;
CM_ARCH_COMMON_OBJ_REF *LpiRefInfo; CM_ARCH_COMMON_OBJ_REF *LpiRefInfo;
UINT32 LpiRefInfoCount; UINT32 LpiRefInfoCount;
UINT32 LpiRefIndex; UINT32 LpiRefIndex;
CM_ARM_LPI_INFO *LpiInfo; CM_ARCH_COMMON_LPI_INFO *LpiInfo;
CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
ASSERT (Generator != NULL); ASSERT (Generator != NULL);
ASSERT (Generator->TokenTable.Table != NULL); ASSERT (Generator->TokenTable.Table != NULL);
@ -739,8 +739,9 @@ GenerateLpiStates (
} }
for (LpiRefIndex = 0; LpiRefIndex < LpiRefInfoCount; LpiRefIndex++) { for (LpiRefIndex = 0; LpiRefIndex < LpiRefInfoCount; LpiRefIndex++) {
// For each CM_ARM_LPI_INFO referenced by the token, add an Lpi state. // For each CM_ARCH_COMMON_LPI_INFO referenced by the token,
Status = GetEArmObjLpiInfo ( // add an Lpi state.
Status = GetEArchCommonObjLpiInfo (
CfgMgrProtocol, CfgMgrProtocol,
LpiRefInfo[LpiRefIndex].ReferenceToken, LpiRefInfo[LpiRefIndex].ReferenceToken,
&LpiInfo, &LpiInfo,

View File

@ -70,7 +70,7 @@
/** A structure used to handle the Lpi structures referencing. /** A structure used to handle the Lpi structures referencing.
A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARCH_COMMON_OBJ_REF. A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARCH_COMMON_OBJ_REF.
This CM_ARCH_COMMON_OBJ_REF references CM_ARM_LPI_INFO structures. This CM_ARCH_COMMON_OBJ_REF references CM_ARCH_COMMON_LPI_INFO structures.
Example: Example:
(Cpu0) (Cpu1) (Cpu0) (Cpu1)
@ -86,7 +86,7 @@
| | | |
v v v v
(A first Lpi state) (A second Lpi state) (A first Lpi state) (A second Lpi state)
CM_ARM_LPI_INFO[0] CM_ARM_LPI_INFO[1] CM_ARCH_COMMON_LPI_INFO[0] CM_ARCH_COMMON_LPI_INFO[1]
Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO
structures reference the same CM_ARCH_COMMON_OBJ_REF. An entry is created in the structures reference the same CM_ARCH_COMMON_OBJ_REF. An entry is created in the
@ -118,7 +118,7 @@
*/ */
typedef struct TokenTable { typedef struct TokenTable {
/// TokenTable, a table allowing to map: /// TokenTable, a table allowing to map:
/// Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures). /// Index <-> CM_OBJECT_TOKEN (to CM_ARCH_COMMON_LPI_INFO structures).
CM_OBJECT_TOKEN *Table; CM_OBJECT_TOKEN *Table;
/// Last used index of the TokenTable. /// Last used index of the TokenTable.

View File

@ -166,18 +166,17 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] = {
TokenFixerNotImplemented, ///< 20 - Processor Hierarchy Info TokenFixerNotImplemented, ///< 20 - Processor Hierarchy Info
TokenFixerNotImplemented, ///< 21 - Cache Info TokenFixerNotImplemented, ///< 21 - Cache Info
NULL, ///< 22 - CMN-600 Info NULL, ///< 22 - CMN-600 Info
NULL, ///< 23 - Lpi Info NULL, ///< 23 - Reserved Memory Range Node
NULL, ///< 24 - Reserved Memory Range Node NULL, ///< 24 - Memory Range Descriptor
NULL, ///< 25 - Memory Range Descriptor NULL, ///< 25 - Continuous Performance Control Info
NULL, ///< 26 - Continuous Performance Control Info NULL, ///< 26 - Pcc Subspace Type 0 Info
NULL, ///< 27 - Pcc Subspace Type 0 Info NULL, ///< 27 - Pcc Subspace Type 2 Info
NULL, ///< 28 - Pcc Subspace Type 2 Info NULL, ///< 28 - Pcc Subspace Type 2 Info
NULL, ///< 29 - Pcc Subspace Type 2 Info NULL, ///< 29 - Pcc Subspace Type 3 Info
NULL, ///< 30 - Pcc Subspace Type 3 Info NULL, ///< 30 - Pcc Subspace Type 4 Info
NULL, ///< 31 - Pcc Subspace Type 4 Info NULL, ///< 31 - Pcc Subspace Type 5 Info
NULL, ///< 32 - Pcc Subspace Type 5 Info NULL, ///< 32 - Embedded Trace Extension/Module Info
NULL, ///< 33 - Embedded Trace Extension/Module Info NULL ///< 33 - P-State Dependency (PSD) Info
NULL ///< 34 - P-State Dependency (PSD) Info
}; };
/** CmObj token fixer. /** CmObj token fixer.

View File

@ -417,9 +417,9 @@ STATIC CONST CM_OBJ_PARSER AcpiGenericAddressParser[] = {
{ "Address", 8, "0x%llx", NULL }, { "Address", 8, "0x%llx", NULL },
}; };
/** A parser for EArmObjLpiInfo. /** A parser for EArchCommonObjLpiInfo.
*/ */
STATIC CONST CM_OBJ_PARSER CmArmLpiInfoParser[] = { STATIC CONST CM_OBJ_PARSER CmArchCommonLpiInfoParser[] = {
{ "MinResidency", 4, "0x%x", NULL }, { "MinResidency", 4, "0x%x", NULL },
{ "WorstCaseWakeLatency", 4, "0x%x", NULL }, { "WorstCaseWakeLatency", 4, "0x%x", NULL },
{ "Flags", 4, "0x%x", NULL }, { "Flags", 4, "0x%x", NULL },
@ -685,6 +685,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArchCommonNamespaceObjectParser[] = {
CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi, CmArchCommonDeviceHandleAcpiParser), CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi, CmArchCommonDeviceHandleAcpiParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci, CmArchCommonDeviceHandlePciParser), CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci, CmArchCommonDeviceHandlePciParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser), CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser),
CM_PARSER_ADD_OBJECT (EArchCommonObjLpiInfo, CmArchCommonLpiInfoParser),
CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax) CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
}; };
@ -714,7 +715,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo, CmArmProcHierarchyInfoParser), CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo, CmArmProcHierarchyInfoParser),
CM_PARSER_ADD_OBJECT (EArmObjCacheInfo, CmArmCacheInfoParser), CM_PARSER_ADD_OBJECT (EArmObjCacheInfo, CmArmCacheInfoParser),
CM_PARSER_ADD_OBJECT (EArmObjCmn600Info, CmArmCmn600InfoParser), CM_PARSER_ADD_OBJECT (EArmObjCmn600Info, CmArmCmn600InfoParser),
CM_PARSER_ADD_OBJECT (EArmObjLpiInfo, CmArmLpiInfoParser),
CM_PARSER_ADD_OBJECT (EArmObjRmr, CmArmRmrInfoParser), CM_PARSER_ADD_OBJECT (EArmObjRmr, CmArmRmrInfoParser),
CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor, CmArmMemoryRangeDescriptorInfoParser), CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor, CmArmMemoryRangeDescriptorInfoParser),
CM_PARSER_ADD_OBJECT (EArmObjCpcInfo, CmArmCpcInfoParser), CM_PARSER_ADD_OBJECT (EArmObjCpcInfo, CmArmCpcInfoParser),

View File

@ -463,18 +463,17 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
| 20 | Processor Hierarchy Info | Move to Arch Common NS | | 20 | Processor Hierarchy Info | Move to Arch Common NS |
| 21 | Cache Info | Move to Arch Common NS | | 21 | Cache Info | Move to Arch Common NS |
| 22 | CMN 600 Info | | | 22 | CMN 600 Info | |
| 23 | Low Power Idle State Info | Move to Arch Common NS | | 23 | Reserved Memory Range Node | |
| 24 | Reserved Memory Range Node | | | 24 | Memory Range Descriptor | |
| 25 | Memory Range Descriptor | | | 25 | Continuous Performance Control Info | Move to Arch Common NS |
| 26 | Continuous Performance Control Info | Move to Arch Common NS | | 26 | Pcc Subspace Type 0 Info | Move to Arch Common NS |
| 27 | Pcc Subspace Type 0 Info | Move to Arch Common NS | | 27 | Pcc Subspace Type 1 Info | Move to Arch Common NS |
| 28 | Pcc Subspace Type 1 Info | Move to Arch Common NS | | 28 | Pcc Subspace Type 2 Info | Move to Arch Common NS |
| 29 | Pcc Subspace Type 2 Info | Move to Arch Common NS | | 29 | Pcc Subspace Type 3 Info | Move to Arch Common NS |
| 30 | Pcc Subspace Type 3 Info | Move to Arch Common NS | | 30 | Pcc Subspace Type 4 Info | Move to Arch Common NS |
| 31 | Pcc Subspace Type 4 Info | Move to Arch Common NS | | 31 | Pcc Subspace Type 5 Info | Move to Arch Common NS |
| 32 | Pcc Subspace Type 5 Info | Move to Arch Common NS | | 32 | Embedded Trace Extension/Module Info | |
| 33 | Embedded Trace Extension/Module Info | | | 33 | P-State Dependency (PSD) Info | Move to Arch Common NS |
| 34 | P-State Dependency (PSD) Info | Move to Arch Common NS |
| `*` | All other values are reserved. | | | `*` | All other values are reserved. | |
#### Object ID's in the Arch Common Namespace: #### Object ID's in the Arch Common Namespace:
@ -496,4 +495,5 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
| 12 | Device Handle Acpi | | | 12 | Device Handle Acpi | |
| 13 | Device Handle PCI | | | 13 | Device Handle PCI | |
| 14 | Generic Initiator Affinity Info | | | 14 | Generic Initiator Affinity Info | |
| 15 | Low Power Idle State Info | |
| `*` | All other values are reserved. | | | `*` | All other values are reserved. | |