From 9455c8536ef458262ce1b23872c1d85d6c20eb41 Mon Sep 17 00:00:00 2001 From: Yeoreum Yun Date: Mon, 10 Aug 2026 12:04:11 +0100 Subject: [PATCH] DynamicTablesPkg: introduce Arm coresight PMU CM object To generate Arm Performance Moniteroing Unit Table (APMT), introduce Arm coresight PMU CM object. Signed-off-by: Yeoreum Yun --- .../Include/ArmNameSpaceObjects.h | 62 +++++++++++++++++++ .../ConfigurationManagerObjectParser.c | 18 ++++++ 2 files changed, 80 insertions(+) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h index 0bdb12a059..f4ba0b05eb 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -55,6 +55,7 @@ typedef enum ArmObjectID { EArmObjDmc620PmuRegInfo, ///< 25 - DMC620 PMU Reg Info EArmObjProcessorSpecificBlockInfo, ///< 26 - Processor Specific Block. EArmObjProcessorSpecificSubDataArchInfo, ///< 27 - Processor Specific Sub Data (ArchData) + EArmObjCoresightPmuInfo, ///< 28 - Coresight PMU Info EArmObjMax } EARM_OBJECT_ID; @@ -873,4 +874,65 @@ typedef struct CmArmProcessorSpecificSubDataArchInfo { UINT64 IdAA64Zfr0; } CM_ARM_PROCESSOR_SPECIFIC_SUB_DATA_ARCH_INFO; +/** A structure that describes Coresight PMU information. + + ID: EArmObjCoresightPmuInfo +*/ +typedef struct CmArmCoresightPmuInfo { + /// Node Flags. + UINT8 Flags; + + /// Node Type. + UINT16 Type; + + /// Unique identifier for this node. + UINT32 Identifier; + + /// Base address of Page 0 of the PMU. + UINT64 BaseAddress0; + + /// + /// Base address of Page 1 of the PMU if the PMU + /// implements the dual-page extension otherwise 0. + /// + UINT64 BaseAddress1; + + /// Overflow Interrupt. + UINT32 OverflowInterrupt; + + /// Overflow Interrupt Flags. + UINT32 OverflowInterruptFlags; + + /// Proc node token for processor affinity + CM_OBJECT_TOKEN ProcNodeToken; + + /// + /// Token pointing to the monitored device. + /// The Token is evaluated in regards to the node Type and might resolve + /// to a CM Object such as CPU cache, Smmu and etc. + /// + CM_OBJECT_TOKEN TypeInstanceToken; + + /// + /// This is valid when type is EFI_ACPI_APMT_NODE_TYPE_ACPI_DEVICE only. + /// Specify the associated acpi device's HID with this Coresight PMU + /// including NULL characther. + /// + CHAR8 AcpiDeviceHid[9]; + + /// + /// This is valid when type is EFI_ACPI_APMT_NODE_TYPE_ACPI_DEVICE only. + /// Specify the associated acpi device's UID with this Coresight PMU. + /// + UINT32 AcpiDeviceUid; + + /// + /// This field is used for specifying the identity of the + /// implementer of this PMU. + /// This field must be set to 0 and ignored if the + /// PMIIDR or PMPIDR register is present in this PMU implementation. + /// + UINT32 ImplementationId; +} CM_ARM_CORESIGHT_PMU_INFO; + #pragma pack() diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c index 7f1e5205c4..20ae13d4b1 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c @@ -469,6 +469,23 @@ STATIC CONST CM_OBJ_PARSER CmArmProcessorSpecificSubDataArchInfoParser[] = { { "IdAA64Zfr0", sizeof (UINT64), "0x%llx", NULL }, }; +/** A parser for EArmObjCoresightPmuInfo. +*/ +STATIC CONST CM_OBJ_PARSER CmArmCoresightPmuInfoParser[] = { + { "Flags", sizeof (UINT8), "0x%x", NULL }, + { "Type", sizeof (UINT16), "0x%x", NULL }, + { "Identifier", sizeof (UINT32), "0x%x", NULL }, + { "BaseAddress0", sizeof (UINT64), "0x%llx", NULL }, + { "BaseAddress1", sizeof (UINT64), "0x%llx", NULL }, + { "OverflowInterrupt", sizeof (UINT32), "0x%x", NULL }, + { "OverflowInterruptFlags", sizeof (UINT32), "0x%x", NULL }, + { "ProcNodeToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "TypeInstanceToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "AcpiDeviceHid", sizeof (CHAR8) * 9, "0x%a", PrintString }, + { "AcpiDeviceUid", sizeof (UINT32), "0x%x", NULL }, + { "ImplementationId", sizeof (UINT32), "0x%x", NULL }, +}; + /** A parser for EArmObjCmn600Info. */ STATIC CONST CM_OBJ_PARSER CmArmCmn600InfoParser[] = { @@ -1588,6 +1605,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = { CM_PARSER_ADD_OBJECT (EArmObjDmc620PmuRegInfo, CmArmDmc620PmuRegInfoParser), CM_PARSER_ADD_OBJECT (EArmObjProcessorSpecificBlockInfo, CmArmProcessorSpecificBlockInfoParser), CM_PARSER_ADD_OBJECT (EArmObjProcessorSpecificSubDataArchInfo,CmArmProcessorSpecificSubDataArchInfoParser), + CM_PARSER_ADD_OBJECT (EArmObjCoresightPmuInfo, CmArmCoresightPmuInfoParser), CM_PARSER_ADD_OBJECT_RESERVED (EArmObjMax) };