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