]> git.proxmox.com Git - mirror_edk2.git/blame - UefiPayloadPkg/Include/Library/BlParseLib.h
UefiPayloadPkg: Add PCI root bridge info hob support for SBL
[mirror_edk2.git] / UefiPayloadPkg / Include / Library / BlParseLib.h
CommitLineData
04af8bf2
DG
1/** @file\r
2 This library will parse the coreboot table in memory and extract those required\r
3 information.\r
4\r
422e5d2f 5 Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
04af8bf2
DG
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
8**/\r
9#include <PiPei.h>\r
10#include <Guid/GraphicsInfoHob.h>\r
11#include <Guid/MemoryMapInfoGuid.h>\r
12#include <Guid/SerialPortInfoGuid.h>\r
13#include <Guid/SystemTableInfoGuid.h>\r
14#include <Guid/AcpiBoardInfoGuid.h>\r
15\r
16#ifndef __BOOTLOADER_PARSE_LIB__\r
17#define __BOOTLOADER_PARSE_LIB__\r
18\r
422e5d2f 19#define GET_BOOTLOADER_PARAMETER() PcdGet64 (PcdBootloaderParameter)\r
04af8bf2
DG
20\r
21typedef RETURN_STATUS \\r
22 (*BL_MEM_INFO_CALLBACK) (MEMROY_MAP_ENTRY *MemoryMapEntry, VOID *Param);\r
23\r
24/**\r
25 This function retrieves the parameter base address from boot loader.\r
26\r
27 This function will get bootloader specific parameter address for UEFI payload.\r
28 e.g. HobList pointer for Slim Bootloader, and coreboot table header for Coreboot.\r
29\r
30 @retval NULL Failed to find the GUID HOB.\r
31 @retval others GUIDed HOB data pointer.\r
32\r
33**/\r
34VOID *\r
35EFIAPI\r
36GetParameterBase (\r
37 VOID\r
38 );\r
39\r
40/**\r
41 Acquire the memory map information.\r
42\r
43 @param MemInfoCallback The callback routine\r
44 @param Params Pointer to the callback routine parameter\r
45\r
46 @retval RETURN_SUCCESS Successfully find out the memory information.\r
47 @retval RETURN_NOT_FOUND Failed to find the memory information.\r
48\r
49**/\r
50RETURN_STATUS\r
51EFIAPI\r
52ParseMemoryInfo (\r
53 IN BL_MEM_INFO_CALLBACK MemInfoCallback,\r
54 IN VOID *Params\r
55 );\r
56\r
57/**\r
58 Acquire acpi table and smbios table from slim bootloader\r
59\r
60 @param SystemTableInfo Pointer to the system table info\r
61\r
62 @retval RETURN_SUCCESS Successfully find out the tables.\r
63 @retval RETURN_NOT_FOUND Failed to find the tables.\r
64\r
65**/\r
66RETURN_STATUS\r
67EFIAPI\r
68ParseSystemTable (\r
69 OUT SYSTEM_TABLE_INFO *SystemTableInfo\r
70 );\r
71\r
72\r
73/**\r
74 Find the serial port information\r
75\r
76 @param SERIAL_PORT_INFO Pointer to serial port info structure\r
77\r
78 @retval RETURN_SUCCESS Successfully find the serial port information.\r
79 @retval RETURN_NOT_FOUND Failed to find the serial port information .\r
80\r
81**/\r
82RETURN_STATUS\r
83EFIAPI\r
84ParseSerialInfo (\r
85 OUT SERIAL_PORT_INFO *SerialPortInfo\r
86 );\r
87\r
88\r
89/**\r
90 Find the video frame buffer information\r
91\r
92 @param GfxInfo Pointer to the EFI_PEI_GRAPHICS_INFO_HOB structure\r
93\r
94 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
95 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
96\r
97**/\r
98RETURN_STATUS\r
99EFIAPI\r
100ParseGfxInfo (\r
101 OUT EFI_PEI_GRAPHICS_INFO_HOB *GfxInfo\r
102 );\r
103\r
104/**\r
105 Find the video frame buffer device information\r
106\r
107 @param GfxDeviceInfo Pointer to the EFI_PEI_GRAPHICS_DEVICE_INFO_HOB structure\r
108\r
109 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
110 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
111\r
112**/\r
113RETURN_STATUS\r
114EFIAPI\r
115ParseGfxDeviceInfo (\r
116 OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo\r
117 );\r
118\r
978d428e
MM
119/**\r
120 Parse and handle the misc info provided by bootloader\r
121\r
122 @retval RETURN_SUCCESS The misc information was parsed successfully.\r
123 @retval RETURN_NOT_FOUND Could not find required misc info.\r
124 @retval RETURN_OUT_OF_RESOURCES Insufficant memory space.\r
125\r
126**/\r
127RETURN_STATUS\r
128EFIAPI\r
129ParseMiscInfo (\r
130 VOID\r
131 );\r
132\r
04af8bf2 133#endif\r