summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Include
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-02-22 17:42:27 +0000
committerSami Mujawar <sami.mujawar@arm.com>2019-06-11 08:36:18 +0100
commit77db115601fb0455642bb63ec0e0e4df3ce05a2e (patch)
tree6ea6f4accfd3dec126e9d983e8b84cdb3912b42c /DynamicTablesPkg/Include
parent8349b8683640cc73522e5728d6f9ea2a45487be8 (diff)
downloadedk2-77db115601fb0455642bb63ec0e0e4df3ce05a2e.tar.gz
edk2-77db115601fb0455642bb63ec0e0e4df3ce05a2e.tar.bz2
edk2-77db115601fb0455642bb63ec0e0e4df3ce05a2e.zip
DynamicTablesPkg: Add dynamic PPTT table generation support
The PPTT generator uses the configuration manager protocol to obtain information about platform's processor topology and caches. This data is then used to generate the PPTT table. The table generator supports ACPI 6.3, PPTT table revision 2. The dynamic PPTT generator also carries out extensive input validation which includes cycle detection and MADT-PPTT cross-validation. A number of architectural compliance checks are also performed. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Include')
-rw-r--r--DynamicTablesPkg/Include/AcpiTableGenerator.h3
-rw-r--r--DynamicTablesPkg/Include/ArmNameSpaceObjects.h95
-rw-r--r--DynamicTablesPkg/Include/ConfigurationManagerObject.h22
-rw-r--r--DynamicTablesPkg/Include/TableGenerator.h3
4 files changed, 118 insertions, 5 deletions
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index c4ef05965f..7d6d344227 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -51,6 +51,8 @@ The Dynamic Tables Framework implements the following ACPI table generators:
from the Configuration Manager and builds the MCFG table.
- IORT : The IORT generator collates the IO Topology information from the
Configuration Manager and builds the IORT table.
+ - PPTT : The PPTT generator collates the processor topology information from
+ the Configuration Manager and builds the PPTT table.
*/
/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
@@ -72,6 +74,7 @@ typedef enum StdAcpiTableId {
EStdAcpiTableIdSpcr, ///< SPCR Generator
EStdAcpiTableIdMcfg, ///< MCFG Generator
EStdAcpiTableIdIort, ///< IORT Generator
+ EStdAcpiTableIdPptt, ///< PPTT Generator
EStdAcpiTableIdMax
} ESTD_ACPI_TABLE_ID;
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index d9dcca12db..19c47ef655 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -48,6 +48,10 @@ typedef enum ArmObjectID {
EArmObjGicItsIdentifierArray, ///< 24 - GIC ITS Identifier Array
EArmObjIdMappingArray, ///< 25 - ID Mapping Array
EArmObjSmmuInterruptArray, ///< 26 - SMMU Interrupt Array
+ EArmObjProcHierarchyInfo, ///< 27 - Processor Hierarchy Info
+ EArmObjCacheInfo, ///< 28 - Cache Info
+ EArmObjProcNodeIdInfo, ///< 29 - Processor Hierarchy Node ID Info
+ EArmObjCmRef, ///< 30 - CM Object Reference
EArmObjMax
} EARM_OBJECT_ID;
@@ -628,6 +632,97 @@ typedef struct CmArmSmmuInterrupt {
UINT32 Flags;
} CM_ARM_SMMU_INTERRUPT;
+/** A structure that describes the Processor Hierarchy Node (Type 0) in PPTT
+
+ ID: EArmObjProcHierarchyInfo
+*/
+typedef struct CmArmProcHierarchyInfo {
+ /// A unique token used to identify this object
+ CM_OBJECT_TOKEN Token;
+ /// Processor structure flags (ACPI 6.3 - January 2019, PPTT, Table 5-155)
+ UINT32 Flags;
+ /// 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;
+ /// Number of resources private to this Node
+ UINT32 NoOfPrivateResources;
+ /// Token of the array which contains references to the resources private to
+ /// this CM_ARM_PROC_HIERARCHY_INFO instance. This field is ignored if
+ /// the NoOfPrivateResources is 0, in which case it is recomended to set
+ /// this field to CM_NULL_TOKEN.
+ CM_OBJECT_TOKEN PrivateResourcesArrayToken;
+} CM_ARM_PROC_HIERARCHY_INFO;
+
+/** A structure that describes the Cache Type Structure (Type 1) in PPTT
+
+ ID: EArmObjCacheInfo
+*/
+typedef struct CmArmCacheInfo {
+ /// A unique token used to identify this object
+ CM_OBJECT_TOKEN Token;
+ /// Reference token for the next level of cache that is private to the same
+ /// CM_ARM_PROC_HIERARCHY_INFO instance. A value of CM_NULL_TOKEN means this
+ /// entry represents the last cache level appropriate to the processor
+ /// hierarchy node structures using this entry.
+ CM_OBJECT_TOKEN NextLevelOfCacheToken;
+ /// Size of the cache in bytes
+ UINT32 Size;
+ /// Number of sets in the cache
+ UINT32 NumberOfSets;
+ /// Integer number of ways. The maximum associativity supported by
+ /// ACPI Cache type structure is limited to MAX_UINT8. However,
+ /// the maximum number of ways supported by the architecture is
+ /// PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX. Therfore this field
+ /// is 32-bit wide.
+ UINT32 Associativity;
+ /// Cache attributes (ACPI 6.3 - January 2019, PPTT, Table 5-156)
+ UINT8 Attributes;
+ /// Line size in bytes
+ UINT16 LineSize;
+} CM_ARM_CACHE_INFO;
+
+/** A structure that describes the ID Structure (Type 2) in PPTT
+
+ ID: EArmObjProcNodeIdInfo
+*/
+typedef struct CmArmProcNodeIdInfo {
+ /// A unique token used to identify this object
+ CM_OBJECT_TOKEN Token;
+ // Vendor ID (as described in ACPI ID registry)
+ UINT32 VendorId;
+ /// First level unique node ID
+ UINT64 Level1Id;
+ /// Second level unique node ID
+ UINT64 Level2Id;
+ /// Major revision of the node
+ UINT16 MajorRev;
+ /// Minor revision of the node
+ UINT16 MinorRev;
+ /// Spin revision of the node
+ UINT16 SpinRev;
+} CM_ARM_PROC_NODE_ID_INFO;
+
+/** A structure that describes a reference to another Configuration Manager
+ object.
+
+ This is useful for creating an array of reference tokens. The framework
+ can then query the configuration manager for these arrays using the
+ object ID EArmObjCmRef.
+
+ This can be used is to represent one-to-many relationships between objects.
+
+ ID: EArmObjCmRef
+*/
+typedef struct CmArmObjRef {
+ /// Token of the CM object being referenced
+ CM_OBJECT_TOKEN ReferenceToken;
+} CM_ARM_OBJ_REF;
+
#pragma pack()
#endif // ARM_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
index 3bd4273d25..b0d3e709ec 100644
--- a/DynamicTablesPkg/Include/ConfigurationManagerObject.h
+++ b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
@@ -63,10 +63,24 @@ Object ID's in the ARM Namespace:
10 - Serial Debug Port Info
11 - Generic Timer Info
12 - Platform GT Block Info
- 13 - Platform Generic Watchdog
- 14 - PCI Configuration Space Info
- 15 - Hypervisor Vendor Id
- 16 - Fixed feature flags for FADT
+ 13 - Generic Timer Block Frame Info
+ 14 - Platform Generic Watchdog
+ 15 - PCI Configuration Space Info
+ 16 - Hypervisor Vendor Id
+ 17 - Fixed feature flags for FADT
+ 18 - ITS Group
+ 19 - Named Component
+ 20 - Root Complex
+ 21 - SMMUv1 or SMMUv2
+ 22 - SMMUv3
+ 23 - PMCG
+ 24 - GIC ITS Identifier Array
+ 25 - ID Mapping Array
+ 26 - SMMU Interrupt Array
+ 27 - Processor Hierarchy Info
+ 28 - Cache Info
+ 29 - Processor Hierarchy Node ID Info
+ 30 - CM Object Reference
*/
typedef UINT32 CM_OBJECT_ID;
diff --git a/DynamicTablesPkg/Include/TableGenerator.h b/DynamicTablesPkg/Include/TableGenerator.h
index d39868a41c..da6434a48b 100644
--- a/DynamicTablesPkg/Include/TableGenerator.h
+++ b/DynamicTablesPkg/Include/TableGenerator.h
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2017, ARM Limited. All rights reserved.
+ Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -55,6 +55,7 @@ _______________________________________________________________________________
7 - DBG2
8 - SPCR
9 - MCFG
+ 10 - PPTT
Standard SMBIOS Table IDs:
0 - Reserved