Skip to content

Commit ba69c6d

Browse files
sarah-walker-armmergify[bot]
authored andcommitted
DynamicTablesPkg: FdtHwInfoParserLib: Generate GIC ITS group objects
Add generation of GIC ITS identifier array and group CmObjs. Signed-off-by: Sarah Walker <[email protected]>
1 parent b0aac86 commit ba69c6d

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

DynamicTablesPkg/Include/StandardNameSpaceObjects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,18 @@ typedef UINTN CM_OBJECT_TOKEN;
5454
typedef enum AbstractTokenID {
5555
ETokenNameSpaceUnknown = 0,
5656
ETokenNameSpaceSmbios,
57+
ETokenNameSpaceFdtHwInfo,
5758

5859
ETokenNameSpaceMax
5960
} EABSTRACT_TOKEN_ID;
6061

62+
/** The EFDT_HW_INFO_OBJECT_ID enum describes the defined object
63+
types for the ETokenNameSpaceFdtHwInfo namespace.
64+
*/
65+
typedef enum FdtHwInfoObjectID {
66+
EFdtHwInfoIortObject = 0
67+
} EFDT_HW_INFO_OBJECT_ID;
68+
6169
/** Abstract token generated by table generators
6270
6371
Description of abstract token format

DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.c

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

DynamicTablesPkg/Library/FdtHwInfoParserLib/Arm/Gic/ArmGicItsParser.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@
1616
This parser expects FdtBranch to be a Gic interrupt-controller node.
1717
Gic version must be v3 or higher.
1818
typedef struct CmArmGicItsInfo {
19-
UINT32 GicItsId; // {Populated}
20-
UINT64 PhysicalBaseAddress; // {Populated}
21-
UINT32 ProximityDomain; // {default = 0}
19+
UINT32 GicItsId; // {Populated}
20+
UINT64 PhysicalBaseAddress; // {Populated}
21+
UINT32 ProximityDomain; // {default = 0}
22+
CM_OBJECT_TOKEN ProximityDomainToken; // {default = CM_NULL_TOKEN}
2223
} CM_ARM_GIC_ITS_INFO;
2324
25+
typedef struct CmArmItsGroupNode {
26+
CM_OBJECT_TOKEN Token; // {default = CM_NULL_TOKEN}
27+
UINT32 ItsIdCount; // {Populated}
28+
CM_OBJECT_TOKEN ItsIdToken; // {Populated}
29+
UINT32 Identifier; // {default = 0}
30+
} CM_ARM_ITS_GROUP_NODE;
31+
32+
typedef struct CmArmGicItsIdentifier {
33+
UINT32 ItsId; // {Populated}
34+
} CM_ARM_ITS_IDENTIFIER;
35+
2436
A parser parses a Device Tree to populate a specific CmObj type. None,
2537
one or many CmObj can be created by the parser.
2638
The created CmObj are then handed to the parser's caller through the

0 commit comments

Comments
 (0)