2 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
3 SPDX-License-Identifier: BSD-2-Clause-Patent
6 #include "UefiPayloadEntry.h"
7 #include <UniversalPayload/AcpiTable.h>
8 #include <UniversalPayload/SerialPortInfo.h>
9 #include <UniversalPayload/PciRootBridges.h>
10 #include <UniversalPayload/ExtraData.h>
11 #include <Guid/MemoryTypeInformation.h>
12 #include <Guid/AcpiBoardInfoGuid.h>
13 #include <Guid/BootManagerMenu.h>
15 #define ROW_LIMITER 16
19 (*HOB_PRINT_HANDLER
) (
27 HOB_PRINT_HANDLER PrintHandler
;
28 } HOB_PRINT_HANDLER_TABLE
;
30 CHAR8
* mMemoryTypeStr
[] = {
31 "EfiReservedMemoryType",
34 "EfiBootServicesCode",
35 "EfiBootServicesData",
36 "EfiRuntimeServicesCode",
37 "EfiRuntimeServicesData",
38 "EfiConventionalMemory",
40 "EfiACPIReclaimMemory",
43 "EfiMemoryMappedIOPortSpace",
45 "EfiPersistentMemory",
49 CHAR8
* mResource_Type_List
[] = {
50 "EFI_RESOURCE_SYSTEM_MEMORY ", //0x00000000
51 "EFI_RESOURCE_MEMORY_MAPPED_IO ", //0x00000001
52 "EFI_RESOURCE_IO ", //0x00000002
53 "EFI_RESOURCE_FIRMWARE_DEVICE ", //0x00000003
54 "EFI_RESOURCE_MEMORY_MAPPED_IO_PORT ", //0x00000004
55 "EFI_RESOURCE_MEMORY_RESERVED ", //0x00000005
56 "EFI_RESOURCE_IO_RESERVED ", //0x00000006
57 "EFI_RESOURCE_MAX_MEMORY_TYPE " //0x00000007
69 GUID_HOB_PRINT PrintHandler
;
71 } GUID_HOB_PRINT_HANDLE
;
76 } PRINT_MEMORY_ALLOCCATION_HOB
;
80 Print the Hex value of a given range.
81 @param[in] DataStart A pointer to the start of data to be printed.
82 @param[in] DataSize The length of the data to be printed.
83 @retval EFI_SUCCESS If it completed successfully.
95 StartAddr
= DataStart
;
96 for (Index1
= 0; Index1
* ROW_LIMITER
< DataSize
; Index1
++) {
97 DEBUG ((DEBUG_VERBOSE
, " 0x%04p:", (DataStart
- StartAddr
)));
98 for (Index2
= 0; (Index2
< ROW_LIMITER
) && (Index1
* ROW_LIMITER
+ Index2
< DataSize
); Index2
++){
99 DEBUG ((DEBUG_VERBOSE
, " %02x", *DataStart
));
102 DEBUG ((DEBUG_VERBOSE
, "\n"));
109 Print the information in HandOffHob.
111 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_HANDOFF.
112 @param[in] HobLength The length in bytes of HOB of type EFI_HOB_TYPE_HANDOFF.
113 @retval EFI_SUCCESS If it completed successfully.
121 EFI_PEI_HOB_POINTERS Hob
;
122 Hob
.Raw
= (UINT8
*) HobStart
;
123 ASSERT (HobLength
>= sizeof (*Hob
.HandoffInformationTable
));
124 DEBUG ((DEBUG_INFO
, " BootMode = 0x%x\n", Hob
.HandoffInformationTable
->BootMode
));
125 DEBUG ((DEBUG_INFO
, " EfiMemoryTop = 0x%lx\n", Hob
.HandoffInformationTable
->EfiMemoryTop
));
126 DEBUG ((DEBUG_INFO
, " EfiMemoryBottom = 0x%lx\n", Hob
.HandoffInformationTable
->EfiMemoryBottom
));
127 DEBUG ((DEBUG_INFO
, " EfiFreeMemoryTop = 0x%lx\n", Hob
.HandoffInformationTable
->EfiFreeMemoryTop
));
128 DEBUG ((DEBUG_INFO
, " EfiFreeMemoryBottom = 0x%lx\n", Hob
.HandoffInformationTable
->EfiFreeMemoryBottom
));
129 DEBUG ((DEBUG_INFO
, " EfiEndOfHobList = 0x%lx\n", Hob
.HandoffInformationTable
->EfiEndOfHobList
));
134 Print the information in Memory Allocation Hob.
135 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_MEMORY_ALLOCATION.
136 @param[in] HobLength The length in bytes of HOB of type EFI_HOB_TYPE_MEMORY_ALLOCATION.
137 @retval EFI_SUCCESS If it completed successfully.
140 PrintMemoryAllocationHob (
145 EFI_PEI_HOB_POINTERS Hob
;
147 Hob
.Raw
= (UINT8
*) HobStart
;
149 if(CompareGuid (&Hob
.MemoryAllocation
->AllocDescriptor
.Name
, &gEfiHobMemoryAllocStackGuid
)) {
150 ASSERT (HobLength
>= sizeof (*Hob
.MemoryAllocationStack
));
151 DEBUG ((DEBUG_INFO
, " Type = EFI_HOB_MEMORY_ALLOCATION_STACK\n"));
152 } else if (CompareGuid (&Hob
.MemoryAllocation
->AllocDescriptor
.Name
, &gEfiHobMemoryAllocBspStoreGuid
)) {
153 ASSERT (HobLength
>= sizeof (*Hob
.MemoryAllocationBspStore
));
154 DEBUG ((DEBUG_INFO
, " Type = EFI_HOB_MEMORY_ALLOCATION_BSP_STORE\n"));
155 } else if (CompareGuid (&Hob
.MemoryAllocation
->AllocDescriptor
.Name
, &gEfiHobMemoryAllocModuleGuid
)) {
156 ASSERT (HobLength
>= sizeof (*Hob
.MemoryAllocationModule
));
157 DEBUG ((DEBUG_INFO
, " Type = EFI_HOB_MEMORY_ALLOCATION_MODULE\n"));
158 DEBUG ((DEBUG_INFO
, " Module Name = %g\n", Hob
.MemoryAllocationModule
->ModuleName
));
159 DEBUG ((DEBUG_INFO
, " Physical Address = 0x%lx\n", Hob
.MemoryAllocationModule
->EntryPoint
));
161 ASSERT (HobLength
>= sizeof (*Hob
.MemoryAllocation
));
162 DEBUG ((DEBUG_INFO
, " Type = EFI_HOB_TYPE_MEMORY_ALLOCATION\n"));
164 DEBUG ((DEBUG_INFO
, " MemoryBaseAddress = 0x%lx\n", Hob
.MemoryAllocationStack
->AllocDescriptor
.MemoryBaseAddress
));
165 DEBUG ((DEBUG_INFO
, " MemoryLength = 0x%lx\n", Hob
.MemoryAllocationStack
->AllocDescriptor
.MemoryLength
));
166 DEBUG ((DEBUG_INFO
, " MemoryType = %a \n", mMemoryTypeStr
[Hob
.MemoryAllocationStack
->AllocDescriptor
.MemoryType
]));
171 Print the information in Resource Discriptor Hob.
172 @param[in] HobStart A pointer to HOB of type EFI_HOB_TYPE_RESOURCE_DESCRIPTOR.
173 @param[in] HobLength The Length in bytes of HOB of type EFI_HOB_TYPE_RESOURCE_DESCRIPTOR.
174 @retval EFI_SUCCESS If it completed successfully.
177 PrintResourceDiscriptorHob (
182 EFI_PEI_HOB_POINTERS Hob
;
184 Hob
.Raw
= (UINT8
*) HobStart
;
185 ASSERT (HobLength
>= sizeof (*Hob
.ResourceDescriptor
));
187 DEBUG ((DEBUG_INFO
, " ResourceType = %a\n", mResource_Type_List
[Hob
.ResourceDescriptor
->ResourceType
]));
188 if(!IsZeroGuid (&Hob
.ResourceDescriptor
->Owner
)) {
189 DEBUG ((DEBUG_INFO
, " Owner = %g\n", Hob
.ResourceDescriptor
->Owner
));
191 DEBUG ((DEBUG_INFO
, " ResourceAttribute = 0x%x\n", Hob
.ResourceDescriptor
->ResourceAttribute
));
192 DEBUG ((DEBUG_INFO
, " PhysicalStart = 0x%lx\n", Hob
.ResourceDescriptor
->PhysicalStart
));
193 DEBUG ((DEBUG_INFO
, " ResourceLength = 0x%lx\n", Hob
.ResourceDescriptor
->ResourceLength
));
198 Print the information in Acpi Guid Hob.
200 @param[in] HobRaw A pointer to the start of gUniversalPayloadAcpiTableGuid HOB.
201 @param[in] HobLength The size of the HOB data buffer.
203 @retval EFI_SUCCESS If it completed successfully.
211 UNIVERSAL_PAYLOAD_ACPI_TABLE
*AcpiTableHob
;
212 AcpiTableHob
= (UNIVERSAL_PAYLOAD_ACPI_TABLE
*) GET_GUID_HOB_DATA (HobRaw
);
213 ASSERT (HobLength
>= AcpiTableHob
->Header
.Length
);
214 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", AcpiTableHob
->Header
.Revision
));
215 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", AcpiTableHob
->Header
.Length
));
216 DEBUG ((DEBUG_INFO
, " Rsdp = 0x%p\n", (UINT64
) AcpiTableHob
->Rsdp
));
221 Print the information in Serial Guid Hob.
222 @param[in] HobRaw A pointer to the start of gUniversalPayloadSerialPortInfoGuid HOB.
223 @param[in] HobLength The size of the HOB data buffer.
225 @retval EFI_SUCCESS If it completed successfully.
233 UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO
*SerialPortInfo
;
234 SerialPortInfo
= (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO
*) GET_GUID_HOB_DATA (HobRaw
);
235 ASSERT (HobLength
>= SerialPortInfo
->Header
.Length
);
236 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", SerialPortInfo
->Header
.Revision
));
237 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", SerialPortInfo
->Header
.Length
));
238 DEBUG ((DEBUG_INFO
, " UseMmio = 0x%x\n", SerialPortInfo
->UseMmio
));
239 DEBUG ((DEBUG_INFO
, " RegisterStride = 0x%x\n", SerialPortInfo
->RegisterStride
));
240 DEBUG ((DEBUG_INFO
, " BaudRate = %d\n", SerialPortInfo
->BaudRate
));
241 DEBUG ((DEBUG_INFO
, " RegisterBase = 0x%lx\n", SerialPortInfo
->RegisterBase
));
246 Print the information in Smbios Guid Hob.
247 @param[in] HobRaw A pointer to the start of gUniversalPayloadSmbios3TableGuid HOB.
248 @param[in] HobLength The size of the HOB data buffer.
249 @retval EFI_SUCCESS If it completed successfully.
252 PrintSmbios3GuidHob (
257 UNIVERSAL_PAYLOAD_SMBIOS_TABLE
*SmBiosTable
;
258 SmBiosTable
= (UNIVERSAL_PAYLOAD_SMBIOS_TABLE
*) GET_GUID_HOB_DATA (HobRaw
);
259 ASSERT (HobLength
>= SmBiosTable
->Header
.Length
);
260 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", SmBiosTable
->Header
.Revision
));
261 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", SmBiosTable
->Header
.Length
));
262 DEBUG ((DEBUG_INFO
, " SmBiosEntryPoint = 0x%lx\n", (UINT64
) SmBiosTable
->SmBiosEntryPoint
));
267 Print the information in Smbios Guid Hob.
268 @param[in] HobRaw A pointer to the start of gUniversalPayloadSmbiosTableGuid HOB.
269 @param[in] HobLength The size of the HOB data buffer.
271 @retval EFI_SUCCESS If it completed successfully.
274 PrintSmbiosTablGuidHob (
279 UNIVERSAL_PAYLOAD_SMBIOS_TABLE
*SmBiosTable
;
280 SmBiosTable
= (UNIVERSAL_PAYLOAD_SMBIOS_TABLE
*) GET_GUID_HOB_DATA (HobRaw
);
281 ASSERT (HobLength
>= SmBiosTable
->Header
.Length
);
282 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", SmBiosTable
->Header
.Revision
));
283 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", SmBiosTable
->Header
.Length
));
284 DEBUG ((DEBUG_INFO
, " SmBiosEntryPoint = 0x%lx\n", (UINT64
) SmBiosTable
->SmBiosEntryPoint
));
289 Print the information in Acpi BoardInfo Guid Hob.
290 @param[in] HobRaw A pointer to the start of gUefiAcpiBoardInfoGuid HOB.
291 @param[in] HobLength The size of the HOB data buffer.
293 @retval EFI_SUCCESS If it completed successfully.
296 PrintAcpiBoardInfoGuidHob (
301 ACPI_BOARD_INFO
*AcpBoardInfo
;
302 AcpBoardInfo
= (ACPI_BOARD_INFO
*) GET_GUID_HOB_DATA (HobRaw
);
303 ASSERT (HobLength
>= sizeof (*AcpBoardInfo
));
304 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", AcpBoardInfo
->Revision
));
305 DEBUG ((DEBUG_INFO
, " Reserved0 = 0x%x\n", AcpBoardInfo
->Reserved0
));
306 DEBUG ((DEBUG_INFO
, " ResetValue = 0x%x\n", AcpBoardInfo
->ResetValue
));
307 DEBUG ((DEBUG_INFO
, " PmEvtBase = 0x%lx\n", AcpBoardInfo
->PmEvtBase
));
308 DEBUG ((DEBUG_INFO
, " PmGpeEnBase = 0x%lx\n", AcpBoardInfo
->PmGpeEnBase
));
309 DEBUG ((DEBUG_INFO
, " PmCtrlRegBase = 0x%lx\n", AcpBoardInfo
->PmCtrlRegBase
));
310 DEBUG ((DEBUG_INFO
, " PmTimerRegBase = 0x%lx\n", AcpBoardInfo
->PmTimerRegBase
));
311 DEBUG ((DEBUG_INFO
, " ResetRegAddress = 0x%lx\n", AcpBoardInfo
->ResetRegAddress
));
312 DEBUG ((DEBUG_INFO
, " PcieBaseAddress = 0x%lx\n", AcpBoardInfo
->PcieBaseAddress
));
313 DEBUG ((DEBUG_INFO
, " PcieBaseSize = 0x%lx\n", AcpBoardInfo
->PcieBaseSize
));
318 Print the information in Pci RootBridge Info Guid Hob.
319 @param[in] HobRaw A pointer to the start of gUniversalPayloadPciRootBridgeInfoGuid HOB.
320 @param[in] HobLength The size of the HOB data buffer.
322 @retval EFI_SUCCESS If it completed successfully.
325 PrintPciRootBridgeInfoGuidHob (
330 UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES
*PciRootBridges
;
334 PciRootBridges
= (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES
*) GET_GUID_HOB_DATA (HobRaw
);
335 Length
= sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES
) + PciRootBridges
->Count
* sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE
);
336 ASSERT (HobLength
>= Length
);
337 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", PciRootBridges
->Header
.Revision
));
338 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", PciRootBridges
->Header
.Length
));
339 DEBUG ((DEBUG_INFO
, " Count = 0x%x\n", PciRootBridges
->Count
));
340 DEBUG ((DEBUG_INFO
, " ResourceAssigned = %a\n", (PciRootBridges
->ResourceAssigned
? "True" : "False")));
342 while(Index
< PciRootBridges
->Count
) {
343 DEBUG ((DEBUG_INFO
, " Root Bridge Index[%d]:\n", Index
));
344 DEBUG ((DEBUG_INFO
, " Segment = 0x%x\n", PciRootBridges
->RootBridge
[Index
].Segment
));
345 DEBUG ((DEBUG_INFO
, " Supports = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Supports
));
346 DEBUG ((DEBUG_INFO
, " Attributes = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Attributes
));
347 DEBUG ((DEBUG_INFO
, " DmaAbove4G = 0x%x\n", PciRootBridges
->RootBridge
[Index
].DmaAbove4G
));
348 DEBUG ((DEBUG_INFO
, " NoExtendedConfigSpace = 0x%x\n", PciRootBridges
->RootBridge
[Index
].NoExtendedConfigSpace
));
349 DEBUG ((DEBUG_INFO
, " AllocationAttributes = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].AllocationAttributes
));
350 DEBUG ((DEBUG_INFO
, " Bus.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Bus
.Base
));
351 DEBUG ((DEBUG_INFO
, " Bus.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Bus
.Limit
));
352 DEBUG ((DEBUG_INFO
, " Bus.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Bus
.Translation
));
353 DEBUG ((DEBUG_INFO
, " Io.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Io
.Base
));
354 DEBUG ((DEBUG_INFO
, " Io.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Io
.Limit
));
355 DEBUG ((DEBUG_INFO
, " Io.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Io
.Translation
));
356 DEBUG ((DEBUG_INFO
, " Mem.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Mem
.Base
));
357 DEBUG ((DEBUG_INFO
, " Mem.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Mem
.Limit
));
358 DEBUG ((DEBUG_INFO
, " Mem.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].Mem
.Translation
));
359 DEBUG ((DEBUG_INFO
, " MemAbove4G.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].MemAbove4G
.Base
));
360 DEBUG ((DEBUG_INFO
, " MemAbove4G.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].MemAbove4G
.Limit
));
361 DEBUG ((DEBUG_INFO
, " MemAbove4G.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].MemAbove4G
.Translation
));
362 DEBUG ((DEBUG_INFO
, " PMem.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMem
.Base
));
363 DEBUG ((DEBUG_INFO
, " PMem.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMem
.Limit
));
364 DEBUG ((DEBUG_INFO
, " PMem.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMem
.Translation
));
365 DEBUG ((DEBUG_INFO
, " PMemAbove4G.Base = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMemAbove4G
.Base
));
366 DEBUG ((DEBUG_INFO
, " PMemAbove4G.Limit = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMemAbove4G
.Limit
));
367 DEBUG ((DEBUG_INFO
, " PMemAbove4G.Translation = 0x%lx\n", PciRootBridges
->RootBridge
[Index
].PMemAbove4G
.Translation
));
374 Print the information in Extra Data Guid Hob.
375 @param[in] HobRaw A pointer to the start of gUniversalPayloadExtraDataGuid HOB.
376 @param[in] HobLength The size of the HOB data buffer.
378 @retval EFI_SUCCESS If it completed successfully.
381 PrintExtraDataGuidHob (
386 UNIVERSAL_PAYLOAD_EXTRA_DATA
*ExtraData
;
391 ExtraData
= (UNIVERSAL_PAYLOAD_EXTRA_DATA
*) GET_GUID_HOB_DATA (HobRaw
);
392 Length
= sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA
) + ExtraData
->Count
* sizeof (UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY
);
393 ASSERT (HobLength
>= Length
);
394 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", ExtraData
->Header
.Revision
));
395 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", ExtraData
->Header
.Length
));
396 DEBUG ((DEBUG_INFO
, " Count = 0x%x\n", ExtraData
->Count
));
398 while (Index
< ExtraData
->Count
) {
399 DEBUG ((DEBUG_INFO
, " Id[%d] = %a\n", Index
,ExtraData
->Entry
[Index
].Identifier
));
400 DEBUG ((DEBUG_INFO
, " Base[%d] = 0x%lx\n", Index
,ExtraData
->Entry
[Index
].Base
));
401 DEBUG ((DEBUG_INFO
, " Size[%d] = 0x%lx\n", Index
,ExtraData
->Entry
[Index
].Size
));
408 Print the information in MemoryTypeInfoGuidHob.
409 @param[in] HobRaw A pointer to the start of gEfiMemoryTypeInformationGuid HOB.
410 @param[in] HobLength The size of the HOB data buffer.
412 @retval EFI_SUCCESS If it completed successfully.
415 PrintMemoryTypeInfoGuidHob (
420 EFI_MEMORY_TYPE_INFORMATION
*MemoryTypeInfo
;
422 MemoryTypeInfo
= (EFI_MEMORY_TYPE_INFORMATION
*) GET_GUID_HOB_DATA (HobRaw
);
423 ASSERT (HobLength
>= sizeof (*MemoryTypeInfo
));
424 DEBUG ((DEBUG_INFO
, " Type = 0x%x\n", MemoryTypeInfo
->Type
));
425 DEBUG ((DEBUG_INFO
, " NumberOfPages = 0x%x\n", MemoryTypeInfo
->NumberOfPages
));
430 Print the information in EdkiiBootManagerMenuFileGuid.
431 @param[in] HobRaw A pointer to the start of gEdkiiBootManagerMenuFileGuid HOB.
432 @param[in] HobLength The size of the HOB data buffer.
433 @retval EFI_SUCCESS If it completed successfully.
436 PrintBootManagerMenuGuidHob (
441 UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU
*BootManagerMenuFile
;
443 BootManagerMenuFile
= (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU
*) GET_GUID_HOB_DATA (HobRaw
);
444 ASSERT (HobLength
>= sizeof (*BootManagerMenuFile
));
445 DEBUG ((DEBUG_INFO
, " Revision = 0x%x\n", BootManagerMenuFile
->Header
.Revision
));
446 DEBUG ((DEBUG_INFO
, " Length = 0x%x\n", BootManagerMenuFile
->Header
.Length
));
447 DEBUG ((DEBUG_INFO
, " FileName = %g\n", &BootManagerMenuFile
->FileName
));
452 // Mappint table for dump Guid Hob information.
453 // This table can be easily extented.
455 GUID_HOB_PRINT_HANDLE GuidHobPrintHandleTable
[] = {
456 {&gUniversalPayloadAcpiTableGuid
, PrintAcpiGuidHob
, "gUniversalPayloadAcpiTableGuid(ACPI table Guid)"},
457 {&gUniversalPayloadSerialPortInfoGuid
, PrintSerialGuidHob
, "gUniversalPayloadSerialPortInfoGuid(Serial Port Info)"},
458 {&gUniversalPayloadSmbios3TableGuid
, PrintSmbios3GuidHob
, "gUniversalPayloadSmbios3TableGuid(SmBios Guid)"},
459 {&gUniversalPayloadSmbiosTableGuid
, PrintSmbiosTablGuidHob
, "gUniversalPayloadSmbiosTableGuid(SmBios Guid)"},
460 {&gUefiAcpiBoardInfoGuid
, PrintAcpiBoardInfoGuidHob
, "gUefiAcpiBoardInfoGuid(Acpi Guid)"},
461 {&gUniversalPayloadPciRootBridgeInfoGuid
, PrintPciRootBridgeInfoGuidHob
, "gUniversalPayloadPciRootBridgeInfoGuid(Pci Guid)"},
462 {&gEfiMemoryTypeInformationGuid
, PrintMemoryTypeInfoGuidHob
, "gEfiMemoryTypeInformationGuid(Memory Type Information Guid)"},
463 {&gUniversalPayloadExtraDataGuid
, PrintExtraDataGuidHob
, "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"},
464 {&gEdkiiBootManagerMenuFileGuid
, PrintBootManagerMenuGuidHob
, "gEdkiiBootManagerMenuFileGuid(Boot Manager Menu File Guid)"}
468 Print the Guid Hob using related print handle function.
469 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
470 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_GUID_EXTENSION.
471 @retval EFI_SUCCESS If it completed successfully.
479 EFI_PEI_HOB_POINTERS Hob
;
483 Hob
.Raw
= (UINT8
*) HobStart
;
484 ASSERT (HobLength
>= sizeof (Hob
.Guid
));
486 for (Index
= 0; Index
< ARRAY_SIZE (GuidHobPrintHandleTable
); Index
++) {
487 if (CompareGuid (&Hob
.Guid
->Name
, GuidHobPrintHandleTable
[Index
].Guid
)) {
488 DEBUG ((DEBUG_INFO
, " Guid = %a\n", GuidHobPrintHandleTable
[Index
].GuidName
));
489 Status
= GuidHobPrintHandleTable
[Index
].PrintHandler (Hob
.Raw
, GET_GUID_HOB_DATA_SIZE (Hob
.Raw
));
493 DEBUG ((DEBUG_INFO
, " Name = %g\n", &Hob
.Guid
->Name
));
494 PrintHex (GET_GUID_HOB_DATA (Hob
.Raw
), GET_GUID_HOB_DATA_SIZE (Hob
.Raw
));
499 Print the information in FV Hob.
500 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_FV.
501 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_FV.
502 @retval EFI_SUCCESS If it completed successfully.
510 EFI_PEI_HOB_POINTERS Hob
;
512 Hob
.Raw
= (UINT8
*) HobStart
;
513 ASSERT (HobLength
>= sizeof (*Hob
.FirmwareVolume
));
515 DEBUG ((DEBUG_INFO
, " BaseAddress = 0x%lx\n", Hob
.FirmwareVolume
->BaseAddress
));
516 DEBUG ((DEBUG_INFO
, " Length = 0x%lx\n", Hob
.FirmwareVolume
->Length
));
521 Print the information in Cpu Hob.
522 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_CPU.
523 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_CPU.
524 @retval EFI_SUCCESS If it completed successfully.
532 EFI_PEI_HOB_POINTERS Hob
;
534 Hob
.Raw
= (UINT8
*) HobStart
;
535 ASSERT (HobLength
>= sizeof (*Hob
.Cpu
));
537 DEBUG ((DEBUG_INFO
, " SizeOfMemorySpace = 0x%lx\n", Hob
.Cpu
->SizeOfMemorySpace
));
538 DEBUG ((DEBUG_INFO
, " SizeOfIoSpace = 0x%lx\n", Hob
.Cpu
->SizeOfIoSpace
));
543 Print the information in MemoryPoolHob.
544 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_MEMORY_POOL.
545 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_MEMORY_POOL.
546 @retval EFI_SUCCESS If it completed successfully.
558 Print the information in Fv2Hob.
559 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_FV2.
560 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_FV2.
561 @retval EFI_SUCCESS If it completed successfully.
569 EFI_PEI_HOB_POINTERS Hob
;
571 Hob
.Raw
= (UINT8
*) HobStart
;
572 ASSERT (HobLength
>= sizeof (*Hob
.FirmwareVolume2
));
574 DEBUG ((DEBUG_INFO
, " BaseAddress = 0x%lx\n", Hob
.FirmwareVolume2
->BaseAddress
));
575 DEBUG ((DEBUG_INFO
, " Length = 0x%lx\n", Hob
.FirmwareVolume2
->Length
));
576 DEBUG ((DEBUG_INFO
, " FvName = %g\n", &Hob
.FirmwareVolume2
->FvName
));
577 DEBUG ((DEBUG_INFO
, " FileName = %g\n", &Hob
.FirmwareVolume2
->FileName
));
582 Print the information in Capsule Hob.
583 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_UEFI_CAPSULE.
584 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_UEFI_CAPSULE.
585 @retval EFI_SUCCESS If it completed successfully.
593 EFI_PEI_HOB_POINTERS Hob
;
595 Hob
.Raw
= (UINT8
*) HobStart
;
596 ASSERT (HobLength
>= sizeof (*Hob
.Capsule
));
598 DEBUG ((DEBUG_INFO
, " BaseAddress = 0x%lx\n", Hob
.Capsule
->BaseAddress
));
599 DEBUG ((DEBUG_INFO
, " Length = 0x%lx\n", Hob
.Capsule
->Length
));
604 Print the information in Fv3 Hob.
605 @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_FV3.
606 @param[in] HobLength The length in bytes of the HOB of type EFI_HOB_TYPE_FV3.
607 @retval EFI_SUCCESS If it completed successfully.
615 EFI_PEI_HOB_POINTERS Hob
;
616 Hob
.Raw
= (UINT8
*) HobStart
;
617 ASSERT (HobLength
>= sizeof (*Hob
.FirmwareVolume3
));
619 DEBUG ((DEBUG_INFO
, " BaseAddress = 0x%lx\n", Hob
.FirmwareVolume3
->BaseAddress
));
620 DEBUG ((DEBUG_INFO
, " Length = 0x%lx\n", Hob
.FirmwareVolume3
->Length
));
621 DEBUG ((DEBUG_INFO
, " AuthenticationStatus = 0x%x\n", Hob
.FirmwareVolume3
->AuthenticationStatus
));
622 DEBUG ((DEBUG_INFO
, " ExtractedFv = %a\n", (Hob
.FirmwareVolume3
->ExtractedFv
? "True" : "False")));
623 DEBUG ((DEBUG_INFO
, " FVName = %g\n", &Hob
.FirmwareVolume3
->FvName
));
624 DEBUG ((DEBUG_INFO
, " FileName = %g\n", &Hob
.FirmwareVolume3
->FileName
));
629 // Mappint table from Hob type to Hob print function.
631 HOB_PRINT_HANDLER_TABLE mHobHandles
[] = {
632 {EFI_HOB_TYPE_HANDOFF
, "EFI_HOB_TYPE_HANDOFF", PrintHandOffHob
},
633 {EFI_HOB_TYPE_MEMORY_ALLOCATION
, "EFI_HOB_TYPE_MEMORY_ALLOCATION", PrintMemoryAllocationHob
},
634 {EFI_HOB_TYPE_RESOURCE_DESCRIPTOR
, "EFI_HOB_TYPE_RESOURCE_DESCRIPTOR", PrintResourceDiscriptorHob
},
635 {EFI_HOB_TYPE_GUID_EXTENSION
, "EFI_HOB_TYPE_GUID_EXTENSION", PrintGuidHob
},
636 {EFI_HOB_TYPE_FV
, "EFI_HOB_TYPE_FV", PrintFvHob
},
637 {EFI_HOB_TYPE_CPU
, "EFI_HOB_TYPE_CPU", PrintCpuHob
},
638 {EFI_HOB_TYPE_MEMORY_POOL
, "EFI_HOB_TYPE_MEMORY_POOL", PrintMemoryPoolHob
},
639 {EFI_HOB_TYPE_FV2
, "EFI_HOB_TYPE_FV2", PrintFv2Hob
},
640 {EFI_HOB_TYPE_UEFI_CAPSULE
, "EFI_HOB_TYPE_UEFI_CAPSULE", PrintCapsuleHob
},
641 {EFI_HOB_TYPE_FV3
, "EFI_HOB_TYPE_FV3", PrintFv3Hob
}
646 Print all HOBs info from the HOB list.
647 @param[in] HobStart A pointer to the HOB list
648 @return The pointer to the HOB list.
652 IN CONST VOID
*HobStart
655 EFI_PEI_HOB_POINTERS Hob
;
658 ASSERT (HobStart
!= NULL
);
660 Hob
.Raw
= (UINT8
*) HobStart
;
661 DEBUG ((DEBUG_INFO
, "Print all Hob information from Hob 0x%p\n", Hob
.Raw
));
665 // Parse the HOB list to see which type it is, and print the information.
667 while (!END_OF_HOB_LIST (Hob
)) {
668 for (Index
= 0; Index
< ARRAY_SIZE (mHobHandles
); Index
++) {
669 if (Hob
.Header
->HobType
== mHobHandles
[Index
].Type
) {
670 DEBUG ((DEBUG_INFO
, "HOB[%d]: Type = %a, Offset = 0x%p, Length = 0x%x\n", Count
, mHobHandles
[Index
].Name
, (Hob
.Raw
- (UINT8
*) HobStart
), Hob
.Header
->HobLength
));
671 mHobHandles
[Index
].PrintHandler (Hob
.Raw
, Hob
.Header
->HobLength
);
675 if (Index
== ARRAY_SIZE (mHobHandles
)) {
676 DEBUG ((DEBUG_INFO
, "HOB[%d]: Type = %d, Offset = 0x%p, Length = 0x%x\n", Count
, Hob
.Header
->HobType
, (Hob
.Raw
- (UINT8
*)HobStart
), Hob
.Header
->HobLength
));
677 DEBUG ((DEBUG_INFO
, " Unkown Hob type\n"));
678 PrintHex (Hob
.Raw
, Hob
.Header
->HobLength
);
681 Hob
.Raw
= GET_NEXT_HOB (Hob
);
683 DEBUG ((DEBUG_INFO
, "There are totally %d Hobs, the End Hob address is %p\n", Count
, Hob
.Raw
));