public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second)
@ 2024-03-21 15:59 PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 01/19] DynamicTablesPkg: Move Pci Address Map Info to Arch Common PierreGondois
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

Following [1] and [2], other architectures than Arm aim to leverage
the DynamicTablesPkg. The package uses namespaces/domains to split
objects IDs. Currently most of the objects are part of the Arm
namespace. Some objects are generic enough to be re-used by other
architectures.

In [2], an Arch Common namespace Id was created and some objects
present in the Arm namespace were identified to be moved to this
Arch Common namespace.
Continue the effort by moving these objects to this new namespace.

Some platforms rely on the DynamicTablesPkg and its namespace
organization. Additional patches matching this change for the:
- Juno
- VExpress
platforms will be submitted along this patchset.

As the actual patchset is more than 20 patches, split it in
two parts to avoid being detected as a spam/fraudulous activity.
The first part of the patchset is available at:
- https://edk2.groups.io/g/devel/message/116961

A branch holding the whole patchset is available at:
- https://github.com/pierregondois/edk2/tree/sami/arch_common_obj_sent

[1] Branch to reorg Dynamic Tables & support other arch
https://edk2.groups.io/g/devel/topic/104054584#116308
[2] DynamicTablesPkg: Arch Common Namespace
https://edk2.groups.io/g/devel/message/116330

Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Pierre Gondois <Pierre.Gondois@arm.com>
Cc: Yeo Reum Yun <YeoReum.Yun@arm.com>
Cc: Sunil V L <sunilvl@ventanamicro.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>

Sami Mujawar (19):
  DynamicTablesPkg: Move Pci Address Map Info to Arch Common
  DynamicTablesPkg: Move CM_ARM_GENERIC_INTERRUPT struct to Arch Common
  DynamicTablesPkg: Move Pci Interrupt Map Info to Arch Common
  DynamicTablesPkg: Move Mem Affinity Info to Arch Common
  DynamicTablesPkg: Move ACPI device Handle object to Arch Common
  DynamicTablesPkg: Move PCI device Handle object to Arch Common
  DynamicTablesPkg: Move Generic Initiator affinity info to Arch Common
  DynamicTablesPkg: Move LPI info object to Arch Common
  DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info
  DynamicTablesPkg: Move Processor hierarchy info to Arch Common
  DynamicTablesPkg: Move Cache info to Arch Common
  DynamicTablesPkg: Move Continuous perf control info to Arch Common
  DynamicTablesPkg: Move PCC structure definitions to Arch Common
  DynamicTablesPkg: Move PCC Type0 info to Arch Common
  DynamicTablesPkg: Move PCC Type1 info to Arch Common
  DynamicTablesPkg: Move PCC Type2 info to Arch Common
  DynamicTablesPkg: Move PCC Type 3 & 4 info to Arch Common
  DynamicTablesPkg: Move PCC Type 5 info to Arch Common
  DynamicTablesPkg: Move PSD info to Arch Common

 .../Include/ArchCommonNameSpaceObjects.h      | 510 +++++++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 526 +-----------------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 182 +++---
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   5 +-
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 114 ++--
 .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c   |  58 +-
 .../SsdtCmn600Generator.c                     |  16 +-
 .../SsdtCpuTopologyGenerator.c                | 128 ++---
 .../SsdtCpuTopologyGenerator.h                |  24 +-
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    |  56 +-
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  25 +-
 .../ConfigurationManagerObjectParser.c        | 212 +++----
 .../Pci/ArmPciConfigSpaceParser.c             |  40 +-
 .../Pci/ArmPciConfigSpaceParser.h             |  16 +-
 DynamicTablesPkg/Readme.md                    |  67 +--
 15 files changed, 984 insertions(+), 995 deletions(-)

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116978): https://edk2.groups.io/g/devel/message/116978
Mute This Topic: https://groups.io/mt/105068142/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 01/19] DynamicTablesPkg: Move Pci Address Map Info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 02/19] DynamicTablesPkg: Move CM_ARM_GENERIC_INTERRUPT struct " PierreGondois
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move Pci Address Map 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 PCIe generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map
 - FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.

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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 28 ++++++++++
 .../Include/ArmNameSpaceObjects.h             | 52 +++++--------------
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    | 30 +++++------
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 23 ++++----
 .../ConfigurationManagerObjectParser.c        |  6 +--
 .../Pci/ArmPciConfigSpaceParser.c             | 18 +++----
 .../Pci/ArmPciConfigSpaceParser.h             |  4 +-
 DynamicTablesPkg/Readme.md                    | 26 +++++-----
 8 files changed, 93 insertions(+), 94 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 7c70ba023829..bbc5d7dc55cd 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -29,6 +29,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjFixedFeatureFlags,              ///<  6 - Fixed feature flags for FADT
   EArchCommonObjCmRef,                          ///<  7 - CM Object Reference
   EArchCommonObjPciConfigSpaceInfo,             ///<  8 - PCI Configuration Space Info
+  EArchCommonObjPciAddressMapInfo,              ///<  9 - Pci Address Map Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -142,6 +143,33 @@ typedef struct CmArchCommonPciConfigSpaceInfo {
   CM_OBJECT_TOKEN    InterruptMapToken;
 } CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO;
 
+/** A structure that describes a PCI Address Map.
+
+  The memory-ranges used by the PCI bus are described by this object.
+
+  ID: EArchCommonObjPciAddressMapInfo
+*/
+typedef struct CmArchCommonPciAddressMapInfo {
+  /** Pci address space code
+
+  Available values are:
+   - 0: Configuration Space
+   - 1: I/O Space
+   - 2: 32-bit-address Memory Space
+   - 3: 64-bit-address Memory Space
+  */
+  UINT8     SpaceCode;
+
+  /// PCI address
+  UINT64    PciAddress;
+
+  /// Cpu address
+  UINT64    CpuAddress;
+
+  /// Address size
+  UINT64    AddressSize;
+} CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index a701de4bcd60..5b318bbb10c3 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -56,19 +56,18 @@ typedef enum ArmObjectID {
   EArmObjGenericInitiatorAffinityInfo,                         ///< 25 - Generic Initiator Affinity
   EArmObjCmn600Info,                                           ///< 26 - CMN-600 Info
   EArmObjLpiInfo,                                              ///< 27 - Lpi Info
-  EArmObjPciAddressMapInfo,                                    ///< 28 - Pci Address Map Info
-  EArmObjPciInterruptMapInfo,                                  ///< 29 - Pci Interrupt Map Info
-  EArmObjRmr,                                                  ///< 30 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 31 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 32 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 33 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 34 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 35 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 36 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 37 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 38 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 39 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 40 - P-State Dependency (PSD) Info
+  EArmObjPciInterruptMapInfo,                                  ///< 28 - Pci Interrupt Map Info
+  EArmObjRmr,                                                  ///< 29 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 30 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 31 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 32 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 33 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 34 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 35 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 36 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 37 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 38 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 39 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -901,33 +900,6 @@ typedef struct CmArmLpiInfo {
   CHAR8                                     StateName[16];
 } CM_ARM_LPI_INFO;
 
-/** A structure that describes a PCI Address Map.
-
-  The memory-ranges used by the PCI bus are described by this object.
-
-  ID: EArmObjPciAddressMapInfo
-*/
-typedef struct CmArmPciAddressMapInfo {
-  /** Pci address space code
-
-  Available values are:
-   - 0: Configuration Space
-   - 1: I/O Space
-   - 2: 32-bit-address Memory Space
-   - 3: 64-bit-address Memory Space
-  */
-  UINT8     SpaceCode;
-
-  /// PCI address
-  UINT64    PciAddress;
-
-  /// Cpu address
-  UINT64    CpuAddress;
-
-  /// Address size
-  UINT64    AddressSize;
-} CM_ARM_PCI_ADDRESS_MAP_INFO;
-
 /** A structure that describes a PCI Interrupt Map.
 
   The legacy PCI interrupts used by PCI devices are described by this object.
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 2a169e0f6c1c..e86f1cb529f0 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -44,7 +44,7 @@ Requirements:
   this Generator:
   - EArchCommonObjCmRef
   - EArchCommonObjPciConfigSpaceInfo
-  - EArmObjPciAddressMapInfo
+  - EArchCommonObjPciAddressMapInfo
   - EArmObjPciInterruptMapInfo
 */
 
@@ -70,9 +70,9 @@ GET_OBJECT_LIST (
     Address Mapping Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPciAddressMapInfo,
-  CM_ARM_PCI_ADDRESS_MAP_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPciAddressMapInfo,
+  CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO
   );
 
 /** This macro expands to a function that retrieves the Pci
@@ -455,14 +455,14 @@ GeneratePciCrs (
   IN  OUT       AML_OBJECT_NODE_HANDLE                        PciNode
   )
 {
-  EFI_STATUS                   Status;
-  BOOLEAN                      Translation;
-  UINT32                       Index;
-  CM_ARCH_COMMON_OBJ_REF       *RefInfo;
-  UINT32                       RefCount;
-  CM_ARM_PCI_ADDRESS_MAP_INFO  *AddrMapInfo;
-  AML_OBJECT_NODE_HANDLE       CrsNode;
-  BOOLEAN                      IsPosDecode;
+  EFI_STATUS                           Status;
+  BOOLEAN                              Translation;
+  UINT32                               Index;
+  CM_ARCH_COMMON_OBJ_REF               *RefInfo;
+  UINT32                               RefCount;
+  CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO  *AddrMapInfo;
+  AML_OBJECT_NODE_HANDLE               CrsNode;
+  BOOLEAN                              IsPosDecode;
 
   ASSERT (Generator != NULL);
   ASSERT (CfgMgrProtocol != NULL);
@@ -506,7 +506,7 @@ GeneratePciCrs (
   }
 
   // Get the array of CM_ARCH_COMMON_OBJ_REF referencing the
-  // CM_ARM_PCI_ADDRESS_MAP_INFO objects.
+  // CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO objects.
   Status = GetEArchCommonObjCmRef (
              CfgMgrProtocol,
              PciInfo->AddressMapToken,
@@ -519,8 +519,8 @@ GeneratePciCrs (
   }
 
   for (Index = 0; Index < RefCount; Index++) {
-    // Get CM_ARM_PCI_ADDRESS_MAP_INFO structures one by one.
-    Status = GetEArmObjPciAddressMapInfo (
+    // Get CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO structures one by one.
+    Status = GetEArchCommonObjPciAddressMapInfo (
                CfgMgrProtocol,
                RefInfo[Index].ReferenceToken,
                &AddrMapInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 41f66ee7b689..0e12b0f8b167 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -171,19 +171,18 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 25 - Generic Initiator Affinity
   NULL,                             ///< 26 - CMN-600 Info
   NULL,                             ///< 27 - Lpi Info
-  NULL,                             ///< 28 - Pci Address Map Info
-  NULL,                             ///< 29 - Pci Interrupt Map Info
-  NULL,                             ///< 30 - Reserved Memory Range Node
-  NULL,                             ///< 31 - Memory Range Descriptor
-  NULL,                             ///< 32 - Continuous Performance Control Info
-  NULL,                             ///< 33 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 28 - Pci Interrupt Map Info
+  NULL,                             ///< 29 - Reserved Memory Range Node
+  NULL,                             ///< 30 - Memory Range Descriptor
+  NULL,                             ///< 31 - Continuous Performance Control Info
+  NULL,                             ///< 32 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 33 - Pcc Subspace Type 2 Info
   NULL,                             ///< 34 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 35 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 36 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 37 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 38 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 39 - Embedded Trace Extension/Module Info
-  NULL                              ///< 40 - P-State Dependency (PSD) Info
+  NULL,                             ///< 35 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 36 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 37 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 38 - Embedded Trace Extension/Module Info
+  NULL                              ///< 39 - 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 73dbb9879dcc..2d0e62876606 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -440,9 +440,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
   { "StateName",                16,                                              NULL,     PrintString },
 };
 
-/** A parser for EArmObjPciAddressMapInfo.
+/** A parser for EArchCommonObjPciAddressMapInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPciAddressMapInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPciAddressMapInfoParser[] = {
   { "SpaceCode",   1, "%d",     NULL },
   { "PciAddress",  8, "0x%llx", NULL },
   { "CpuAddress",  8, "0x%llx", NULL },
@@ -679,6 +679,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjFixedFeatureFlags,         CmArchCommonFixedFeatureFlagsParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjCmRef,                     CmArchCommonObjRefParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciConfigSpaceInfo,        CmArchCommonPciConfigSpaceInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,         CmArchCommonPciAddressMapInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -713,7 +714,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                  CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjLpiInfo,                     CmArmLpiInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPciAddressMapInfo,           CmArmPciAddressMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPciInterruptMapInfo,         CmPciInterruptMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                         CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,       CmArmMemoryRangeDescriptorInfoParser),
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
index 7d9fe7b1da22..aef0f27a15ae 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
@@ -188,8 +188,8 @@ ParseAddressMap (
   UINT32       Count;
   UINT32       PciAddressAttr;
 
-  CM_ARM_PCI_ADDRESS_MAP_INFO  *PciAddressMapInfo;
-  UINT32                       BufferSize;
+  CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO  *PciAddressMapInfo;
+  UINT32                               BufferSize;
 
   // The mapping is done on AddressMapSize bytes.
   AddressMapSize = (PCI_ADDRESS_CELLS + AddressCells + PCI_SIZE_CELLS) *
@@ -208,7 +208,7 @@ ParseAddressMap (
   Count = DataSize / AddressMapSize;
 
   // Allocate a buffer to store each address mapping.
-  BufferSize        = Count * sizeof (CM_ARM_PCI_ADDRESS_MAP_INFO);
+  BufferSize        = Count * sizeof (CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO);
   PciAddressMapInfo = AllocateZeroPool (BufferSize);
   if (PciAddressMapInfo == NULL) {
     ASSERT (0);
@@ -246,9 +246,9 @@ ParseAddressMap (
   } // for
 
   PciInfo->Mapping[PciMappingTableAddress].ObjectId =
-    CREATE_CM_ARM_OBJECT_ID (EArmObjPciAddressMapInfo);
+    CREATE_CM_ARCH_COMMON_OBJECT_ID (EArchCommonObjPciAddressMapInfo);
   PciInfo->Mapping[PciMappingTableAddress].Size =
-    sizeof (CM_ARM_PCI_ADDRESS_MAP_INFO) * Count;
+    sizeof (CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO) * Count;
   PciInfo->Mapping[PciMappingTableAddress].Data  = PciAddressMapInfo;
   PciInfo->Mapping[PciMappingTableAddress].Count = Count;
 
@@ -413,7 +413,7 @@ ParseIrqMap (
 
   // Allocate a buffer to store each interrupt mapping.
   IrqMapCount         = DataSize / IrqMapSize;
-  BufferSize          = IrqMapCount * sizeof (CM_ARM_PCI_ADDRESS_MAP_INFO);
+  BufferSize          = IrqMapCount * sizeof (CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO);
   PciInterruptMapInfo = AllocateZeroPool (BufferSize);
   if (PciInterruptMapInfo == NULL) {
     ASSERT (0);
@@ -580,7 +580,7 @@ PciNodeParser (
 
   CmObj of the following types are concerned:
    - EArchCommonObjPciConfigSpaceInfo
-   - EArmObjPciAddressMapInfo
+   - EArchCommonObjPciAddressMapInfo
    - EArmObjPciInterruptMapInfo
 
   @param [in]  FdtParserHandle  A handle to the parser instance.
@@ -694,12 +694,12 @@ FreeParserTable (
     UINT8   EndBusNumber;                         // {Populated}
   } CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO;
 
-  typedef struct CmArmPciAddressMapInfo {
+  typedef struct CmArchCommonPciAddressMapInfo {
     UINT8                     SpaceCode;          // {Populated}
     UINT64                    PciAddress;         // {Populated}
     UINT64                    CpuAddress;         // {Populated}
     UINT64                    AddressSize;        // {Populated}
-  } CM_ARM_PCI_ADDRESS_MAP_INFO;
+  } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
   typedef struct CmArmPciInterruptMapInfo {
     UINT8                       PciBus;           // {Populated}
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
index 4e269508a6e4..ba7090fd7e47 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
@@ -102,12 +102,12 @@ typedef struct PciParserTable {
     UINT8   EndBusNumber;                         // {Populated}
   } CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO;
 
-  typedef struct CmArmPciAddressMapInfo {
+  typedef struct CmArchCommonPciAddressMapInfo {
     UINT8                     SpaceCode;          // {Populated}
     UINT64                    PciAddress;         // {Populated}
     UINT64                    CpuAddress;         // {Populated}
     UINT64                    AddressSize;        // {Populated}
-  } CM_ARM_PCI_ADDRESS_MAP_INFO;
+  } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
   typedef struct CmArmPciInterruptMapInfo {
     UINT8                       PciBus;           // {Populated}
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index e0544fe40b1c..0caae7dc4527 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -468,19 +468,18 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  25   | Generic Initiator Affinity Info           | Move to Arch Common NS |
 |  26   | CMN 600 Info                              | |
 |  27   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  28   | PCI Address Map Info                      | Move to Arch Common NS |
-|  29   | PCI Interrupt Map Info                    | Move to Arch Common NS |
-|  30   | Reserved Memory Range Node                | |
-|  31   | Memory Range Descriptor                   | |
-|  32   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  34   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  35   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  36   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  37   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  38   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  39   | Embedded Trace Extension/Module Info      | |
-|  40   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  28   | PCI Interrupt Map Info                    | Move to Arch Common NS |
+|  29   | Reserved Memory Range Node                | |
+|  30   | Memory Range Descriptor                   | |
+|  31   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  32   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  33   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  34   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  35   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  36   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  37   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  38   | Embedded Trace Extension/Module Info      | |
+|  39   | 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
 |   6   | Fixed feature flags for FADT      | |
 |   7   | CM Object Reference               | |
 |   8   | PCI Configuration Space Info      | |
+|   9   | PCI Address Map Info              | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116979): https://edk2.groups.io/g/devel/message/116979
Mute This Topic: https://groups.io/mt/105068145/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 02/19] DynamicTablesPkg: Move CM_ARM_GENERIC_INTERRUPT struct to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 01/19] DynamicTablesPkg: Move Pci Address Map Info to Arch Common PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 03/19] DynamicTablesPkg: Move Pci Interrupt Map Info " PierreGondois
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

The CM_ARM_GENERIC_INTERRUPT struct describes a standard interrupt and
is generic. Therefore move it to the Arch Common namespace header file
and rename it as CM_ARCH_COMMON_GENERIC_INTERRUPT.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SSDT CMN600 generator
 - ConfigurationManagerObjectParser
 - FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.

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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 15 +++++
 .../Include/ArmNameSpaceObjects.h             | 55 +++++++------------
 .../SsdtCmn600Generator.c                     | 16 +++---
 .../ConfigurationManagerObjectParser.c        | 36 ++++++------
 .../Pci/ArmPciConfigSpaceParser.c             |  8 +--
 .../Pci/ArmPciConfigSpaceParser.h             |  8 +--
 6 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index bbc5d7dc55cd..c5639e050881 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -170,6 +170,21 @@ typedef struct CmArchCommonPciAddressMapInfo {
   UINT64    AddressSize;
 } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
+/** A structure that describes the
+    Generic Interrupts.
+*/
+typedef struct CmArchCommonGenericInterrupt {
+  /// Interrupt number
+  UINT32    Interrupt;
+
+  /// Flags
+  /// BIT0: 0: Interrupt is Level triggered
+  ///       1: Interrupt is Edge triggered
+  /// BIT1: 0: Interrupt is Active high
+  ///       1: Interrupt is Active low
+  UINT32    Flags;
+} CM_ARCH_COMMON_GENERIC_INTERRUPT;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 5b318bbb10c3..60ec34a7b31a 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -632,21 +632,6 @@ typedef struct CmArmIdMapping {
   UINT32             Flags;
 } CM_ARM_ID_MAPPING;
 
-/** A structure that describes the Arm
-    Generic Interrupts.
-*/
-typedef struct CmArmGenericInterrupt {
-  /// Interrupt number
-  UINT32    Interrupt;
-
-  /// Flags
-  /// BIT0: 0: Interrupt is Level triggered
-  ///       1: Interrupt is Edge triggered
-  /// BIT1: 0: Interrupt is Active high
-  ///       1: Interrupt is Active low
-  UINT32    Flags;
-} CM_ARM_GENERIC_INTERRUPT;
-
 /** A structure that describes the SMMU interrupts for the Platform.
 
     Interrupt   Interrupt number.
@@ -654,7 +639,7 @@ typedef struct CmArmGenericInterrupt {
 
     ID: EArmObjSmmuInterruptArray
 */
-typedef CM_ARM_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT;
+typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT;
 
 /** A structure that describes the AML Extended Interrupts.
 
@@ -664,7 +649,7 @@ typedef CM_ARM_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT;
                 resource descriptor.
                 See EFI_ACPI_EXTENDED_INTERRUPT_FLAG_xxx in Acpi10.h
 */
-typedef CM_ARM_GENERIC_INTERRUPT CM_ARM_EXTENDED_INTERRUPT;
+typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_EXTENDED_INTERRUPT;
 
 /** A structure that describes the Processor Hierarchy Node (Type 0) in PPTT
 
@@ -927,14 +912,14 @@ typedef struct CmArmPciInterruptMapInfo {
   Device-tree bindings are shifted by 1:
       "INTA=1, INTB=2, INTC=3, INTD=4"
   */
-  UINT8                       PciInterrupt;
+  UINT8                               PciInterrupt;
 
   /** Interrupt controller interrupt.
 
   Cf Devicetree Specification - Release v0.3
   s2.4.3 "Interrupt Nexus Properties": "parent interrupt specifier"
   */
-  CM_ARM_GENERIC_INTERRUPT    IntcInterrupt;
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;
 } CM_ARM_PCI_INTERRUPT_MAP_INFO;
 
 /** A structure that describes the
@@ -1085,10 +1070,10 @@ typedef struct CmArmPccSubspaceType1Info {
     The Subspace of Type0 contains information that can be re-used
     in other Subspace types.
   */
-  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
 
   /// Platform Interrupt.
-  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
 } CM_ARM_PCC_SUBSPACE_TYPE1_INFO;
 
 /** A structure that describes a
@@ -1102,13 +1087,13 @@ typedef struct CmArmPccSubspaceType2Info {
     The Subspace of Type0 contains information that can be re-used
     in other Subspace types.
   */
-  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
 
   /// Platform Interrupt.
-  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
 
   /// Platform Interrupt Register.
-  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
+  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
 } CM_ARM_PCC_SUBSPACE_TYPE2_INFO;
 
 /** A structure that describes a
@@ -1122,24 +1107,24 @@ typedef struct CmArmPccSubspaceType3Info {
     The Subspace of Type0 contains information that can be re-used
     in other Subspace types.
   */
-  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
 
   /// Platform Interrupt.
-  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
 
   /// Platform Interrupt Register.
-  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
+  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
 
   /// Command Complete Check Register.
   /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
 
   /// Command Complete Update Register.
-  PCC_MAILBOX_REGISTER_INFO    CmdCompleteUpdateReg;
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteUpdateReg;
 
   /// Error Status Register.
   /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
+  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
 } CM_ARM_PCC_SUBSPACE_TYPE3_INFO;
 
 /** A structure that describes a
@@ -1163,21 +1148,21 @@ typedef struct CmArmPccSubspaceType5Info {
     MaximumPeriodicAccessRate doesn't need to be populated for
     this structure.
   */
-  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
 
   /// Version.
-  UINT16                       Version;
+  UINT16                              Version;
 
   /// Platform Interrupt.
-  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
 
   /// Command Complete Check Register.
   /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
 
   /// Error Status Register.
   /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
