public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <pierre.gondois@arm.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Pierre Gondois <Pierre.Gondois@arm.com>,
	Yeo Reum Yun <YeoReum.Yun@arm.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	AbdulLateef Attar <AbdulLateef.Attar@amd.com>,
	Jeshua Smith <jeshuas@nvidia.com>,
	Jeff Brasen <jbrasen@nvidia.com>,
	Girish Mahadevan <gmahadevan@nvidia.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Subject: [edk2-devel] [PATCH 15/16] DynamicTablesPkg: Move Cm Reference object to Arch Common
Date: Thu, 21 Mar 2024 16:53:18 +0100	[thread overview]
Message-ID: <20240321155319.701355-16-pierre.gondois@arm.com> (raw)
In-Reply-To: <20240321155319.701355-1-pierre.gondois@arm.com>

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

Move Cm Reference 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
 - SSDT PCIe generator
 - ConfigurationManagerObjectParser
 - Dynamic Plat Repo, the Token Mapper and the TokenFixer map.
 - FdtHwInfoParser library

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      | 17 ++++++
 .../Include/ArmNameSpaceObjects.h             | 61 +++++++------------
 .../Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c   | 20 +++---
 .../SsdtCpuTopologyGenerator.c                | 14 ++---
 .../SsdtCpuTopologyGenerator.h                | 10 +--
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    | 20 +++---
 .../DynamicPlatRepoLib/CmObjectTokenFixer.c   | 37 ++++++-----
 .../DynamicPlatRepoLib/DynamicPlatRepo.c      | 28 ++++-----
 .../Common/DynamicPlatRepoLib/TokenMapper.c   |  9 +--
 .../ConfigurationManagerObjectParser.c        |  6 +-
 .../FdtHwInfoParserLib/CmObjectDescUtility.c  | 10 +--
 .../FdtHwInfoParserLib/CmObjectDescUtility.h  |  6 +-
 DynamicTablesPkg/Readme.md                    | 40 ++++++------
 13 files changed, 139 insertions(+), 139 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
index 1030488f4561..632816da09de 100644
--- a/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h
@@ -27,6 +27,7 @@ typedef enum ArchCommonObjectID {
   EArchCommonObjSerialDebugPortInfo,            ///<  4 - Serial Debug Port Info
   EArchCommonObjHypervisorVendorIdentity,       ///<  5 - Hypervisor Vendor Id
   EArchCommonObjFixedFeatureFlags,              ///<  6 - Fixed feature flags for FADT
+  EArchCommonObjCmRef,                          ///<  7 - CM Object Reference
   EArchCommonObjMax
 } EARCH_COMMON_OBJECT_ID;
 
@@ -97,6 +98,22 @@ typedef struct CmArchCommonFixedFeatureFlags {
   UINT32    Flags;
 } CM_ARCH_COMMON_FIXED_FEATURE_FLAGS;
 
+/** A structure that describes a reference to another Configuration Manager
+    object.
+
+    This is useful for creating an array of reference tokens. The framework
+    can then query the configuration manager for these arrays using the
+    object ID EArchCommonObjCmRef.
+
+    This can be used is to represent one-to-many relationships between objects.
+
+    ID: EArchCommonObjCmRef
+*/
+typedef struct CmArchCommonObjRef {
+  /// Token of the CM object being referenced
+  CM_OBJECT_TOKEN    ReferenceToken;
+} CM_ARCH_COMMON_OBJ_REF;
+
 #pragma pack()
 
 #endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 66709c41fd69..cfcb2c7d2758 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -51,26 +51,25 @@ typedef enum ArmObjectID {
   EArmObjSmmuInterruptArray,                                   ///< 20 - SMMU Interrupt Array
   EArmObjProcHierarchyInfo,                                    ///< 21 - Processor Hierarchy Info
   EArmObjCacheInfo,                                            ///< 22 - Cache Info
