2 Configuration Manager Object parser.
4 Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/BaseLib.h>
10 #include <Library/DebugLib.h>
11 #include <ConfigurationManagerObject.h>
12 #include "ConfigurationManagerObjectParser.h"
30 /** A parser for EArmObjBootArchInfo.
32 STATIC CONST CM_OBJ_PARSER CmArmBootArchInfoParser
[] = {
33 { "BootArchFlags", 2, "0x%x", NULL
}
36 /** A parser for EArmObjPowerManagementProfileInfo.
38 STATIC CONST CM_OBJ_PARSER CmArmPowerManagementProfileInfoParser
[] = {
39 { "PowerManagementProfile", 1, "0x%x", NULL
}
42 /** A parser for EArmObjGicCInfo.
44 STATIC CONST CM_OBJ_PARSER CmArmGicCInfoParser
[] = {
45 { "CPUInterfaceNumber", 4, "0x%x", NULL
},
46 { "AcpiProcessorUid", 4, "0x%x", NULL
},
47 { "Flags", 4, "0x%x", NULL
},
48 { "ParkingProtocolVersion", 4, "0x%x", NULL
},
49 { "PerformanceInterruptGsiv", 4, "0x%x", NULL
},
50 { "ParkedAddress", 8, "0x%llx", NULL
},
51 { "PhysicalBaseAddress", 8, "0x%llx", NULL
},
52 { "GICV", 8, "0x%llx", NULL
},
53 { "GICH", 8, "0x%llx", NULL
},
54 { "VGICMaintenanceInterrupt", 4, "0x%x", NULL
},
55 { "GICRBaseAddress", 8, "0x%llx", NULL
},
56 { "MPIDR", 8, "0x%llx", NULL
},
57 { "ProcessorPowerEfficiencyClass", 1, "0x%x", NULL
},
58 { "SpeOverflowInterrupt", 2, "0x%x", NULL
},
59 { "ProximityDomain", 4, "0x%x", NULL
},
60 { "ClockDomain", 4, "0x%x", NULL
},
61 { "AffinityFlags", 4, "0x%x", NULL
},
62 { "CpcToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
}
65 /** A parser for EArmObjGicDInfo.
67 STATIC CONST CM_OBJ_PARSER CmArmGicDInfoParser
[] = {
68 { "PhysicalBaseAddress", 8, "0x%llx", NULL
},
69 { "SystemVectorBase", 4, "0x%x", NULL
},
70 { "GicVersion", 1, "0x%x", NULL
},
73 /** A parser for EArmObjGicMsiFrameInfo.
75 STATIC CONST CM_OBJ_PARSER CmArmGicMsiFrameInfoParser
[] = {
76 { "GicMsiFrameId", 4, "0x%x", NULL
},
77 { "PhysicalBaseAddress", 8, "0x%llx", NULL
},
78 { "Flags", 4, "0x%x", NULL
},
79 { "SPICount", 2, "0x%x", NULL
},
80 { "SPIBase", 2, "0x%x", NULL
}
83 /** A parser for EArmObjGicRedistributorInfo.
85 STATIC CONST CM_OBJ_PARSER CmArmGicRedistInfoParser
[] = {
86 { "DiscoveryRangeBaseAddress", 8, "0x%llx", NULL
},
87 { "DiscoveryRangeLength", 4, "0x%x", NULL
}
90 /** A parser for EArmObjGicItsInfo.
92 STATIC CONST CM_OBJ_PARSER CmArmGicItsInfoParser
[] = {
93 { "GicItsId", 4, "0x%x", NULL
},
94 { "PhysicalBaseAddress", 8, "0x%llx", NULL
},
95 { "ProximityDomain", 4, "0x%x", NULL
}
98 /** A parser for EArmObjSerialConsolePortInfo,
99 EArmObjSerialDebugPortInfo and EArmObjSerialPortInfo.
101 STATIC CONST CM_OBJ_PARSER CmArmSerialPortInfoParser
[] = {
102 { "BaseAddress", 8, "0x%llx", NULL
},
103 { "Interrupt", 4, "0x%x", NULL
},
104 { "BaudRate", 8, "0x%llx", NULL
},
105 { "Clock", 4, "0x%x", NULL
},
106 { "PortSubtype", 2, "0x%x", NULL
},
107 { "BaseAddressLength", 8, "0x%llx", NULL
},
108 { "AccessSize", 1, "0x%d", NULL
}
111 /** A parser for EArmObjGenericTimerInfo.
113 STATIC CONST CM_OBJ_PARSER CmArmGenericTimerInfoParser
[] = {
114 { "CounterControlBaseAddress", 8, "0x%llx", NULL
},
115 { "CounterReadBaseAddress", 8, "0x%llx", NULL
},
116 { "SecurePL1TimerGSIV", 4, "0x%x", NULL
},
117 { "SecurePL1TimerFlags", 4, "0x%x", NULL
},
118 { "NonSecurePL1TimerGSIV", 4, "0x%x", NULL
},
119 { "NonSecurePL1TimerFlags", 4, "0x%x", NULL
},
120 { "VirtualTimerGSIV", 4, "0x%x", NULL
},
121 { "VirtualTimerFlags", 4, "0x%x", NULL
},
122 { "NonSecurePL2TimerGSIV", 4, "0x%x", NULL
},
123 { "NonSecurePL2TimerFlags", 4, "0x%x", NULL
},
124 { "VirtualPL2TimerGSIV", 4, "0x%x", NULL
},
125 { "VirtualPL2TimerFlags", 4, "0x%x", NULL
}
128 /** A parser for EArmObjPlatformGTBlockInfo.
130 STATIC CONST CM_OBJ_PARSER CmArmGTBlockInfoParser
[] = {
131 { "GTBlockPhysicalAddress", 8, "0x%llx", NULL
},
132 { "GTBlockTimerFrameCount", 4, "0x%x", NULL
},
133 { "GTBlockTimerFrameToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
}
136 /** A parser for EArmObjGTBlockTimerFrameInfo.
138 STATIC CONST CM_OBJ_PARSER CmArmGTBlockTimerFrameInfoParser
[] = {
139 { "FrameNumber", 1, "0x%x", NULL
},
140 { "PhysicalAddressCntBase", 8, "0x%llx", NULL
},
141 { "PhysicalAddressCntEL0Base", 8, "0x%llx", NULL
},
142 { "PhysicalTimerGSIV", 4, "0x%x", NULL
},
143 { "PhysicalTimerFlags", 4, "0x%x", NULL
},
144 { "VirtualTimerGSIV", 4, "0x%x", NULL
},
145 { "VirtualTimerFlags", 4, "0x%x", NULL
},
146 { "CommonFlags", 4, "0x%x", NULL
}
149 /** A parser for EArmObjPlatformGenericWatchdogInfo.
151 STATIC CONST CM_OBJ_PARSER CmArmGenericWatchdogInfoParser
[] = {
152 { "ControlFrameAddress", 8, "0x%llx", NULL
},
153 { "RefreshFrameAddress", 8, "0x%llx", NULL
},
154 { "TimerGSIV", 4, "0x%x", NULL
},
155 { "Flags", 4, "0x%x", NULL
}
158 /** A parser for EArmObjPciConfigSpaceInfo.
160 STATIC CONST CM_OBJ_PARSER CmArmPciConfigSpaceInfoParser
[] = {
161 { "BaseAddress", 8, "0x%llx", NULL
},
162 { "PciSegmentGroupNumber", 2, "0x%x", NULL
},
163 { "StartBusNumber", 1, "0x%x", NULL
},
164 { "EndBusNumber", 1, "0x%x", NULL
},
165 { "AddressMapToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
166 { "InterruptMapToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
169 /** A parser for EArmObjHypervisorVendorIdentity.
171 STATIC CONST CM_OBJ_PARSER CmArmHypervisorVendorIdParser
[] = {
172 { "HypervisorVendorId", 8, "0x%llx", NULL
}
175 /** A parser for EArmObjFixedFeatureFlags.
177 STATIC CONST CM_OBJ_PARSER CmArmFixedFeatureFlagsParser
[] = {
178 { "Flags", 4, "0x%x", NULL
}
181 /** A parser for EArmObjItsGroup.
183 STATIC CONST CM_OBJ_PARSER CmArmItsGroupNodeParser
[] = {
184 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
185 { "ItsIdCount", 4, "0x%x", NULL
},
186 { "ItsIdToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
187 { "Identifier", 4, "0x%x", NULL
},
190 /** A parser for EArmObjNamedComponent.
192 STATIC CONST CM_OBJ_PARSER CmArmNamedComponentNodeParser
[] = {
193 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
194 { "IdMappingCount", 4, "0x%x", NULL
},
195 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
196 { "Flags", 4, "0x%x", NULL
},
197 { "CacheCoherent", 4, "0x%x", NULL
},
198 { "AllocationHints", 1, "0x%x", NULL
},
199 { "MemoryAccessFlags", 1, "0x%x", NULL
},
200 { "AddressSizeLimit", 1, "0x%x", NULL
},
201 { "ObjectName", sizeof (CHAR8
*), NULL
, PrintString
},
202 { "Identifier", 4, "0x%x", NULL
},
205 /** A parser for EArmObjRootComplex.
207 STATIC CONST CM_OBJ_PARSER CmArmRootComplexNodeParser
[] = {
208 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
209 { "IdMappingCount", 4, "0x%x", NULL
},
210 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
211 { "CacheCoherent", 4, "0x%x", NULL
},
212 { "AllocationHints", 1, "0x%x", NULL
},
213 { "MemoryAccessFlags", 1, "0x%x", NULL
},
214 { "AtsAttribute", 4, "0x%x", NULL
},
215 { "PciSegmentNumber", 4, "0x%x", NULL
},
216 { "MemoryAddressSize", 1, "0x%x", NULL
},
217 { "PasidCapabilities", 2, "0x%x", NULL
},
218 { "Flags", 4, "0x%x", NULL
},
219 { "Identifier", 4, "0x%x", NULL
},
222 /** A parser for EArmObjSmmuV1SmmuV2.
224 STATIC CONST CM_OBJ_PARSER CmArmSmmuV1SmmuV2NodeParser
[] = {
225 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
226 { "IdMappingCount", 4, "0x%x", NULL
},
227 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
228 { "BaseAddress", 8, "0x%llx", NULL
},
229 { "Span", 8, "0x%llx", NULL
},
230 { "Model", 4, "0x%x", NULL
},
231 { "Flags", 4, "0x%x", NULL
},
232 { "ContextInterruptCount", 4, "0x%x", NULL
},
233 { "ContextInterruptToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
234 { "PmuInterruptCount", 4, "0x%x", NULL
},
235 { "PmuInterruptToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
236 { "SMMU_NSgIrpt", 4, "0x%x", NULL
},
237 { "SMMU_NSgIrptFlags", 4, "0x%x", NULL
},
238 { "SMMU_NSgCfgIrpt", 4, "0x%x", NULL
},
239 { "SMMU_NSgCfgIrptFlags", 4, "0x%x", NULL
},
240 { "Identifier", 4, "0x%x", NULL
},
243 /** A parser for EArmObjSmmuV3.
245 STATIC CONST CM_OBJ_PARSER CmArmSmmuV3NodeParser
[] = {
246 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
247 { "IdMappingCount", 4, "0x%x", NULL
},
248 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
249 { "BaseAddress", 8, "0x%llx", NULL
},
250 { "Flags", 4, "0x%x", NULL
},
251 { "VatosAddress", 8, "0x%llx", NULL
},
252 { "Model", 4, "0x%x", NULL
},
253 { "EventInterrupt", 4, "0x%x", NULL
},
254 { "PriInterrupt", 4, "0x%x", NULL
},
255 { "GerrInterrupt", 4, "0x%x", NULL
},
256 { "SyncInterrupt", 4, "0x%x", NULL
},
257 { "ProximityDomain", 4, "0x%x", NULL
},
258 { "DeviceIdMappingIndex", 4, "0x%x", NULL
},
259 { "Identifier", 4, "0x%x", NULL
},
262 /** A parser for EArmObjPmcg.
264 STATIC CONST CM_OBJ_PARSER CmArmPmcgNodeParser
[] = {
265 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
266 { "IdMappingCount", 4, "0x%x", NULL
},
267 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
268 { "BaseAddress", 8, "0x%llx", NULL
},
269 { "OverflowInterrupt", 4, "0x%x", NULL
},
270 { "Page1BaseAddress", 8, "0x%llx", NULL
},
271 { "ReferenceToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
272 { "Identifier", 4, "0x%x", NULL
},
275 /** A parser for EArmObjGicItsIdentifierArray.
277 STATIC CONST CM_OBJ_PARSER CmArmGicItsIdentifierParser
[] = {
278 { "ItsId", 4, "0x%x", NULL
}
281 /** A parser for EArmObjIdMappingArray.
283 STATIC CONST CM_OBJ_PARSER CmArmIdMappingParser
[] = {
284 { "InputBase", 4, "0x%x", NULL
},
285 { "NumIds", 4, "0x%x", NULL
},
286 { "OutputBase", 4, "0x%x", NULL
},
287 { "OutputReferenceToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
288 { "Flags", 4, "0x%x", NULL
}
291 /** A parser for EArmObjSmmuInterruptArray.
293 STATIC CONST CM_OBJ_PARSER CmArmGenericInterruptParser
[] = {
294 { "Interrupt", 4, "0x%x", NULL
},
295 { "Flags", 4, "0x%x", NULL
}
298 /** A parser for EArmObjProcHierarchyInfo.
300 STATIC CONST CM_OBJ_PARSER CmArmProcHierarchyInfoParser
[] = {
301 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
302 { "Flags", 4, "0x%x", NULL
},
303 { "ParentToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
304 { "GicCToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
305 { "NoOfPrivateResources", 4, "0x%x", NULL
},
306 { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
307 { "LpiToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
310 /** A parser for EArmObjCacheInfo.
312 STATIC CONST CM_OBJ_PARSER CmArmCacheInfoParser
[] = {
313 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
314 { "NextLevelOfCacheToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
315 { "Size", 4, "0x%x", NULL
},
316 { "NumberOfSets", 4, "0x%x", NULL
},
317 { "Associativity", 4, "0x%x", NULL
},
318 { "Attributes", 1, "0x%x", NULL
},
319 { "LineSize", 2, "0x%x", NULL
},
320 { "CacheId", 4, "0x%x", NULL
},
323 /** A parser for EArmObjProcNodeIdInfo.
325 STATIC CONST CM_OBJ_PARSER CmArmProcNodeIdInfoParser
[] = {
326 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
327 { "VendorId", 4, "0x%p", NULL
},
328 { "Level1Id", 8, "0x%x", NULL
},
329 { "Level2Id", 8, "0x%x", NULL
},
330 { "MajorRev", 2, "0x%x", NULL
},
331 { "MinorRev", 2, "0x%x", NULL
},
332 { "SpinRev", 2, "0x%x", NULL
}
335 /** A parser for EArmObjCmRef.
337 STATIC CONST CM_OBJ_PARSER CmArmObjRefParser
[] = {
338 { "ReferenceToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
}
341 /** A parser for EArmObjMemoryAffinityInfo.
343 STATIC CONST CM_OBJ_PARSER CmArmMemoryAffinityInfoParser
[] = {
344 { "ProximityDomain", 4, "0x%x", NULL
},
345 { "BaseAddress", 8, "0x%llx", NULL
},
346 { "Length", 8, "0x%llx", NULL
},
347 { "Flags", 4, "0x%x", NULL
}
350 /** A parser for EArmObjDeviceHandleAcpi.
352 STATIC CONST CM_OBJ_PARSER CmArmDeviceHandleAcpiParser
[] = {
353 { "Hid", 8, "0x%llx", NULL
},
354 { "Uid", 4, "0x%x", NULL
}
357 /** A parser for EArmObjDeviceHandlePci.
359 STATIC CONST CM_OBJ_PARSER CmArmDeviceHandlePciParser
[] = {
360 { "SegmentNumber", 2, "0x%x", NULL
},
361 { "BusNumber", 1, "0x%x", NULL
},
362 { "DeviceNumber", 1, "0x%x", NULL
},
363 { "FunctionNumber", 1, "0x%x", NULL
}
366 /** A parser for EArmObjGenericInitiatorAffinityInfo.
368 STATIC CONST CM_OBJ_PARSER CmArmGenericInitiatorAffinityInfoParser
[] = {
369 { "ProximityDomain", 4, "0x%x", NULL
},
370 { "Flags", 4, "0x%x", NULL
},
371 { "DeviceHandleType", 1, "0x%x", NULL
},
372 { "DeviceHandleToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
}
375 /** A parser for EArmObjCmn600Info.
377 STATIC CONST CM_OBJ_PARSER CmArmCmn600InfoParser
[] = {
378 { "PeriphBaseAddress", 8, "0x%llx", NULL
},
379 { "PeriphBaseAddressLength", 8, "0x%llx", NULL
},
380 { "RootNodeBaseAddress", 8, "0x%llx", NULL
},
381 { "DtcCount", 1, "0x%x", NULL
},
382 { "DtcInterrupt[0]", 4, "0x%x", NULL
},
383 { "DtcFlags[0]", 4, "0x%x", NULL
},
384 { "DtcInterrupt[1]", 4, "0x%x", NULL
},
385 { "DtcFlags[1]", 4, "0x%x", NULL
},
386 { "DtcInterrupt[2]", 4, "0x%x", NULL
},
387 { "DtcFlags[2]", 4, "0x%x", NULL
},
388 { "DtcInterrupt[3]", 4, "0x%x", NULL
},
389 { "DtcFlags[3]", 4, "0x%x", NULL
}
392 /** A parser for the EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE structure.
394 STATIC CONST CM_OBJ_PARSER AcpiGenericAddressParser
[] = {
395 { "AddressSpaceId", 1, "%d", NULL
},
396 { "RegisterBitWidth", 1, "%d", NULL
},
397 { "RegisterBitOffset", 1, "%d", NULL
},
398 { "AccessSize", 1, "%d", NULL
},
399 { "Address", 8, "0x%llx", NULL
},
402 /** A parser for EArmObjLpiInfo.
404 STATIC CONST CM_OBJ_PARSER CmArmLpiInfoParser
[] = {
405 { "MinResidency", 4, "0x%x", NULL
},
406 { "WorstCaseWakeLatency", 4, "0x%x", NULL
},
407 { "Flags", 4, "0x%x", NULL
},
408 { "ArchFlags", 4, "0x%x", NULL
},
409 { "ResCntFreq", 4, "0x%x", NULL
},
410 { "EnableParentState", 4, "0x%x", NULL
},
411 { "IsInteger", 1, "%d", NULL
},
412 { "IntegerEntryMethod", 8, "0x%llx", NULL
},
413 { "RegisterEntryMethod", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE
),
414 NULL
, NULL
, AcpiGenericAddressParser
,
415 ARRAY_SIZE (AcpiGenericAddressParser
) },
416 { "ResidencyCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE
),
417 NULL
, NULL
, AcpiGenericAddressParser
,
418 ARRAY_SIZE (AcpiGenericAddressParser
) },
419 { "UsageCounterRegister", sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE
),
420 NULL
, NULL
, AcpiGenericAddressParser
,
421 ARRAY_SIZE (AcpiGenericAddressParser
) },
422 { "StateName", 16, NULL
, PrintString
},
425 /** A parser for EArmObjPciAddressMapInfo.
427 STATIC CONST CM_OBJ_PARSER CmArmPciAddressMapInfoParser
[] = {
428 { "SpaceCode", 1, "%d", NULL
},
429 { "PciAddress", 8, "0x%llx", NULL
},
430 { "CpuAddress", 8, "0x%llx", NULL
},
431 { "AddressSize", 8, "0x%llx", NULL
},
434 /** A parser for EArmObjPciInterruptMapInfo.
436 STATIC CONST CM_OBJ_PARSER CmPciInterruptMapInfoParser
[] = {
437 { "PciBus", 1, "0x%x", NULL
},
438 { "PciDevice", 1, "0x%x", NULL
},
439 { "PciInterrupt", 1, "0x%x", NULL
},
440 { "IntcInterrupt", sizeof (CM_ARM_GENERIC_INTERRUPT
),
441 NULL
, NULL
, CmArmGenericInterruptParser
,
442 ARRAY_SIZE (CmArmGenericInterruptParser
) },
445 /** A parser for EArmObjRmr.
447 STATIC CONST CM_OBJ_PARSER CmArmRmrInfoParser
[] = {
448 { "Token", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
449 { "IdMappingCount", 4, "0x%x", NULL
},
450 { "IdMappingToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
451 { "Identifier", 4, "0x%x", NULL
},
452 { "Flags", 4, "0x%x", NULL
},
453 { "MemRangeDescCount", 4, "0x%x", NULL
},
454 { "MemRangeDescToken", sizeof (CM_OBJECT_TOKEN
), "0x%p", NULL
},
457 /** A parser for EArmObjMemoryRangeDescriptor.
459 STATIC CONST CM_OBJ_PARSER CmArmMemoryRangeDescriptorInfoParser
[] = {
460 { "BaseAddress", 8, "0x%llx", NULL
},
461 { "Length", 8, "0x%llx", NULL
},
464 /** A parser for EArmObjCpcInfo.
466 STATIC CONST CM_OBJ_PARSER CmArmCpcInfoParser
[] = {
467 { "Revision", 4, "0x%lx", NULL
},
468 { "HighestPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
469 NULL
, NULL
, AcpiGenericAddressParser
,
470 ARRAY_SIZE (AcpiGenericAddressParser
) },
471 { "HighestPerformanceInteger", 4, "0x%lx", NULL
},
472 { "NominalPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
473 NULL
, NULL
, AcpiGenericAddressParser
,
474 ARRAY_SIZE (AcpiGenericAddressParser
) },
475 { "NominalPerformanceInteger", 4, "0x%lx", NULL
},
476 { "LowestNonlinearPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
477 NULL
, NULL
, AcpiGenericAddressParser
,
478 ARRAY_SIZE (AcpiGenericAddressParser
) },
479 { "LowestNonlinearPerformanceInteger", 4, "0x%lx", NULL
},
480 { "LowestPerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
481 NULL
, NULL
, AcpiGenericAddressParser
,
482 ARRAY_SIZE (AcpiGenericAddressParser
) },
483 { "LowestPerformanceInteger", 4, "0x%lx", NULL
},
484 { "GuaranteedPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
485 NULL
, NULL
, AcpiGenericAddressParser
,
486 ARRAY_SIZE (AcpiGenericAddressParser
) },
487 { "DesiredPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
488 NULL
, NULL
, AcpiGenericAddressParser
,
489 ARRAY_SIZE (AcpiGenericAddressParser
) },
490 { "MinimumPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
491 NULL
, NULL
, AcpiGenericAddressParser
,
492 ARRAY_SIZE (AcpiGenericAddressParser
) },
493 { "MaximumPerformanceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
494 NULL
, NULL
, AcpiGenericAddressParser
,
495 ARRAY_SIZE (AcpiGenericAddressParser
) },
496 { "PerformanceReductionToleranceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
497 NULL
, NULL
, AcpiGenericAddressParser
,
498 ARRAY_SIZE (AcpiGenericAddressParser
) },
499 { "TimeWindowRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
500 NULL
, NULL
, AcpiGenericAddressParser
,
501 ARRAY_SIZE (AcpiGenericAddressParser
) },
502 { "CounterWraparoundTimeBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
503 NULL
, NULL
, AcpiGenericAddressParser
,
504 ARRAY_SIZE (AcpiGenericAddressParser
) },
505 { "CounterWraparoundTimeInteger", 4, "0x%lx", NULL
},
506 { "ReferencePerformanceCounterRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
507 NULL
, NULL
, AcpiGenericAddressParser
,
508 ARRAY_SIZE (AcpiGenericAddressParser
) },
509 { "DeliveredPerformanceCounterRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
510 NULL
, NULL
, AcpiGenericAddressParser
,
511 ARRAY_SIZE (AcpiGenericAddressParser
) },
512 { "PerformanceLimitedRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
513 NULL
, NULL
, AcpiGenericAddressParser
,
514 ARRAY_SIZE (AcpiGenericAddressParser
) },
515 { "CPPCEnableRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
516 NULL
, NULL
, AcpiGenericAddressParser
,
517 ARRAY_SIZE (AcpiGenericAddressParser
) },
518 { "AutonomousSelectionEnableBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
519 NULL
, NULL
, AcpiGenericAddressParser
,
520 ARRAY_SIZE (AcpiGenericAddressParser
) },
521 { "AutonomousSelectionEnableInteger", 4, "0x%lx", NULL
},
522 { "AutonomousActivityWindowRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
523 NULL
, NULL
, AcpiGenericAddressParser
,
524 ARRAY_SIZE (AcpiGenericAddressParser
) },
525 { "EnergyPerformancePreferenceRegister", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
526 NULL
, NULL
, AcpiGenericAddressParser
,
527 ARRAY_SIZE (AcpiGenericAddressParser
) },
528 { "ReferencePerformanceBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
529 NULL
, NULL
, AcpiGenericAddressParser
,
530 ARRAY_SIZE (AcpiGenericAddressParser
) },
531 { "ReferencePerformanceInteger", 4, "0x%lx", NULL
},
532 { "LowestFrequencyBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
533 NULL
, NULL
, AcpiGenericAddressParser
,
534 ARRAY_SIZE (AcpiGenericAddressParser
) },
535 { "LowestFrequencyInteger", 4, "0x%lx", NULL
},
536 { "NominalFrequencyBuffer", sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE
),
537 NULL
, NULL
, AcpiGenericAddressParser
,
538 ARRAY_SIZE (AcpiGenericAddressParser
) },
539 { "NominalFrequencyInteger", 4, "0x%lx", NULL
},
542 /** A parser for Arm namespace objects.
544 STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser
[] = {
545 { "EArmObjReserved", NULL
, 0 },
546 { "EArmObjBootArchInfo", CmArmBootArchInfoParser
,
547 ARRAY_SIZE (CmArmBootArchInfoParser
) },
548 { "EArmObjCpuInfo", NULL
, 0 },
549 { "EArmObjPowerManagementProfileInfo", CmArmPowerManagementProfileInfoParser
,
550 ARRAY_SIZE (CmArmPowerManagementProfileInfoParser
) },
551 { "EArmObjGicCInfo", CmArmGicCInfoParser
, ARRAY_SIZE (CmArmGicCInfoParser
) },
552 { "EArmObjGicDInfo", CmArmGicDInfoParser
, ARRAY_SIZE (CmArmGicDInfoParser
) },
553 { "EArmObjGicMsiFrameInfo", CmArmGicMsiFrameInfoParser
,
554 ARRAY_SIZE (CmArmGicMsiFrameInfoParser
) },
555 { "EArmObjGicRedistributorInfo", CmArmGicRedistInfoParser
,
556 ARRAY_SIZE (CmArmGicRedistInfoParser
) },
557 { "EArmObjGicItsInfo", CmArmGicItsInfoParser
,
558 ARRAY_SIZE (CmArmGicItsInfoParser
) },
559 { "EArmObjSerialConsolePortInfo", CmArmSerialPortInfoParser
,
560 ARRAY_SIZE (CmArmSerialPortInfoParser
) },
561 { "EArmObjSerialDebugPortInfo", CmArmSerialPortInfoParser
,
562 ARRAY_SIZE (CmArmSerialPortInfoParser
) },
563 { "EArmObjGenericTimerInfo", CmArmGenericTimerInfoParser
,
564 ARRAY_SIZE (CmArmGenericTimerInfoParser
) },
565 { "EArmObjPlatformGTBlockInfo", CmArmGTBlockInfoParser
,
566 ARRAY_SIZE (CmArmGTBlockInfoParser
) },
567 { "EArmObjGTBlockTimerFrameInfo", CmArmGTBlockTimerFrameInfoParser
,
568 ARRAY_SIZE (CmArmGTBlockTimerFrameInfoParser
) },
569 { "EArmObjPlatformGenericWatchdogInfo", CmArmGenericWatchdogInfoParser
,
570 ARRAY_SIZE (CmArmGenericWatchdogInfoParser
) },
571 { "EArmObjPciConfigSpaceInfo", CmArmPciConfigSpaceInfoParser
,
572 ARRAY_SIZE (CmArmPciConfigSpaceInfoParser
) },
573 { "EArmObjHypervisorVendorIdentity", CmArmHypervisorVendorIdParser
,
574 ARRAY_SIZE (CmArmHypervisorVendorIdParser
) },
575 { "EArmObjFixedFeatureFlags", CmArmFixedFeatureFlagsParser
,
576 ARRAY_SIZE (CmArmFixedFeatureFlagsParser
) },
577 { "EArmObjItsGroup", CmArmItsGroupNodeParser
,
578 ARRAY_SIZE (CmArmItsGroupNodeParser
) },
579 { "EArmObjNamedComponent", CmArmNamedComponentNodeParser
,
580 ARRAY_SIZE (CmArmNamedComponentNodeParser
) },
581 { "EArmObjRootComplex", CmArmRootComplexNodeParser
,
582 ARRAY_SIZE (CmArmRootComplexNodeParser
) },
583 { "EArmObjSmmuV1SmmuV2", CmArmSmmuV1SmmuV2NodeParser
,
584 ARRAY_SIZE (CmArmSmmuV1SmmuV2NodeParser
) },
585 { "EArmObjSmmuV3", CmArmSmmuV3NodeParser
,
586 ARRAY_SIZE (CmArmSmmuV3NodeParser
) },
587 { "EArmObjPmcg", CmArmPmcgNodeParser
, ARRAY_SIZE (CmArmPmcgNodeParser
) },
588 { "EArmObjGicItsIdentifierArray", CmArmGicItsIdentifierParser
,
589 ARRAY_SIZE (CmArmGicItsIdentifierParser
) },
590 { "EArmObjIdMappingArray", CmArmIdMappingParser
,
591 ARRAY_SIZE (CmArmIdMappingParser
) },
592 { "EArmObjSmmuInterruptArray", CmArmGenericInterruptParser
,
593 ARRAY_SIZE (CmArmGenericInterruptParser
) },
594 { "EArmObjProcHierarchyInfo", CmArmProcHierarchyInfoParser
,
595 ARRAY_SIZE (CmArmProcHierarchyInfoParser
) },
596 { "EArmObjCacheInfo", CmArmCacheInfoParser
,
597 ARRAY_SIZE (CmArmCacheInfoParser
) },
598 { "EArmObjProcNodeIdInfo", CmArmProcNodeIdInfoParser
,
599 ARRAY_SIZE (CmArmProcNodeIdInfoParser
) },
600 { "EArmObjCmRef", CmArmObjRefParser
, ARRAY_SIZE (CmArmObjRefParser
) },
601 { "EArmObjMemoryAffinityInfo", CmArmMemoryAffinityInfoParser
,
602 ARRAY_SIZE (CmArmMemoryAffinityInfoParser
) },
603 { "EArmObjDeviceHandleAcpi", CmArmDeviceHandleAcpiParser
,
604 ARRAY_SIZE (CmArmDeviceHandleAcpiParser
) },
605 { "EArmObjDeviceHandlePci", CmArmDeviceHandlePciParser
,
606 ARRAY_SIZE (CmArmDeviceHandlePciParser
) },
607 { "EArmObjGenericInitiatorAffinityInfo",
608 CmArmGenericInitiatorAffinityInfoParser
,
609 ARRAY_SIZE (CmArmGenericInitiatorAffinityInfoParser
) },
610 { "EArmObjSerialPortInfo", CmArmSerialPortInfoParser
,
611 ARRAY_SIZE (CmArmSerialPortInfoParser
) },
612 { "EArmObjCmn600Info", CmArmCmn600InfoParser
,
613 ARRAY_SIZE (CmArmCmn600InfoParser
) },
614 { "EArmObjLpiInfo", CmArmLpiInfoParser
,
615 ARRAY_SIZE (CmArmLpiInfoParser
) },
616 { "EArmObjPciAddressMapInfo", CmArmPciAddressMapInfoParser
,
617 ARRAY_SIZE (CmArmPciAddressMapInfoParser
) },
618 { "EArmObjPciInterruptMapInfo", CmPciInterruptMapInfoParser
,
619 ARRAY_SIZE (CmPciInterruptMapInfoParser
) },
620 { "EArmObjRmr", CmArmRmrInfoParser
,
621 ARRAY_SIZE (CmArmRmrInfoParser
) },
622 { "EArmObjMemoryRangeDescriptor", CmArmMemoryRangeDescriptorInfoParser
,
623 ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser
) },
624 { "EArmObjCpcInfo", CmArmCpcInfoParser
,
625 ARRAY_SIZE (CmArmCpcInfoParser
) },
626 { "EArmObjMax", NULL
, 0 },
629 /** A parser for EStdObjCfgMgrInfo.
631 STATIC CONST CM_OBJ_PARSER StdObjCfgMgrInfoParser
[] = {
632 { "Revision", 4, "0x%x", NULL
},
633 { "OemId[6]", 6, "%C%C%C%C%C%C", PrintOemId
}
636 /** A parser for EStdObjAcpiTableList.
638 STATIC CONST CM_OBJ_PARSER StdObjAcpiTableInfoParser
[] = {
639 { "AcpiTableSignature", 4, "0x%x", NULL
},
640 { "AcpiTableRevision", 1, "%d", NULL
},
641 { "TableGeneratorId", sizeof (ACPI_TABLE_GENERATOR_ID
), "0x%x", NULL
},
642 { "AcpiTableData", sizeof (EFI_ACPI_DESCRIPTION_HEADER
*), "0x%p", NULL
},
643 { "OemTableId", 8, "0x%LLX", NULL
},
644 { "OemRevision", 4, "0x%x", NULL
},
645 { "MinorRevision", 1, "0x%x", NULL
},
648 /** A parser for EStdObjSmbiosTableList.
650 STATIC CONST CM_OBJ_PARSER StdObjSmbiosTableInfoParser
[] = {
651 { "TableGeneratorId", sizeof (SMBIOS_TABLE_GENERATOR_ID
), "0x%x", NULL
},
652 { "SmbiosTableData", sizeof (SMBIOS_STRUCTURE
*), "0x%p", NULL
}
655 /** A parser for Standard namespace objects.
657 STATIC CONST CM_OBJ_PARSER_ARRAY StdNamespaceObjectParser
[] = {
658 { "EStdObjCfgMgrInfo", StdObjCfgMgrInfoParser
,
659 ARRAY_SIZE (StdObjCfgMgrInfoParser
) },
660 { "EStdObjAcpiTableList", StdObjAcpiTableInfoParser
,
661 ARRAY_SIZE (StdObjAcpiTableInfoParser
) },
662 { "EStdObjSmbiosTableList", StdObjSmbiosTableInfoParser
,
663 ARRAY_SIZE (StdObjSmbiosTableInfoParser
) },
668 @param [in] Format Format to print the Ptr.
669 @param [in] Ptr Pointer to the OEM Id.
675 IN CONST CHAR8
*Format
,
681 (Format
!= NULL
) ? Format
: "%C%C%C%C%C%C",
693 The string must be NULL terminated.
695 @param [in] Format Format to print the Ptr.
696 @param [in] Ptr Pointer to the string.
706 DEBUG ((DEBUG_ERROR
, "%a", Ptr
));
709 /** Print fields of the objects.
711 @param [in] Data Pointer to the object to print.
712 @param [in] Parser Parser containing the object fields.
713 @param [in] ItemCount Number of entries/fields in the Parser.
714 @param [in] RemainingSize Parse at most *RemainingSize bytes.
715 This function decrements the value
716 from the number bytes consumed.
717 @param [in] IndentLevel Indentation to use when printing.
723 IN CONST CM_OBJ_PARSER
*Parser
,
725 IN INTN
*RemainingSize
,
726 IN UINT32 IndentLevel
733 if ((Data
== NULL
) ||
736 (RemainingSize
== NULL
))
743 for (Index
= 0; Index
< ItemCount
; Index
++) {
744 // Check there is enough space in left.
745 *RemainingSize
-= Parser
[Index
].Length
;
746 if (*RemainingSize
< 0) {
749 "\nERROR: %a: Buffer overrun\n",
750 Parser
[Index
].NameStr
757 for (IndentIndex
= 0; IndentIndex
< IndentLevel
; IndentIndex
++) {
758 DEBUG ((DEBUG_ERROR
, " "));
764 OUTPUT_FIELD_COLUMN_WIDTH
- 2 * IndentLevel
,
765 Parser
[Index
].NameStr
767 if (Parser
[Index
].PrintFormatter
!= NULL
) {
768 Parser
[Index
].PrintFormatter (Parser
[Index
].Format
, Data
);
769 } else if (Parser
[Index
].Format
!= NULL
) {
770 switch (Parser
[Index
].Length
) {
772 DEBUG ((DEBUG_ERROR
, Parser
[Index
].Format
, *(UINT8
*)Data
));
775 DEBUG ((DEBUG_ERROR
, Parser
[Index
].Format
, *(UINT16
*)Data
));
778 DEBUG ((DEBUG_ERROR
, Parser
[Index
].Format
, *(UINT32
*)Data
));
781 DEBUG ((DEBUG_ERROR
, Parser
[Index
].Format
, ReadUnaligned64 (Data
)));
786 "\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
787 Parser
[Index
].NameStr
,
791 } else if (Parser
[Index
].SubObjParser
!= NULL
) {
792 SubStructSize
= Parser
[Index
].Length
;
794 DEBUG ((DEBUG_ERROR
, "\n"));
797 Parser
[Index
].SubObjParser
,
798 Parser
[Index
].SubObjItemCount
,
806 "\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length = %d\n",
807 Parser
[Index
].NameStr
,
812 DEBUG ((DEBUG_ERROR
, "\n"));
813 Data
= (UINT8
*)Data
+ Parser
[Index
].Length
;
817 /** Parse and print a CmObjDesc.
819 @param [in] CmObjDesc The CmObjDesc to parse and print.
824 IN CONST CM_OBJ_DESCRIPTOR
*CmObjDesc
833 CONST CM_OBJ_PARSER_ARRAY
*ParserArray
;
835 if ((CmObjDesc
== NULL
) || (CmObjDesc
->Data
== NULL
)) {
839 NameSpaceId
= GET_CM_NAMESPACE_ID (CmObjDesc
->ObjectId
);
840 ObjId
= GET_CM_OBJECT_ID (CmObjDesc
->ObjectId
);
842 switch (NameSpaceId
) {
843 case EObjNameSpaceStandard
:
844 if (ObjId
>= EStdObjMax
) {
849 ParserArray
= &StdNamespaceObjectParser
[ObjId
];
851 case EObjNameSpaceArm
:
852 if (ObjId
>= EArmObjMax
) {
857 ParserArray
= &ArmNamespaceObjectParser
[ObjId
];
865 ObjectCount
= CmObjDesc
->Count
;
866 RemainingSize
= CmObjDesc
->Size
;
869 for (ObjIndex
= 0; ObjIndex
< ObjectCount
; ObjIndex
++) {
873 OUTPUT_FIELD_COLUMN_WIDTH
,
874 ParserArray
->ObjectName
,
879 (VOID
*)((UINTN
)CmObjDesc
->Data
+ Offset
),
881 ParserArray
->ItemCount
,
885 if ((RemainingSize
> CmObjDesc
->Size
) ||
892 Offset
= CmObjDesc
->Size
- RemainingSize
;
895 ASSERT (RemainingSize
== 0);