From: Sami Mujawar <sami.muja...@arm.com> 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.gond...@arm.com> Cc: Yeo Reum Yun <yeoreum....@arm.com> Cc: AbdulLateef Attar <abdullateef.at...@amd.com> Cc: Jeshua Smith <jesh...@nvidia.com> Cc: Jeff Brasen <jbra...@nvidia.com> Cc: Girish Mahadevan <gmahade...@nvidia.com> Cc: Leif Lindholm <quic_llind...@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggar...@nxp.com> Signed-off-by: Sami Mujawar <sami.muja...@arm.com> Signed-off-by: Pierre Gondois <pierre.gond...@arm.com> --- .../Include/ArchCommonNameSpaceObjects.h | 64 ++++++++++++++ .../Include/ArmNameSpaceObjects.h | 88 +++---------------- .../SsdtCpuTopologyGenerator.c | 27 +++--- .../SsdtCpuTopologyGenerator.h | 6 +- .../DynamicPlatRepoLib/CmObjectTokenFixer.c | 21 +++-- .../ConfigurationManagerObjectParser.c | 6 +- DynamicTablesPkg/Readme.md | 24 ++--- 7 files changed, 118 insertions(+), 118 deletions(-) diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h index b70c327d46e4..681e84501960 100644 --- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h @@ -35,6 +35,7 @@ typedef enum ArchCommonObjectID { EArchCommonObjDeviceHandleAcpi, ///< 12 - Device Handle Acpi EArchCommonObjDeviceHandlePci, ///< 13 - Device Handle Pci EArchCommonObjGenericInitiatorAffinityInfo, ///< 14 - Generic Initiator Affinity + EArchCommonObjLpiInfo, ///< 15 - Lpi Info EArchCommonObjMax } EARCH_COMMON_OBJECT_ID; @@ -295,6 +296,69 @@ typedef struct CmArchCommonGenericInitiatorAffinityInfo { CM_OBJECT_TOKEN DeviceHandleToken; } 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() #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_ diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index ddf886a53db4..e019323c1fcd 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -51,18 +51,17 @@ typedef enum ArmObjectID { EArmObjProcHierarchyInfo, ///< 20 - Processor Hierarchy Info EArmObjCacheInfo, ///< 21 - Cache Info EArmObjCmn600Info, ///< 22 - CMN-600 Info - EArmObjLpiInfo, ///< 23 - Lpi Info - EArmObjRmr, ///< 24 - Reserved Memory Range Node - EArmObjMemoryRangeDescriptor, ///< 25 - Memory Range Descriptor - EArmObjCpcInfo, ///< 26 - Continuous Performance Control Info - EArmObjPccSubspaceType0Info, ///< 27 - Pcc Subspace Type 0 Info - EArmObjPccSubspaceType1Info, ///< 28 - Pcc Subspace Type 2 Info - EArmObjPccSubspaceType2Info, ///< 29 - Pcc Subspace Type 2 Info - EArmObjPccSubspaceType3Info, ///< 30 - Pcc Subspace Type 3 Info - EArmObjPccSubspaceType4Info, ///< 31 - Pcc Subspace Type 4 Info - EArmObjPccSubspaceType5Info, ///< 32 - Pcc Subspace Type 5 Info - EArmObjEtInfo, ///< 33 - Embedded Trace Extension/Module Info - EArmObjPsdInfo, ///< 34 - P-State Dependency (PSD) Info + EArmObjRmr, ///< 23 - Reserved Memory Range Node + EArmObjMemoryRangeDescriptor, ///< 24 - Memory Range Descriptor + EArmObjCpcInfo, ///< 25 - Continuous Performance Control Info + EArmObjPccSubspaceType0Info, ///< 26 - Pcc Subspace Type 0 Info + EArmObjPccSubspaceType1Info, ///< 27 - Pcc Subspace Type 2 Info + EArmObjPccSubspaceType2Info, ///< 28 - Pcc Subspace Type 2 Info + EArmObjPccSubspaceType3Info, ///< 29 - Pcc Subspace Type 3 Info + EArmObjPccSubspaceType4Info, ///< 30 - Pcc Subspace Type 4 Info + EArmObjPccSubspaceType5Info, ///< 31 - Pcc Subspace Type 5 Info + EArmObjEtInfo, ///< 32 - Embedded Trace Extension/Module Info + EArmObjPsdInfo, ///< 33 - P-State Dependency (PSD) Info EArmObjMax } EARM_OBJECT_ID; @@ -672,7 +671,7 @@ typedef struct CmArmProcHierarchyInfo { CM_OBJECT_TOKEN PrivateResourcesArrayToken; /// Optional field: Reference Token for the Lpi state of this processor. /// 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; /// Set to TRUE if UID should override index for name and _UID /// for processor container nodes and name of processors. @@ -749,69 +748,6 @@ typedef struct CmArmCmn600Info { CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4]; } 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 RMR node for the Platform. diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index 994733a4e9c2..6ce7b71fac8b 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -40,7 +40,7 @@ Requirements: - EArmObjGicCInfo - EArmObjProcHierarchyInfo (OPTIONAL) along with - EArchCommonObjCmRef (OPTIONAL) - - EArmObjLpiInfo (OPTIONAL) + - EArchCommonObjLpiInfo (OPTIONAL) - GetEArmObjEtInfo (OPTIONAL) - EArmObjPsdInfo (OPTIONAL) */ @@ -79,9 +79,9 @@ GET_OBJECT_LIST ( information from the Configuration Manager. */ GET_OBJECT_LIST ( - EObjNameSpaceArm, - EArmObjLpiInfo, - CM_ARM_LPI_INFO + EObjNameSpaceArchCommon, + EArchCommonObjLpiInfo, + CM_ARCH_COMMON_LPI_INFO ); /** @@ -118,7 +118,7 @@ GET_OBJECT_LIST ( One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO 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) than the number of cpus/clusters (CM_ARM_PROC_HIERARCHY_INFO). @@ -696,12 +696,12 @@ GenerateLpiStates ( UINT32 Index; UINT32 LastIndex; - AML_OBJECT_NODE_HANDLE LpiNode; - CM_ARCH_COMMON_OBJ_REF *LpiRefInfo; - UINT32 LpiRefInfoCount; - UINT32 LpiRefIndex; - CM_ARM_LPI_INFO *LpiInfo; - CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; + AML_OBJECT_NODE_HANDLE LpiNode; + CM_ARCH_COMMON_OBJ_REF *LpiRefInfo; + UINT32 LpiRefInfoCount; + UINT32 LpiRefIndex; + CM_ARCH_COMMON_LPI_INFO *LpiInfo; + CHAR8 AslName[AML_NAME_SEG_SIZE + 1]; ASSERT (Generator != NULL); ASSERT (Generator->TokenTable.Table != NULL); @@ -739,8 +739,9 @@ GenerateLpiStates ( } for (LpiRefIndex = 0; LpiRefIndex < LpiRefInfoCount; LpiRefIndex++) { - // For each CM_ARM_LPI_INFO referenced by the token, add an Lpi state. - Status = GetEArmObjLpiInfo ( + // For each CM_ARCH_COMMON_LPI_INFO referenced by the token, + // add an Lpi state. + Status = GetEArchCommonObjLpiInfo ( CfgMgrProtocol, LpiRefInfo[LpiRefIndex].ReferenceToken, &LpiInfo, diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h index d6561e33da11..889711789fa0 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h @@ -70,7 +70,7 @@ /** A structure used to handle the Lpi structures referencing. 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: (Cpu0) (Cpu1) @@ -86,7 +86,7 @@ | | v v (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 structures reference the same CM_ARCH_COMMON_OBJ_REF. An entry is created in the @@ -118,7 +118,7 @@ */ typedef struct TokenTable { /// 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; /// Last used index of the TokenTable. diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c index 5f3e9f5fdcb5..de3338d10884 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c @@ -166,18 +166,17 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] = { TokenFixerNotImplemented, ///< 20 - Processor Hierarchy Info TokenFixerNotImplemented, ///< 21 - Cache Info NULL, ///< 22 - CMN-600 Info - NULL, ///< 23 - Lpi Info - NULL, ///< 24 - Reserved Memory Range Node - NULL, ///< 25 - Memory Range Descriptor - NULL, ///< 26 - Continuous Performance Control Info - NULL, ///< 27 - Pcc Subspace Type 0 Info + NULL, ///< 23 - Reserved Memory Range Node + NULL, ///< 24 - Memory Range Descriptor + NULL, ///< 25 - Continuous Performance Control Info + NULL, ///< 26 - Pcc Subspace Type 0 Info + NULL, ///< 27 - Pcc Subspace Type 2 Info NULL, ///< 28 - Pcc Subspace Type 2 Info - NULL, ///< 29 - Pcc Subspace Type 2 Info - NULL, ///< 30 - Pcc Subspace Type 3 Info - NULL, ///< 31 - Pcc Subspace Type 4 Info - NULL, ///< 32 - Pcc Subspace Type 5 Info - NULL, ///< 33 - Embedded Trace Extension/Module Info - NULL ///< 34 - P-State Dependency (PSD) Info + NULL, ///< 29 - Pcc Subspace Type 3 Info + NULL, ///< 30 - Pcc Subspace Type 4 Info + NULL, ///< 31 - Pcc Subspace Type 5 Info + NULL, ///< 32 - Embedded Trace Extension/Module Info + NULL ///< 33 - P-State Dependency (PSD) Info }; /** CmObj token fixer. diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index 732454da8f93..050cd04d09c2 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -417,9 +417,9 @@ STATIC CONST CM_OBJ_PARSER AcpiGenericAddressParser[] = { { "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 }, { "WorstCaseWakeLatency", 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 (EArchCommonObjDeviceHandlePci, CmArchCommonDeviceHandlePciParser), CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser), + CM_PARSER_ADD_OBJECT (EArchCommonObjLpiInfo, CmArchCommonLpiInfoParser), 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 (EArmObjCacheInfo, CmArmCacheInfoParser), CM_PARSER_ADD_OBJECT (EArmObjCmn600Info, CmArmCmn600InfoParser), - CM_PARSER_ADD_OBJECT (EArmObjLpiInfo, CmArmLpiInfoParser), CM_PARSER_ADD_OBJECT (EArmObjRmr, CmArmRmrInfoParser), CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor, CmArmMemoryRangeDescriptorInfoParser), CM_PARSER_ADD_OBJECT (EArmObjCpcInfo, CmArmCpcInfoParser), diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md index 303f85986566..055836a7e31e 100644 --- a/DynamicTablesPkg/Readme.md +++ b/DynamicTablesPkg/Readme.md @@ -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 | | 21 | Cache Info | Move to Arch Common NS | | 22 | CMN 600 Info | | -| 23 | Low Power Idle State Info | Move to Arch Common NS | -| 24 | Reserved Memory Range Node | | -| 25 | Memory Range Descriptor | | -| 26 | Continuous Performance Control Info | Move to Arch Common NS | -| 27 | Pcc Subspace Type 0 Info | Move to Arch Common NS | -| 28 | Pcc Subspace Type 1 Info | Move to Arch Common NS | -| 29 | Pcc Subspace Type 2 Info | Move to Arch Common NS | -| 30 | Pcc Subspace Type 3 Info | Move to Arch Common NS | -| 31 | Pcc Subspace Type 4 Info | Move to Arch Common NS | -| 32 | Pcc Subspace Type 5 Info | Move to Arch Common NS | -| 33 | Embedded Trace Extension/Module Info | | -| 34 | P-State Dependency (PSD) Info | Move to Arch Common NS | +| 23 | Reserved Memory Range Node | | +| 24 | Memory Range Descriptor | | +| 25 | Continuous Performance Control Info | Move to Arch Common NS | +| 26 | 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 2 Info | Move to Arch Common NS | +| 29 | 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 5 Info | Move to Arch Common NS | +| 32 | Embedded Trace Extension/Module Info | | +| 33 | P-State Dependency (PSD) Info | Move to Arch Common NS | | `*` | All other values are reserved. | | #### 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 | | | 13 | Device Handle PCI | | | 14 | Generic Initiator Affinity Info | | +| 15 | Low Power Idle State Info | | | `*` | All other values are reserved. | | -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116986): https://edk2.groups.io/g/devel/message/116986 Mute This Topic: https://groups.io/mt/105068159/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-