+  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
 } CM_ARM_PCC_SUBSPACE_TYPE5_INFO;
 
 /** An enum describing the Arm Embedded Trace device type.
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c
index b990686d40a3..60d9e72140e9 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c
@@ -65,10 +65,10 @@ ValidateCmn600Info (
   IN  CONST UINT32               Cmn600Count
   )
 {
-  UINT32                          Index;
-  UINT32                          DtcIndex;
-  CONST CM_ARM_CMN_600_INFO       *Cmn600Info;
-  CONST CM_ARM_GENERIC_INTERRUPT  *DtcInterrupt;
+  UINT32                                  Index;
+  UINT32                                  DtcIndex;
+  CONST CM_ARM_CMN_600_INFO               *Cmn600Info;
+  CONST CM_ARCH_COMMON_GENERIC_INTERRUPT  *DtcInterrupt;
 
   if ((Cmn600InfoList == NULL) ||
       (Cmn600Count == 0))
@@ -231,10 +231,10 @@ FixupCmn600Info (
   OUT       EFI_ACPI_DESCRIPTION_HEADER  **Table
   )
 {
-  EFI_STATUS                      Status;
-  EFI_STATUS                      Status1;
-  UINT8                           Index;
-  CONST CM_ARM_GENERIC_INTERRUPT  *DtcInt;
+  EFI_STATUS                              Status;
+  EFI_STATUS                              Status1;
+  UINT8                                   Index;
+  CONST CM_ARCH_COMMON_GENERIC_INTERRUPT  *DtcInt;
 
   EFI_ACPI_DESCRIPTION_HEADER  *SsdtCmn600Template;
   AML_ROOT_NODE_HANDLE         RootNodeHandle;
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 2d0e62876606..1fd1edb8eb7f 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -317,7 +317,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmIdMappingParser[] = {
 
 /** A parser for EArmObjSmmuInterruptArray.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmGenericInterruptParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonGenericInterruptParser[] = {
   { "Interrupt", 4, "0x%x", NULL },
   { "Flags",     4, "0x%x", NULL }
 };
@@ -452,12 +452,12 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPciAddressMapInfoParser[] = {
 /** A parser for EArmObjPciInterruptMapInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmPciInterruptMapInfoParser[] = {
-  { "PciBus",        1,                                 "0x%x", NULL },
-  { "PciDevice",     1,                                 "0x%x", NULL },
-  { "PciInterrupt",  1,                                 "0x%x", NULL },
-  { "IntcInterrupt", sizeof (CM_ARM_GENERIC_INTERRUPT),
-    NULL, NULL, CmArmGenericInterruptParser,
-    ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PciBus",        1,                                         "0x%x", NULL },
+  { "PciDevice",     1,                                         "0x%x", NULL },
+  { "PciInterrupt",  1,                                         "0x%x", NULL },
+  { "IntcInterrupt", sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),
+    NULL, NULL, CmArchCommonGenericInterruptParser,
+    ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
 };
 
 /** A parser for EArmObjRmr.
@@ -595,9 +595,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
-    NULL, NULL, CmArmGenericInterruptParser,
-    ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PlatIrq",        sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),
+    NULL, NULL, CmArchCommonGenericInterruptParser,
+    ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
 };
 
 /** A parser for EArmObjPccSubspaceType2Info.
@@ -606,8 +606,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
-    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PlatIrq",        sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,NULL,
+    CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
   { "PlatIrqAckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
@@ -619,8 +619,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
   { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
-    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PlatIrq",              sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,NULL,
+    CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
   { "PlatIrqAckReg",        sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
@@ -641,9 +641,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
   { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "Version",             2,                                 "0x%x",NULL },
-  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,  NULL,
-    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "Version",             2,                                        "0x%x",NULL },
+  { "PlatIrq",             sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,  NULL,
+    CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
   { "CmdCompleteCheckReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
@@ -705,7 +705,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjPmcg,                        CmArmPmcgNodeParser),
   CM_PARSER_ADD_OBJECT (EArmObjGicItsIdentifierArray,       CmArmGicItsIdentifierParser),
   CM_PARSER_ADD_OBJECT (EArmObjIdMappingArray,              CmArmIdMappingParser),
-  CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArmGenericInterruptParser),
+  CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArchCommonGenericInterruptParser),
   CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryAffinityInfo,          CmArmMemoryAffinityInfoParser),
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
index aef0f27a15ae..b20d265a839e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
@@ -702,10 +702,10 @@ FreeParserTable (
   } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
   typedef struct CmArmPciInterruptMapInfo {
-    UINT8                       PciBus;           // {Populated}
-    UINT8                       PciDevice;        // {Populated}
-    UINT8                       PciInterrupt;     // {Populated}
-    CM_ARM_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
+    UINT8                               PciBus;           // {Populated}
+    UINT8                               PciDevice;        // {Populated}
+    UINT8                               PciInterrupt;     // {Populated}
+    CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
   } CM_ARM_PCI_INTERRUPT_MAP_INFO;
 
   A parser parses a Device Tree to populate a specific CmObj type. None,
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
index ba7090fd7e47..33457cd6e95c 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
@@ -110,10 +110,10 @@ typedef struct PciParserTable {
   } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
   typedef struct CmArmPciInterruptMapInfo {
-    UINT8                       PciBus;           // {Populated}
-    UINT8                       PciDevice;        // {Populated}
-    UINT8                       PciInterrupt;     // {Populated}
-    CM_ARM_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
+    UINT8                               PciBus;           // {Populated}
+    UINT8                               PciDevice;        // {Populated}
+    UINT8                               PciInterrupt;     // {Populated}
+    CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
   } CM_ARM_PCI_INTERRUPT_MAP_INFO;
 
   A parser parses a Device Tree to populate a specific CmObj type. None,
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116980): https://edk2.groups.io/g/devel/message/116980
Mute This Topic: https://groups.io/mt/105068148/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 03/19] DynamicTablesPkg: Move Pci Interrupt Map Info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 01/19] DynamicTablesPkg: Move Pci Address Map Info to Arch Common PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 02/19] DynamicTablesPkg: Move CM_ARM_GENERIC_INTERRUPT struct " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 04/19] DynamicTablesPkg: Move Mem Affinity " PierreGondois
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move Pci Interrupt Map 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 PCIe library
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo TokenFixer map
 - FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.

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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 38 ++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 60 ++++---------------
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    | 26 ++++----
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 21 ++++---
 .../ConfigurationManagerObjectParser.c        |  6 +-
 .../Pci/ArmPciConfigSpaceParser.c             | 14 ++---
 .../Pci/ArmPciConfigSpaceParser.h             |  4 +-
 DynamicTablesPkg/Readme.md                    | 24 ++++----
 8 files changed, 96 insertions(+), 97 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index c5639e050881..429505b6509a 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -30,6 +30,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjCmRef,                          ///<  7 - CM Object Reference
   EArchCommonObjPciConfigSpaceInfo,             ///<  8 - PCI Configuration Space Info
   EArchCommonObjPciAddressMapInfo,              ///<  9 - Pci Address Map Info
+  EArchCommonObjPciInterruptMapInfo,            ///< 10 - Pci Interrupt Map Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -185,6 +186,43 @@ typedef struct CmArchCommonGenericInterrupt {
   UINT32    Flags;
 } CM_ARCH_COMMON_GENERIC_INTERRUPT;
 
+/** A structure that describes a PCI Interrupt Map.
+
+  The legacy PCI interrupts used by PCI devices are described by this object.
+
+  Cf Devicetree Specification - Release v0.3
+  s2.4.3 "Interrupt Nexus Properties"
+
+  ID: EArchCommonObjPciInterruptMapInfo
+*/
+typedef struct CmArchCommonPciInterruptMapInfo {
+  /// Pci Bus.
+  /// Value on 8 bits (max 255).
+  UINT8    PciBus;
+
+  /// Pci Device.
+  /// Value on 5 bits (max 31).
+  UINT8    PciDevice;
+
+  /** PCI interrupt
+
+  ACPI bindings are used:
+  Cf. ACPI 6.4, s6.2.13 _PRT (PCI Routing Table):
+      "0-INTA, 1-INTB, 2-INTC, 3-INTD"
+
+  Device-tree bindings are shifted by 1:
+      "INTA=1, INTB=2, INTC=3, INTD=4"
+  */
+  UINT8                               PciInterrupt;
+
+  /** Interrupt controller interrupt.
+
+  Cf Devicetree Specification - Release v0.3
+  s2.4.3 "Interrupt Nexus Properties": "parent interrupt specifier"
+  */
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;
+} CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 60ec34a7b31a..5d7c84f51df6 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -56,18 +56,17 @@ typedef enum ArmObjectID {
   EArmObjGenericInitiatorAffinityInfo,                         ///< 25 - Generic Initiator Affinity
   EArmObjCmn600Info,                                           ///< 26 - CMN-600 Info
   EArmObjLpiInfo,                                              ///< 27 - Lpi Info
-  EArmObjPciInterruptMapInfo,                                  ///< 28 - Pci Interrupt Map Info
-  EArmObjRmr,                                                  ///< 29 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 30 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 31 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 32 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 33 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 34 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 35 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 36 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 37 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 38 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 39 - P-State Dependency (PSD) Info
+  EArmObjRmr,                                                  ///< 28 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 29 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 30 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 31 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 32 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 33 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 34 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 35 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 36 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 37 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 38 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -885,43 +884,6 @@ typedef struct CmArmLpiInfo {
   CHAR8                                     StateName[16];
 } CM_ARM_LPI_INFO;
 
-/** A structure that describes a PCI Interrupt Map.
-
-  The legacy PCI interrupts used by PCI devices are described by this object.
-
-  Cf Devicetree Specification - Release v0.3
-  s2.4.3 "Interrupt Nexus Properties"
-
-  ID: EArmObjPciInterruptMapInfo
-*/
-typedef struct CmArmPciInterruptMapInfo {
-  /// Pci Bus.
-  /// Value on 8 bits (max 255).
-  UINT8    PciBus;
-
-  /// Pci Device.
-  /// Value on 5 bits (max 31).
-  UINT8    PciDevice;
-
-  /** PCI interrupt
-
-  ACPI bindings are used:
-  Cf. ACPI 6.4, s6.2.13 _PRT (PCI Routing Table):
-      "0-INTA, 1-INTB, 2-INTC, 3-INTD"
-
-  Device-tree bindings are shifted by 1:
-      "INTA=1, INTB=2, INTC=3, INTD=4"
-  */
-  UINT8                               PciInterrupt;
-
-  /** Interrupt controller interrupt.
-
-  Cf Devicetree Specification - Release v0.3
-  s2.4.3 "Interrupt Nexus Properties": "parent interrupt specifier"
-  */
-  CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;
-} CM_ARM_PCI_INTERRUPT_MAP_INFO;
-
 /** A structure that describes the
     RMR node for the Platform.
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index e86f1cb529f0..2b488016e545 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -45,7 +45,7 @@ Requirements:
   - EArchCommonObjCmRef
   - EArchCommonObjPciConfigSpaceInfo
   - EArchCommonObjPciAddressMapInfo
-  - EArmObjPciInterruptMapInfo
+  - EArchCommonObjPciInterruptMapInfo
 */
 
 /** This macro expands to a function that retrieves the cross-CM-object-
@@ -79,9 +79,9 @@ GET_OBJECT_LIST (
     Interrupt Mapping Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPciInterruptMapInfo,
-  CM_ARM_PCI_INTERRUPT_MAP_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPciInterruptMapInfo,
+  CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO
   );
 
 /** Initialize the MappingTable.
@@ -310,12 +310,12 @@ GeneratePrt (
   IN  OUT       AML_OBJECT_NODE_HANDLE                        PciNode
   )
 {
-  EFI_STATUS                     Status;
-  INT32                          Index;
-  AML_OBJECT_NODE_HANDLE         PrtNode;
-  CM_ARCH_COMMON_OBJ_REF         *RefInfo;
-  UINT32                         RefCount;
-  CM_ARM_PCI_INTERRUPT_MAP_INFO  *IrqMapInfo;
+  EFI_STATUS                             Status;
+  INT32                                  Index;
+  AML_OBJECT_NODE_HANDLE                 PrtNode;
+  CM_ARCH_COMMON_OBJ_REF                 *RefInfo;
+  UINT32                                 RefCount;
+  CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO  *IrqMapInfo;
 
   ASSERT (Generator != NULL);
   ASSERT (CfgMgrProtocol != NULL);
@@ -325,7 +325,7 @@ GeneratePrt (
   PrtNode = NULL;
 
   // Get the array of CM_ARCH_COMMON_OBJ_REF referencing the
-  // CM_ARM_PCI_INTERRUPT_MAP_INFO objects.
+  // CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO objects.
   Status = GetEArchCommonObjCmRef (
              CfgMgrProtocol,
              PciInfo->InterruptMapToken,
@@ -352,8 +352,8 @@ GeneratePrt (
   }
 
   for (Index = 0; Index < RefCount; Index++) {
-    // Get CM_ARM_PCI_INTERRUPT_MAP_INFO structures one by one.
-    Status = GetEArmObjPciInterruptMapInfo (
+    // Get CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO structures one by one.
+    Status = GetEArchCommonObjPciInterruptMapInfo (
                CfgMgrProtocol,
                RefInfo[Index].ReferenceToken,
                &IrqMapInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 0e12b0f8b167..4d660265cfe3 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -171,18 +171,17 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 25 - Generic Initiator Affinity
   NULL,                             ///< 26 - CMN-600 Info
   NULL,                             ///< 27 - Lpi Info
-  NULL,                             ///< 28 - Pci Interrupt Map Info
-  NULL,                             ///< 29 - Reserved Memory Range Node
-  NULL,                             ///< 30 - Memory Range Descriptor
-  NULL,                             ///< 31 - Continuous Performance Control Info
-  NULL,                             ///< 32 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 28 - Reserved Memory Range Node
+  NULL,                             ///< 29 - Memory Range Descriptor
+  NULL,                             ///< 30 - Continuous Performance Control Info
+  NULL,                             ///< 31 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 32 - Pcc Subspace Type 2 Info
   NULL,                             ///< 33 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 34 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 35 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 36 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 37 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 38 - Embedded Trace Extension/Module Info
-  NULL                              ///< 39 - P-State Dependency (PSD) Info
+  NULL,                             ///< 34 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 35 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 36 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 37 - Embedded Trace Extension/Module Info
+  NULL                              ///< 38 - 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 1fd1edb8eb7f..4ca35d65fca3 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -449,9 +449,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPciAddressMapInfoParser[] = {
   { "AddressSize", 8, "0x%llx", NULL },
 };
 
-/** A parser for EArmObjPciInterruptMapInfo.
+/** A parser for EArchCommonObjPciInterruptMapInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmPciInterruptMapInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPciInterruptMapInfoParser[] = {
   { "PciBus",        1,                                         "0x%x", NULL },
   { "PciDevice",     1,                                         "0x%x", NULL },
   { "PciInterrupt",  1,                                         "0x%x", NULL },
@@ -680,6 +680,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjCmRef,                     CmArchCommonObjRefParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciConfigSpaceInfo,        CmArchCommonPciConfigSpaceInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,         CmArchCommonPciAddressMapInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,       CmArchCommonPciInterruptMapInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -714,7 +715,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                  CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjLpiInfo,                     CmArmLpiInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPciInterruptMapInfo,         CmPciInterruptMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                         CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,       CmArmMemoryRangeDescriptorInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCpcInfo,                     CmArmCpcInfoParser),
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
index b20d265a839e..b064e62c17bc 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.c
@@ -311,8 +311,8 @@ ParseIrqMap (
 
   UINT32  PciAddressAttr;
 
-  CM_ARM_PCI_INTERRUPT_MAP_INFO  *PciInterruptMapInfo;
-  UINT32                         BufferSize;
+  CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO  *PciInterruptMapInfo;
+  UINT32                                 BufferSize;
 
   Data = fdt_getprop (Fdt, HostPciNode, "interrupt-map", &DataSize);
   if ((Data == NULL) || (DataSize <= 0)) {
@@ -455,9 +455,9 @@ ParseIrqMap (
   } // for
 
   PciInfo->Mapping[PciMappingTableInterrupt].ObjectId =
-    CREATE_CM_ARM_OBJECT_ID (EArmObjPciInterruptMapInfo);
+    CREATE_CM_ARCH_COMMON_OBJECT_ID (EArchCommonObjPciInterruptMapInfo);
   PciInfo->Mapping[PciMappingTableInterrupt].Size =
-    sizeof (CM_ARM_PCI_INTERRUPT_MAP_INFO) * IrqMapCount;
+    sizeof (CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO) * IrqMapCount;
   PciInfo->Mapping[PciMappingTableInterrupt].Data  = PciInterruptMapInfo;
   PciInfo->Mapping[PciMappingTableInterrupt].Count = IrqMapCount;
 
@@ -581,7 +581,7 @@ PciNodeParser (
   CmObj of the following types are concerned:
    - EArchCommonObjPciConfigSpaceInfo
    - EArchCommonObjPciAddressMapInfo
-   - EArmObjPciInterruptMapInfo
+   - EArchCommonObjPciInterruptMapInfo
 
   @param [in]  FdtParserHandle  A handle to the parser instance.
   @param [in]  PciTableInfo     PCI_PARSER_TABLE structure containing the
@@ -701,12 +701,12 @@ FreeParserTable (
     UINT64                    AddressSize;        // {Populated}
   } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
-  typedef struct CmArmPciInterruptMapInfo {
+  typedef struct CmArchCommonPciInterruptMapInfo {
     UINT8                               PciBus;           // {Populated}
     UINT8                               PciDevice;        // {Populated}
     UINT8                               PciInterrupt;     // {Populated}
     CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
-  } CM_ARM_PCI_INTERRUPT_MAP_INFO;
+  } CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO;
 
   A parser parses a Device Tree to populate a specific CmObj type. None,
   one or many CmObj can be created by the parser.
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
index 33457cd6e95c..e68013838515 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser.h
@@ -109,12 +109,12 @@ typedef struct PciParserTable {
     UINT64                    AddressSize;        // {Populated}
   } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
 
-  typedef struct CmArmPciInterruptMapInfo {
+  typedef struct CmArchCommonPciInterruptMapInfo {
     UINT8                               PciBus;           // {Populated}
     UINT8                               PciDevice;        // {Populated}
     UINT8                               PciInterrupt;     // {Populated}
     CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;    // {Populated}
-  } CM_ARM_PCI_INTERRUPT_MAP_INFO;
+  } CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO;
 
   A parser parses a Device Tree to populate a specific CmObj type. None,
   one or many CmObj can be created by the parser.
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 0caae7dc4527..558cf69afad6 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -468,18 +468,17 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  25   | Generic Initiator Affinity Info           | Move to Arch Common NS |
 |  26   | CMN 600 Info                              | |
 |  27   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  28   | PCI Interrupt Map Info                    | Move to Arch Common NS |
-|  29   | Reserved Memory Range Node                | |
-|  30   | Memory Range Descriptor                   | |
-|  31   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  32   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  34   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  35   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  36   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  37   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  38   | Embedded Trace Extension/Module Info      | |
-|  39   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  28   | Reserved Memory Range Node                | |
+|  29   | Memory Range Descriptor                   | |
+|  30   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  31   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  32   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  33   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  34   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  35   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  36   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  37   | Embedded Trace Extension/Module Info      | |
+|  38   | 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
 |   7   | CM Object Reference               | |
 |   8   | PCI Configuration Space Info      | |
 |   9   | PCI Address Map Info              | |
+|  10   | PCI Interrupt Map Info            | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116981): https://edk2.groups.io/g/devel/message/116981
Mute This Topic: https://groups.io/mt/105068151/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 04/19] DynamicTablesPkg: Move Mem Affinity Info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (2 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 03/19] DynamicTablesPkg: Move Pci Interrupt Map Info " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 05/19] DynamicTablesPkg: Move ACPI device Handle object " PierreGondois
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the Memory Affinity Info object from Arm Namespace to the
Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SRAT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 19 +++++++
 .../Include/ArmNameSpaceObjects.h             | 51 ++++++-------------
 .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c   | 14 ++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 31 ++++++-----
 .../ConfigurationManagerObjectParser.c        |  6 +--
 DynamicTablesPkg/Readme.md                    | 34 ++++++-------
 6 files changed, 77 insertions(+), 78 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 429505b6509a..86d751bdfaaa 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -31,6 +31,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPciConfigSpaceInfo,             ///<  8 - PCI Configuration Space Info
   EArchCommonObjPciAddressMapInfo,              ///<  9 - Pci Address Map Info
   EArchCommonObjPciInterruptMapInfo,            ///< 10 - Pci Interrupt Map Info
+  EArchCommonObjMemoryAffinityInfo,             ///< 11 - Memory Affinity Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -223,6 +224,24 @@ typedef struct CmArchCommonPciInterruptMapInfo {
   CM_ARCH_COMMON_GENERIC_INTERRUPT    IntcInterrupt;
 } CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO;
 
+/** A structure that describes the Memory Affinity Structure (Type 1) in SRAT
+
+    ID: EArchCommonObjMemoryAffinityInfo
+*/
+typedef struct CmArchCommonMemoryAffinityInfo {
+  /// The proximity domain to which the "range of memory" belongs.
+  UINT32    ProximityDomain;
+
+  /// Base Address
+  UINT64    BaseAddress;
+
+  /// Length
+  UINT64    Length;
+
+  /// Flags
+  UINT32    Flags;
+} CM_ARCH_COMMON_MEMORY_AFFINITY_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 5d7c84f51df6..7905152114a7 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -50,23 +50,22 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
   EArmObjProcHierarchyInfo,                                    ///< 20 - Processor Hierarchy Info
   EArmObjCacheInfo,                                            ///< 21 - Cache Info
-  EArmObjMemoryAffinityInfo,                                   ///< 22 - Memory Affinity Info
-  EArmObjDeviceHandleAcpi,                                     ///< 23 - Device Handle Acpi
-  EArmObjDeviceHandlePci,                                      ///< 24 - Device Handle Pci
-  EArmObjGenericInitiatorAffinityInfo,                         ///< 25 - Generic Initiator Affinity
-  EArmObjCmn600Info,                                           ///< 26 - CMN-600 Info
-  EArmObjLpiInfo,                                              ///< 27 - Lpi Info
-  EArmObjRmr,                                                  ///< 28 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 29 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 30 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 31 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 32 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 33 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 34 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 35 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 36 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 37 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 38 - P-State Dependency (PSD) Info
+  EArmObjDeviceHandleAcpi,                                     ///< 22 - Device Handle Acpi
+  EArmObjDeviceHandlePci,                                      ///< 23 - Device Handle Pci
+  EArmObjGenericInitiatorAffinityInfo,                         ///< 24 - Generic Initiator Affinity
+  EArmObjCmn600Info,                                           ///< 25 - CMN-600 Info
+  EArmObjLpiInfo,                                              ///< 26 - Lpi Info
+  EArmObjRmr,                                                  ///< 27 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 28 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 29 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 30 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 31 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 32 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 33 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 34 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 35 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 36 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 37 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -721,24 +720,6 @@ typedef struct CmArmCacheInfo {
   UINT32             CacheId;
 } CM_ARM_CACHE_INFO;
 