-  EArmObjCmRef,                                                ///< 23 - CM Object Reference
-  EArmObjMemoryAffinityInfo,                                   ///< 24 - Memory Affinity Info
-  EArmObjDeviceHandleAcpi,                                     ///< 25 - Device Handle Acpi
-  EArmObjDeviceHandlePci,                                      ///< 26 - Device Handle Pci
-  EArmObjGenericInitiatorAffinityInfo,                         ///< 27 - Generic Initiator Affinity
-  EArmObjCmn600Info,                                           ///< 28 - CMN-600 Info
-  EArmObjLpiInfo,                                              ///< 29 - Lpi Info
-  EArmObjPciAddressMapInfo,                                    ///< 30 - Pci Address Map Info
-  EArmObjPciInterruptMapInfo,                                  ///< 31 - Pci Interrupt Map Info
-  EArmObjRmr,                                                  ///< 32 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,                                ///< 33 - Memory Range Descriptor
-  EArmObjCpcInfo,                                              ///< 34 - Continuous Performance Control Info
-  EArmObjPccSubspaceType0Info,                                 ///< 35 - Pcc Subspace Type 0 Info
-  EArmObjPccSubspaceType1Info,                                 ///< 36 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType2Info,                                 ///< 37 - Pcc Subspace Type 2 Info
-  EArmObjPccSubspaceType3Info,                                 ///< 38 - Pcc Subspace Type 3 Info
-  EArmObjPccSubspaceType4Info,                                 ///< 39 - Pcc Subspace Type 4 Info
-  EArmObjPccSubspaceType5Info,                                 ///< 40 - Pcc Subspace Type 5 Info
-  EArmObjEtInfo,                                               ///< 41 - Embedded Trace Extension/Module Info
-  EArmObjPsdInfo,                                              ///< 42 - P-State Dependency (PSD) Info
+  EArmObjMemoryAffinityInfo,                                   ///< 23 - Memory Affinity Info
+  EArmObjDeviceHandleAcpi,                                     ///< 24 - Device Handle Acpi
+  EArmObjDeviceHandlePci,                                      ///< 25 - Device Handle Pci
+  EArmObjGenericInitiatorAffinityInfo,                         ///< 26 - Generic Initiator Affinity
+  EArmObjCmn600Info,                                           ///< 27 - CMN-600 Info
+  EArmObjLpiInfo,                                              ///< 28 - Lpi Info
+  EArmObjPciAddressMapInfo,                                    ///< 29 - Pci Address Map Info
+  EArmObjPciInterruptMapInfo,                                  ///< 30 - Pci Interrupt Map Info
+  EArmObjRmr,                                                  ///< 31 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 32 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 33 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 34 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 35 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 36 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 37 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 38 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 39 - Pcc Subspace Type 5 Info
+  EArmObjEtInfo,                                               ///< 40 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 41 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -428,11 +427,11 @@ typedef struct CmArmPciConfigSpaceInfo {
   UINT8              EndBusNumber;
 
   /// Optional field: Reference Token for address mapping.
-  /// Token identifying a CM_ARM_OBJ_REF structure.
+  /// Token identifying a CM_ARCH_COMMON_OBJ_REF structure.
   CM_OBJECT_TOKEN    AddressMapToken;
 
   /// Optional field: Reference Token for interrupt mapping.
-  /// Token identifying a CM_ARM_OBJ_REF structure.
+  /// Token identifying a CM_ARCH_COMMON_OBJ_REF structure.
   CM_OBJECT_TOKEN    InterruptMapToken;
 } CM_ARM_PCI_CONFIG_SPACE_INFO;
 
