]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: Add CM_ARM_LPI_INFO object
authorPierre Gondois <Pierre.Gondois@arm.com>
Fri, 8 Oct 2021 14:46:31 +0000 (15:46 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 8 Oct 2021 15:39:42 +0000 (15:39 +0000)
Introduce the CM_ARM_LPI_INFO CmObj in the ArmNameSpaceObjects.
This allows to describe LPI state information, as described in
ACPI 6.4, s8.4.4.3 "_LPI (Low Power Idle States)".

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
DynamicTablesPkg/Include/ArmNameSpaceObjects.h
DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c

index 2244eafaf00939ba36a3fdf021515fcb1e152764..f19c9c70666970bb70b6aa09f064bb10a9a67112 100644 (file)
@@ -58,6 +58,7 @@ typedef enum ArmObjectID {
   EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity\r
   EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info\r
   EArmObjCmn600Info,                   ///< 36 - CMN-600 Info\r
+  EArmObjLpiInfo,                      ///< 37 - Lpi Info\r
   EArmObjMax\r
 } EARM_OBJECT_ID;\r
 \r
@@ -711,6 +712,10 @@ typedef struct CmArmProcHierarchyInfo {
   /// the NoOfPrivateResources is 0, in which case it is recommended to set\r
   /// this field to CM_NULL_TOKEN.\r
   CM_OBJECT_TOKEN   PrivateResourcesArrayToken;\r
+  /// Optional field: Reference Token for the Lpi state of this processor.\r
+  /// Token identifying a CM_ARM_OBJ_REF structure, itself referencing\r
+  /// CM_ARM_LPI_INFO objects.\r
+  CM_OBJECT_TOKEN   LpiToken;\r
 } CM_ARM_PROC_HIERARCHY_INFO;\r
 \r
 /** A structure that describes the Cache Type Structure (Type 1) in PPTT\r
@@ -878,6 +883,69 @@ typedef struct CmArmCmn600Info {
   CM_ARM_EXTENDED_INTERRUPT  DtcInterrupt[4];\r
 } CM_ARM_CMN_600_INFO;\r
 \r
+/** A structure that describes the Lpi information.\r
+\r
+  The Low Power Idle states are described in DSDT/SSDT and associated\r
+  to cpus/clusters in the cpu topology.\r
+\r
+  ID: EArmObjLpiInfo\r
+*/\r
+typedef struct CmArmLpiInfo {\r
+  /** Minimum Residency. Time in microseconds after which a\r
+      state becomes more energy efficient than any shallower state.\r
+  */\r
+  UINT32                                  MinResidency;\r
+\r
+  /** Worst case time in microseconds from a wake interrupt\r
+      being asserted to the return to a running state\r
+  */\r
+  UINT32                                  WorstCaseWakeLatency;\r
+\r
+  /** Flags.\r
+  */\r
+  UINT32                                  Flags;\r
+\r
+  /** Architecture specific context loss flags.\r
+  */\r
+  UINT32                                  ArchFlags;\r
+\r
+  /** Residency counter frequency in cycles-per-second (Hz).\r
+  */\r
+  UINT32                                  ResCntFreq;\r
+\r
+  /** Every shallower power state in the parent is also enabled.\r
+  */\r
+  UINT32                                  EnableParentState;\r
+\r
+  /** The EntryMethod _LPI field can be described as an integer\r
+      or in a Register resource data descriptor.\r
+\r
+  If IsInteger is TRUE, the IntegerEntryMethod field is used.\r
+  If IsInteger is FALSE, the RegisterEntryMethod field is used.\r
+  */\r
+  BOOLEAN                                 IsInteger;\r
+\r
+  /** EntryMethod described as an Integer.\r
+  */\r
+  UINT64                                  IntegerEntryMethod;\r
+\r
+  /** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.\r
+  */\r
+  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  RegisterEntryMethod;\r
+\r
+  /** Residency counter register.\r
+  */\r
+  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  ResidencyCounterRegister;\r
+\r
+  /** Usage counter register.\r
+  */\r
+  EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE  UsageCounterRegister;\r
+\r
+  /** String representing the Lpi state\r
+  */\r
+  CHAR8                                   StateName[16];\r
+} CM_ARM_LPI_INFO;\r
+\r
 #pragma pack()\r
 \r
 #endif // ARM_NAMESPACE_OBJECTS_H_\r
index ee2918ab5cc6b68517ac1734328c1d530e1806c0..2337d47e3fb33eaef5b8c58dc3ec109f7b3e4c85 100644 (file)
@@ -368,6 +368,39 @@ STATIC CONST CM_OBJ_PARSER CmArmCmn600InfoParser[] = {
   {"DtcFlags[3]", 4, "0x%x", NULL}\r
 };\r
 \r
+/** A parser for the EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE structure.\r
+*/\r
+STATIC CONST CM_OBJ_PARSER AcpiGenericAddressParser[] = {\r
+  {"AddressSpaceId", 1, "%d", NULL},\r
+  {"RegisterBitWidth", 1, "%d", NULL},\r
+  {"RegisterBitOffset", 1, "%d", NULL},\r
+  {"AccessSize", 1, "%d", NULL},\r
+  {"Address", 8, "0x%llx", NULL},\r
+};\r
+\r
+/** A parser for EArmObjLpiInfo.\r
+*/\r
+STATIC CONST CM_OBJ_PARSER CmArmLpiInfoParser[] = {\r
+  {"MinResidency", 4, "0x%llx", NULL},\r
+  {"WorstCaseWakeLatency", 4, "0x%llx", NULL},\r
+  {"Flags", 4, "0x%llx", NULL},\r
+  {"ArchFlags", 4, "0x%llx", NULL},\r
+  {"ResCntFreq", 4, "0x%llx", NULL},\r
+  {"EnableParentState", 4, "0x%llx", NULL},\r
+  {"IsInteger", 1, "%d", NULL},\r
+  {"IntegerEntryMethod", 8, "0x%llx", NULL},\r
+  {"RegisterEntryMethod", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),\r
+    NULL, NULL, AcpiGenericAddressParser,\r
+    ARRAY_SIZE (AcpiGenericAddressParser)},\r
+  {"ResidencyCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),\r
+    NULL, NULL, AcpiGenericAddressParser,\r
+    ARRAY_SIZE (AcpiGenericAddressParser)},\r
+  {"UsageCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),\r
+    NULL, NULL, AcpiGenericAddressParser,\r
+    ARRAY_SIZE (AcpiGenericAddressParser)},\r
+  {"StateName", 16, "0x%a", NULL},\r
+};\r
+\r
 /** A parser for Arm namespace objects.\r
 */\r
 STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {\r
@@ -440,6 +473,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
     ARRAY_SIZE (CmArmSerialPortInfoParser)},\r
   {"EArmObjCmn600Info", CmArmCmn600InfoParser,\r
     ARRAY_SIZE (CmArmCmn600InfoParser)},\r
+  {"EArmObjLpiInfo", CmArmLpiInfoParser,\r
+      ARRAY_SIZE (CmArmLpiInfoParser)},\r
   {"EArmObjMax", NULL, 0},\r
 };\r
 \r