-/** A structure that describes the Memory Affinity Structure (Type 1) in SRAT
-
-    ID: EArmObjMemoryAffinityInfo
-*/
-typedef struct CmArmMemoryAffinityInfo {
-  /// The proximity domain to which the "range of memory" belongs.
-  UINT32    ProximityDomain;
-
-  /// Base Address
-  UINT64    BaseAddress;
-
-  /// Length
-  UINT64    Length;
-
-  /// Flags
-  UINT32    Flags;
-} CM_ARM_MEMORY_AFFINITY_INFO;
-
 /** A structure that describes the ACPI Device Handle (Type 0) in the
     Generic Initiator Affinity structure in SRAT
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
index 431995ed3884..3ba2448f2384 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
@@ -32,7 +32,7 @@
     The following Configuration Manager Object(s) are used by this Generator:
     - EArmObjGicCInfo (REQUIRED)
     - EArmObjGicItsInfo (OPTIONAL)
-    - EArmObjMemoryAffinityInfo (OPTIONAL)
+    - EArchCommonObjMemoryAffinityInfo (OPTIONAL)
     - EArmObjGenericInitiatorAffinityInfo (OPTIONAL)
     - EArmObjDeviceHandleAcpi (OPTIONAL)
     - EArmObjDeviceHandlePci (OPTIONAL)
@@ -62,9 +62,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjMemoryAffinityInfo,
-  CM_ARM_MEMORY_AFFINITY_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjMemoryAffinityInfo,
+  CM_ARCH_COMMON_MEMORY_AFFINITY_INFO
   );
 
 /**
@@ -235,7 +235,7 @@ AddMemoryAffinity (
   IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
   IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat,
   IN CONST UINT32                                               MemAffOffset,
-  IN CONST CM_ARM_MEMORY_AFFINITY_INFO                          *MemAffInfo,
+  IN CONST CM_ARCH_COMMON_MEMORY_AFFINITY_INFO                  *MemAffInfo,
   IN       UINT32                                               MemAffCount
   )
 {
@@ -467,7 +467,7 @@ BuildSratTable (
 
   CM_ARM_GICC_INFO                        *GicCInfo;
   CM_ARM_GIC_ITS_INFO                     *GicItsInfo;
-  CM_ARM_MEMORY_AFFINITY_INFO             *MemAffInfo;
+  CM_ARCH_COMMON_MEMORY_AFFINITY_INFO     *MemAffInfo;
   CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO  *GenInitiatorAffInfo;
 
   EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER  *Srat;
@@ -537,7 +537,7 @@ BuildSratTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjMemoryAffinityInfo (
+  Status = GetEArchCommonObjMemoryAffinityInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &MemAffInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 4d660265cfe3..654686a0125a 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -165,23 +165,22 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 19 - SMMU Interrupt Array
   TokenFixerNotImplemented,         ///< 20 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 21 - Cache Info
-  NULL,                             ///< 22 - Memory Affinity Info
-  NULL,                             ///< 23 - Device Handle Acpi
-  NULL,                             ///< 24 - Device Handle Pci
-  NULL,                             ///< 25 - Generic Initiator Affinity
-  NULL,                             ///< 26 - CMN-600 Info
-  NULL,                             ///< 27 - Lpi Info
-  NULL,                             ///< 28 - Reserved Memory Range Node
-  NULL,                             ///< 29 - Memory Range Descriptor
-  NULL,                             ///< 30 - Continuous Performance Control Info
-  NULL,                             ///< 31 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 22 - Device Handle Acpi
+  NULL,                             ///< 23 - Device Handle Pci
+  NULL,                             ///< 24 - Generic Initiator Affinity
+  NULL,                             ///< 25 - CMN-600 Info
+  NULL,                             ///< 26 - Lpi Info
+  NULL,                             ///< 27 - Reserved Memory Range Node
+  NULL,                             ///< 28 - Memory Range Descriptor
+  NULL,                             ///< 29 - Continuous Performance Control Info
+  NULL,                             ///< 30 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 31 - Pcc Subspace Type 2 Info
   NULL,                             ///< 32 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 33 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 34 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 35 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 36 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 37 - Embedded Trace Extension/Module Info
-  NULL                              ///< 38 - P-State Dependency (PSD) Info
+  NULL,                             ///< 33 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 34 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 35 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 36 - Embedded Trace Extension/Module Info
+  NULL                              ///< 37 - 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 4ca35d65fca3..b2fe74cd4f9b 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -356,9 +356,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonObjRefParser[] = {
   { "ReferenceToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
 };
 
-/** A parser for EArmObjMemoryAffinityInfo.
+/** A parser for EArchCommonObjMemoryAffinityInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmMemoryAffinityInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonMemoryAffinityInfoParser[] = {
   { "ProximityDomain", 4, "0x%x",   NULL },
   { "BaseAddress",     8, "0x%llx", NULL },
   { "Length",          8, "0x%llx", NULL },
@@ -681,6 +681,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciConfigSpaceInfo,        CmArchCommonPciConfigSpaceInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,         CmArchCommonPciAddressMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,       CmArchCommonPciInterruptMapInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryAffinityInfo,        CmArchCommonMemoryAffinityInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -709,7 +710,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArchCommonGenericInterruptParser),
   CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjMemoryAffinityInfo,          CmArmMemoryAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjDeviceHandleAcpi,            CmArmDeviceHandleAcpiParser),
   CM_PARSER_ADD_OBJECT (EArmObjDeviceHandlePci,             CmArmDeviceHandlePciParser),
   CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 558cf69afad6..55311fd4cef5 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -462,23 +462,22 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  19   | SMMU Interrupt Array                      | |
 |  20   | Processor Hierarchy Info                  | Move to Arch Common NS |
 |  21   | Cache Info                                | Move to Arch Common NS |
-|  22   | Memory Affinity Info                      | Move to Arch Common NS |
-|  23   | Device Handle Acpi                        | Move to Arch Common NS |
-|  24   | Device Handle PCI                         | Move to Arch Common NS |
-|  25   | Generic Initiator Affinity Info           | Move to Arch Common NS |
-|  26   | CMN 600 Info                              | |
-|  27   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  28   | Reserved Memory Range Node                | |
-|  29   | Memory Range Descriptor                   | |
-|  30   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  31   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  32   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  34   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  35   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  36   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  37   | Embedded Trace Extension/Module Info      | |
-|  38   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  22   | Device Handle Acpi                        | Move to Arch Common NS |
+|  23   | Device Handle PCI                         | Move to Arch Common NS |
+|  24   | Generic Initiator Affinity Info           | Move to Arch Common NS |
+|  25   | CMN 600 Info                              | |
+|  26   | Low Power Idle State Info                 | Move to Arch Common NS |
+|  27   | Reserved Memory Range Node                | |
+|  28   | Memory Range Descriptor                   | |
+|  29   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  30   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  31   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  32   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  33   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  34   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  35   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  36   | Embedded Trace Extension/Module Info      | |
+|  37   | 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
 |   8   | PCI Configuration Space Info      | |
 |   9   | PCI Address Map Info              | |
 |  10   | PCI Interrupt Map Info            | |
+|  11   | Memory Affinity Info              | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116982): https://edk2.groups.io/g/devel/message/116982
Mute This Topic: https://groups.io/mt/105068152/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 05/19] DynamicTablesPkg: Move ACPI device Handle object to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (3 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 04/19] DynamicTablesPkg: Move Mem Affinity " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 06/19] DynamicTablesPkg: Move PCI " PierreGondois
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the ACPI device Handle object from Arm Namespace to the
Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SRAT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 14 ++++++
 .../Include/ArmNameSpaceObjects.h             | 44 +++++++------------
 .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c   | 12 ++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 29 ++++++------
 .../ConfigurationManagerObjectParser.c        |  6 +--
 DynamicTablesPkg/Readme.md                    | 32 +++++++-------
 6 files changed, 68 insertions(+), 69 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 86d751bdfaaa..0b450e8f99c2 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -32,6 +32,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPciAddressMapInfo,              ///<  9 - Pci Address Map Info
   EArchCommonObjPciInterruptMapInfo,            ///< 10 - Pci Interrupt Map Info
   EArchCommonObjMemoryAffinityInfo,             ///< 11 - Memory Affinity Info
+  EArchCommonObjDeviceHandleAcpi,               ///< 12 - Device Handle Acpi
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -242,6 +243,19 @@ typedef struct CmArchCommonMemoryAffinityInfo {
   UINT32    Flags;
 } CM_ARCH_COMMON_MEMORY_AFFINITY_INFO;
 
+/** A structure that describes the ACPI Device Handle (Type 0) in the
+    Generic Initiator Affinity structure in SRAT
+
+    ID: EArchCommonObjDeviceHandleAcpi
+*/
+typedef struct CmArchCommonDeviceHandleAcpi {
+  /// Hardware ID
+  UINT64    Hid;
+
+  /// Unique Id
+  UINT32    Uid;
+} CM_ARCH_COMMON_DEVICE_HANDLE_ACPI;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 7905152114a7..64c5f2677246 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -50,22 +50,21 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
   EArmObjProcHierarchyInfo,                                    ///< 20 - Processor Hierarchy Info
   EArmObjCacheInfo,                                            ///< 21 - Cache Info
-  EArmObjDeviceHandleAcpi,                                     ///< 22 - Device Handle Acpi
-  EArmObjDeviceHandlePci,                                      ///< 23 - Device Handle Pci
-  EArmObjGenericInitiatorAffinityInfo,                         ///< 24 - Generic Initiator Affinity
-  EArmObjCmn600Info,                                           ///< 25 - CMN-600 Info
-  EArmObjLpiInfo,                                              ///< 26 - Lpi Info
-  EArmObjRmr,                                                  ///< 27 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 28 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 29 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 30 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 31 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 32 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 33 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 34 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 35 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 36 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 37 - P-State Dependency (PSD) Info
+  EArmObjDeviceHandlePci,                                      ///< 22 - Device Handle Pci
+  EArmObjGenericInitiatorAffinityInfo,                         ///< 23 - Generic Initiator Affinity
+  EArmObjCmn600Info,                                           ///< 24 - CMN-600 Info
+  EArmObjLpiInfo,                                              ///< 25 - Lpi Info
+  EArmObjRmr,                                                  ///< 26 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 27 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 28 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 29 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 30 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 31 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 32 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 33 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 34 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 35 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 36 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -720,19 +719,6 @@ typedef struct CmArmCacheInfo {
   UINT32             CacheId;
 } CM_ARM_CACHE_INFO;
 
-/** A structure that describes the ACPI Device Handle (Type 0) in the
-    Generic Initiator Affinity structure in SRAT
-
-    ID: EArmObjDeviceHandleAcpi
-*/
-typedef struct CmArmDeviceHandleAcpi {
-  /// Hardware ID
-  UINT64    Hid;
-
-  /// Unique Id
-  UINT32    Uid;
-} CM_ARM_DEVICE_HANDLE_ACPI;
-
 /** A structure that describes the PCI Device Handle (Type 1) in the
     Generic Initiator Affinity structure in SRAT
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
index 3ba2448f2384..c65a28cd142a 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
@@ -34,7 +34,7 @@
     - EArmObjGicItsInfo (OPTIONAL)
     - EArchCommonObjMemoryAffinityInfo (OPTIONAL)
     - EArmObjGenericInitiatorAffinityInfo (OPTIONAL)
-    - EArmObjDeviceHandleAcpi (OPTIONAL)
+    - EArchCommonObjDeviceHandleAcpi (OPTIONAL)
     - EArmObjDeviceHandlePci (OPTIONAL)
 */
 
@@ -82,9 +82,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjDeviceHandleAcpi,
-  CM_ARM_DEVICE_HANDLE_ACPI
+  EObjNameSpaceArchCommon,
+  EArchCommonObjDeviceHandleAcpi,
+  CM_ARCH_COMMON_DEVICE_HANDLE_ACPI
   );
 
 /**
@@ -301,7 +301,7 @@ AddGenericInitiatorAffinity (
 {
   EFI_STATUS                                         Status;
   EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE  *GenInitAff;
-  CM_ARM_DEVICE_HANDLE_ACPI                          *DeviceHandleAcpi;
+  CM_ARCH_COMMON_DEVICE_HANDLE_ACPI                  *DeviceHandleAcpi;
   CM_ARM_DEVICE_HANDLE_PCI                           *DeviceHandlePci;
   UINT32                                             DeviceHandleCount;
 
@@ -331,7 +331,7 @@ AddGenericInitiatorAffinity (
     }
 
     if (GenInitAffInfo->DeviceHandleType == EFI_ACPI_6_3_ACPI_DEVICE_HANDLE) {
-      Status = GetEArmObjDeviceHandleAcpi (
+      Status = GetEArchCommonObjDeviceHandleAcpi (
                  CfgMgrProtocol,
                  GenInitAffInfo->DeviceHandleToken,
                  &DeviceHandleAcpi,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 654686a0125a..43aae423814f 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -165,22 +165,21 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 19 - SMMU Interrupt Array
   TokenFixerNotImplemented,         ///< 20 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 21 - Cache Info
-  NULL,                             ///< 22 - Device Handle Acpi
-  NULL,                             ///< 23 - Device Handle Pci
-  NULL,                             ///< 24 - Generic Initiator Affinity
-  NULL,                             ///< 25 - CMN-600 Info
-  NULL,                             ///< 26 - Lpi Info
-  NULL,                             ///< 27 - Reserved Memory Range Node
-  NULL,                             ///< 28 - Memory Range Descriptor
-  NULL,                             ///< 29 - Continuous Performance Control Info
-  NULL,                             ///< 30 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 22 - Device Handle Pci
+  NULL,                             ///< 23 - Generic Initiator Affinity
+  NULL,                             ///< 24 - CMN-600 Info
+  NULL,                             ///< 25 - Lpi Info
+  NULL,                             ///< 26 - Reserved Memory Range Node
+  NULL,                             ///< 27 - Memory Range Descriptor
+  NULL,                             ///< 28 - Continuous Performance Control Info
+  NULL,                             ///< 29 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 30 - Pcc Subspace Type 2 Info
   NULL,                             ///< 31 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 32 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 33 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 34 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 35 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 36 - Embedded Trace Extension/Module Info
-  NULL                              ///< 37 - P-State Dependency (PSD) Info
+  NULL,                             ///< 32 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 33 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 34 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 35 - Embedded Trace Extension/Module Info
+  NULL                              ///< 36 - 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 b2fe74cd4f9b..9326ea639351 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -365,9 +365,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonMemoryAffinityInfoParser[] = {
   { "Flags",           4, "0x%x",   NULL }
 };
 
-/** A parser for EArmObjDeviceHandleAcpi.
+/** A parser for EArchCommonObjDeviceHandleAcpi.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmDeviceHandleAcpiParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonDeviceHandleAcpiParser[] = {
   { "Hid", 8, "0x%llx", NULL },
   { "Uid", 4, "0x%x",   NULL }
 };
@@ -682,6 +682,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,         CmArchCommonPciAddressMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,       CmArchCommonPciInterruptMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryAffinityInfo,        CmArchCommonMemoryAffinityInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi,          CmArchCommonDeviceHandleAcpiParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -710,7 +711,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArchCommonGenericInterruptParser),
   CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjDeviceHandleAcpi,            CmArmDeviceHandleAcpiParser),
   CM_PARSER_ADD_OBJECT (EArmObjDeviceHandlePci,             CmArmDeviceHandlePciParser),
   CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                  CmArmCmn600InfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 55311fd4cef5..f82c37f4afeb 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -462,22 +462,21 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  19   | SMMU Interrupt Array                      | |
 |  20   | Processor Hierarchy Info                  | Move to Arch Common NS |
 |  21   | Cache Info                                | Move to Arch Common NS |
-|  22   | Device Handle Acpi                        | Move to Arch Common NS |
-|  23   | Device Handle PCI                         | Move to Arch Common NS |
-|  24   | Generic Initiator Affinity Info           | Move to Arch Common NS |
-|  25   | CMN 600 Info                              | |
-|  26   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  27   | Reserved Memory Range Node                | |
-|  28   | Memory Range Descriptor                   | |
-|  29   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  30   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  31   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  32   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  34   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  35   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  36   | Embedded Trace Extension/Module Info      | |
-|  37   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  22   | Device Handle PCI                         | Move to Arch Common NS |
+|  23   | Generic Initiator Affinity Info           | Move to Arch Common NS |
+|  24   | CMN 600 Info                              | |
+|  25   | Low Power Idle State Info                 | Move to Arch Common NS |
+|  26   | Reserved Memory Range Node                | |
+|  27   | Memory Range Descriptor                   | |
+|  28   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  29   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  30   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  31   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  32   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  33   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  34   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  35   | Embedded Trace Extension/Module Info      | |
+|  36   | 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
 |   9   | PCI Address Map Info              | |
 |  10   | PCI Interrupt Map Info            | |
 |  11   | Memory Affinity Info              | |
+|  12   | Device Handle Acpi                | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116983): https://edk2.groups.io/g/devel/message/116983
Mute This Topic: https://groups.io/mt/105068153/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 06/19] DynamicTablesPkg: Move PCI device Handle object to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (4 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 05/19] DynamicTablesPkg: Move ACPI device Handle object " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 07/19] DynamicTablesPkg: Move Generic Initiator affinity info " PierreGondois
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCI device Handle object from Arm Namespace to the
Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SRAT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 20 ++++++++
 .../Include/ArmNameSpaceObjects.h             | 48 ++++++-------------
 .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c   | 14 +++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 27 +++++------
 .../ConfigurationManagerObjectParser.c        |  6 +--
 DynamicTablesPkg/Readme.md                    | 30 ++++++------
 6 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 0b450e8f99c2..230d0bc334c0 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -33,6 +33,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPciInterruptMapInfo,            ///< 10 - Pci Interrupt Map Info
   EArchCommonObjMemoryAffinityInfo,             ///< 11 - Memory Affinity Info
   EArchCommonObjDeviceHandleAcpi,               ///< 12 - Device Handle Acpi
+  EArchCommonObjDeviceHandlePci,                ///< 13 - Device Handle Pci
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -256,6 +257,25 @@ typedef struct CmArchCommonDeviceHandleAcpi {
   UINT32    Uid;
 } CM_ARCH_COMMON_DEVICE_HANDLE_ACPI;
 
+/** A structure that describes the PCI Device Handle (Type 1) in the
+    Generic Initiator Affinity structure in SRAT
+
+    ID: EArchCommonObjDeviceHandlePci
+*/
+typedef struct CmArchCommonDeviceHandlePci {
+  /// PCI Segment Number
+  UINT16    SegmentNumber;
+
+  /// PCI Bus Number - Max 256 busses (Bits 15:8 of BDF)
+  UINT8     BusNumber;
+
+  /// PCI Device Number - Max 32 devices (Bits 7:3 of BDF)
+  UINT8     DeviceNumber;
+
+  /// PCI Function Number - Max 8 functions (Bits 2:0 of BDF)
+  UINT8     FunctionNumber;
+} CM_ARCH_COMMON_DEVICE_HANDLE_PCI;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 64c5f2677246..05691e6fcf69 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -50,21 +50,20 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
   EArmObjProcHierarchyInfo,                                    ///< 20 - Processor Hierarchy Info
   EArmObjCacheInfo,                                            ///< 21 - Cache Info
-  EArmObjDeviceHandlePci,                                      ///< 22 - Device Handle Pci
-  EArmObjGenericInitiatorAffinityInfo,                         ///< 23 - Generic Initiator Affinity
-  EArmObjCmn600Info,                                           ///< 24 - CMN-600 Info
-  EArmObjLpiInfo,                                              ///< 25 - Lpi Info
-  EArmObjRmr,                                                  ///< 26 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 27 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 28 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 29 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 30 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 31 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 32 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 33 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 34 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 35 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 36 - P-State Dependency (PSD) Info
+  EArmObjGenericInitiatorAffinityInfo,                         ///< 22 - Generic Initiator Affinity
+  EArmObjCmn600Info,                                           ///< 23 - CMN-600 Info
+  EArmObjLpiInfo,                                              ///< 24 - Lpi Info
+  EArmObjRmr,                                                  ///< 25 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 26 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 27 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 28 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 29 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 30 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 31 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 32 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 33 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 34 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 35 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -719,25 +718,6 @@ typedef struct CmArmCacheInfo {
   UINT32             CacheId;
 } CM_ARM_CACHE_INFO;
 
-/** A structure that describes the PCI Device Handle (Type 1) in the
-    Generic Initiator Affinity structure in SRAT
-
-    ID: EArmObjDeviceHandlePci
-*/
-typedef struct CmArmDeviceHandlePci {
-  /// PCI Segment Number
-  UINT16    SegmentNumber;
-
-  /// PCI Bus Number - Max 256 busses (Bits 15:8 of BDF)
-  UINT8     BusNumber;
-
-  /// PCI Device Number - Max 32 devices (Bits 7:3 of BDF)
-  UINT8     DeviceNumber;
-
-  /// PCI Function Number - Max 8 functions (Bits 2:0 of BDF)
-  UINT8     FunctionNumber;
-} CM_ARM_DEVICE_HANDLE_PCI;
-
 /** A structure that describes the Generic Initiator Affinity structure in SRAT
 
     ID: EArmObjGenericInitiatorAffinityInfo
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
index c65a28cd142a..66fefc80f5f6 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
@@ -35,7 +35,7 @@
     - EArchCommonObjMemoryAffinityInfo (OPTIONAL)
     - EArmObjGenericInitiatorAffinityInfo (OPTIONAL)
     - EArchCommonObjDeviceHandleAcpi (OPTIONAL)
-    - EArmObjDeviceHandlePci (OPTIONAL)
+    - EArchCommonObjDeviceHandlePci (OPTIONAL)
 */
 
 /** This macro expands to a function that retrieves the GIC
@@ -92,9 +92,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjDeviceHandlePci,
-  CM_ARM_DEVICE_HANDLE_PCI
+  EObjNameSpaceArchCommon,
+  EArchCommonObjDeviceHandlePci,
+  CM_ARCH_COMMON_DEVICE_HANDLE_PCI
   );
 
 /** Return the PCI Device information in BDF format
@@ -110,7 +110,7 @@ GET_OBJECT_LIST (
 STATIC
 UINT16
 GetBdf (
-  IN CONST CM_ARM_DEVICE_HANDLE_PCI  *DeviceHandlePci
+  IN CONST CM_ARCH_COMMON_DEVICE_HANDLE_PCI  *DeviceHandlePci
   )
 {
   UINT16  Bdf;
@@ -302,7 +302,7 @@ AddGenericInitiatorAffinity (
   EFI_STATUS                                         Status;
   EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE  *GenInitAff;
   CM_ARCH_COMMON_DEVICE_HANDLE_ACPI                  *DeviceHandleAcpi;
-  CM_ARM_DEVICE_HANDLE_PCI                           *DeviceHandlePci;
+  CM_ARCH_COMMON_DEVICE_HANDLE_PCI                   *DeviceHandlePci;
   UINT32                                             DeviceHandleCount;
 
   ASSERT (Srat != NULL);
@@ -362,7 +362,7 @@ AddGenericInitiatorAffinity (
     } else if (GenInitAffInfo->DeviceHandleType ==
                EFI_ACPI_6_3_PCI_DEVICE_HANDLE)
     {
-      Status = GetEArmObjDeviceHandlePci (
+      Status = GetEArchCommonObjDeviceHandlePci (
                  CfgMgrProtocol,
                  GenInitAffInfo->DeviceHandleToken,
                  &DeviceHandlePci,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 43aae423814f..d5ee9317e693 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -165,21 +165,20 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 19 - SMMU Interrupt Array
   TokenFixerNotImplemented,         ///< 20 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 21 - Cache Info
-  NULL,                             ///< 22 - Device Handle Pci
-  NULL,                             ///< 23 - Generic Initiator Affinity
-  NULL,                             ///< 24 - CMN-600 Info
-  NULL,                             ///< 25 - Lpi Info
-  NULL,                             ///< 26 - Reserved Memory Range Node
-  NULL,                             ///< 27 - Memory Range Descriptor
-  NULL,                             ///< 28 - Continuous Performance Control Info
-  NULL,                             ///< 29 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 22 - Generic Initiator Affinity
+  NULL,                             ///< 23 - CMN-600 Info
+  NULL,                             ///< 24 - Lpi Info
+  NULL,                             ///< 25 - Reserved Memory Range Node
+  NULL,                             ///< 26 - Memory Range Descriptor
+  NULL,                             ///< 27 - Continuous Performance Control Info
+  NULL,                             ///< 28 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 29 - Pcc Subspace Type 2 Info
   NULL,                             ///< 30 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 31 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 32 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 33 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 34 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 35 - Embedded Trace Extension/Module Info
-  NULL                              ///< 36 - P-State Dependency (PSD) Info
+  NULL,                             ///< 31 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 32 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 33 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 34 - Embedded Trace Extension/Module Info
+  NULL                              ///< 35 - 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 9326ea639351..4b4965dfb00f 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -372,9 +372,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonDeviceHandleAcpiParser[] = {
   { "Uid", 4, "0x%x",   NULL }
 };
 
-/** A parser for EArmObjDeviceHandlePci.
+/** A parser for EArchCommonObjDeviceHandlePci.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmDeviceHandlePciParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonDeviceHandlePciParser[] = {
   { "SegmentNumber",  2, "0x%x", NULL },
   { "BusNumber",      1, "0x%x", NULL },
   { "DeviceNumber",   1, "0x%x", NULL },
@@ -683,6 +683,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,       CmArchCommonPciInterruptMapInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryAffinityInfo,        CmArchCommonMemoryAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi,          CmArchCommonDeviceHandleAcpiParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci,           CmArchCommonDeviceHandlePciParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -711,7 +712,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArchCommonGenericInterruptParser),
   CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjDeviceHandlePci,             CmArmDeviceHandlePciParser),
   CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                  CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjLpiInfo,                     CmArmLpiInfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index f82c37f4afeb..9c7738983df5 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -462,21 +462,20 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  19   | SMMU Interrupt Array                      | |
 |  20   | Processor Hierarchy Info                  | Move to Arch Common NS |
 |  21   | Cache Info                                | Move to Arch Common NS |
-|  22   | Device Handle PCI                         | Move to Arch Common NS |
-|  23   | Generic Initiator Affinity Info           | Move to Arch Common NS |
-|  24   | CMN 600 Info                              | |
-|  25   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  26   | Reserved Memory Range Node                | |
-|  27   | Memory Range Descriptor                   | |
-|  28   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  29   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  30   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  31   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  32   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  34   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  35   | Embedded Trace Extension/Module Info      | |
-|  36   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  22   | Generic Initiator Affinity Info           | Move to Arch Common NS |
+|  23   | CMN 600 Info                              | |
+|  24   | Low Power Idle State Info                 | Move to Arch Common NS |
+|  25   | Reserved Memory Range Node                | |
+|  26   | Memory Range Descriptor                   | |
+|  27   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  28   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  29   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  30   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  31   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  32   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  33   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  34   | Embedded Trace Extension/Module Info      | |
+|  35   | 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
 |  10   | PCI Interrupt Map Info            | |
 |  11   | Memory Affinity Info              | |
 |  12   | Device Handle Acpi                | |
+|  13   | Device Handle PCI                 | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116984): https://edk2.groups.io/g/devel/message/116984
Mute This Topic: https://groups.io/mt/105068154/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 07/19] DynamicTablesPkg: Move Generic Initiator affinity info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (5 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 06/19] DynamicTablesPkg: Move PCI " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 08/19] DynamicTablesPkg: Move LPI info object " PierreGondois
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the Generic Initiator affinity info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - SRAT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      |  19 ++++
 .../Include/ArmNameSpaceObjects.h             |  45 +++-----
 .../Acpi/Arm/AcpiSratLibArm/SratGenerator.c   |  20 ++--
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  25 +++--
 .../ConfigurationManagerObjectParser.c        | 100 +++++++++---------
 DynamicTablesPkg/Readme.md                    |  28 ++---
 6 files changed, 118 insertions(+), 119 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 230d0bc334c0..b70c327d46e4 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -34,6 +34,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjMemoryAffinityInfo,             ///< 11 - Memory Affinity Info
   EArchCommonObjDeviceHandleAcpi,               ///< 12 - Device Handle Acpi
   EArchCommonObjDeviceHandlePci,                ///< 13 - Device Handle Pci
+  EArchCommonObjGenericInitiatorAffinityInfo,   ///< 14 - Generic Initiator Affinity
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -276,6 +277,24 @@ typedef struct CmArchCommonDeviceHandlePci {
   UINT8     FunctionNumber;
 } CM_ARCH_COMMON_DEVICE_HANDLE_PCI;
 
+/** A structure that describes the Generic Initiator Affinity structure in SRAT
+
+    ID: EArchCommonObjGenericInitiatorAffinityInfo
+*/
+typedef struct CmArchCommonGenericInitiatorAffinityInfo {
+  /// The proximity domain to which the generic initiator belongs.
+  UINT32             ProximityDomain;
+
+  /// Flags
+  UINT32             Flags;
+
+  /// Device Handle Type
+  UINT8              DeviceHandleType;
+
+  /// Reference Token for the Device Handle
+  CM_OBJECT_TOKEN    DeviceHandleToken;
+} CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 05691e6fcf69..ddf886a53db4 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -50,20 +50,19 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
   EArmObjProcHierarchyInfo,                                    ///< 20 - Processor Hierarchy Info
   EArmObjCacheInfo,                                            ///< 21 - Cache Info
-  EArmObjGenericInitiatorAffinityInfo,                         ///< 22 - Generic Initiator Affinity
-  EArmObjCmn600Info,                                           ///< 23 - CMN-600 Info
-  EArmObjLpiInfo,                                              ///< 24 - Lpi Info
-  EArmObjRmr,                                                  ///< 25 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 26 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 27 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 28 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 29 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 30 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 31 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 32 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 33 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 34 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 35 - P-State Dependency (PSD) 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
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -718,24 +717,6 @@ typedef struct CmArmCacheInfo {
   UINT32             CacheId;
 } CM_ARM_CACHE_INFO;
 
-/** A structure that describes the Generic Initiator Affinity structure in SRAT
-
-    ID: EArmObjGenericInitiatorAffinityInfo
-*/
-typedef struct CmArmGenericInitiatorAffinityInfo {
-  /// The proximity domain to which the generic initiator belongs.
-  UINT32             ProximityDomain;
-
-  /// Flags
-  UINT32             Flags;
-
-  /// Device Handle Type
-  UINT8              DeviceHandleType;
-
-  /// Reference Token for the Device Handle
-  CM_OBJECT_TOKEN    DeviceHandleToken;
-} CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO;
-
 /** A structure that describes the CMN-600 hardware.
 
     ID: EArmObjCmn600Info
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
index 66fefc80f5f6..48c9970a7151 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c
@@ -33,7 +33,7 @@
     - EArmObjGicCInfo (REQUIRED)
     - EArmObjGicItsInfo (OPTIONAL)
     - EArchCommonObjMemoryAffinityInfo (OPTIONAL)
-    - EArmObjGenericInitiatorAffinityInfo (OPTIONAL)
+    - EArchCommonObjGenericInitiatorAffinityInfo (OPTIONAL)
     - EArchCommonObjDeviceHandleAcpi (OPTIONAL)
     - EArchCommonObjDeviceHandlePci (OPTIONAL)
 */
@@ -72,9 +72,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjGenericInitiatorAffinityInfo,
-  CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjGenericInitiatorAffinityInfo,
+  CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO
   );
 
 /**
@@ -295,7 +295,7 @@ AddGenericInitiatorAffinity (
   IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL         *CONST  CfgMgrProtocol,
   IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST  Srat,
   IN CONST UINT32                                               GenInitAffOff,
-  IN CONST CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO               *GenInitAffInfo,
+  IN CONST CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO       *GenInitAffInfo,
   IN       UINT32                                               GenInitAffCount
   )
 {
@@ -465,10 +465,10 @@ BuildSratTable (
   UINT32  MemAffOffset;
   UINT32  GenInitiatorAffOffset;
 
-  CM_ARM_GICC_INFO                        *GicCInfo;
-  CM_ARM_GIC_ITS_INFO                     *GicItsInfo;
-  CM_ARCH_COMMON_MEMORY_AFFINITY_INFO     *MemAffInfo;
-  CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO  *GenInitiatorAffInfo;
+  CM_ARM_GICC_INFO                                *GicCInfo;
+  CM_ARM_GIC_ITS_INFO                             *GicItsInfo;
+  CM_ARCH_COMMON_MEMORY_AFFINITY_INFO             *MemAffInfo;
+  CM_ARCH_COMMON_GENERIC_INITIATOR_AFFINITY_INFO  *GenInitiatorAffInfo;
 
   EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER  *Srat;
 
@@ -552,7 +552,7 @@ BuildSratTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjGenericInitiatorAffinityInfo (
+  Status = GetEArchCommonObjGenericInitiatorAffinityInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &GenInitiatorAffInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index d5ee9317e693..5f3e9f5fdcb5 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -165,20 +165,19 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 19 - SMMU Interrupt Array
   TokenFixerNotImplemented,         ///< 20 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 21 - Cache Info
-  NULL,                             ///< 22 - Generic Initiator Affinity
-  NULL,                             ///< 23 - CMN-600 Info
-  NULL,                             ///< 24 - Lpi Info
-  NULL,                             ///< 25 - Reserved Memory Range Node
-  NULL,                             ///< 26 - Memory Range Descriptor
-  NULL,                             ///< 27 - Continuous Performance Control Info
-  NULL,                             ///< 28 - Pcc Subspace Type 0 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,                             ///< 28 - Pcc Subspace Type 2 Info
   NULL,                             ///< 29 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 30 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 31 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 32 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 33 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 34 - Embedded Trace Extension/Module Info
-  NULL                              ///< 35 - P-State Dependency (PSD) 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
 };
 
 /** CmObj token fixer.
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 4b4965dfb00f..732454da8f93 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -381,9 +381,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonDeviceHandlePciParser[] = {
   { "FunctionNumber", 1, "0x%x", NULL }
 };
 
-/** A parser for EArmObjGenericInitiatorAffinityInfo.
+/** A parser for EArchCommonObjGenericInitiatorAffinityInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmGenericInitiatorAffinityInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonGenericInitiatorAffinityInfoParser[] = {
   { "ProximityDomain",   4,                        "0x%x", NULL },
   { "Flags",             4,                        "0x%x", NULL },
   { "DeviceHandleType",  1,                        "0x%x", NULL },
@@ -671,19 +671,20 @@ STATIC CONST CM_OBJ_PARSER  CmArmPsdInfoParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjReserved),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjPowerManagementProfileInfo,CmArchCommonPowerManagementProfileInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjSerialPortInfo,            CmArchCommonSerialPortInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjConsolePortInfo,           CmArchCommonSerialPortInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjSerialDebugPortInfo,       CmArchCommonSerialPortInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjHypervisorVendorIdentity,  CmArchCommonHypervisorVendorIdentityParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjFixedFeatureFlags,         CmArchCommonFixedFeatureFlagsParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjCmRef,                     CmArchCommonObjRefParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjPciConfigSpaceInfo,        CmArchCommonPciConfigSpaceInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,         CmArchCommonPciAddressMapInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,       CmArchCommonPciInterruptMapInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryAffinityInfo,        CmArchCommonMemoryAffinityInfoParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi,          CmArchCommonDeviceHandleAcpiParser),
-  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci,           CmArchCommonDeviceHandlePciParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPowerManagementProfileInfo,  CmArchCommonPowerManagementProfileInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjSerialPortInfo,              CmArchCommonSerialPortInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjConsolePortInfo,             CmArchCommonSerialPortInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjSerialDebugPortInfo,         CmArchCommonSerialPortInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjHypervisorVendorIdentity,    CmArchCommonHypervisorVendorIdentityParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjFixedFeatureFlags,           CmArchCommonFixedFeatureFlagsParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjCmRef,                       CmArchCommonObjRefParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPciConfigSpaceInfo,          CmArchCommonPciConfigSpaceInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPciAddressMapInfo,           CmArchCommonPciAddressMapInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPciInterruptMapInfo,         CmArchCommonPciInterruptMapInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjMemoryAffinityInfo,          CmArchCommonMemoryAffinityInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandleAcpi,            CmArchCommonDeviceHandleAcpiParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci,             CmArchCommonDeviceHandlePciParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -691,41 +692,40 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT_RESERVED (EArmObjReserved),
-  CM_PARSER_ADD_OBJECT (EArmObjBootArchInfo,                CmArmBootArchInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicCInfo,                    CmArmGicCInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicDInfo,                    CmArmGicDInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicMsiFrameInfo,             CmArmGicMsiFrameInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicRedistributorInfo,        CmArmGicRedistInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicItsInfo,                  CmArmGicItsInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGenericTimerInfo,            CmArmGenericTimerInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPlatformGTBlockInfo,         CmArmGTBlockInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGTBlockTimerFrameInfo,       CmArmGTBlockTimerFrameInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPlatformGenericWatchdogInfo, CmArmGenericWatchdogInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjItsGroup,                    CmArmItsGroupNodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjNamedComponent,              CmArmNamedComponentNodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjRootComplex,                 CmArmRootComplexNodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjSmmuV1SmmuV2,                CmArmSmmuV1SmmuV2NodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjSmmuV3,                      CmArmSmmuV3NodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPmcg,                        CmArmPmcgNodeParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGicItsIdentifierArray,       CmArmGicItsIdentifierParser),
-  CM_PARSER_ADD_OBJECT (EArmObjIdMappingArray,              CmArmIdMappingParser),
-  CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArchCommonGenericInterruptParser),
-  CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjGenericInitiatorAffinityInfo,CmArmGenericInitiatorAffinityInfoParser),
-  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),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType0Info,        CmArmPccSubspaceType0InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType1Info,        CmArmPccSubspaceType1InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,        CmArmPccSubspaceType2InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,        CmArmPccSubspaceType34InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType4Info,        CmArmPccSubspaceType34InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType5Info,        CmArmPccSubspaceType5InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjEtInfo,                      CmArmEtInfo),
-  CM_PARSER_ADD_OBJECT (EArmObjPsdInfo,                     CmArmPsdInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjBootArchInfo,               CmArmBootArchInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicCInfo,                   CmArmGicCInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicDInfo,                   CmArmGicDInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicMsiFrameInfo,            CmArmGicMsiFrameInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicRedistributorInfo,       CmArmGicRedistInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicItsInfo,                 CmArmGicItsInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGenericTimerInfo,           CmArmGenericTimerInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPlatformGTBlockInfo,        CmArmGTBlockInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGTBlockTimerFrameInfo,      CmArmGTBlockTimerFrameInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPlatformGenericWatchdogInfo,CmArmGenericWatchdogInfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjItsGroup,                   CmArmItsGroupNodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjNamedComponent,             CmArmNamedComponentNodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjRootComplex,                CmArmRootComplexNodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjSmmuV1SmmuV2,               CmArmSmmuV1SmmuV2NodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjSmmuV3,                     CmArmSmmuV3NodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPmcg,                       CmArmPmcgNodeParser),
+  CM_PARSER_ADD_OBJECT (EArmObjGicItsIdentifierArray,      CmArmGicItsIdentifierParser),
+  CM_PARSER_ADD_OBJECT (EArmObjIdMappingArray,             CmArmIdMappingParser),
+  CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,         CmArchCommonGenericInterruptParser),
+  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),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType0Info,       CmArmPccSubspaceType0InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType1Info,       CmArmPccSubspaceType1InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,       CmArmPccSubspaceType2InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,       CmArmPccSubspaceType34InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType4Info,       CmArmPccSubspaceType34InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType5Info,       CmArmPccSubspaceType5InfoParser),
+  CM_PARSER_ADD_OBJECT (EArmObjEtInfo,                     CmArmEtInfo),
+  CM_PARSER_ADD_OBJECT (EArmObjPsdInfo,                    CmArmPsdInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArmObjMax)
 };
 
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 9c7738983df5..303f85986566 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -462,20 +462,19 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  19   | SMMU Interrupt Array                      | |
 |  20   | Processor Hierarchy Info                  | Move to Arch Common NS |
 |  21   | Cache Info                                | Move to Arch Common NS |
-|  22   | Generic Initiator Affinity Info           | Move to Arch Common NS |
-|  23   | CMN 600 Info                              | |
-|  24   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  25   | Reserved Memory Range Node                | |
-|  26   | Memory Range Descriptor                   | |
-|  27   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  28   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  29   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  30   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  31   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  32   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  33   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  34   | Embedded Trace Extension/Module Info      | |
-|  35   | P-State Dependency (PSD) 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 |
 |  `*`  | 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
 |  11   | Memory Affinity Info              | |
 |  12   | Device Handle Acpi                | |
 |  13   | Device Handle PCI                 | |
+|  14   | Generic Initiator Affinity Info   | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116985): https://edk2.groups.io/g/devel/message/116985
Mute This Topic: https://groups.io/mt/105068157/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 08/19] DynamicTablesPkg: Move LPI info object to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (6 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 07/19] DynamicTablesPkg: Move Generic Initiator affinity info " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 09/19] DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info PierreGondois
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@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.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>
---
 .../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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 09/19] DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (7 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 08/19] DynamicTablesPkg: Move LPI info object " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 10/19] DynamicTablesPkg: Move Processor hierarchy info to Arch Common PierreGondois
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

The GicCToken field in the CM_ARM_PROC_HIERARCHY_INFO structure is
a reference to the associated object which has the corresponding
ACPI Processor ID, e.g. for Arm systems this is a reference to the
CM_ARM_GICC_INFO object.
For other architecture this may be a reference to a similar object
that has the ACPI Processor ID.

Therefore, rename the GicCToken field to a more generic name like
AcpiIdObjectToken.

Correspondingly also update the following modules to reflect the
changes introduced by this renaming:
 - PPTT generator
 - SSDT CPu topology generator
 - ConfigurationManagerObjectParser.

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>
---
 .../Include/ArmNameSpaceObjects.h             | 10 ++--
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 60 ++++++++++---------
 .../SsdtCpuTopologyGenerator.c                |  8 +--
 .../ConfigurationManagerObjectParser.c        |  2 +-
 4 files changed, 41 insertions(+), 39 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index e019323c1fcd..da50f581fa25 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -657,11 +657,11 @@ typedef struct CmArmProcHierarchyInfo {
   /// 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;
+  /// Token of the associated object which has the corresponding ACPI Processor
+  /// ID, e.g. for Arm systems this is a reference to CM_ARM_GICC_INFO object.
+  /// A value of CM_NULL_TOKEN means this node represents a group of associated
+  /// processors and it does not have an associated CPU interface.
+  CM_OBJECT_TOKEN    AcpiIdObjectToken;
   /// Number of resources private to this Node
   UINT32             NoOfPrivateResources;
   /// Token of the array which contains references to the resources private to
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index c237f7ff9386..f2f2a834116e 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -397,12 +397,14 @@ AddPrivateResources (
   @param [in]  Index2         Index of Object2 to be displayed for debugging
                               purposes.
 
-  @retval TRUE                Object1 and Object2 have the same GicCToken.
-  @retval FALSE               Object1 and Object2 have different GicCTokens.
+  @retval TRUE                Object1 and Object2 have the same
+                              AcpiIdObjectToken.
+  @retval FALSE               Object1 and Object2 have different
+                              AcpiIdObjectTokens.
 **/
 BOOLEAN
 EFIAPI