@@ -721,7 +720,7 @@ typedef struct CmArmProcHierarchyInfo {
   /// 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_ARM_OBJ_REF structure, itself referencing
+  /// Token identifying a CM_ARCH_COMMON_OBJ_REF structure, itself referencing
   /// CM_ARM_LPI_INFO objects.
   CM_OBJECT_TOKEN    LpiToken;
   /// Set to TRUE if UID should override index for name and _UID
@@ -767,22 +766,6 @@ typedef struct CmArmCacheInfo {
   UINT32             CacheId;
 } CM_ARM_CACHE_INFO;
 
-/** A structure that describes a reference to another Configuration Manager
-    object.
-
-    This is useful for creating an array of reference tokens. The framework
-    can then query the configuration manager for these arrays using the
-    object ID EArmObjCmRef.
-
-    This can be used is to represent one-to-many relationships between objects.
-
-    ID: EArmObjCmRef
-*/
-typedef struct CmArmObjRef {
-  /// Token of the CM object being referenced
-  CM_OBJECT_TOKEN    ReferenceToken;
-} CM_ARM_OBJ_REF;
-
 /** A structure that describes the Memory Affinity Structure (Type 1) in SRAT
 
     ID: EArmObjMemoryAffinityInfo
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index 78fa63ff47e5..c237f7ff9386 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
@@ -34,7 +34,7 @@
     The following Configuration Manager Object(s) are used by this Generator:
     - EArmObjProcHierarchyInfo (REQUIRED)
     - EArmObjCacheInfo
-    - EArmObjCmRef
+    - EArchCommonObjCmRef
     - EArmObjGicCInfo (REQUIRED)
 */
 
@@ -63,9 +63,9 @@ GET_OBJECT_LIST (
   reference information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjCmRef,
-  CM_ARM_OBJ_REF
+  EObjNameSpaceArchCommon,
+  EArchCommonObjCmRef,
+  CM_ARCH_COMMON_OBJ_REF
   );
 
 /**
@@ -264,7 +264,7 @@ DetectCyclesInTopology (
                                     Protocol Interface.
   @param [in]  PrivResArray         Pointer to the array of private resources.
   @param [in]  PrivResCount         Number of private resources.
-  @param [in]  PrivResArrayToken    Reference Token for the CM_ARM_OBJ_REF
+  @param [in]  PrivResArrayToken    Reference Token for the CM_ARCH_COMMON_OBJ_REF
                                     array describing node's private resources.
 
   @retval EFI_SUCCESS               Array updated successfully.
@@ -281,10 +281,10 @@ AddPrivateResources (
   IN  CONST CM_OBJECT_TOKEN                                PrivResArrayToken
   )
 {
-  EFI_STATUS         Status;
-  CM_ARM_OBJ_REF     *CmObjRefs;
-  UINT32             CmObjRefCount;
-  PPTT_NODE_INDEXER  *PpttNodeFound;
+  EFI_STATUS              Status;
+  CM_ARCH_COMMON_OBJ_REF  *CmObjRefs;
+  UINT32                  CmObjRefCount;
+  PPTT_NODE_INDEXER       *PpttNodeFound;
 
   ASSERT (
     (Generator != NULL) &&
@@ -308,7 +308,7 @@ AddPrivateResources (
 
   CmObjRefCount = 0;
   // Get the CM Object References
-  Status = GetEArmObjCmRef (
+  Status = GetEArchCommonObjCmRef (
              CfgMgrProtocol,
              PrivResArrayToken,
              &CmObjRefs,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index cc6400e9e0df..994733a4e9c2 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -39,7 +39,7 @@ Requirements:
   this Generator:
   - EArmObjGicCInfo
   - EArmObjProcHierarchyInfo (OPTIONAL) along with
-  - EArmObjCmRef (OPTIONAL)
+  - EArchCommonObjCmRef (OPTIONAL)
   - EArmObjLpiInfo (OPTIONAL)
   - GetEArmObjEtInfo (OPTIONAL)
   - EArmObjPsdInfo (OPTIONAL)
@@ -69,9 +69,9 @@ GET_OBJECT_LIST (
   reference information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjCmRef,
-  CM_ARM_OBJ_REF
+  EObjNameSpaceArchCommon,
+  EArchCommonObjCmRef,
+  CM_ARCH_COMMON_OBJ_REF
   );
 
 /**
@@ -120,7 +120,7 @@ GET_OBJECT_LIST (
   structure of the platform. The TokenTable allows to have a mapping:
   Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures).
 
-  There will always be less sets of Lpi states (CM_ARM_OBJ_REF)
+  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).
 
   @param [in]  Generator  The SSDT Cpu Topology generator.
@@ -697,7 +697,7 @@ GenerateLpiStates (
   UINT32  LastIndex;
 
   AML_OBJECT_NODE_HANDLE  LpiNode;
-  CM_ARM_OBJ_REF          *LpiRefInfo;
+  CM_ARCH_COMMON_OBJ_REF  *LpiRefInfo;
   UINT32                  LpiRefInfoCount;
   UINT32                  LpiRefIndex;
   CM_ARM_LPI_INFO         *LpiInfo;
@@ -727,7 +727,7 @@ GenerateLpiStates (
     }
 
     // Fetch the LPI objects referenced by the token.
-    Status = GetEArmObjCmRef (
+    Status = GetEArchCommonObjCmRef (
                CfgMgrProtocol,
                Generator->TokenTable.Table[Index],
                &LpiRefInfo,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
index 0c7a0b0601ab..d6561e33da11 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h
@@ -69,8 +69,8 @@
 
 /** A structure used to handle the Lpi structures referencing.
 
-  A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARM_OBJ_REF.
-  This CM_ARM_OBJ_REF references CM_ARM_LPI_INFO structures.
+  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.
 
   Example:
   (Cpu0)                                   (Cpu1)
@@ -80,7 +80,7 @@
               |
               v
   (List of references to Lpi states)
-  CM_ARM_OBJ_REF
+  CM_ARCH_COMMON_OBJ_REF
               |
               +----------------------------------------
               |                                       |
@@ -89,9 +89,9 @@
   CM_ARM_LPI_INFO[0]                        CM_ARM_LPI_INFO[1]
 
   Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO
-  structures reference the same CM_ARM_OBJ_REF. An entry is created in the
+  structures reference the same CM_ARCH_COMMON_OBJ_REF. An entry is created in the
   TokenTable such as:
-  0 <-> CM_ARM_OBJ_REF
+  0 <-> CM_ARCH_COMMON_OBJ_REF
 
   This will lead to the creation of this pseudo-ASL code where Cpu0 and Cpu1
   return the same object at \_SB.L000:
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 72873709aab5..dc1371c3bc5f 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -42,7 +42,7 @@
 Requirements:
   The following Configuration Manager Object(s) are required by
   this Generator:
-  - EArmObjCmRef
+  - EArchCommonObjCmRef
   - EArmObjPciConfigSpaceInfo
   - EArmObjPciAddressMapInfo
   - EArmObjPciInterruptMapInfo
@@ -52,9 +52,9 @@ Requirements:
     reference information from the Configuration Manager.
 */
 GET_OBJECT_LIST (
-  EObjNameSpaceArm,
-  EArmObjCmRef,
-  CM_ARM_OBJ_REF
+  EObjNameSpaceArchCommon,
+  EArchCommonObjCmRef,
+  CM_ARCH_COMMON_OBJ_REF
   );
 
 /** This macro expands to a function that retrieves the Pci
@@ -313,7 +313,7 @@ GeneratePrt (
   EFI_STATUS                     Status;
   INT32                          Index;
   AML_OBJECT_NODE_HANDLE         PrtNode;
-  CM_ARM_OBJ_REF                 *RefInfo;
+  CM_ARCH_COMMON_OBJ_REF         *RefInfo;
   UINT32                         RefCount;
   CM_ARM_PCI_INTERRUPT_MAP_INFO  *IrqMapInfo;
 
@@ -324,9 +324,9 @@ GeneratePrt (
 
   PrtNode = NULL;
 
-  // Get the array of CM_ARM_OBJ_REF referencing the
+  // Get the array of CM_ARCH_COMMON_OBJ_REF referencing the
   // CM_ARM_PCI_INTERRUPT_MAP_INFO objects.
-  Status = GetEArmObjCmRef (
+  Status = GetEArchCommonObjCmRef (
              CfgMgrProtocol,
              PciInfo->InterruptMapToken,
              &RefInfo,
@@ -458,7 +458,7 @@ GeneratePciCrs (
   EFI_STATUS                   Status;
   BOOLEAN                      Translation;
   UINT32                       Index;
-  CM_ARM_OBJ_REF               *RefInfo;
+  CM_ARCH_COMMON_OBJ_REF       *RefInfo;
   UINT32                       RefCount;
   CM_ARM_PCI_ADDRESS_MAP_INFO  *AddrMapInfo;
   AML_OBJECT_NODE_HANDLE       CrsNode;
@@ -505,9 +505,9 @@ GeneratePciCrs (
     return Status;
   }
 
-  // Get the array of CM_ARM_OBJ_REF referencing the
+  // Get the array of CM_ARCH_COMMON_OBJ_REF referencing the
   // CM_ARM_PCI_ADDRESS_MAP_INFO objects.
-  Status = GetEArmObjCmRef (
+  Status = GetEArchCommonObjCmRef (
              CfgMgrProtocol,
              PciInfo->AddressMapToken,
              &RefInfo,
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
index aef818e77f0c..d7ecd4dc1ba7 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c
@@ -166,26 +166,25 @@ CM_OBJECT_TOKEN_FIXER  TokenFixer[EArmObjMax] = {
   NULL,                             ///< 20 - SMMU Interrupt Array
   TokenFixerNotImplemented,         ///< 21 - Processor Hierarchy Info
   TokenFixerNotImplemented,         ///< 22 - Cache Info
-  NULL,                             ///< 23 - CM Object Reference
-  NULL,                             ///< 24 - Memory Affinity Info
-  NULL,                             ///< 25 - Device Handle Acpi
-  NULL,                             ///< 26 - Device Handle Pci
-  NULL,                             ///< 27 - Generic Initiator Affinity
-  NULL,                             ///< 28 - CMN-600 Info
-  NULL,                             ///< 29 - Lpi Info
-  NULL,                             ///< 30 - Pci Address Map Info
-  NULL,                             ///< 31 - Pci Interrupt Map Info
-  NULL,                             ///< 32 - Reserved Memory Range Node
-  NULL,                             ///< 33 - Memory Range Descriptor
-  NULL,                             ///< 34 - Continuous Performance Control Info
-  NULL,                             ///< 35 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 23 - Memory Affinity Info
+  NULL,                             ///< 24 - Device Handle Acpi
+  NULL,                             ///< 25 - Device Handle Pci
+  NULL,                             ///< 26 - Generic Initiator Affinity
+  NULL,                             ///< 27 - CMN-600 Info
+  NULL,                             ///< 28 - Lpi Info
+  NULL,                             ///< 29 - Pci Address Map Info
+  NULL,                             ///< 30 - Pci Interrupt Map Info
+  NULL,                             ///< 31 - Reserved Memory Range Node
+  NULL,                             ///< 32 - Memory Range Descriptor
+  NULL,                             ///< 33 - Continuous Performance Control Info
+  NULL,                             ///< 34 - Pcc Subspace Type 0 Info
+  NULL,                             ///< 35 - Pcc Subspace Type 2 Info
   NULL,                             ///< 36 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 37 - Pcc Subspace Type 2 Info
-  NULL,                             ///< 38 - Pcc Subspace Type 3 Info
-  NULL,                             ///< 39 - Pcc Subspace Type 4 Info
-  NULL,                             ///< 40 - Pcc Subspace Type 5 Info
-  NULL,                             ///< 41 - Embedded Trace Extension/Module Info
-  NULL                              ///< 42 - P-State Dependency (PSD) Info
+  NULL,                             ///< 37 - Pcc Subspace Type 3 Info
+  NULL,                             ///< 38 - Pcc Subspace Type 4 Info
+  NULL,                             ///< 39 - Pcc Subspace Type 5 Info
+  NULL,                             ///< 40 - Embedded Trace Extension/Module Info
+  NULL                              ///< 41 - P-State Dependency (PSD) Info
 };
 
 /** CmObj token fixer.
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c
index e4fa1233708e..08d11ac96a22 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/DynamicPlatRepo.c
@@ -145,7 +145,7 @@ DynPlatRepoAddObject (
 
   // Check the CmObjDesc:
   //  - only Arm objects and Arch Common objects are supported for now.
-  //  - only EArmObjCmRef objects can be added as arrays.
+  //  - only EArchCommonObjCmRef objects can be added as arrays.
   if ((CmObjDesc->Size == 0) || (CmObjDesc->Count == 0)) {
     ASSERT (0);
     return EFI_INVALID_PARAMETER;
@@ -155,16 +155,16 @@ DynPlatRepoAddObject (
   NamespaceId = GET_CM_NAMESPACE_ID (CmObjDesc->ObjectId);
 
   if (EObjNameSpaceArm == NamespaceId) {
-    if ((ObjId >= EArmObjMax) ||
-        ((CmObjDesc->Count > 1)  && (ObjId != EArmObjCmRef)))
-    {
+    if (ObjId >= EArmObjMax) {
       ASSERT (0);
       return EFI_INVALID_PARAMETER;
     }
 
     ObjList = &This->ArmCmObjList[ObjId];
   } else if (EObjNameSpaceArchCommon == NamespaceId) {
-    if (ObjId >= EArchCommonObjMax) {
+    if ((ObjId >= EArchCommonObjMax) ||
+        ((CmObjDesc->Count > 1)  && (ObjId != EArchCommonObjCmRef)))
+    {
       ASSERT (0);
       return EFI_INVALID_PARAMETER;
     }
@@ -281,11 +281,11 @@ GroupCmObjNodes (
     }
 
     if ((CmObjDesc->Count != 1) &&
-        ((NamespaceId != EObjNameSpaceArm) ||
-         (ObjIndex != EArmObjCmRef)))
+        ((NamespaceId != EObjNameSpaceArchCommon) ||
+         (ObjIndex != EArchCommonObjCmRef)))
     {
       // We expect each descriptor to contain an individual object.
-      // EArmObjCmRef objects are counted as groups, so +1 as well.
+      // EArchCommonObjCmRef objects are counted as groups, so +1 as well.
       ASSERT (0);
       return EFI_INVALID_PARAMETER;
     }
@@ -452,18 +452,18 @@ DynamicPlatRepoGetObject (
   ObjId       = GET_CM_OBJECT_ID (CmObjectId);
 
   if (NamespaceId == EObjNameSpaceArm) {
-    if ((ObjId >= EArmObjMax) ||
-        ((ObjId == EArmObjCmRef) &&
-         (Token == CM_NULL_TOKEN)))
-    {
-      // EArmObjCmRef object must be requested using a valid token.
+    if (ObjId >= EArmObjMax) {
       ASSERT (0);
       return EFI_INVALID_PARAMETER;
     }
 
     Desc = &This->ArmCmObjArray[ObjId];
   } else if (NamespaceId == EObjNameSpaceArchCommon) {
-    if (ObjId >= EArchCommonObjMax) {
+    if ((ObjId >= EArchCommonObjMax) ||
+        ((ObjId == EArchCommonObjCmRef) &&
+         (Token == CM_NULL_TOKEN)))
+    {
+      // EArchCommonObjCmRef object must be requested using a valid token.
       ASSERT (0);
       return EFI_INVALID_PARAMETER;
     }
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenMapper.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenMapper.c
index 9391e935eee0..2300375f0386 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenMapper.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenMapper.c
@@ -66,11 +66,12 @@ TokenMapperAddObject (
   // Point inside the finalized array.
   CmObjDesc->Data = Data;
 
-  // Only EArmObjCmRef CmObj can be added as arrays (more than 1 elements).
-  if ((GET_CM_NAMESPACE_ID (ObjectId) == EObjNameSpaceArm) &&
-      (GET_CM_OBJECT_ID (ObjectId) == EArmObjCmRef))
+  // Only EArchCommonObjCmRef CmObj can be added as
+  // arrays (more than 1 elements).
+  if ((GET_CM_NAMESPACE_ID (ObjectId) == EObjNameSpaceArchCommon) &&
+      (GET_CM_OBJECT_ID (ObjectId) == EArchCommonObjCmRef))
   {
-    CmObjDesc->Count = Size / sizeof (CM_ARM_OBJ_REF);
+    CmObjDesc->Count = Size / sizeof (CM_ARCH_COMMON_OBJ_REF);
   } else {
     CmObjDesc->Count = 1;
   }
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 3205cf87c8bf..264e01cff29f 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -350,9 +350,9 @@ STATIC CONST CM_OBJ_PARSER  CmArmCacheInfoParser[] = {
   { "CacheId",               4,                        "0x%x", NULL },
 };
 
-/** A parser for EArmObjCmRef.
+/** A parser for EArchCommonObjCmRef.
 */
-STATIC CONST CM_OBJ_PARSER  CmArmObjRefParser[] = {
+STATIC CONST CM_OBJ_PARSER  CmArchCommonObjRefParser[] = {
   { "ReferenceToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
 };
 
@@ -677,6 +677,7 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArchCommonNamespaceObjectParser[] = {
   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_RESERVED (EArchCommonObjMax)
 };
 
@@ -706,7 +707,6 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
   CM_PARSER_ADD_OBJECT (EArmObjSmmuInterruptArray,          CmArmGenericInterruptParser),
   CM_PARSER_ADD_OBJECT (EArmObjProcHierarchyInfo,           CmArmProcHierarchyInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjCacheInfo,                   CmArmCacheInfoParser),
-  CM_PARSER_ADD_OBJECT (EArmObjCmRef,                       CmArmObjRefParser),
   CM_PARSER_ADD_OBJECT (EArmObjMemoryAffinityInfo,          CmArmMemoryAffinityInfoParser),
   CM_PARSER_ADD_OBJECT (EArmObjDeviceHandleAcpi,            CmArmDeviceHandleAcpiParser),
   CM_PARSER_ADD_OBJECT (EArmObjDeviceHandlePci,             CmArmDeviceHandlePciParser),
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.c
index 8be1b5b8cd88..120a98c2a9eb 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.c
@@ -219,11 +219,11 @@ AddMultipleCmObj (
 
 /** Add multiple CmObj to the Configuration Manager.
 
-  Get one token referencing a EArmObjCmRef CmObj itself referencing
+  Get one token referencing a EArchCommonObjCmRef CmObj itself referencing
   the input CmObj. In the table below, RefToken is returned.
 
   Token referencing an      Array of tokens             Array of CmObj
-  array of EArmObjCmRef     referencing each            from the input:
+  array of EArchCommonObjCmRef     referencing each            from the input:
   CmObj:                    CmObj from the input:
 
   RefToken         --->     CmObjToken[0]        --->   CmObj[0]
@@ -234,7 +234,7 @@ AddMultipleCmObj (
   @param  [in]  CmObjDesc         CmObjDesc containing multiple CmObj
                                   to add.
   @param  [out] Token             If success, token referencing an array
-                                  of EArmObjCmRef CmObj, themselves
+                                  of EArchCommonObjCmRef CmObj, themselves
                                   referencing the input CmObjs.
 
   @retval EFI_SUCCESS             The function completed successfully.
@@ -286,12 +286,12 @@ AddMultipleCmObjWithCmObjRef (
     goto exit_handler;
   }
 
-  CmObjRef.ObjectId = CREATE_CM_ARM_OBJECT_ID (EArmObjCmRef);
+  CmObjRef.ObjectId = CREATE_CM_ARCH_COMMON_OBJECT_ID (EArchCommonObjCmRef);
   CmObjRef.Data     = TokenTable;
   CmObjRef.Count    = CmObjDesc->Count;
   CmObjRef.Size     = TokenTableSize;
 
-  // Add the array of EArmObjCmRef CmObjs.
+  // Add the array of EArchCommonObjCmRef CmObjs.
   Status = FdtParserHandle->HwInfoAdd (
                               FdtParserHandle,
                               FdtParserHandle->Context,
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.h
index 270e0c3528f9..14e135335f9e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/CmObjectDescUtility.h
@@ -98,11 +98,11 @@ AddMultipleCmObj (
 
 /** Add multiple CmObj to the Configuration Manager.
 
-  Get one token referencing a EArmObjCmRef CmObj itself referencing
+  Get one token referencing a EArchCommonObjCmRef CmObj itself referencing
   the input CmObj. In the table below, RefToken is returned.
 
   Token referencing an      Array of tokens             Array of CmObj
-  array of EArmObjCmRef     referencing each            from the input:
+  array of EArchCommonObjCmRef     referencing each            from the input:
   CmObj:                    CmObj from the input:
 
   RefToken         --->     CmObjToken[0]        --->   CmObj[0]
@@ -113,7 +113,7 @@ AddMultipleCmObj (
   @param  [in]  CmObjDesc         CmObjDesc containing multiple CmObj
                                   to add.
   @param  [out] Token             If success, token referencing an array
-                                  of EArmObjCmRef CmObj, themselves
+                                  of EArchCommonObjCmRef CmObj, themselves
                                   referencing the input CmObjs.
 
   @retval EFI_SUCCESS             The function completed successfully.
diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 5b9dda3e63d9..9110c754690d 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -463,26 +463,25 @@ The CM_OBJECT_ID type is used to identify the Configuration Manager
 |  20   | SMMU Interrupt Array                      | |
 |  21   | Processor Hierarchy Info                  | Move to Arch Common NS |
 |  22   | Cache Info                                | Move to Arch Common NS |
-|  23   | CM Object Reference                       | Move to Arch Common NS |
-|  24   | Memory Affinity Info                      | Move to Arch Common NS |
-|  25   | Device Handle Acpi                        | Move to Arch Common NS |
-|  26   | Device Handle PCI                         | Move to Arch Common NS |
-|  27   | Generic Initiator Affinity Info           | Move to Arch Common NS |
-|  28   | CMN 600 Info                              | |
-|  29   | Low Power Idle State Info                 | Move to Arch Common NS |
-|  30   | PCI Address Map Info                      | Move to Arch Common NS |
-|  31   | PCI Interrupt Map Info                    | Move to Arch Common NS |
-|  32   | Reserved Memory Range Node                | |
-|  33   | Memory Range Descriptor                   | |
-|  34   | Continuous Performance Control Info       | Move to Arch Common NS |
-|  35   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
-|  36   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
-|  37   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
-|  38   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
-|  39   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
-|  40   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
-|  41   | Embedded Trace Extension/Module Info      | |
-|  42   | P-State Dependency (PSD) Info             | Move to Arch Common NS |
+|  23   | Memory Affinity Info                      | Move to Arch Common NS |
+|  24   | Device Handle Acpi                        | Move to Arch Common NS |
+|  25   | Device Handle PCI                         | Move to Arch Common NS |
+|  26   | Generic Initiator Affinity Info           | Move to Arch Common NS |
+|  27   | CMN 600 Info                              | |
+|  28   | Low Power Idle State Info                 | Move to Arch Common NS |
+|  29   | PCI Address Map Info                      | Move to Arch Common NS |
+|  30   | PCI Interrupt Map Info                    | Move to Arch Common NS |
+|  31   | Reserved Memory Range Node                | |
+|  32   | Memory Range Descriptor                   | |
+|  33   | Continuous Performance Control Info       | Move to Arch Common NS |
+|  34   | Pcc Subspace Type 0 Info                  | Move to Arch Common NS |
+|  35   | Pcc Subspace Type 1 Info                  | Move to Arch Common NS |
+|  36   | Pcc Subspace Type 2 Info                  | Move to Arch Common NS |
+|  37   | Pcc Subspace Type 3 Info                  | Move to Arch Common NS |
+|  38   | Pcc Subspace Type 4 Info                  | Move to Arch Common NS |
+|  39   | Pcc Subspace Type 5 Info                  | Move to Arch Common NS |
+|  40   | Embedded Trace Extension/Module Info      | |
+|  41   | 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
 |   4   | Serial Debug Port Info            | |
 |   5   | Hypervisor Vendor Id              | |
 |   6   | Fixed feature flags for FADT      | |
+|   7   | CM Object Reference               | |
 |  `*`  | All other values are reserved.    | |
-- 
2.25.1



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



  parent reply	other threads:[~2024-03-21 15:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 15:53 [edk2-devel] [PATCH 00/16] DynamicTablesPkg: Move objects to Arch Common NameSpace (first) PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 01/16] DynamicTablesPkg/SsdtCpuTopology: Update function's parameter description PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 02/16] DynamicTablesPkg: Replace ProcNodeIdInfo with EArmObjReserved29 PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 03/16] DynamicTablesPkg: Introduce ObjectId to validate CmObject Parser Array PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 04/16] DynamicTablesPkg: Introduce an Arch Common Namespace header file PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 05/16] DynamicTablesPkg: Add support for ArchCommon objects in CmObjParser PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 06/16] DynamicTablesPkg: TokenFixer: Return Non Arm NS objs as unsupported PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 07/16] DynamicTablesPkg: Update DynamicPlatRepo for Arch Common namespace PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 08/16] DynamicTablesPkg: Update documentation for CM_OBJECT_ID PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 09/16] DynamicTablesPkg: Drop Cpu Info object ID from Arm Namespace PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 10/16] DynamicTablesPkg: Drop Reserved29 " PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 11/16] ArmVirtPkg: Kvmtool: Update ConfigMgr to support ArchCommon PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 12/16] DynamicTablesPkg & ArmVirtPkg: Move Power Mgmt Profile Info Object PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 13/16] DynamicTablesPkg: Move Hypervisor Vendor Id to Arch Common PierreGondois
2024-03-21 15:53 ` [edk2-devel] [PATCH 14/16] DynamicTablesPkg: Move FADT Fixed Features Flags " PierreGondois
2024-03-21 15:53 ` PierreGondois [this message]
2024-03-21 15:53 ` [edk2-devel] [PATCH 16/16] DynamicTablesPkg & ArmVirtPkg: Move Pci Config Space Info PierreGondois
2024-04-04 10:02 ` [edk2-devel] [PATCH 00/16] DynamicTablesPkg: Move objects to Arch Common NameSpace (first) Sunil V L
2024-06-07 14:19   ` Sami Mujawar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321155319.701355-16-pierre.gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox