From: Sami Mujawar <sami.muja...@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.gond...@arm.com>
Cc: Yeo Reum Yun <yeoreum....@arm.com>
Cc: AbdulLateef Attar <abdullateef.at...@amd.com>
Cc: Jeshua Smith <jesh...@nvidia.com>
Cc: Jeff Brasen <jbra...@nvidia.com>
Cc: Girish Mahadevan <gmahade...@nvidia.com>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Cc: Meenakshi Aggarwal <meenakshi.aggar...@nxp.com>
Signed-off-by: Sami Mujawar <sami.muja...@arm.com>
Signed-off-by: Pierre Gondois <pierre.gond...@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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to