]> git.proxmox.com Git - mirror_edk2.git/blame - CorebootModulePkg/Include/Library/CbParseLib.h
CorebootModulePkg: Fix various typos
[mirror_edk2.git] / CorebootModulePkg / Include / Library / CbParseLib.h
CommitLineData
fce4ecd9
MM
1/** @file\r
2 This library will parse the coreboot table in memory and extract those required\r
3 information.\r
4\r
3176d84f 5 Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
fce4ecd9
MM
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15#include <Guid/FrameBufferInfoGuid.h>\r
16\r
2d90b74d 17typedef RETURN_STATUS \\r
18 (*CB_MEM_INFO_CALLBACK) (UINT64 Base, UINT64 Size, UINT32 Type, VOID *Param);\r
19\r
3176d84f 20/**\r
21 Find coreboot record with given Tag from the memory Start in 4096\r
22 bytes range.\r
23\r
24 @param Start The start memory to be searched in\r
25 @param Tag The tag id to be found\r
26\r
27 @retval NULL The Tag is not found.\r
06516768 28 @retval Others The pointer to the record found.\r
3176d84f 29\r
30**/\r
31VOID *\r
32EFIAPI\r
33FindCbTag (\r
34 IN VOID *Start,\r
35 IN UINT32 Tag\r
36 );\r
37\r
fce4ecd9
MM
38/**\r
39 Acquire the memory information from the coreboot table in memory.\r
40\r
2d90b74d 41 @param MemInfoCallback The callback routine\r
42 @param pParam Pointer to the callback routine parameter\r
fce4ecd9
MM
43\r
44 @retval RETURN_SUCCESS Successfully find out the memory information.\r
fce4ecd9
MM
45 @retval RETURN_NOT_FOUND Failed to find the memory information.\r
46\r
47**/\r
48RETURN_STATUS\r
3176d84f 49EFIAPI\r
fce4ecd9 50CbParseMemoryInfo (\r
2d90b74d 51 IN CB_MEM_INFO_CALLBACK MemInfoCallback,\r
52 IN VOID *pParam\r
fce4ecd9 53 );\r
06516768 54\r
fce4ecd9
MM
55/**\r
56 Acquire the coreboot memory table with the given table id\r
57\r
58 @param TableId Table id to be searched\r
59 @param pMemTable Pointer to the base address of the memory table\r
60 @param pMemTableSize Pointer to the size of the memory table\r
61\r
62 @retval RETURN_SUCCESS Successfully find out the memory table.\r
63 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
64 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
65\r
66**/\r
67RETURN_STATUS\r
3176d84f 68EFIAPI\r
fce4ecd9 69CbParseCbMemTable (\r
06516768 70 IN UINT32 TableId,\r
fce4ecd9
MM
71 IN VOID** pMemTable,\r
72 IN UINT32* pMemTableSize\r
73 );\r
06516768 74\r
fce4ecd9
MM
75/**\r
76 Acquire the acpi table from coreboot\r
77\r
78 @param pMemTable Pointer to the base address of the memory table\r
79 @param pMemTableSize Pointer to the size of the memory table\r
80\r
81 @retval RETURN_SUCCESS Successfully find out the memory table.\r
82 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
83 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
84\r
85**/\r
86RETURN_STATUS\r
3176d84f 87EFIAPI\r
fce4ecd9 88CbParseAcpiTable (\r
2e1fffce 89 IN VOID** pMemTable,\r
fce4ecd9
MM
90 IN UINT32* pMemTableSize\r
91 );\r
06516768 92\r
fce4ecd9
MM
93/**\r
94 Acquire the smbios table from coreboot\r
95\r
96 @param pMemTable Pointer to the base address of the memory table\r
97 @param pMemTableSize Pointer to the size of the memory table\r
98\r
99 @retval RETURN_SUCCESS Successfully find out the memory table.\r
100 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
101 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
102\r
103**/\r
104RETURN_STATUS\r
3176d84f 105EFIAPI\r
fce4ecd9
MM
106CbParseSmbiosTable (\r
107 IN VOID** pMemTable,\r
108 IN UINT32* pMemTableSize\r
109 );\r
06516768 110\r
fce4ecd9
MM
111/**\r
112 Find the required fadt information\r
113\r
114 @param pPmCtrlReg Pointer to the address of power management control register\r
115 @param pPmTimerReg Pointer to the address of power management timer register\r
116 @param pResetReg Pointer to the address of system reset register\r
06516768 117 @param pResetValue Pointer to the value to be written to the system reset register\r
cb3e201f
GD
118 @param pPmEvtReg Pointer to the address of power management event register\r
119 @param pPmGpeEnReg Pointer to the address of power management GPE enable register\r
fce4ecd9
MM
120\r
121 @retval RETURN_SUCCESS Successfully find out all the required fadt information.\r
122 @retval RETURN_NOT_FOUND Failed to find the fadt table.\r
123\r
124**/\r
125RETURN_STATUS\r
3176d84f 126EFIAPI\r
fce4ecd9
MM
127CbParseFadtInfo (\r
128 IN UINTN* pPmCtrlReg,\r
129 IN UINTN* pPmTimerReg,\r
130 IN UINTN* pResetReg,\r
cb3e201f
GD
131 IN UINTN* pResetValue,\r
132 IN UINTN* pPmEvtReg,\r
133 IN UINTN* pPmGpeEnReg\r
fce4ecd9 134 );\r
06516768 135\r
fce4ecd9
MM
136/**\r
137 Find the serial port information\r
138\r
139 @param pRegBase Pointer to the base address of serial port registers\r
140 @param pRegAccessType Pointer to the access type of serial port registers\r
06516768 141 @param pRegWidth Pointer to the register width in bytes\r
fce4ecd9 142 @param pBaudrate Pointer to the serial port baudrate\r
06516768
AC
143 @param pInputHertz Pointer to the input clock frequency\r
144 @param pUartPciAddr Pointer to the UART PCI bus, dev and func address\r
fce4ecd9
MM
145\r
146 @retval RETURN_SUCCESS Successfully find the serial port information.\r
147 @retval RETURN_NOT_FOUND Failed to find the serial port information .\r
148\r
149**/\r
150RETURN_STATUS\r
3176d84f 151EFIAPI\r
fce4ecd9 152CbParseSerialInfo (\r
06516768
AC
153 OUT UINT32 *pRegBase,\r
154 OUT UINT32 *pRegAccessType,\r
155 OUT UINT32 *pRegWidth,\r
156 OUT UINT32 *pBaudrate,\r
157 OUT UINT32 *pInputHertz,\r
158 OUT UINT32 *pUartPciAddr\r
fce4ecd9
MM
159 );\r
160\r
161/**\r
162 Search for the coreboot table header\r
163\r
164 @param Level Level of the search depth\r
165 @param HeaderPtr Pointer to the pointer of coreboot table header\r
166\r
167 @retval RETURN_SUCCESS Successfully find the coreboot table header .\r
168 @retval RETURN_NOT_FOUND Failed to find the coreboot table header .\r
169\r
170**/\r
171RETURN_STATUS\r
3176d84f 172EFIAPI\r
fce4ecd9
MM
173CbParseGetCbHeader (\r
174 IN UINTN Level,\r
175 IN VOID** HeaderPtr\r
176 );\r
06516768 177\r
fce4ecd9
MM
178/**\r
179 Find the video frame buffer information\r
180\r
181 @param pFbInfo Pointer to the FRAME_BUFFER_INFO structure\r
182\r
183 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
184 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
185\r
186**/\r
187RETURN_STATUS\r
3176d84f 188EFIAPI\r
fce4ecd9
MM
189CbParseFbInfo (\r
190 IN FRAME_BUFFER_INFO* pFbInfo\r
191 );\r
192\r