-IsGicCTokenEqual (
+IsAcpiIdObjectTokenEqual (
   IN  CONST VOID   *Object1,
   IN  CONST VOID   *Object2,
   IN        UINTN  Index1,
@@ -426,18 +428,18 @@ IsGicCTokenEqual (
 
   if (IS_ACPI_PROC_ID_VALID (ProcNode1) &&
       IS_ACPI_PROC_ID_VALID (ProcNode2) &&
-      (ProcNode1->GicCToken != CM_NULL_TOKEN) &&
-      (ProcNode2->GicCToken != CM_NULL_TOKEN) &&
-      (ProcNode1->GicCToken == ProcNode2->GicCToken))
+      (ProcNode1->AcpiIdObjectToken != CM_NULL_TOKEN) &&
+      (ProcNode2->AcpiIdObjectToken != CM_NULL_TOKEN) &&
+      (ProcNode1->AcpiIdObjectToken == ProcNode2->AcpiIdObjectToken))
   {
     DEBUG ((
       DEBUG_ERROR,
       "ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \
-      "the same GICC Info object. ACPI Processor IDs are not unique. " \
-      "GicCToken = %p.\n",
+      "the same ACPI ID reference object. ACPI Processor IDs are not unique. " \
+      "AcpiIdObjectToken = %p.\n",
       Index1,
       Index2,
-      ProcNode1->GicCToken
+      ProcNode1->AcpiIdObjectToken
       ));
     return TRUE;
   }
@@ -474,7 +476,7 @@ AddProcHierarchyNodes (
   EFI_STATUS                             Status;
   EFI_ACPI_6_4_PPTT_STRUCTURE_PROCESSOR  *ProcStruct;
   UINT32                                 *PrivateResources;
-  BOOLEAN                                IsGicCTokenDuplicated;
+  BOOLEAN                                IsAcpiIdObjectTokenDuplicated;
 
   CM_ARM_GICC_INFO  *GicCInfoList;
   UINT32            GicCInfoCount;
@@ -500,15 +502,15 @@ AddProcHierarchyNodes (
   NodeCount        = Generator->ProcHierarchyNodeCount;
 
   // Check if every GICC Object is referenced by onlu one Proc Node
-  IsGicCTokenDuplicated = FindDuplicateValue (
-                            ProcNodeIterator,
-                            NodeCount,
-                            sizeof (PPTT_NODE_INDEXER),
-                            IsGicCTokenEqual
-                            );
+  IsAcpiIdObjectTokenDuplicated = FindDuplicateValue (
+                                    ProcNodeIterator,
+                                    NodeCount,
+                                    sizeof (PPTT_NODE_INDEXER),
+                                    IsAcpiIdObjectTokenEqual
+                                    );
   // Duplicate GIC CPU Interface Token was found so two PPTT Processor Hierarchy
   // Nodes map to the same MADT GICC structure
-  if (IsGicCTokenDuplicated) {
+  if (IsAcpiIdObjectTokenDuplicated) {
     return EFI_INVALID_PARAMETER;
   }
 
@@ -602,14 +604,14 @@ AddProcHierarchyNodes (
     if (!IS_ACPI_PROC_ID_VALID (ProcInfoNode)) {
       // Default invalid ACPI Processor ID to 0
       ProcStruct->AcpiProcessorId = 0;
-    } else if (ProcInfoNode->GicCToken == CM_NULL_TOKEN) {
+    } else if (ProcInfoNode->AcpiIdObjectToken == CM_NULL_TOKEN) {
       Status = EFI_INVALID_PARAMETER;
       DEBUG ((
         DEBUG_ERROR,
-        "ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no GICC " \
-        "structure token was provided. GicCToken = %p. RequestorToken = %p. " \
-        "Status = %r\n",
-        ProcInfoNode->GicCToken,
+        "ERROR: PPTT: The 'ACPI Processor ID valid' flag is set but no " \
+        "ACPI ID Reference object token was provided. " \
+        "AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
+        ProcInfoNode->AcpiIdObjectToken,
         ProcInfoNode->Token,
         Status
         ));
@@ -617,17 +619,17 @@ AddProcHierarchyNodes (
     } else {
       Status = GetEArmObjGicCInfo (
                  CfgMgrProtocol,
-                 ProcInfoNode->GicCToken,
+                 ProcInfoNode->AcpiIdObjectToken,
                  &GicCInfoList,
                  &GicCInfoCount
                  );
       if (EFI_ERROR (Status)) {
         DEBUG ((
           DEBUG_ERROR,
-          "ERROR: PPTT: Failed to get GICC structure. ACPI Processor ID " \
-          "can't be populated. GicCToken = %p. RequestorToken = %p. " \
-          "Status = %r\n",
-          ProcInfoNode->GicCToken,
+          "ERROR: PPTT: Failed to get ACPI ID Reference object token.  " \
+          "ACPI Processor ID can't be populated. " \
+          "AcpiIdObjectToken = %p. RequestorToken = %p. Status = %r\n",
+          ProcInfoNode->AcpiIdObjectToken,
           ProcInfoNode->Token,
           Status
           ));
@@ -640,10 +642,10 @@ AddProcHierarchyNodes (
           DEBUG_ERROR,
           "ERROR: PPTT: Failed to find a unique GICC structure. " \
           "ACPI Processor ID can't be populated. " \
-          "GICC Structure Count = %d. GicCToken = %p. RequestorToken = %p " \
+          "GICC Structure Count = %d. AcpiIdObjectToken = %p. RequestorToken = %p " \
           "Status = %r\n",
           GicCInfoCount,
-          ProcInfoNode->GicCToken,
+          ProcInfoNode->AcpiIdObjectToken,
           ProcInfoNode->Token,
           Status
           ));
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 6ce7b71fac8b..5a5bfefd894e 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -894,11 +894,11 @@ CreateAmlCpuFromProcHierarchy (
   ASSERT (CfgMgrProtocol != NULL);
   ASSERT (ParentNode != NULL);
   ASSERT (ProcHierarchyNodeInfo != NULL);
-  ASSERT (ProcHierarchyNodeInfo->GicCToken != CM_NULL_TOKEN);
+  ASSERT (ProcHierarchyNodeInfo->AcpiIdObjectToken != CM_NULL_TOKEN);
 
   Status = GetEArmObjGicCInfo (
              CfgMgrProtocol,
-             ProcHierarchyNodeInfo->GicCToken,
+             ProcHierarchyNodeInfo->AcpiIdObjectToken,
              &GicCInfo,
              NULL
              );
@@ -1170,9 +1170,9 @@ CreateAmlCpuTopologyTree (
     // Find the children of the CM_ARM_PROC_HIERARCHY_INFO
     // currently being handled (i.e. ParentToken == NodeToken).
     if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
-      // Only Cpus (leaf nodes in this tree) have a GicCToken.
+      // Only Cpus (leaf nodes in this tree) have a AcpiIdObjectToken.
       // Create a Cpu node.
-      if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) {
+      if (Generator->ProcNodeList[Index].AcpiIdObjectToken != CM_NULL_TOKEN) {
         Status = CheckProcNode (
                    Generator->ProcNodeList[Index].Flags,
                    TRUE,
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 050cd04d09c2..17388b183554 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -328,7 +328,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] = {
   { "Token",                      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "Flags",                      4,                        "0x%x", NULL },
   { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-  { "GicCToken",                  sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "AcpiIdObjectToken",          sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "NoOfPrivateResources",       4,                        "0x%x", NULL },
   { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "LpiToken",                   sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116987): https://edk2.groups.io/g/devel/message/116987
Mute This Topic: https://groups.io/mt/105068161/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 10/19] DynamicTablesPkg: Move Processor hierarchy info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (8 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 09/19] DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 11/19] DynamicTablesPkg: Move Cache " PierreGondois
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

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

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PPTT generator
 - 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 42 +++++++++++
 .../Include/ArmNameSpaceObjects.h             | 74 ++++---------------
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 38 +++++-----
 .../SsdtCpuTopologyGenerator.c                | 67 +++++++++--------
 .../SsdtCpuTopologyGenerator.h                | 18 ++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  1 -
 .../ConfigurationManagerObjectParser.c        |  6 +-
 DynamicTablesPkg/Readme.md                    | 29 ++++----
 8 files changed, 137 insertions(+), 138 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 681e84501960..872f2eebb7c3 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -36,6 +36,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjDeviceHandlePci,                ///< 13 - Device Handle Pci
   EArchCommonObjGenericInitiatorAffinityInfo,   ///< 14 - Generic Initiator Affinity
   EArchCommonObjLpiInfo,                        ///< 15 - Lpi Info
+  EArchCommonObjProcHierarchyInfo,              ///< 16 - Processor Hierarchy Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -359,6 +360,47 @@ typedef struct CmArchCommonLpiInfo {
   CHAR8                                     StateName[16];
 } CM_ARCH_COMMON_LPI_INFO;
 
+/** A structure that describes the Processor Hierarchy Node (Type 0) in PPTT
+
+    ID: EArchCommonObjProcHierarchyInfo
+*/
+typedef struct CmArchCommonProcHierarchyInfo {
+  /// 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_ARCH_COMMON_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 object which has the corresponding ACPI Processor
+  /// ID, e.g. for Arm systems this is a reference to CM_ARM_GICC_INFO object.
+  /// A value of CM_NULL_TOKEN means this node represents a group of associated
+  /// processors and it does not have an associated CPU interface.
+  CM_OBJECT_TOKEN    AcpiIdObjectToken;
+  /// Number of resources private to this Node
+  UINT32             NoOfPrivateResources;
+  /// Token of the array which contains references to the resources private to
+  /// this CM_ARCH_COMMON_PROC_HIERARCHY_INFO instance. This field is ignored if
+  /// the NoOfPrivateResources is 0, in which case it is recommended to set
+  /// this field to CM_NULL_TOKEN.
+  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_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.
+  /// This should be consistently set for containers or processors to avoid
+  /// duplicate values
+  BOOLEAN            OverrideNameUidEnabled;
+  /// If OverrideNameUidEnabled is TRUE then this value will be used for name of
+  /// processors and processor containers.
+  UINT16             OverrideName;
+  /// If OverrideNameUidEnabled is TRUE then this value will be used for
+  /// the UID of processor containers.
+  UINT32             OverrideUid;
+} CM_ARCH_COMMON_PROC_HIERARCHY_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index da50f581fa25..4e9f0096ba60 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -48,20 +48,19 @@ typedef enum ArmObjectID {
   EArmObjGicItsIdentifierArray,                                ///< 17 - GIC ITS Identifier Array
   EArmObjIdMappingArray,                                       ///< 18 - ID Mapping Array
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
-  EArmObjProcHierarchyInfo,                                    ///< 20 - Processor Hierarchy Info
-  EArmObjCacheInfo,                                            ///< 21 - Cache Info
-  EArmObjCmn600Info,                                           ///< 22 - CMN-600 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
+  EArmObjCacheInfo,                                            ///< 20 - Cache Info
+  EArmObjCmn600Info,                                           ///< 21 - CMN-600 Info
+  EArmObjRmr,                                                  ///< 22 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 23 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 24 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 25 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 26 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 27 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 28 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 29 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 30 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 31 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 32 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -645,47 +644,6 @@ typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT;
 */
 typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_EXTENDED_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 object which has the corresponding ACPI Processor
-  /// ID, e.g. for Arm systems this is a reference to CM_ARM_GICC_INFO object.
-  /// A value of CM_NULL_TOKEN means this node represents a group of associated
-  /// processors and it does not have an associated CPU interface.
-  CM_OBJECT_TOKEN    AcpiIdObjectToken;
-  /// 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 recommended to set
-  /// this field to CM_NULL_TOKEN.
-  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_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.
-  /// This should be consistently set for containers or processors to avoid
-  /// duplicate values
-  BOOLEAN            OverrideNameUidEnabled;
-  /// If OverrideNameUidEnabled is TRUE then this value will be used for name of
-  /// processors and processor containers.
-  UINT16             OverrideName;
-  /// If OverrideNameUidEnabled is TRUE then this value will be used for
-  /// the UID of processor containers.
-  UINT32             OverrideUid;
-} CM_ARM_PROC_HIERARCHY_INFO;
-
 /** A structure that describes the Cache Type Structure (Type 1) in PPTT
 
     ID: EArmObjCacheInfo
@@ -694,9 +652,9 @@ 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_ARCH_COMMON_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;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index f2f2a834116e..9485de707046 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -32,7 +32,7 @@
 
   Requirements:
     The following Configuration Manager Object(s) are used by this Generator:
-    - EArmObjProcHierarchyInfo (REQUIRED)
+    - EArchCommonObjProcHierarchyInfo (REQUIRED)
     - EArmObjCacheInfo
     - EArchCommonObjCmRef
     - EArmObjGicCInfo (REQUIRED)
@@ -43,9 +43,9 @@
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjProcHierarchyInfo,
-  CM_ARM_PROC_HIERARCHY_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjProcHierarchyInfo,
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO
   );
 
 /**
@@ -90,7 +90,7 @@ GET_OBJECT_LIST (
 STATIC
 UINT32
 GetProcHierarchyNodeSize (
-  IN  CONST CM_ARM_PROC_HIERARCHY_INFO  *Node
+  IN  CONST CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *Node
   )
 {
   ASSERT (Node != NULL);
@@ -107,7 +107,7 @@ GetProcHierarchyNodeSize (
 GET_SIZE_OF_PPTT_STRUCTS (
   ProcHierarchyNodes,
   GetProcHierarchyNodeSize (NodesToIndex),
-  CM_ARM_PROC_HIERARCHY_INFO
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO
   );
 
 /**
@@ -411,10 +411,10 @@ IsAcpiIdObjectTokenEqual (
   IN        UINTN  Index2
   )
 {
-  PPTT_NODE_INDEXER           *IndexedObject1;
-  PPTT_NODE_INDEXER           *IndexedObject2;
-  CM_ARM_PROC_HIERARCHY_INFO  *ProcNode1;
-  CM_ARM_PROC_HIERARCHY_INFO  *ProcNode2;
+  PPTT_NODE_INDEXER                   *IndexedObject1;
+  PPTT_NODE_INDEXER                   *IndexedObject2;
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcNode1;
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcNode2;
 
   ASSERT (
     (Object1 != NULL) &&
@@ -423,8 +423,8 @@ IsAcpiIdObjectTokenEqual (
 
   IndexedObject1 = (PPTT_NODE_INDEXER *)Object1;
   IndexedObject2 = (PPTT_NODE_INDEXER *)Object2;
-  ProcNode1      = (CM_ARM_PROC_HIERARCHY_INFO *)IndexedObject1->Object;
-  ProcNode2      = (CM_ARM_PROC_HIERARCHY_INFO *)IndexedObject2->Object;
+  ProcNode1      = (CM_ARCH_COMMON_PROC_HIERARCHY_INFO *)IndexedObject1->Object;
+  ProcNode2      = (CM_ARCH_COMMON_PROC_HIERARCHY_INFO *)IndexedObject2->Object;
 
   if (IS_ACPI_PROC_ID_VALID (ProcNode1) &&
       IS_ACPI_PROC_ID_VALID (ProcNode2) &&
@@ -482,8 +482,8 @@ AddProcHierarchyNodes (
   UINT32            GicCInfoCount;
   UINT32            UniqueGicCRefCount;
 
-  PPTT_NODE_INDEXER           *PpttNodeFound;
-  CM_ARM_PROC_HIERARCHY_INFO  *ProcInfoNode;
+  PPTT_NODE_INDEXER                   *PpttNodeFound;
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcInfoNode;
 
   PPTT_NODE_INDEXER  *ProcNodeIterator;
   UINT32             NodeCount;
@@ -517,7 +517,7 @@ AddProcHierarchyNodes (
   UniqueGicCRefCount = 0;
 
   while (NodeCount-- != 0) {
-    ProcInfoNode = (CM_ARM_PROC_HIERARCHY_INFO *)ProcNodeIterator->Object;
+    ProcInfoNode = (CM_ARCH_COMMON_PROC_HIERARCHY_INFO *)ProcNodeIterator->Object;
 
     // Check if the private resource count is within the size limit
     // imposed on the Processor Hierarchy node by the specification.
@@ -577,7 +577,7 @@ AddProcHierarchyNodes (
 
       // Test if the reference is to a 'leaf' node
       if (IS_PROC_NODE_LEAF (
-            ((CM_ARM_PROC_HIERARCHY_INFO *)PpttNodeFound->Object)
+            ((CM_ARCH_COMMON_PROC_HIERARCHY_INFO *)PpttNodeFound->Object)
             ))
       {
         Status = EFI_INVALID_PARAMETER;
@@ -1074,8 +1074,8 @@ BuildPpttTable (
   UINT32  ProcHierarchyNodeOffset;
   UINT32  CacheStructOffset;
 
-  CM_ARM_PROC_HIERARCHY_INFO  *ProcHierarchyNodeList;
-  CM_ARM_CACHE_INFO           *CacheStructList;
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcHierarchyNodeList;
+  CM_ARM_CACHE_INFO                   *CacheStructList;
 
   ACPI_PPTT_GENERATOR  *Generator;
 
@@ -1112,7 +1112,7 @@ BuildPpttTable (
 
   // Get the processor hierarchy info and update the processor topology
   // structure count with Processor Hierarchy Nodes (Type 0)
-  Status = GetEArmObjProcHierarchyInfo (
+  Status = GetEArchCommonObjProcHierarchyInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &ProcHierarchyNodeList,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 5a5bfefd894e..1bb90e114b16 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -38,7 +38,7 @@ Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
   - EArmObjGicCInfo
-  - EArmObjProcHierarchyInfo (OPTIONAL) along with
+  - EArchCommonObjProcHierarchyInfo (OPTIONAL) along with
   - EArchCommonObjCmRef (OPTIONAL)
   - EArchCommonObjLpiInfo (OPTIONAL)
   - GetEArmObjEtInfo (OPTIONAL)
@@ -59,9 +59,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjProcHierarchyInfo,
-  CM_ARM_PROC_HIERARCHY_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjProcHierarchyInfo,
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO
   );
 
 /**
@@ -116,12 +116,12 @@ GET_OBJECT_LIST (
 
 /** Initialize the TokenTable.
 
-  One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO
+  One entry should be allocated for each CM_ARCH_COMMON_PROC_HIERARCHY_INFO
   structure of the platform. The TokenTable allows to have a mapping:
   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).
+  than the number of cpus/clusters (CM_ARCH_COMMON_PROC_HIERARCHY_INFO).
 
   @param [in]  Generator  The SSDT Cpu Topology generator.
   @param [in]  Count      Number of entries to allocate in the TokenTable.
@@ -585,8 +585,8 @@ CreateAmlEtNode (
   }
 
   @param [in]  Generator              The SSDT Cpu Topology generator.
-  @param [in]  ProcHierarchyNodeInfo  CM_ARM_PROC_HIERARCHY_INFO describing
-                                      the Cpu.
+  @param [in]  ProcHierarchyNodeInfo  CM_ARCH_COMMON_PROC_HIERARCHY_INFO
+                                       describing the Cpu.
   @param [in]  Node                   Node to which the _LPI method is
                                       attached. Can represent a Cpu or a
                                       Cluster.
@@ -599,9 +599,9 @@ STATIC
 EFI_STATUS
 EFIAPI
 CreateAmlLpiMethod (
-  IN  ACPI_CPU_TOPOLOGY_GENERATOR  *Generator,
-  IN  CM_ARM_PROC_HIERARCHY_INFO   *ProcHierarchyNodeInfo,
-  IN  AML_OBJECT_NODE_HANDLE       *Node
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR         *Generator,
+  IN  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcHierarchyNodeInfo,
+  IN  AML_OBJECT_NODE_HANDLE              *Node
   )
 {
   EFI_STATUS  Status;
@@ -860,7 +860,7 @@ CreateAmlCpu (
   return Status;
 }
 
-/** Create a Cpu in the AML namespace from a CM_ARM_PROC_HIERARCHY_INFO
+/** Create a Cpu in the AML namespace from a CM_ARCH_COMMON_PROC_HIERARCHY_INFO
     CM object.
 
   @param [in]  Generator              The SSDT Cpu Topology generator.
@@ -868,8 +868,8 @@ CreateAmlCpu (
                                       Protocol Interface.
   @param [in]  ParentNode             Parent node to attach the Cpu node to.
   @param [in]  CpuName                Value used to generate the node name.
-  @param [in]  ProcHierarchyNodeInfo  CM_ARM_PROC_HIERARCHY_INFO describing
-                                      the Cpu.
+  @param [in]  ProcHierarchyNodeInfo  CM_ARCH_COMMON_PROC_HIERARCHY_INFO
+                                       describing the Cpu.
 
   @retval EFI_SUCCESS             Success.
   @retval EFI_INVALID_PARAMETER   Invalid parameter.
@@ -883,7 +883,7 @@ CreateAmlCpuFromProcHierarchy (
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
   IN        AML_NODE_HANDLE                               ParentNode,
   IN        UINT32                                        CpuName,
-  IN        CM_ARM_PROC_HIERARCHY_INFO                    *ProcHierarchyNodeInfo
+  IN        CM_ARCH_COMMON_PROC_HIERARCHY_INFO            *ProcHierarchyNodeInfo
   )
 {
   EFI_STATUS              Status;
@@ -914,7 +914,7 @@ CreateAmlCpuFromProcHierarchy (
   }
 
   // If a set of Lpi states is associated with the
-  // CM_ARM_PROC_HIERARCHY_INFO, create an _LPI method returning them.
+  // CM_ARCH_COMMON_PROC_HIERARCHY_INFO, create an _LPI method returning them.
   if (ProcHierarchyNodeInfo->LpiToken != CM_NULL_TOKEN) {
     Status = CreateAmlLpiMethod (Generator, ProcHierarchyNodeInfo, CpuNode);
     if (EFI_ERROR (Status)) {
@@ -961,7 +961,7 @@ CreateAmlCpuFromProcHierarchy (
 
 /** Create a Processor Container in the AML namespace.
 
-  Any CM_ARM_PROC_HIERARCHY_INFO object with the following flags is
+  Any CM_ARCH_COMMON_PROC_HIERARCHY_INFO object with the following flags is
   assumed to be a processor container:
    - EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL
    - EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID
@@ -979,8 +979,8 @@ CreateAmlCpuFromProcHierarchy (
                                       Protocol Interface.
   @param [in]  ParentNode             Parent node to attach the processor
                                       container node to.
-  @param [in]  ProcHierarchyNodeInfo  CM_ARM_PROC_HIERARCHY_INFO object used
-                                      to create the node.
+  @param [in]  ProcHierarchyNodeInfo  CM_ARCH_COMMON_PROC_HIERARCHY_INFO object
+                                      used to create the node.
   @param [in]  ProcContainerName      Name of the processor container.
   @param [in]  ProcContainerUid       Uid of the processor container.
   @param [out] ProcContainerNodePtr   If success, contains the created processor
@@ -997,7 +997,7 @@ CreateAmlProcessorContainer (
   IN        ACPI_CPU_TOPOLOGY_GENERATOR                   *Generator,
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
   IN        AML_NODE_HANDLE                               ParentNode,
-  IN        CM_ARM_PROC_HIERARCHY_INFO                    *ProcHierarchyNodeInfo,
+  IN        CM_ARCH_COMMON_PROC_HIERARCHY_INFO            *ProcHierarchyNodeInfo,
   IN        UINT16                                        ProcContainerName,
   IN        UINT32                                        ProcContainerUid,
   OUT       AML_OBJECT_NODE_HANDLE                        *ProcContainerNodePtr
@@ -1050,7 +1050,7 @@ CreateAmlProcessorContainer (
   }
 
   // If a set of Lpi states are associated with the
-  // CM_ARM_PROC_HIERARCHY_INFO, create an _LPI method returning them.
+  // CM_ARCH_COMMON_PROC_HIERARCHY_INFO, create an _LPI method returning them.
   if (ProcHierarchyNodeInfo->LpiToken != CM_NULL_TOKEN) {
     Status = CreateAmlLpiMethod (
                Generator,
@@ -1126,8 +1126,7 @@ CheckProcNode (
   @param [in] Generator               The SSDT Cpu Topology generator.
   @param [in] CfgMgrProtocol          Pointer to the Configuration Manager
                                       Protocol Interface.
-  @param [in] NodeToken               Token of the CM_ARM_PROC_HIERARCHY_INFO
-                                      currently handled.
+  @param [in] NodeToken               Token of the CM_ARCH_COMMON_PROC_HIERARCHY_INFO currently handled.
   @param [in] ParentNode              Parent node to attach the created
                                       node to.
   @param [in,out] ProcContainerIndex  Pointer to the current processor container
@@ -1167,7 +1166,7 @@ CreateAmlCpuTopologyTree (
   ProcContainerName = 0;
 
   for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
-    // Find the children of the CM_ARM_PROC_HIERARCHY_INFO
+    // Find the children of the CM_ARCH_COMMON_PROC_HIERARCHY_INFO
     // currently being handled (i.e. ParentToken == NodeToken).
     if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
       // Only Cpus (leaf nodes in this tree) have a AcpiIdObjectToken.
@@ -1270,8 +1269,8 @@ CreateAmlCpuTopologyTree (
   return EFI_SUCCESS;
 }
 
-/** Create the processor hierarchy AML tree from CM_ARM_PROC_HIERARCHY_INFO
-    CM objects.
+/** Create the processor hierarchy AML tree from
+    CM_ARCH_COMMON_PROC_HIERARCHY_INFO CM objects.
 
   @param [in] Generator        The SSDT Cpu Topology generator.
   @param [in] CfgMgrProtocol   Pointer to the Configuration Manager
@@ -1457,12 +1456,12 @@ BuildSsdtCpuTopologyTable (
   OUT       EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
   )
 {
-  EFI_STATUS                   Status;
-  AML_ROOT_NODE_HANDLE         RootNode;
-  AML_OBJECT_NODE_HANDLE       ScopeNode;
-  CM_ARM_PROC_HIERARCHY_INFO   *ProcHierarchyNodeList;
-  UINT32                       ProcHierarchyNodeCount;
-  ACPI_CPU_TOPOLOGY_GENERATOR  *Generator;
+  EFI_STATUS                          Status;
+  AML_ROOT_NODE_HANDLE                RootNode;
+  AML_OBJECT_NODE_HANDLE              ScopeNode;
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcHierarchyNodeList;
+  UINT32                              ProcHierarchyNodeCount;
+  ACPI_CPU_TOPOLOGY_GENERATOR         *Generator;
 
   ASSERT (This != NULL);
   ASSERT (AcpiTableInfo != NULL);
@@ -1490,7 +1489,7 @@ BuildSsdtCpuTopologyTable (
 
   // Get the processor hierarchy info and update the processor topology
   // structure count with Processor Hierarchy Nodes (Type 0)
-  Status = GetEArmObjProcHierarchyInfo (
+  Status = GetEArchCommonObjProcHierarchyInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &ProcHierarchyNodeList,
@@ -1514,7 +1513,7 @@ BuildSsdtCpuTopologyTable (
       goto exit_handler;
     }
   } else {
-    // Generate the topology from CM_ARM_PROC_HIERARCHY_INFO objects.
+    // Generate the topology from CM_ARCH_COMMON_PROC_HIERARCHY_INFO objects.
     Generator->ProcNodeList  = ProcHierarchyNodeList;
     Generator->ProcNodeCount = ProcHierarchyNodeCount;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
index 889711789fa0..6fb44c7e5887 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
@@ -69,12 +69,12 @@
 
 /** 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_ARCH_COMMON_PROC_HIERARCHY_INFO structure references a CM_ARCH_COMMON_OBJ_REF.
   This CM_ARCH_COMMON_OBJ_REF references CM_ARCH_COMMON_LPI_INFO structures.
 
   Example:
   (Cpu0)                                   (Cpu1)
-  CM_ARM_PROC_HIERARCHY_INFO               CM_ARM_PROC_HIERARCHY_INFO
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO       CM_ARCH_COMMON_PROC_HIERARCHY_INFO
               |                                       |
               +----------------------------------------
               |
@@ -88,7 +88,7 @@
   (A first Lpi state)                       (A second Lpi state)
   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_ARCH_COMMON_PROC_HIERARCHY_INFO
   structures reference the same CM_ARCH_COMMON_OBJ_REF. An entry is created in the
   TokenTable such as:
   0 <-> CM_ARCH_COMMON_OBJ_REF
@@ -130,16 +130,16 @@ typedef struct TokenTable {
 */
 typedef struct AcpiCpuTopologyGenerator {
   /// ACPI Table generator header
-  ACPI_TABLE_GENERATOR          Header;
+  ACPI_TABLE_GENERATOR                  Header;
 
   // Private fields are defined from here.
 
   /// Private object used to handle token referencing.
-  TOKEN_TABLE                   TokenTable;
-  /// List of CM_ARM_PROC_HIERARCHY_INFO CM objects.
-  CM_ARM_PROC_HIERARCHY_INFO    *ProcNodeList;
-  /// Count of CM_ARM_PROC_HIERARCHY_INFO CM objects.
-  UINT32                        ProcNodeCount;
+  TOKEN_TABLE                           TokenTable;
+  /// List of CM_ARCH_COMMON_PROC_HIERARCHY_INFO CM objects.
+  CM_ARCH_COMMON_PROC_HIERARCHY_INFO    *ProcNodeList;
+  /// Count of CM_ARCH_COMMON_PROC_HIERARCHY_INFO CM objects.
+  UINT32                                ProcNodeCount;
 } ACPI_CPU_TOPOLOGY_GENERATOR;
 
 #pragma pack()
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index de3338d10884..fd2a321bfb55 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -163,7 +163,6 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 17 - GIC ITS Identifier Array
   NULL,                             ///< 18 - ID Mapping Array
   NULL,                             ///< 19 - SMMU Interrupt Array
-  TokenFixerNotImplemented,         ///< 20 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 21 - Cache Info
   NULL,                             ///< 22 - CMN-600 Info
   NULL,                             ///< 23 - Reserved Memory Range Node
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 17388b183554..c48e29e5053d 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -322,9 +322,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonGenericInterruptParser[] = {
   { "Flags",     4, "0x%x", NULL }
 };
 
-/** A parser for EArmObjProcHierarchyInfo.
+/** A parser for EArchCommonObjProcHierarchyInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonProcHierarchyInfoParser[] = {
   { "Token",                      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "Flags",                      4,                        "0x%x", NULL },
   { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
@@ -686,6 +686,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjDeviceHandlePci,             CmArchCommonDeviceHandlePciParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjLpiInfo,                     CmArchCommonLpiInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjProcHierarchyInfo,           CmArchCommonProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -712,7 +713,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjGicItsIdentifierArray,      CmArmGicItsIdentifierParser),
   CM_PARSER_ADD_OBJECT (EArmObjIdMappingArray,             CmArmIdMappingParser),
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,         CmArchCommonGenericInterruptParser),
-  CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,          CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                  CmArmCacheInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 055836a7e31e..e0af0fd336bb 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -460,20 +460,19 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  17   | GIC ITS Identifier Array                  | |
 |  18   | ID Mapping Array                          | |
 |  19   | SMMU Interrupt Array                      | |
-|  20   | Processor Hierarchy Info                  | Move to Arch Common NS |
-|  21   | Cache Info                                | Move to Arch Common NS |
-|  22   | CMN 600 Info                              | |
-|  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 |
+|  20   | Cache Info                                | Move to Arch Common NS |
+|  21   | CMN 600 Info                              | |
+|  22   | Reserved Memory Range Node                | |
+|  23   | Memory Range Descriptor                   | |
+|  24   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  26   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  27   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  28   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  29   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  30   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  31   | Embedded Trace Extension/Module Info      | |
+|  32   | 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,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  13   | Device Handle PCI                 | |
 |  14   | Generic Initiator Affinity Info   | |
 |  15   | Low Power Idle State Info         | |
+|  16   | Processor Hierarchy Info          | |
 |  `*`  | All other values are reserved.    | |
+
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116988): https://edk2.groups.io/g/devel/message/116988
Mute This Topic: https://groups.io/mt/105068163/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 11/19] DynamicTablesPkg: Move Cache info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (9 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 10/19] DynamicTablesPkg: Move Processor hierarchy info to Arch Common PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 12/19] DynamicTablesPkg: Move Continuous perf control " PierreGondois
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

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

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PPTT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 31 +++++++++++
 .../Include/ArmNameSpaceObjects.h             | 55 ++++---------------
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 18 +++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 25 ++++-----
 .../ConfigurationManagerObjectParser.c        |  6 +-
 DynamicTablesPkg/Readme.md                    | 26 ++++-----
 6 files changed, 80 insertions(+), 81 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 872f2eebb7c3..17cd552a3f74 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -37,6 +37,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjGenericInitiatorAffinityInfo,   ///< 14 - Generic Initiator Affinity
   EArchCommonObjLpiInfo,                        ///< 15 - Lpi Info
   EArchCommonObjProcHierarchyInfo,              ///< 16 - Processor Hierarchy Info
+  EArchCommonObjCacheInfo,                      ///< 17 - Cache Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -401,6 +402,36 @@ typedef struct CmArchCommonProcHierarchyInfo {
   UINT32             OverrideUid;
 } CM_ARCH_COMMON_PROC_HIERARCHY_INFO;
 
+/** A structure that describes the Cache Type Structure (Type 1) in PPTT
+
+    ID: EArchCommonObjCacheInfo
+*/
+typedef struct CmArchCommonCacheInfo {
+  /// 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_ARCH_COMMON_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.4 - January 2021, PPTT, Table 5.140)
+  UINT8              Attributes;
+  /// Line size in bytes
+  UINT16             LineSize;
+  /// Unique ID for the cache
+  UINT32             CacheId;
+} CM_ARCH_COMMON_CACHE_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 4e9f0096ba60..eade2afcd028 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -48,19 +48,18 @@ typedef enum ArmObjectID {
   EArmObjGicItsIdentifierArray,                                ///< 17 - GIC ITS Identifier Array
   EArmObjIdMappingArray,                                       ///< 18 - ID Mapping Array
   EArmObjSmmuInterruptArray,                                   ///< 19 - SMMU Interrupt Array
-  EArmObjCacheInfo,                                            ///< 20 - Cache Info
-  EArmObjCmn600Info,                                           ///< 21 - CMN-600 Info
-  EArmObjRmr,                                                  ///< 22 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 23 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 24 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 25 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 26 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 27 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 28 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 29 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 30 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 31 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 32 - P-State Dependency (PSD) Info
+  EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
+  EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 23 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 24 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 25 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 26 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 27 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 28 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 29 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 30 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 31 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -644,36 +643,6 @@ typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_SMMU_INTERRUPT;
 */
 typedef CM_ARCH_COMMON_GENERIC_INTERRUPT CM_ARM_EXTENDED_INTERRUPT;
 
-/** 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_ARCH_COMMON_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.4 - January 2021, PPTT, Table 5.140)
-  UINT8              Attributes;
-  /// Line size in bytes
-  UINT16             LineSize;
-  /// Unique ID for the cache
-  UINT32             CacheId;
-} CM_ARM_CACHE_INFO;
-
 /** A structure that describes the CMN-600 hardware.
 
     ID: EArmObjCmn600Info
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index 9485de707046..2b8088a07f44 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -33,7 +33,7 @@
   Requirements:
     The following Configuration Manager Object(s) are used by this Generator:
     - EArchCommonObjProcHierarchyInfo (REQUIRED)
-    - EArmObjCacheInfo
+    - EArchCommonObjCacheInfo
     - EArchCommonObjCmRef
     - EArmObjGicCInfo (REQUIRED)
 */
@@ -53,9 +53,9 @@ GET_OBJECT_LIST (
   from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjCacheInfo,
-  CM_ARM_CACHE_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjCacheInfo,
+  CM_ARCH_COMMON_CACHE_INFO
   );
 
 /**
@@ -117,7 +117,7 @@ GET_SIZE_OF_PPTT_STRUCTS (
 GET_SIZE_OF_PPTT_STRUCTS (
   CacheTypeStructs,
   sizeof (EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE),
-  CM_ARM_CACHE_INFO
+  CM_ARCH_COMMON_CACHE_INFO
   );
 
 /**
@@ -788,7 +788,7 @@ AddCacheTypeStructures (
   EFI_STATUS                         Status;
   EFI_ACPI_6_4_PPTT_STRUCTURE_CACHE  *CacheStruct;
   PPTT_NODE_INDEXER                  *PpttNodeFound;
-  CM_ARM_CACHE_INFO                  *CacheInfoNode;
+  CM_ARCH_COMMON_CACHE_INFO          *CacheInfoNode;
   PPTT_NODE_INDEXER                  *CacheNodeIterator;
   UINT32                             NodeCount;
   BOOLEAN                            CacheIdUnique;
@@ -814,7 +814,7 @@ AddCacheTypeStructures (
   }
 
   for (NodeIndex = 0; NodeIndex < NodeCount; NodeIndex++) {
-    CacheInfoNode = (CM_ARM_CACHE_INFO *)CacheNodeIterator->Object;
+    CacheInfoNode = (CM_ARCH_COMMON_CACHE_INFO *)CacheNodeIterator->Object;
 
     // Populate the node header
     CacheStruct->Type        = EFI_ACPI_6_4_PPTT_TYPE_CACHE;
@@ -1075,7 +1075,7 @@ BuildPpttTable (
   UINT32  CacheStructOffset;
 
   CM_ARCH_COMMON_PROC_HIERARCHY_INFO  *ProcHierarchyNodeList;
-  CM_ARM_CACHE_INFO                   *CacheStructList;
+  CM_ARCH_COMMON_CACHE_INFO           *CacheStructList;
 
   ACPI_PPTT_GENERATOR  *Generator;
 
@@ -1132,7 +1132,7 @@ BuildPpttTable (
 
   // Get the cache info and update the processor topology structure count with
   // Cache Type Structures (Type 1)
-  Status = GetEArmObjCacheInfo (
+  Status = GetEArchCommonObjCacheInfo (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &CacheStructList,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index fd2a321bfb55..a162d614f9f0 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -163,19 +163,18 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 17 - GIC ITS Identifier Array
   NULL,                             ///< 18 - ID Mapping Array
   NULL,                             ///< 19 - SMMU Interrupt Array
-  TokenFixerNotImplemented,         ///< 21 - Cache Info
-  NULL,                             ///< 22 - CMN-600 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 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
+  NULL,                             ///< 20 - CMN-600 Info
+  NULL,                             ///< 21 - Reserved Memory Range Node
+  NULL,                             ///< 22 - Memory Range Descriptor
+  NULL,                             ///< 23 - Continuous Performance Control Info
+  NULL,                             ///< 24 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 25 - Pcc Subspace Type 2 Info
+  NULL,                             ///< 26 - Pcc Subspace Type 2 Info
+  NULL,                             ///< 27 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 28 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 29 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 30 - Embedded Trace Extension/Module Info
+  NULL                              ///< 31 - 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 c48e29e5053d..5440f9993b67 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -337,9 +337,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonProcHierarchyInfoParser[] = {
   { "OverrideUid",                4,                        "0x%x", NULL }
 };
 
-/** A parser for EArmObjCacheInfo.
+/** A parser for EArchCommonObjCacheInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmCacheInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonCacheInfoParser[] = {
   { "Token",                 sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "NextLevelOfCacheToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "Size",                  4,                        "0x%x", NULL },
@@ -687,6 +687,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjGenericInitiatorAffinityInfo,CmArchCommonGenericInitiatorAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjLpiInfo,                     CmArchCommonLpiInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjProcHierarchyInfo,           CmArchCommonProcHierarchyInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjCacheInfo,                   CmArchCommonCacheInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -713,7 +714,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjGicItsIdentifierArray,      CmArmGicItsIdentifierParser),
   CM_PARSER_ADD_OBJECT (EArmObjIdMappingArray,             CmArmIdMappingParser),
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,         CmArchCommonGenericInterruptParser),
-  CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                  CmArmCacheInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index e0af0fd336bb..7865731841d6 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -460,19 +460,18 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  17   | GIC ITS Identifier Array                  | |
 |  18   | ID Mapping Array                          | |
 |  19   | SMMU Interrupt Array                      | |
-|  20   | Cache Info                                | Move to Arch Common NS |
-|  21   | CMN 600 Info                              | |
-|  22   | Reserved Memory Range Node                | |
-|  23   | Memory Range Descriptor                   | |
-|  24   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  26   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  27   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  28   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  29   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  30   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  31   | Embedded Trace Extension/Module Info      | |
-|  32   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  20   | CMN 600 Info                              | |
+|  21   | Reserved Memory Range Node                | |
+|  22   | Memory Range Descriptor                   | |
+|  23   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  24   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  26   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  27   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  28   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  29   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  30   | Embedded Trace Extension/Module Info      | |
+|  31   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  14   | Generic Initiator Affinity Info   | |
 |  15   | Low Power Idle State Info         | |
 |  16   | Processor Hierarchy Info          | |
+|  17   | Cache Info                        | |
 |  `*`  | All other values are reserved.    | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116989): https://edk2.groups.io/g/devel/message/116989
Mute This Topic: https://groups.io/mt/105068165/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 12/19] DynamicTablesPkg: Move Continuous perf control info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (10 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 11/19] DynamicTablesPkg: Move Cache " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 13/19] DynamicTablesPkg: Move PCC structure definitions " PierreGondois
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the Continuous perfformance control 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 19 ++++++
 .../Include/ArmNameSpaceObjects.h             | 37 +++---------
 .../SsdtCpuTopologyGenerator.c                | 12 ++--
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 15 +++--
 .../ConfigurationManagerObjectParser.c        |  6 +-
 DynamicTablesPkg/Readme.md                    | 60 +++++++++----------
 6 files changed, 74 insertions(+), 75 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 17cd552a3f74..63b24de2f2f1 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -38,6 +38,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjLpiInfo,                        ///< 15 - Lpi Info
   EArchCommonObjProcHierarchyInfo,              ///< 16 - Processor Hierarchy Info
   EArchCommonObjCacheInfo,                      ///< 17 - Cache Info
+  EArchCommonObjCpcInfo,                        ///< 18 - Continuous Performance Control Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -432,6 +433,24 @@ typedef struct CmArchCommonCacheInfo {
   UINT32             CacheId;
 } CM_ARCH_COMMON_CACHE_INFO;
 
+/** A structure that describes the Cpc information.
+
+  Continuous Performance Control is described in DSDT/SSDT and associated
+  to cpus/clusters in the cpu topology.
+
+  Unsupported Optional registers should be encoded with NULL resource
+  Register {(SystemMemory, 0, 0, 0, 0)}
+
+  For values that support Integer or Buffer, integer will be used
+  if buffer is NULL resource.
+  If resource is not NULL then Integer must be 0
+
+  Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)
+
+  ID: EArchCommonObjCpcInfo
+*/
+typedef AML_CPC_INFO CM_ARCH_COMMON_CPC_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index eade2afcd028..b9d1202be365 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,15 +51,14 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 23 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 24 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 25 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 26 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 27 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 28 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 29 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 30 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 31 - P-State Dependency (PSD) Info
+  EArmObjPccSubspaceType0Info,                                 ///< 23 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 24 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 25 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 26 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 27 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 28 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 29 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 30 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -177,7 +176,7 @@ typedef struct CmArmGicCInfo {
   UINT32             AffinityFlags;
 
   /** Optional field: Reference Token for the Cpc info of this processor.
-      i.e. a token referencing a CM_ARM_CPC_INFO object.
+      i.e. a token referencing a CM_ARCH_COMMON_CPC_INFO object.
   */
   CM_OBJECT_TOKEN    CpcToken;
 
@@ -715,24 +714,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes the Cpc information.
-
-  Continuous Performance Control is described in DSDT/SSDT and associated
-  to cpus/clusters in the cpu topology.
-
-  Unsupported Optional registers should be encoded with NULL resource
-  Register {(SystemMemory, 0, 0, 0, 0)}
-
-  For values that support Integer or Buffer, integer will be used
-  if buffer is NULL resource.
-  If resource is not NULL then Integer must be 0
-
-  Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)
-
-  ID: EArmObjCpcInfo
-*/
-typedef AML_CPC_INFO CM_ARM_CPC_INFO;
-
 /** A structure that describes a
     PCC Mailbox Register.
 */
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 1bb90e114b16..21233a404a05 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -89,9 +89,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjCpcInfo,
-  CM_ARM_CPC_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjCpcInfo,
+  CM_ARCH_COMMON_CPC_INFO
   );
 
 /**
@@ -400,10 +400,10 @@ CreateAmlCpcNode (
   IN  AML_OBJECT_NODE_HANDLE                              *Node
   )
 {
-  EFI_STATUS       Status;
-  CM_ARM_CPC_INFO  *CpcInfo;
+  EFI_STATUS               Status;
+  CM_ARCH_COMMON_CPC_INFO  *CpcInfo;
 
-  Status = GetEArmObjCpcInfo (
+  Status = GetEArchCommonObjCpcInfo (
              CfgMgrProtocol,
              GicCInfo->CpcToken,
              &CpcInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index a162d614f9f0..68db478c5789 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,15 +166,14 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Continuous Performance Control Info
-  NULL,                             ///< 24 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 23 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 24 - Pcc Subspace Type 2 Info
   NULL,                             ///< 25 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 26 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 27 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 28 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 29 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 30 - Embedded Trace Extension/Module Info
-  NULL                              ///< 31 - P-State Dependency (PSD) Info
+  NULL,                             ///< 26 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 27 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 28 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 29 - Embedded Trace Extension/Module Info
+  NULL                              ///< 30 - 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 5440f9993b67..54ecc66c5b40 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -479,9 +479,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmMemoryRangeDescriptorInfoParser[] = {
   { "Length",      8, "0x%llx", NULL },
 };
 
-/** A parser for EArmObjCpcInfo.
+/** A parser for EArchCommonObjCpcInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonCpcInfoParser[] = {
   { "Revision",                              4,                                               "0x%lx", NULL },
   { "HighestPerformanceBuffer",              sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE),
     NULL, NULL, AcpiGenericAddressParser,
@@ -688,6 +688,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjLpiInfo,                     CmArchCommonLpiInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjProcHierarchyInfo,           CmArchCommonProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjCacheInfo,                   CmArchCommonCacheInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjCpcInfo,                     CmArchCommonCpcInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -717,7 +718,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjCpcInfo,                    CmArmCpcInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType0Info,       CmArmPccSubspaceType0InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType1Info,       CmArmPccSubspaceType1InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,       CmArmPccSubspaceType2InfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 7865731841d6..8ac9d126b834 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,38 +463,38 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  24   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  26   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  27   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  28   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  29   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  30   | Embedded Trace Extension/Module Info      | |
-|  31   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  24   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  26   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  27   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  28   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  29   | Embedded Trace Extension/Module Info      | |
+|  30   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
 
-|  ID   |  Description                      | Comments |
-| ---:  | :--------------------------       | :---     |
-|   0   |  Reserved                         | |
-|   1   | Power Management Profile Info     | |
-|   2   | Serial Port Info                  | |
-|   3   | Serial Console Port Info          | |
-|   4   | Serial Debug Port Info            | |
-|   5   | Hypervisor Vendor Id              | |
-|   6   | Fixed feature flags for FADT      | |
-|   7   | CM Object Reference               | |
-|   8   | PCI Configuration Space Info      | |
-|   9   | PCI Address Map Info              | |
-|  10   | PCI Interrupt Map Info            | |
-|  11   | Memory Affinity Info              | |
-|  12   | Device Handle Acpi                | |
-|  13   | Device Handle PCI                 | |
-|  14   | Generic Initiator Affinity Info   | |
-|  15   | Low Power Idle State Info         | |
-|  16   | Processor Hierarchy Info          | |
-|  17   | Cache Info                        | |
-|  `*`  | All other values are reserved.    | |
+|  ID   |  Description                              | Comments |
+| ---:  | :--------------------------               | :---     |
+|   0   |  Reserved                                 | |
+|   1   | Power Management Profile Info             | |
+|   2   | Serial Port Info                          | |
+|   3   | Serial Console Port Info                  | |
+|   4   | Serial Debug Port Info                    | |
+|   5   | Hypervisor Vendor Id                      | |
+|   6   | Fixed feature flags for FADT              | |
+|   7   | CM Object Reference                       | |
+|   8   | PCI Configuration Space Info              | |
+|   9   | PCI Address Map Info                      | |
+|  10   | PCI Interrupt Map Info                    | |
+|  11   | Memory Affinity Info                      | |
+|  12   | Device Handle Acpi                        | |
+|  13   | Device Handle PCI                         | |
+|  14   | Generic Initiator Affinity Info           | |
+|  15   | Low Power Idle State Info                 | |
+|  16   | Processor Hierarchy Info                  | |
+|  17   | Cache Info                                | |
+|  18   | Continuous Performance Control Info       | |
+|  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116990): https://edk2.groups.io/g/devel/message/116990
Mute This Topic: https://groups.io/mt/105068166/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 13/19] DynamicTablesPkg: Move PCC structure definitions to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (11 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 12/19] DynamicTablesPkg: Move Continuous perf control " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 14/19] DynamicTablesPkg: Move PCC Type0 info " PierreGondois
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move PCC structure definitions from Arm Namespace header file to
the Arch Common namespace header file.

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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 72 +++++++++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 72 -------------------
 2 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 63b24de2f2f1..e21e2ca4e0d2 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -451,6 +451,78 @@ typedef struct CmArchCommonCacheInfo {
 */
 typedef AML_CPC_INFO CM_ARCH_COMMON_CPC_INFO;
 
+/** A structure that describes a
+    PCC Mailbox Register.
+*/
+typedef struct PccMailboxRegisterInfo {
+  /// GAS describing the Register.
+  EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE    Register;
+
+  /** Mask of bits to preserve when writing.
+
+    This mask is also used for registers. The Register is only read
+    and there is no write mask required. E.g.:
+    - Error Status mask (Cf. PCC Subspace types 3/4/5).
+    - Command Complete Check mask (Cf. PCC Subspace types 3/4/5).
+  */
+  UINT64    PreserveMask;
+
+  /// Mask of bits to set when writing.
+  UINT64    WriteMask;
+} PCC_MAILBOX_REGISTER_INFO;
+
+/** A structure that describes the
+    PCC Subspace CHannel Timings.
+*/
+typedef struct PccSubspaceChannelTimingInfo {
+  /// Expected latency to process a command, in microseconds.
+  UINT32    NominalLatency;
+
+  /** Maximum number of periodic requests that the subspace channel can
+      support, reported in commands per minute. 0 indicates no limitation.
+
+    This field is ignored for the PCC Subspace type 5 (HW Registers based).
+  */
+  UINT32    MaxPeriodicAccessRate;
+
+  /** Minimum amount of time that OSPM must wait after the completion
+      of a command before issuing the next command, in microseconds.
+  */
+  UINT16    MinRequestTurnaroundTime;
+} PCC_SUBSPACE_CHANNEL_TIMING_INFO;
+
+/** A structure that describes a
+    Generic PCC Subspace (Type 0).
+*/
+typedef struct PccSubspaceGenericInfo {
+  /** Subspace Id.
+
+  Cf. ACPI 6.4, s14.7 Referencing the PCC address space
+  Cf. s14.1.2 Platform Communications Channel Subspace Structures
+      The subspace ID of a PCC subspace is its index in the array of
+      subspace structures, starting with subspace 0.
+
+  At most 256 subspaces are supported.
+  */
+  UINT8                               SubspaceId;
+
+  /// Table type (or subspace).
+  UINT8                               Type;
+
+  /// Base address of the shared memory range.
+  /// This field is ignored for the PCC Subspace type 5 (HW Registers based).
+  UINT64                              BaseAddress;
+
+  /// Address length.
+  UINT64                              AddressLength;
+
+  /// Doorbell Register.
+  PCC_MAILBOX_REGISTER_INFO           DoorbellReg;
+
+  /// Mailbox Timings.
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
+} PCC_SUBSPACE_GENERIC_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index b9d1202be365..e9a2cb0fe6c5 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -714,78 +714,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Mailbox Register.
-*/
-typedef struct PccMailboxRegisterInfo {
-  /// GAS describing the Register.
-  EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE    Register;
-
-  /** Mask of bits to preserve when writing.
-
-    This mask is also used for registers. The Register is only read
-    and there is no write mask required. E.g.:
-    - Error Status mask (Cf. PCC Subspace types 3/4/5).
-    - Command Complete Check mask (Cf. PCC Subspace types 3/4/5).
-  */
-  UINT64    PreserveMask;
-
-  /// Mask of bits to set when writing.
-  UINT64    WriteMask;
-} PCC_MAILBOX_REGISTER_INFO;
-
-/** A structure that describes the
-    PCC Subspace CHannel Timings.
-*/
-typedef struct PccSubspaceChannelTimingInfo {
-  /// Expected latency to process a command, in microseconds.
-  UINT32    NominalLatency;
-
-  /** Maximum number of periodic requests that the subspace channel can
-      support, reported in commands per minute. 0 indicates no limitation.
-
-    This field is ignored for the PCC Subspace type 5 (HW Registers based).
-  */
-  UINT32    MaxPeriodicAccessRate;
-
-  /** Minimum amount of time that OSPM must wait after the completion
-      of a command before issuing the next command, in microseconds.
-  */
-  UINT16    MinRequestTurnaroundTime;
-} PCC_SUBSPACE_CHANNEL_TIMING_INFO;
-
-/** A structure that describes a
-    Generic PCC Subspace (Type 0).
-*/
-typedef struct CmArmPccSubspaceGenericInfo {
-  /** Subspace Id.
-
-  Cf. ACPI 6.4, s14.7 Referencing the PCC address space
-  Cf. s14.1.2 Platform Communications Channel Subspace Structures
-      The subspace ID of a PCC subspace is its index in the array of
-      subspace structures, starting with subspace 0.
-
-  At most 256 subspaces are supported.
-  */
-  UINT8                               SubspaceId;
-
-  /// Table type (or subspace).
-  UINT8                               Type;
-
-  /// Base address of the shared memory range.
-  /// This field is ignored for the PCC Subspace type 5 (HW Registers based).
-  UINT64                              BaseAddress;
-
-  /// Address length.
-  UINT64                              AddressLength;
-
-  /// Doorbell Register.
-  PCC_MAILBOX_REGISTER_INFO           DoorbellReg;
-
-  /// Mailbox Timings.
-  PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
-} PCC_SUBSPACE_GENERIC_INFO;
-
 /** A structure that describes a
     PCC Subspace of type 0 (Generic).
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116991): https://edk2.groups.io/g/devel/message/116991
Mute This Topic: https://groups.io/mt/105068168/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 14/19] DynamicTablesPkg: Move PCC Type0 info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (12 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 13/19] DynamicTablesPkg: Move PCC structure definitions " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 15/19] DynamicTablesPkg: Move PCC Type1 " PierreGondois
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCC Subspace Type0 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      |   8 ++
 .../Include/ArmNameSpaceObjects.h             |  22 ++--
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 104 +++++++++---------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   5 +-
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  13 +--
 .../ConfigurationManagerObjectParser.c        |  22 ++--
 DynamicTablesPkg/Readme.md                    |  16 +--
 7 files changed, 96 insertions(+), 94 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index e21e2ca4e0d2..4ce2d7b48ebf 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -39,6 +39,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjProcHierarchyInfo,              ///< 16 - Processor Hierarchy Info
   EArchCommonObjCacheInfo,                      ///< 17 - Cache Info
   EArchCommonObjCpcInfo,                        ///< 18 - Continuous Performance Control Info
+  EArchCommonObjPccSubspaceType0Info,           ///< 19 - Pcc Subspace Type 0 Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -523,6 +524,13 @@ typedef struct PccSubspaceGenericInfo {
   PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
 } PCC_SUBSPACE_GENERIC_INFO;
 
+/** A structure that describes a
+    PCC Subspace of type 0 (Generic).
+
+    ID: EArchCommonObjPccSubspaceType0Info
+*/
+typedef PCC_SUBSPACE_GENERIC_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index e9a2cb0fe6c5..a28415c77687 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,14 +51,13 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjPccSubspaceType0Info,                                 ///< 23 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 24 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 25 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 26 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 27 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 28 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 29 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 30 - P-State Dependency (PSD) Info
+  EArmObjPccSubspaceType1Info,                                 ///< 23 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 24 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 25 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 26 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 27 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 28 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 29 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -714,13 +713,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Subspace of type 0 (Generic).
-
-    ID: EArmObjPccSubspaceType0Info
-*/
-typedef PCC_SUBSPACE_GENERIC_INFO CM_ARM_PCC_SUBSPACE_TYPE0_INFO;
-
 /** A structure that describes a
     PCC Subspace of type 1 (HW-Reduced).
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
index 36caf4aaeab7..575ab31f7ff2 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -29,7 +29,7 @@
 Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
-  - EArmObjPccSubspaceType0Info
+  - EArchCommonObjPccSubspaceType0Info
   - EArmObjPccSubspaceType1Info
   - EArmObjPccSubspaceType2Info
   - EArmObjPccSubspaceType3Info
@@ -41,9 +41,9 @@ Requirements:
     Subspace of Type 0 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType0Info,
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType0Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO
   );
 
 /** This macro expands to a function that retrieves the PCC
@@ -164,11 +164,12 @@ MappingTableFree (
   }
 }
 
-/** Add a new entry for CmArmPccSubspace at Index.
+/** Add a new entry for PccSubspace at Index.
 
   @param [in] MappingTable      The mapping table structure.
-  @param [in] CmArmPccSubspace  Pointer to a CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
-  @param [in] Index             Index at which CmArmPccSubspace must be added.
+  @param [in] PccSubspace       A pointer to
+                                CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO.
+  @param [in] Index             Index at which PccSubspace must be added.
                                 This is the Subspace Id.
 
   @retval EFI_SUCCESS            Success.
@@ -180,13 +181,13 @@ EFI_STATUS
 EFIAPI
 MappingTableAdd (
   IN  MAPPING_TABLE  *MappingTable,
-  IN  VOID           *CmArmPccSubspace,
+  IN  VOID           *PccSubspace,
   IN  UINT32         Index
   )
 {
   if ((MappingTable == NULL)        ||
       (MappingTable->Table == NULL) ||
-      (CmArmPccSubspace == NULL))
+      (PccSubspace == NULL))
   {
     ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
     return EFI_INVALID_PARAMETER;
@@ -200,14 +201,15 @@ MappingTableAdd (
   }
 
   // Just map the Pcc Subspace in the Table.
-  MappingTable->Table[Index] = CmArmPccSubspace;
+  MappingTable->Table[Index] = PccSubspace;
   return EFI_SUCCESS;
 }
 
 /** Parse the CmPccArray objects and add them to the MappingTable.
 
   @param [in] MappingTable     The mapping table structure.
-  @param [in] CmPccArray       Pointer to an array of CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
+  @param [in] CmPccArray       Pointer to an array of
+                               CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO.
   @param [in] CmPccCount       Count of objects in CmPccArray.
 
   @retval EFI_SUCCESS            Success.
@@ -242,7 +244,7 @@ MapPccSubspaceId (
 
   switch (GenericPcc->Type) {
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE0_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO);
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
@@ -304,8 +306,8 @@ STATIC
 EFI_STATUS
 EFIAPI
 AddSubspaceStructType0 (
-  IN  CM_ARM_PCC_SUBSPACE_TYPE0_INFO      *PccCmObj,
-  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC  *PccAcpi
+  IN  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC      *PccAcpi
   )
 {
   PCC_MAILBOX_REGISTER_INFO         *Doorbell;
@@ -360,11 +362,11 @@ AddSubspaceStructType1 (
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS  *PccAcpi
   )
 {
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
-  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
-  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO               *Doorbell;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO        *ChannelTiming;
 
-  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+  GenericPccCmObj = (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
 
   if ((PccCmObj == NULL) ||
       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS)  ||
@@ -420,12 +422,12 @@ AddSubspaceStructType2 (
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS  *PccAcpi
   )
 {
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
-  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
-  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
-  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO               *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO               *PlatIrqAck;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO        *ChannelTiming;
 
-  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+  GenericPccCmObj = (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
 
   if ((PccCmObj == NULL) ||
       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS)  ||
@@ -491,15 +493,15 @@ AddSubspaceStructType34 (
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC  *PccAcpi
   )
 {
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
-  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
-  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
-  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
-  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteUpdate;
-  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
-  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO               *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO               *PlatIrqAck;
+  PCC_MAILBOX_REGISTER_INFO               *CmdCompleteCheck;
+  PCC_MAILBOX_REGISTER_INFO               *CmdCompleteUpdate;
+  PCC_MAILBOX_REGISTER_INFO               *ErrorStatus;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO        *ChannelTiming;
 
-  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+  GenericPccCmObj = (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
 
   if ((PccCmObj == NULL) ||
       ((GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC) &&
@@ -603,13 +605,13 @@ AddSubspaceStructType5 (
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS  *PccAcpi
   )
 {
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
-  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
-  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
-  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
-  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO               *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO               *CmdCompleteCheck;
+  PCC_MAILBOX_REGISTER_INFO               *ErrorStatus;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO        *ChannelTiming;
 
-  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+  GenericPccCmObj = (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
 
   if ((PccCmObj == NULL) ||
       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS)  ||
@@ -705,7 +707,7 @@ PopulatePcctTable (
     switch (((PCC_SUBSPACE_GENERIC_INFO *)CurrentPccSubspace)->Type) {
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
         Status = AddSubspaceStructType0 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *)PccBuffer
                    );
 
@@ -822,18 +824,18 @@ BuildPcctTable (
   MAPPING_TABLE  *MappingTable;
   UINT32         MappingTableCount;
 
-  CM_ARM_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
-  UINT32                          PccType0Count;
-  CM_ARM_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
-  UINT32                          PccType1Count;
-  CM_ARM_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
-  UINT32                          PccType2Count;
-  CM_ARM_PCC_SUBSPACE_TYPE3_INFO  *PccType3;
-  UINT32                          PccType3Count;
-  CM_ARM_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
-  UINT32                          PccType4Count;
-  CM_ARM_PCC_SUBSPACE_TYPE5_INFO  *PccType5;
-  UINT32                          PccType5Count;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
+  UINT32                                  PccType0Count;
+  CM_ARM_PCC_SUBSPACE_TYPE1_INFO          *PccType1;
+  UINT32                                  PccType1Count;
+  CM_ARM_PCC_SUBSPACE_TYPE2_INFO          *PccType2;
+  UINT32                                  PccType2Count;
+  CM_ARM_PCC_SUBSPACE_TYPE3_INFO          *PccType3;
+  UINT32                                  PccType3Count;
+  CM_ARM_PCC_SUBSPACE_TYPE4_INFO          *PccType4;
+  UINT32                                  PccType4Count;
+  CM_ARM_PCC_SUBSPACE_TYPE5_INFO          *PccType5;
+  UINT32                                  PccType5Count;
 
   ASSERT (This != NULL);
   ASSERT (AcpiTableInfo != NULL);
@@ -863,7 +865,7 @@ BuildPcctTable (
 
   // First get all the Pcc Subpace CmObj of type X.
 
-  Status = GetEArmObjPccSubspaceType0Info (
+  Status = GetEArchCommonObjPccSubspaceType0Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType0,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
index 0631a1f5b74b..e1bca78c2ffa 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
@@ -19,7 +19,7 @@
 */
 typedef struct MappingTable {
   /// Mapping table for Subspace Ids.
-  /// Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  /// Subspace ID/Index <-> CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO pointer
   VOID      **Table;
 
   /// Number of entries in the Table.
@@ -34,7 +34,8 @@ typedef struct AcpiPcctGenerator {
 
   // Private fields are defined from here.
 
-  /// Table to map: Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  /// Table to map:
+  /// Subspace ID/Index <-> CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO pointer
   MAPPING_TABLE           MappingTable;
 } ACPI_PCCT_GENERATOR;
 
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 68db478c5789..1691e6015bf8 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,14 +166,13 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 23 - Pcc Subspace Type 2 Info
   NULL,                             ///< 24 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 25 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 26 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 27 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 28 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 29 - Embedded Trace Extension/Module Info
-  NULL                              ///< 30 - P-State Dependency (PSD) Info
+  NULL,                             ///< 25 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 26 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 27 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 28 - Embedded Trace Extension/Module Info
+  NULL                              ///< 29 - 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 54ecc66c5b40..e071fa460a40 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -574,9 +574,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
   { "MinRequestTurnaroundTime", 2, "0x%x", NULL },
 };
 
-/** A parser for EArmObjPccSubspaceType0Info.
+/** A parser for EArchCommonObjPccSubspaceType0Info.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType0InfoParser[] = {
   { "SubspaceId",    1,                                         "0x%x",   NULL },
   { "Type",          1,                                         "0x%x",   NULL },
   { "BaseAddress",   8,                                         "0x%llx", NULL },
@@ -593,8 +593,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
-    NULL, NULL, CmArmPccSubspaceType0InfoParser,
-    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+    NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
   { "PlatIrq",        sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),
     NULL, NULL, CmArchCommonGenericInterruptParser,
     ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
@@ -604,8 +604,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
-    NULL, NULL, CmArmPccSubspaceType0InfoParser,
-    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+    NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
   { "PlatIrq",        sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,NULL,
     CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
   { "PlatIrqAckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
@@ -617,8 +617,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
   { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
-    NULL, NULL, CmArmPccSubspaceType0InfoParser,
-    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+    NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
   { "PlatIrq",              sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,NULL,
     CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
   { "PlatIrqAckReg",        sizeof (PCC_MAILBOX_REGISTER_INFO),
@@ -639,8 +639,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
   { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
-    NULL, NULL, CmArmPccSubspaceType0InfoParser,
-    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+    NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
   { "Version",             2,                                        "0x%x",NULL },
   { "PlatIrq",             sizeof (CM_ARCH_COMMON_GENERIC_INTERRUPT),NULL,  NULL,
     CmArchCommonGenericInterruptParser, ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
@@ -689,6 +689,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjProcHierarchyInfo,           CmArchCommonProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjCacheInfo,                   CmArchCommonCacheInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjCpcInfo,                     CmArchCommonCpcInfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType0Info,        CmArchCommonPccSubspaceType0InfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -718,7 +719,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType0Info,       CmArmPccSubspaceType0InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType1Info,       CmArmPccSubspaceType1InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,       CmArmPccSubspaceType2InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,       CmArmPccSubspaceType34InfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 8ac9d126b834..999422035984 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,14 +463,13 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  24   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  26   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  27   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  28   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  29   | Embedded Trace Extension/Module Info      | |
-|  30   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  24   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  26   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  27   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  28   | Embedded Trace Extension/Module Info      | |
+|  29   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  16   | Processor Hierarchy Info                  | |
 |  17   | Cache Info                                | |
 |  18   | Continuous Performance Control Info       | |
+|  19   | Pcc Subspace Type 0 Info                  | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116992): https://edk2.groups.io/g/devel/message/116992
Mute This Topic: https://groups.io/mt/105068170/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 15/19] DynamicTablesPkg: Move PCC Type1 info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (13 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 14/19] DynamicTablesPkg: Move PCC Type0 info " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 16/19] DynamicTablesPkg: Move PCC Type2 " PierreGondois
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCC Subspace Type1 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 18 +++++++++++
 .../Include/ArmNameSpaceObjects.h             | 30 ++++---------------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 18 +++++------
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 11 ++++---
 .../ConfigurationManagerObjectParser.c        |  6 ++--
 DynamicTablesPkg/Readme.md                    | 14 ++++-----
 6 files changed, 48 insertions(+), 49 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 4ce2d7b48ebf..583ea0089146 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -40,6 +40,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjCacheInfo,                      ///< 17 - Cache Info
   EArchCommonObjCpcInfo,                        ///< 18 - Continuous Performance Control Info
   EArchCommonObjPccSubspaceType0Info,           ///< 19 - Pcc Subspace Type 0 Info
+  EArchCommonObjPccSubspaceType1Info,           ///< 20 - Pcc Subspace Type 1 Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -531,6 +532,23 @@ typedef struct PccSubspaceGenericInfo {
 */
 typedef PCC_SUBSPACE_GENERIC_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO;
 
+/** A structure that describes a
+    PCC Subspace of type 1 (HW-Reduced).
+
+    ID: EArchCommonObjPccSubspaceType1Info
+*/
+typedef struct CmArchCommonPccSubspaceType1Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
+} CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index a28415c77687..8a62d9386263 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,13 +51,12 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjPccSubspaceType1Info,                                 ///< 23 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 24 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 25 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 26 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 27 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 28 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 29 - P-State Dependency (PSD) Info
+  EArmObjPccSubspaceType2Info,                                 ///< 23 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 24 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 25 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 26 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 27 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 28 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -713,23 +712,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Subspace of type 1 (HW-Reduced).
-
-    ID: EArmObjPccSubspaceType1Info
-*/
-typedef struct CmArmPccSubspaceType1Info {
-  /** Generic Pcc information.
-
-    The Subspace of Type0 contains information that can be re-used
-    in other Subspace types.
-  */
-  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
-
-  /// Platform Interrupt.
-  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
-} CM_ARM_PCC_SUBSPACE_TYPE1_INFO;
-
 /** A structure that describes a
     PCC Subspace of type 2 (HW-Reduced).
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
index 575ab31f7ff2..183d8cd221bb 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -30,7 +30,7 @@ Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
   - EArchCommonObjPccSubspaceType0Info
-  - EArmObjPccSubspaceType1Info
+  - EArchCommonObjPccSubspaceType1Info
   - EArmObjPccSubspaceType2Info
   - EArmObjPccSubspaceType3Info
   - EArmObjPccSubspaceType4Info
@@ -50,9 +50,9 @@ GET_OBJECT_LIST (
     Subspace of Type 1 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType1Info,
-  CM_ARM_PCC_SUBSPACE_TYPE1_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType1Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO
   );
 
 /** This macro expands to a function that retrieves the PCC
@@ -248,7 +248,7 @@ MapPccSubspaceId (
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE1_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO);
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
@@ -358,7 +358,7 @@ STATIC
 EFI_STATUS
 EFIAPI
 AddSubspaceStructType1 (
-  IN  CM_ARM_PCC_SUBSPACE_TYPE1_INFO                          *PccCmObj,
+  IN  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO                  *PccCmObj,
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS  *PccAcpi
   )
 {
@@ -716,7 +716,7 @@ PopulatePcctTable (
 
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
         Status = AddSubspaceStructType1 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE1_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS *)PccBuffer
                    );
 
@@ -826,7 +826,7 @@ BuildPcctTable (
 
   CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
   UINT32                                  PccType0Count;
-  CM_ARM_PCC_SUBSPACE_TYPE1_INFO          *PccType1;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
   UINT32                                  PccType1Count;
   CM_ARM_PCC_SUBSPACE_TYPE2_INFO          *PccType2;
   UINT32                                  PccType2Count;
@@ -876,7 +876,7 @@ BuildPcctTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjPccSubspaceType1Info (
+  Status = GetEArchCommonObjPccSubspaceType1Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType1,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 1691e6015bf8..3a19870aad34 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -167,12 +167,11 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
   NULL,                             ///< 23 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 24 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 25 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 26 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 27 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 28 - Embedded Trace Extension/Module Info
-  NULL                              ///< 29 - P-State Dependency (PSD) Info
+  NULL,                             ///< 24 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 25 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 26 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 27 - Embedded Trace Extension/Module Info
+  NULL                              ///< 28 - 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 e071fa460a40..f8e277f1805e 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -589,9 +589,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType0InfoParser[] = {
     ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
 };
 
-/** A parser for EArmObjPccSubspaceType1Info.
+/** A parser for EArchCommonObjPccSubspaceType1Info.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType1InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
@@ -690,6 +690,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjCacheInfo,                   CmArchCommonCacheInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjCpcInfo,                     CmArchCommonCpcInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType0Info,        CmArchCommonPccSubspaceType0InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType1Info,        CmArchCommonPccSubspaceType1InfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -719,7 +720,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType1Info,       CmArmPccSubspaceType1InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,       CmArmPccSubspaceType2InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,       CmArmPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType4Info,       CmArmPccSubspaceType34InfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 999422035984..3fa3dd9af948 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,13 +463,12 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  24   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  26   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  27   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  28   | Embedded Trace Extension/Module Info      | |
-|  29   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  24   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  26   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  27   | Embedded Trace Extension/Module Info      | |
+|  28   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  17   | Cache Info                                | |
 |  18   | Continuous Performance Control Info       | |
 |  19   | Pcc Subspace Type 0 Info                  | |
+|  20   | Pcc Subspace Type 1 Info                  | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116993): https://edk2.groups.io/g/devel/message/116993
Mute This Topic: https://groups.io/mt/105068171/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 16/19] DynamicTablesPkg: Move PCC Type2 info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (14 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 15/19] DynamicTablesPkg: Move PCC Type1 " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 17/19] DynamicTablesPkg: Move PCC Type 3 & 4 " PierreGondois
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCC Subspace Type2 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 21 +++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 31 +++----------------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 18 +++++------
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 11 +++----
 .../ConfigurationManagerObjectParser.c        |  6 ++--
 DynamicTablesPkg/Readme.md                    | 12 +++----
 6 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 583ea0089146..817c07f40d55 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -41,6 +41,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjCpcInfo,                        ///< 18 - Continuous Performance Control Info
   EArchCommonObjPccSubspaceType0Info,           ///< 19 - Pcc Subspace Type 0 Info
   EArchCommonObjPccSubspaceType1Info,           ///< 20 - Pcc Subspace Type 1 Info
+  EArchCommonObjPccSubspaceType2Info,           ///< 21 - Pcc Subspace Type 2 Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -549,6 +550,26 @@ typedef struct CmArchCommonPccSubspaceType1Info {
   CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
 } CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO;
 
+/** A structure that describes a
+    PCC Subspace of type 2 (HW-Reduced).
+
+    ID: EArchCommonObjPccSubspaceType2Info
+*/
+typedef struct CmArchCommonPccSubspaceType2Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
+
+  /// Platform Interrupt Register.
+  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
+} CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 8a62d9386263..c287a855da87 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,12 +51,11 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjPccSubspaceType2Info,                                 ///< 23 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 24 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 25 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 26 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 27 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 28 - P-State Dependency (PSD) Info
+  EArmObjPccSubspaceType3Info,                                 ///< 23 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 24 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 25 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 26 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 27 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -712,26 +711,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Subspace of type 2 (HW-Reduced).
-
-    ID: EArmObjPccSubspaceType2Info
-*/
-typedef struct CmArmPccSubspaceType2Info {
-  /** Generic Pcc information.
-
-    The Subspace of Type0 contains information that can be re-used
-    in other Subspace types.
-  */
-  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
-
-  /// Platform Interrupt.
-  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
-
-  /// Platform Interrupt Register.
-  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
-} CM_ARM_PCC_SUBSPACE_TYPE2_INFO;
-
 /** A structure that describes a
     PCC Subspace of type 3 (Extended)
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
index 183d8cd221bb..552aca4af47c 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -31,7 +31,7 @@ Requirements:
   this Generator:
   - EArchCommonObjPccSubspaceType0Info
   - EArchCommonObjPccSubspaceType1Info
-  - EArmObjPccSubspaceType2Info
+  - EArchCommonObjPccSubspaceType2Info
   - EArmObjPccSubspaceType3Info
   - EArmObjPccSubspaceType4Info
   - EArmObjPccSubspaceType5Info
@@ -59,9 +59,9 @@ GET_OBJECT_LIST (
     Subspace of Type 2 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType2Info,
-  CM_ARM_PCC_SUBSPACE_TYPE2_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType2Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO
   );
 
 /** This macro expands to a function that retrieves the PCC
@@ -252,7 +252,7 @@ MapPccSubspaceId (
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE2_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO);
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
@@ -418,7 +418,7 @@ STATIC
 EFI_STATUS
 EFIAPI
 AddSubspaceStructType2 (
-  IN  CM_ARM_PCC_SUBSPACE_TYPE2_INFO                          *PccCmObj,
+  IN  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO                  *PccCmObj,
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS  *PccAcpi
   )
 {
@@ -725,7 +725,7 @@ PopulatePcctTable (
 
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
         Status = AddSubspaceStructType2 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE2_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS *)PccBuffer
                    );
 
@@ -828,7 +828,7 @@ BuildPcctTable (
   UINT32                                  PccType0Count;
   CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
   UINT32                                  PccType1Count;
-  CM_ARM_PCC_SUBSPACE_TYPE2_INFO          *PccType2;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
   UINT32                                  PccType2Count;
   CM_ARM_PCC_SUBSPACE_TYPE3_INFO          *PccType3;
   UINT32                                  PccType3Count;
@@ -887,7 +887,7 @@ BuildPcctTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjPccSubspaceType2Info (
+  Status = GetEArchCommonObjPccSubspaceType2Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType2,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 3a19870aad34..b73d0ded953d 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,12 +166,11 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 24 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 25 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 26 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 27 - Embedded Trace Extension/Module Info
-  NULL                              ///< 28 - P-State Dependency (PSD) Info
+  NULL,                             ///< 23 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 24 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 25 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 26 - Embedded Trace Extension/Module Info
+  NULL                              ///< 27 - 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 f8e277f1805e..c3e18b5a9500 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -600,9 +600,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType1InfoParser[] = {
     ARRAY_SIZE (CmArchCommonGenericInterruptParser) },
 };
 
-/** A parser for EArmObjPccSubspaceType2Info.
+/** A parser for EArchCommonObjPccSubspaceType2Info.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType2InfoParser[] = {
   { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
@@ -691,6 +691,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjCpcInfo,                     CmArchCommonCpcInfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType0Info,        CmArchCommonPccSubspaceType0InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType1Info,        CmArchCommonPccSubspaceType1InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType2Info,        CmArchCommonPccSubspaceType2InfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -720,7 +721,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType2Info,       CmArmPccSubspaceType2InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,       CmArmPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType4Info,       CmArmPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType5Info,       CmArmPccSubspaceType5InfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 3fa3dd9af948..59b6f8d1eaa3 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,12 +463,11 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  24   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  26   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  27   | Embedded Trace Extension/Module Info      | |
-|  28   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  24   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  25   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  26   | Embedded Trace Extension/Module Info      | |
+|  27   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  18   | Continuous Performance Control Info       | |
 |  19   | Pcc Subspace Type 0 Info                  | |
 |  20   | Pcc Subspace Type 1 Info                  | |
+|  21   | Pcc Subspace Type 2 Info                  | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116994): https://edk2.groups.io/g/devel/message/116994
Mute This Topic: https://groups.io/mt/105068174/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 17/19] DynamicTablesPkg: Move PCC Type 3 & 4 info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (15 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 16/19] DynamicTablesPkg: Move PCC Type2 " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 18/19] DynamicTablesPkg: Move PCC Type 5 " PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 19/19] DynamicTablesPkg: Move PSD " PierreGondois
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCC Subspace Type 3 & 4 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 40 ++++++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 46 ++-----------------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 34 +++++++-------
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  8 ++--
 .../ConfigurationManagerObjectParser.c        |  8 ++--
 DynamicTablesPkg/Readme.md                    | 10 ++--
 6 files changed, 72 insertions(+), 74 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 817c07f40d55..d4de70af5a6c 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -42,6 +42,8 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPccSubspaceType0Info,           ///< 19 - Pcc Subspace Type 0 Info
   EArchCommonObjPccSubspaceType1Info,           ///< 20 - Pcc Subspace Type 1 Info
   EArchCommonObjPccSubspaceType2Info,           ///< 21 - Pcc Subspace Type 2 Info
+  EArchCommonObjPccSubspaceType3Info,           ///< 22 - Pcc Subspace Type 3 Info
+  EArchCommonObjPccSubspaceType4Info,           ///< 23 - Pcc Subspace Type 4 Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -570,6 +572,44 @@ typedef struct CmArchCommonPccSubspaceType2Info {
   PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
 } CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO;
 
+/** A structure that describes a
+    PCC Subspace of type 3 (Extended)
+
+    ID: EArchCommonObjPccSubspaceType3Info
+*/
+typedef struct CmArchCommonPccSubspaceType3Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
+
+  /// Platform Interrupt Register.
+  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
+
+  /// Command Complete Check Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
+
+  /// Command Complete Update Register.
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteUpdateReg;
+
+  /// Error Status Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
+} CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 4 (Extended)
+
+    ID: EArchCommonObjPccSubspaceType4Info
+*/
+typedef CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index c287a855da87..7977cef07a0a 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,11 +51,9 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjPccSubspaceType3Info,                                 ///< 23 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 24 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 25 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 26 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 27 - P-State Dependency (PSD) Info
+  EArmObjPccSubspaceType5Info,                                 ///< 23 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 24 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 25 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -711,44 +709,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Subspace of type 3 (Extended)
-
-    ID: EArmObjPccSubspaceType3Info
-*/
-typedef struct CmArmPccSubspaceType3Info {
-  /** Generic Pcc information.
-
-    The Subspace of Type0 contains information that can be re-used
-    in other Subspace types.
-  */
-  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
-
-  /// Platform Interrupt.
-  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
-
-  /// Platform Interrupt Register.
-  PCC_MAILBOX_REGISTER_INFO           PlatIrqAckReg;
-
-  /// Command Complete Check Register.
-  /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
-
-  /// Command Complete Update Register.
-  PCC_MAILBOX_REGISTER_INFO           CmdCompleteUpdateReg;
-
-  /// Error Status Register.
-  /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
-} CM_ARM_PCC_SUBSPACE_TYPE3_INFO;
-
-/** A structure that describes a
-    PCC Subspace of type 4 (Extended)
-
-    ID: EArmObjPccSubspaceType4Info
-*/
-typedef CM_ARM_PCC_SUBSPACE_TYPE3_INFO CM_ARM_PCC_SUBSPACE_TYPE4_INFO;
-
 /** A structure that describes a
     PCC Subspace of type 5 (HW-Registers).
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
index 552aca4af47c..0df6429b0f91 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -32,8 +32,8 @@ Requirements:
   - EArchCommonObjPccSubspaceType0Info
   - EArchCommonObjPccSubspaceType1Info
   - EArchCommonObjPccSubspaceType2Info
-  - EArmObjPccSubspaceType3Info
-  - EArmObjPccSubspaceType4Info
+  - EArchCommonObjPccSubspaceType3Info
+  - EArchCommonObjPccSubspaceType4Info
   - EArmObjPccSubspaceType5Info
 */
 
@@ -68,18 +68,18 @@ GET_OBJECT_LIST (
     Subspace of Type 3 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType3Info,
-  CM_ARM_PCC_SUBSPACE_TYPE3_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType3Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO
   );
 
 /** This macro expands to a function that retrieves the PCC
     Subspace of Type 4 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType4Info,
-  CM_ARM_PCC_SUBSPACE_TYPE4_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType4Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO
   );
 
 /** This macro expands to a function that retrieves the PCC
@@ -256,11 +256,11 @@ MapPccSubspaceId (
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE3_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO);
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE4_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO);
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
@@ -489,7 +489,7 @@ STATIC
 EFI_STATUS
 EFIAPI
 AddSubspaceStructType34 (
-  IN  CM_ARM_PCC_SUBSPACE_TYPE3_INFO             *PccCmObj,
+  IN  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO     *PccCmObj,
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC  *PccAcpi
   )
 {
@@ -734,7 +734,7 @@ PopulatePcctTable (
 
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
         Status = AddSubspaceStructType34 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE3_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC *)PccBuffer
                    );
 
@@ -743,7 +743,7 @@ PopulatePcctTable (
 
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
         Status = AddSubspaceStructType34 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE4_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC *)PccBuffer
                    );
 
@@ -830,9 +830,9 @@ BuildPcctTable (
   UINT32                                  PccType1Count;
   CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
   UINT32                                  PccType2Count;
-  CM_ARM_PCC_SUBSPACE_TYPE3_INFO          *PccType3;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO  *PccType3;
   UINT32                                  PccType3Count;
-  CM_ARM_PCC_SUBSPACE_TYPE4_INFO          *PccType4;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
   UINT32                                  PccType4Count;
   CM_ARM_PCC_SUBSPACE_TYPE5_INFO          *PccType5;
   UINT32                                  PccType5Count;
@@ -898,7 +898,7 @@ BuildPcctTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjPccSubspaceType3Info (
+  Status = GetEArchCommonObjPccSubspaceType3Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType3,
@@ -909,7 +909,7 @@ BuildPcctTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjPccSubspaceType4Info (
+  Status = GetEArchCommonObjPccSubspaceType4Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType4,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index b73d0ded953d..112bef715166 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,11 +166,9 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 24 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 25 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 26 - Embedded Trace Extension/Module Info
-  NULL                              ///< 27 - P-State Dependency (PSD) Info
+  NULL,                             ///< 23 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 24 - Embedded Trace Extension/Module Info
+  NULL                              ///< 25 - 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 c3e18b5a9500..5f08f514faad 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -613,9 +613,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType2InfoParser[] = {
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
 };
 
-/** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
+/** A parser for EArchCommonObjPccSubspaceType3Info or EArchCommonObjPccSubspaceType4Info.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType34InfoParser[] = {
   { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
@@ -692,6 +692,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType0Info,        CmArchCommonPccSubspaceType0InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType1Info,        CmArchCommonPccSubspaceType1InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType2Info,        CmArchCommonPccSubspaceType2InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType3Info,        CmArchCommonPccSubspaceType34InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType4Info,        CmArchCommonPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -721,8 +723,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType3Info,       CmArmPccSubspaceType34InfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType4Info,       CmArmPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType5Info,       CmArmPccSubspaceType5InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjEtInfo,                     CmArmEtInfo),
   CM_PARSER_ADD_OBJECT (EArmObjPsdInfo,                    CmArmPsdInfoParser),
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 59b6f8d1eaa3..1e45bcd5974e 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,11 +463,9 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  24   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  25   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  26   | Embedded Trace Extension/Module Info      | |
-|  27   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  24   | Embedded Trace Extension/Module Info      | |
+|  25   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +494,7 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  19   | Pcc Subspace Type 0 Info                  | |
 |  20   | Pcc Subspace Type 1 Info                  | |
 |  21   | Pcc Subspace Type 2 Info                  | |
+|  22   | Pcc Subspace Type 3 Info                  | |
+|  23   | Pcc Subspace Type 4 Info                  | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116995): https://edk2.groups.io/g/devel/message/116995
Mute This Topic: https://groups.io/mt/105068175/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 18/19] DynamicTablesPkg: Move PCC Type 5 info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (16 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 17/19] DynamicTablesPkg: Move PCC Type 3 & 4 " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  2024-03-21 15:59 ` [edk2-devel] [PATCH 19/19] DynamicTablesPkg: Move PSD " PierreGondois
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PCC Subspace Type 5 info object from Arm Namespace to
the Arch Common namespace.

Correspondingly also update the following modules to reflect the
changes introduced by the move:
 - PCCT 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>
---
 .../Include/ArchCommonNameSpaceObjects.h      | 32 +++++++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 36 ++-----------------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 22 ++++++------
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |  4 +--
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   |  5 ++-
 .../ConfigurationManagerObjectParser.c        |  6 ++--
 DynamicTablesPkg/Readme.md                    |  6 ++--
 7 files changed, 55 insertions(+), 56 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index d4de70af5a6c..58a137e905d9 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -44,6 +44,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPccSubspaceType2Info,           ///< 21 - Pcc Subspace Type 2 Info
   EArchCommonObjPccSubspaceType3Info,           ///< 22 - Pcc Subspace Type 3 Info
   EArchCommonObjPccSubspaceType4Info,           ///< 23 - Pcc Subspace Type 4 Info
+  EArchCommonObjPccSubspaceType5Info,           ///< 24 - Pcc Subspace Type 5 Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -610,6 +611,37 @@ typedef struct CmArchCommonPccSubspaceType3Info {
 */
 typedef CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO;
 
+/** A structure that describes a
+    PCC Subspace of type 5 (HW-Registers).
+
+    ID: EArchCommonObjPccSubspaceType5Info
+*/
+typedef struct CmArchCommonPccSubspaceType5Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+
+    MaximumPeriodicAccessRate doesn't need to be populated for
+    this structure.
+  */
+  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
+
+  /// Version.
+  UINT16                              Version;
+
+  /// Platform Interrupt.
+  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
+
+  /// Command Complete Check Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
+
+  /// Error Status Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
+} CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 7977cef07a0a..724e614bb652 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,9 +51,8 @@ typedef enum ArmObjectID {
   EArmObjCmn600Info,                                           ///< 20 - CMN-600 Info
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
-  EArmObjPccSubspaceType5Info,                                 ///< 23 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 24 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 25 - P-State Dependency (PSD) Info
+  EArmObjEtInfo,                                               ///< 23 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 24 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -709,37 +708,6 @@ typedef struct CmArmRmrDescriptor {
   UINT64    Length;
 } CM_ARM_MEMORY_RANGE_DESCRIPTOR;
 
-/** A structure that describes a
-    PCC Subspace of type 5 (HW-Registers).
-
-    ID: EArmObjPccSubspaceType5Info
-*/
-typedef struct CmArmPccSubspaceType5Info {
-  /** Generic Pcc information.
-
-    The Subspace of Type0 contains information that can be re-used
-    in other Subspace types.
-
-    MaximumPeriodicAccessRate doesn't need to be populated for
-    this structure.
-  */
-  PCC_SUBSPACE_GENERIC_INFO           GenericPccInfo;
-
-  /// Version.
-  UINT16                              Version;
-
-  /// Platform Interrupt.
-  CM_ARCH_COMMON_GENERIC_INTERRUPT    PlatIrq;
-
-  /// Command Complete Check Register.
-  /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO           CmdCompleteCheckReg;
-
-  /// Error Status Register.
-  /// The WriteMask field is not used.
-  PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
-} CM_ARM_PCC_SUBSPACE_TYPE5_INFO;
-
 /** An enum describing the Arm Embedded Trace device type.
 */
 typedef enum ArmEtType {
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
index 0df6429b0f91..205c44405785 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -34,7 +34,7 @@ Requirements:
   - EArchCommonObjPccSubspaceType2Info
   - EArchCommonObjPccSubspaceType3Info
   - EArchCommonObjPccSubspaceType4Info
-  - EArmObjPccSubspaceType5Info
+  - EArchCommonObjPccSubspaceType5Info
 */
 
 /** This macro expands to a function that retrieves the PCC
@@ -86,9 +86,9 @@ GET_OBJECT_LIST (
     Subspace of Type 5 Information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPccSubspaceType5Info,
-  CM_ARM_PCC_SUBSPACE_TYPE5_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPccSubspaceType5Info,
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO
   );
 
 /** The Platform is capable of generating an interrupt
@@ -168,7 +168,7 @@ MappingTableFree (
 
   @param [in] MappingTable      The mapping table structure.
   @param [in] PccSubspace       A pointer to
-                                CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO.
+                                CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO.
   @param [in] Index             Index at which PccSubspace must be added.
                                 This is the Subspace Id.
 
@@ -209,7 +209,7 @@ MappingTableAdd (
 
   @param [in] MappingTable     The mapping table structure.
   @param [in] CmPccArray       Pointer to an array of
-                               CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO.
+                               CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO.
   @param [in] CmPccCount       Count of objects in CmPccArray.
 
   @retval EFI_SUCCESS            Success.
@@ -264,7 +264,7 @@ MapPccSubspaceId (
       break;
 
     case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
-      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE5_INFO);
+      CmObjSize = sizeof (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO);
       break;
 
     default:
@@ -601,7 +601,7 @@ STATIC
 EFI_STATUS
 EFIAPI
 AddSubspaceStructType5 (
-  IN  CM_ARM_PCC_SUBSPACE_TYPE5_INFO                            *PccCmObj,
+  IN  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO                    *PccCmObj,
   IN  EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS  *PccAcpi
   )
 {
@@ -752,7 +752,7 @@ PopulatePcctTable (
 
       case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
         Status = AddSubspaceStructType5 (
-                   (CM_ARM_PCC_SUBSPACE_TYPE5_INFO *)CurrentPccSubspace,
+                   (CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO *)CurrentPccSubspace,
                    (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS *)PccBuffer
                    );
 
@@ -834,7 +834,7 @@ BuildPcctTable (
   UINT32                                  PccType3Count;
   CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
   UINT32                                  PccType4Count;
-  CM_ARM_PCC_SUBSPACE_TYPE5_INFO          *PccType5;
+  CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO  *PccType5;
   UINT32                                  PccType5Count;
 
   ASSERT (This != NULL);
@@ -920,7 +920,7 @@ BuildPcctTable (
     goto error_handler;
   }
 
-  Status = GetEArmObjPccSubspaceType5Info (
+  Status = GetEArchCommonObjPccSubspaceType5Info (
              CfgMgrProtocol,
              CM_NULL_TOKEN,
              &PccType5,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
index e1bca78c2ffa..b99bf91b41b2 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
@@ -19,7 +19,7 @@
 */
 typedef struct MappingTable {
   /// Mapping table for Subspace Ids.
-  /// Subspace ID/Index <-> CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  /// Subspace ID/Index <-> CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO pointer
   VOID      **Table;
 
   /// Number of entries in the Table.
@@ -35,7 +35,7 @@ typedef struct AcpiPcctGenerator {
   // Private fields are defined from here.
 
   /// Table to map:
-  /// Subspace ID/Index <-> CM_[ARM|ARCH_COMMON]_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  /// Subspace ID/Index <-> CM_ARCH_COMMON_PCC_SUBSPACE_TYPE[X]_INFO pointer
   MAPPING_TABLE           MappingTable;
 } ACPI_PCCT_GENERATOR;
 
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 112bef715166..05fbdadf156b 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,9 +166,8 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 24 - Embedded Trace Extension/Module Info
-  NULL                              ///< 25 - P-State Dependency (PSD) Info
+  NULL,                             ///< 23 - Embedded Trace Extension/Module Info
+  NULL                              ///< 24 - 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 5f08f514faad..da7901a2c48c 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -635,9 +635,9 @@ STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType34InfoParser[] = {
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
 };
 
-/** A parser for EArmObjPccSubspaceType5Info.
+/** A parser for EArchCommonObjPccSubspaceType5Info.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPccSubspaceType5InfoParser[] = {
   { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArchCommonPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArchCommonPccSubspaceType0InfoParser) },
@@ -694,6 +694,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType2Info,        CmArchCommonPccSubspaceType2InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType3Info,        CmArchCommonPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType4Info,        CmArchCommonPccSubspaceType34InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType5Info,        CmArchCommonPccSubspaceType5InfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -723,7 +724,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjCmn600Info,                 CmArmCmn600InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjPccSubspaceType5Info,       CmArmPccSubspaceType5InfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjEtInfo,                     CmArmEtInfo),
   CM_PARSER_ADD_OBJECT (EArmObjPsdInfo,                    CmArmPsdInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArmObjMax)
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 1e45bcd5974e..d4c95a3c42c8 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,9 +463,8 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | CMN 600 Info                              | |
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
-|  23   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  24   | Embedded Trace Extension/Module Info      | |
-|  25   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Embedded Trace Extension/Module Info      | |
+|  24   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  21   | Pcc Subspace Type 2 Info                  | |
 |  22   | Pcc Subspace Type 3 Info                  | |
 |  23   | Pcc Subspace Type 4 Info                  | |
+|  24   | Pcc Subspace Type 5 Info                  | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116996): https://edk2.groups.io/g/devel/message/116996
Mute This Topic: https://groups.io/mt/105068176/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [edk2-devel] [PATCH 19/19] DynamicTablesPkg: Move PSD info to Arch Common
  2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
                   ` (17 preceding siblings ...)
  2024-03-21 15:59 ` [edk2-devel] [PATCH 18/19] DynamicTablesPkg: Move PCC Type 5 " PierreGondois
@ 2024-03-21 15:59 ` PierreGondois
  18 siblings, 0 replies; 20+ messages in thread
From: PierreGondois @ 2024-03-21 15:59 UTC (permalink / raw)
  To: devel
  Cc: Pierre Gondois, Sami Mujawar, Pierre Gondois, Yeo Reum Yun,
	Sunil V L, AbdulLateef Attar, Jeshua Smith, Jeff Brasen,
	Girish Mahadevan, Leif Lindholm, Meenakshi Aggarwal

From: Sami Mujawar <sami.mujawar@arm.com>

Move the PSD 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>
---
 .../Include/ArchCommonNameSpaceObjects.h           | 10 ++++++++++
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h     | 12 +-----------
 .../SsdtCpuTopologyGenerator.c                     | 14 +++++++-------
 .../Common/DynamicPlatRepoLib/CmObjectTokenFixer.c |  3 +--
 .../ConfigurationManagerObjectParser.c             |  6 +++---
 DynamicTablesPkg/Readme.md                         |  2 +-
 6 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 58a137e905d9..6de57dbbf223 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -45,6 +45,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjPccSubspaceType3Info,           ///< 22 - Pcc Subspace Type 3 Info
   EArchCommonObjPccSubspaceType4Info,           ///< 23 - Pcc Subspace Type 4 Info
   EArchCommonObjPccSubspaceType5Info,           ///< 24 - Pcc Subspace Type 5 Info
+  EArchCommonObjPsdInfo,                        ///< 25 - P-State Dependency (PSD) Info
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -642,6 +643,15 @@ typedef struct CmArchCommonPccSubspaceType5Info {
   PCC_MAILBOX_REGISTER_INFO           ErrorStatusReg;
 } CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO;
 
+/** A structure that describes a
+    P-State Dependency (PSD) Info.
+
+    Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).
+
+    ID: EArchCommonObjPsdInfo
+*/
+typedef AML_PSD_INFO CM_ARCH_COMMON_PSD_INFO;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 724e614bb652..958c3dc93cd3 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -52,7 +52,6 @@ typedef enum ArmObjectID {
   EArmObjRmr,                                                  ///< 21 - Reserved Memory Range Node
   EArmObjMemoryRangeDescriptor,                                ///< 22 - Memory Range Descriptor
   EArmObjEtInfo,                                               ///< 23 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 24 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -188,7 +187,7 @@ typedef struct CmArmGicCInfo {
   CM_OBJECT_TOKEN    EtToken;
 
   /** Optional field: Reference Token for the Psd info of this processor.
-      i.e. a token referencing a CM_ARM_PSD_INFO object.
+      i.e. a token referencing a CM_ARCH_COMMON_PSD_INFO object.
   */
   CM_OBJECT_TOKEN    PsdToken;
 } CM_ARM_GICC_INFO;
@@ -724,15 +723,6 @@ typedef struct CmArmEtInfo {
   ARM_ET_TYPE    EtType;
 } CM_ARM_ET_INFO;
 
-/** A structure that describes a
-    P-State Dependency (PSD) Info.
-
-    Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).
-
-    ID: EArmObjPsdInfo
-*/
-typedef AML_PSD_INFO CM_ARM_PSD_INFO;
-
 #pragma pack()
 
 #endif // ARM_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 21233a404a05..f923f41d6bee 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -42,7 +42,7 @@ Requirements:
   - EArchCommonObjCmRef (OPTIONAL)
   - EArchCommonObjLpiInfo (OPTIONAL)
   - GetEArmObjEtInfo (OPTIONAL)
-  - EArmObjPsdInfo (OPTIONAL)
+  - EArchCommonObjPsdInfo (OPTIONAL)
 */
 
 /** This macro expands to a function that retrieves the GIC
@@ -109,9 +109,9 @@ GET_OBJECT_LIST (
   information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjPsdInfo,
-  CM_ARM_PSD_INFO
+  EObjNameSpaceArchCommon,
+  EArchCommonObjPsdInfo,
+  CM_ARCH_COMMON_PSD_INFO
   );
 
 /** Initialize the TokenTable.
@@ -313,10 +313,10 @@ CreateAmlPsdNode (
   IN  AML_OBJECT_NODE_HANDLE                              *Node
   )
 {
-  EFI_STATUS       Status;
-  CM_ARM_PSD_INFO  *PsdInfo;
+  EFI_STATUS               Status;
+  CM_ARCH_COMMON_PSD_INFO  *PsdInfo;
 
-  Status = GetEArmObjPsdInfo (
+  Status = GetEArchCommonObjPsdInfo (
              CfgMgrProtocol,
              GicCInfo->PsdToken,
              &PsdInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index 05fbdadf156b..5325b20743e8 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,8 +166,7 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - CMN-600 Info
   NULL,                             ///< 21 - Reserved Memory Range Node
   NULL,                             ///< 22 - Memory Range Descriptor
-  NULL,                             ///< 23 - Embedded Trace Extension/Module Info
-  NULL                              ///< 24 - P-State Dependency (PSD) Info
+  NULL                              ///< 23 - Embedded Trace Extension/Module Info
 };
 
 /** CmObj token fixer.
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index da7901a2c48c..e726b2c61602 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -658,9 +658,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmEtInfo[] = {
   { "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL }
 };
 
-/** A parser for EArmObjPsdInfo.
+/** A parser for EArchCommonObjPsdInfo.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmPsdInfoParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonPsdInfoParser[] = {
   { "Revision",  1, "0x%x", NULL },
   { "DomainId",  4, "0x%x", NULL },
   { "CoordType", 4, "0x%x", NULL },
@@ -695,6 +695,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType3Info,        CmArchCommonPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType4Info,        CmArchCommonPccSubspaceType34InfoParser),
   CM_PARSER_ADD_OBJECT (EArchCommonObjPccSubspaceType5Info,        CmArchCommonPccSubspaceType5InfoParser),
+  CM_PARSER_ADD_OBJECT (EArchCommonObjPsdInfo,                     CmArchCommonPsdInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArchCommonObjMax)
 };
 
@@ -725,7 +726,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjRmr,                        CmArmRmrInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryRangeDescriptor,      CmArmMemoryRangeDescriptorInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjEtInfo,                     CmArmEtInfo),
-  CM_PARSER_ADD_OBJECT (EArmObjPsdInfo,                    CmArmPsdInfoParser),
   CM_PARSER_ADD_OBJECT_RESERVED (EArmObjMax)
 };
 
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index d4c95a3c42c8..7790b14636ff 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -464,7 +464,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  21   | Reserved Memory Range Node                | |
 |  22   | Memory Range Descriptor                   | |
 |  23   | Embedded Trace Extension/Module Info      | |
-|  24   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
 |  `*`  | All other values are reserved.            | |
 
 #### Object ID's in the Arch Common Namespace:
@@ -496,5 +495,6 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  22   | Pcc Subspace Type 3 Info                  | |
 |  23   | Pcc Subspace Type 4 Info                  | |
 |  24   | Pcc Subspace Type 5 Info                  | |
+|  25   | P-State Dependency (PSD) Info             | |
 |  `*`  | All other values are reserved.            | |
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116997): https://edk2.groups.io/g/devel/message/116997
Mute This Topic: https://groups.io/mt/105068178/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-03-21 16:01 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 15:59 [edk2-devel] [PATCH 00/19] DynamicTablesPkg: Move objects to Arch Common NameSpace (second) PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 01/19] DynamicTablesPkg: Move Pci Address Map Info to Arch Common PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 02/19] DynamicTablesPkg: Move CM_ARM_GENERIC_INTERRUPT struct " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 03/19] DynamicTablesPkg: Move Pci Interrupt Map Info " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 04/19] DynamicTablesPkg: Move Mem Affinity " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 05/19] DynamicTablesPkg: Move ACPI device Handle object " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 06/19] DynamicTablesPkg: Move PCI " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 07/19] DynamicTablesPkg: Move Generic Initiator affinity info " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 08/19] DynamicTablesPkg: Move LPI info object " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 09/19] DynamicTablesPkg: Rename GicCToken field in Processor Hierarchy Info PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 10/19] DynamicTablesPkg: Move Processor hierarchy info to Arch Common PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 11/19] DynamicTablesPkg: Move Cache " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 12/19] DynamicTablesPkg: Move Continuous perf control " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 13/19] DynamicTablesPkg: Move PCC structure definitions " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 14/19] DynamicTablesPkg: Move PCC Type0 info " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 15/19] DynamicTablesPkg: Move PCC Type1 " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 16/19] DynamicTablesPkg: Move PCC Type2 " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 17/19] DynamicTablesPkg: Move PCC Type 3 & 4 " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 18/19] DynamicTablesPkg: Move PCC Type 5 " PierreGondois
2024-03-21 15:59 ` [edk2-devel] [PATCH 19/19] DynamicTablesPkg: Move PSD " PierreGondois

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox