@@ -92,11 +92,23 @@ GicItsIntcNodeParser (
9292 This parser expects FdtBranch to be a Gic interrupt-controller node.
9393 Gic version must be v3 or higher.
9494 typedef struct CmArmGicItsInfo {
95- UINT32 GicItsId; // {Populated}
96- UINT64 PhysicalBaseAddress; // {Populated}
97- UINT32 ProximityDomain; // {default = 0}
95+ UINT32 GicItsId; // {Populated}
96+ UINT64 PhysicalBaseAddress; // {Populated}
97+ UINT32 ProximityDomain; // {default = 0}
98+ CM_OBJECT_TOKEN ProximityDomainToken; // {default = CM_NULL_TOKEN}
9899 } CM_ARM_GIC_ITS_INFO;
99100
101+ typedef struct CmArmItsGroupNode {
102+ CM_OBJECT_TOKEN Token; // {default = CM_NULL_TOKEN}
103+ UINT32 ItsIdCount; // {Populated}
104+ CM_OBJECT_TOKEN ItsIdToken; // {Populated}
105+ UINT32 Identifier; // {default = 0}
106+ } CM_ARM_ITS_GROUP_NODE;
107+
108+ typedef struct CmArmGicItsIdentifier {
109+ UINT32 ItsId; // {Populated}
110+ } CM_ARM_ITS_IDENTIFIER;
111+
100112 A parser parses a Device Tree to populate a specific CmObj type. None,
101113 one or many CmObj can be created by the parser.
102114 The created CmObj are then handed to the parser's caller through the
@@ -129,6 +141,10 @@ ArmGicItsInfoParser (
129141 UINT32 GicItsNodeCount ;
130142 VOID * Fdt ;
131143
144+ CM_ARM_ITS_GROUP_NODE ItsGroupNodeInfo ;
145+ CM_ARM_ITS_IDENTIFIER ItsIdentifier ;
146+ CM_OBJECT_TOKEN Token ;
147+
132148 if (FdtParserHandle == NULL ) {
133149 ASSERT (0 );
134150 return EFI_INVALID_PARAMETER ;
@@ -174,6 +190,8 @@ ArmGicItsInfoParser (
174190 GicItsNode = FdtBranch ;
175191 for (Index = 0 ; Index < GicItsNodeCount ; Index ++ ) {
176192 ZeroMem (& GicItsInfo , sizeof (CM_ARM_GIC_ITS_INFO ));
193+ ZeroMem (& ItsGroupNodeInfo , sizeof (CM_ARM_ITS_GROUP_NODE ));
194+ ZeroMem (& ItsIdentifier , sizeof (CM_ARM_ITS_IDENTIFIER ));
177195
178196 Status = FdtGetNextPropNodeInBranch (
179197 Fdt ,
@@ -214,6 +232,38 @@ ArmGicItsInfoParser (
214232 ASSERT (0 );
215233 return Status ;
216234 }
235+
236+ ItsIdentifier .ItsId = Index ;
237+
238+ // Add the CmObj to the Configuration Manager.
239+ Status = AddSingleCmObj (
240+ FdtParserHandle ,
241+ CREATE_CM_ARM_OBJECT_ID (EArmObjGicItsIdentifierArray ),
242+ & ItsIdentifier ,
243+ sizeof (CM_ARM_ITS_IDENTIFIER ),
244+ & Token
245+ );
246+ if (EFI_ERROR (Status )) {
247+ ASSERT (0 );
248+ return Status ;
249+ }
250+
251+ ItsGroupNodeInfo .ItsIdCount = 1 ;
252+ ItsGroupNodeInfo .ItsIdToken = Token ;
253+
254+ // Add the CmObj to the Configuration Manager.
255+ // Abstract token allows the IORT parser to link to this object
256+ Status = AddSingleCmObjWithToken (
257+ FdtParserHandle ,
258+ CREATE_CM_ARM_OBJECT_ID (EArmObjItsGroup ),
259+ & ItsGroupNodeInfo ,
260+ sizeof (CM_ARM_ITS_GROUP_NODE ),
261+ CM_ABSTRACT_TOKEN_MAKE (ETokenNameSpaceFdtHwInfo , EFdtHwInfoIortObject , FdtGetPhandle (Fdt , GicItsNode ))
262+ );
263+ if (EFI_ERROR (Status )) {
264+ ASSERT (0 );
265+ return Status ;
266+ }
217267 } // for
218268
219269 return Status ;
0 commit comments