]> git.proxmox.com Git - mirror_edk2.git/blame - CorebootModulePkg/Include/Library/CbParseLib.h
CorebootPayloadPkg: Make EFI shell the last boot option.
[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
5 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
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
fce4ecd9
MM
20/**\r
21 Acquire the memory information from the coreboot table in memory.\r
22\r
2d90b74d 23 @param MemInfoCallback The callback routine\r
24 @param pParam Pointer to the callback routine parameter\r
fce4ecd9
MM
25\r
26 @retval RETURN_SUCCESS Successfully find out the memory information.\r
fce4ecd9
MM
27 @retval RETURN_NOT_FOUND Failed to find the memory information.\r
28\r
29**/\r
30RETURN_STATUS\r
31CbParseMemoryInfo (\r
2d90b74d 32 IN CB_MEM_INFO_CALLBACK MemInfoCallback,\r
33 IN VOID *pParam\r
fce4ecd9 34 );\r
24ca2f35 35
fce4ecd9
MM
36/**\r
37 Acquire the coreboot memory table with the given table id\r
38\r
39 @param TableId Table id to be searched\r
40 @param pMemTable Pointer to the base address of the memory table\r
41 @param pMemTableSize Pointer to the size of the memory table\r
42\r
43 @retval RETURN_SUCCESS Successfully find out the memory table.\r
44 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
45 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
46\r
47**/\r
48RETURN_STATUS\r
49CbParseCbMemTable (\r
24ca2f35 50 IN UINT32 TableId,
fce4ecd9
MM
51 IN VOID** pMemTable,\r
52 IN UINT32* pMemTableSize\r
53 );\r
24ca2f35 54
fce4ecd9
MM
55/**\r
56 Acquire the acpi table from coreboot\r
57\r
58 @param pMemTable Pointer to the base address of the memory table\r
59 @param pMemTableSize Pointer to the size of the memory table\r
60\r
61 @retval RETURN_SUCCESS Successfully find out the memory table.\r
62 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
63 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
64\r
65**/\r
66RETURN_STATUS\r
67CbParseAcpiTable (\r
2e1fffce 68 IN VOID** pMemTable,\r
fce4ecd9
MM
69 IN UINT32* pMemTableSize\r
70 );\r
24ca2f35 71
fce4ecd9
MM
72/**\r
73 Acquire the smbios table from coreboot\r
74\r
75 @param pMemTable Pointer to the base address of the memory table\r
76 @param pMemTableSize Pointer to the size of the memory table\r
77\r
78 @retval RETURN_SUCCESS Successfully find out the memory table.\r
79 @retval RETURN_INVALID_PARAMETER Invalid input parameters.\r
80 @retval RETURN_NOT_FOUND Failed to find the memory table.\r
81\r
82**/\r
83RETURN_STATUS\r
84CbParseSmbiosTable (\r
85 IN VOID** pMemTable,\r
86 IN UINT32* pMemTableSize\r
87 );\r
24ca2f35 88
fce4ecd9
MM
89/**\r
90 Find the required fadt information\r
91\r
92 @param pPmCtrlReg Pointer to the address of power management control register\r
93 @param pPmTimerReg Pointer to the address of power management timer register\r
94 @param pResetReg Pointer to the address of system reset register\r
95 @param pResetValue Pointer to the value to be writen to the system reset register\r
cb3e201f
GD
96 @param pPmEvtReg Pointer to the address of power management event register\r
97 @param pPmGpeEnReg Pointer to the address of power management GPE enable register\r
fce4ecd9
MM
98\r
99 @retval RETURN_SUCCESS Successfully find out all the required fadt information.\r
100 @retval RETURN_NOT_FOUND Failed to find the fadt table.\r
101\r
102**/\r
103RETURN_STATUS\r
104CbParseFadtInfo (\r
105 IN UINTN* pPmCtrlReg,\r
106 IN UINTN* pPmTimerReg,\r
107 IN UINTN* pResetReg,\r
cb3e201f
GD
108 IN UINTN* pResetValue,\r
109 IN UINTN* pPmEvtReg,\r
110 IN UINTN* pPmGpeEnReg\r
fce4ecd9 111 );\r
24ca2f35 112
fce4ecd9
MM
113/**\r
114 Find the serial port information\r
115\r
116 @param pRegBase Pointer to the base address of serial port registers\r
117 @param pRegAccessType Pointer to the access type of serial port registers\r
24ca2f35 118 @param pRegWidth Pointer to the register width in bytes
fce4ecd9 119 @param pBaudrate Pointer to the serial port baudrate\r
24ca2f35
LL
120 @param pInputHertz Pointer to the input clock frequency
121 @param pUartPciAddr Pointer to the UART PCI bus, dev and func address
fce4ecd9
MM
122\r
123 @retval RETURN_SUCCESS Successfully find the serial port information.\r
124 @retval RETURN_NOT_FOUND Failed to find the serial port information .\r
125\r
126**/\r
127RETURN_STATUS\r
128CbParseSerialInfo (\r
24ca2f35
LL
129 OUT UINT32 *pRegBase,
130 OUT UINT32 *pRegAccessType,
131 OUT UINT32 *pRegWidth,
132 OUT UINT32 *pBaudrate,
133 OUT UINT32 *pInputHertz,
134 OUT UINT32 *pUartPciAddr
fce4ecd9
MM
135 );\r
136\r
137/**\r
138 Search for the coreboot table header\r
139\r
140 @param Level Level of the search depth\r
141 @param HeaderPtr Pointer to the pointer of coreboot table header\r
142\r
143 @retval RETURN_SUCCESS Successfully find the coreboot table header .\r
144 @retval RETURN_NOT_FOUND Failed to find the coreboot table header .\r
145\r
146**/\r
147RETURN_STATUS\r
148CbParseGetCbHeader (\r
149 IN UINTN Level,\r
150 IN VOID** HeaderPtr\r
151 );\r
24ca2f35 152
fce4ecd9
MM
153/**\r
154 Find the video frame buffer information\r
155\r
156 @param pFbInfo Pointer to the FRAME_BUFFER_INFO structure\r
157\r
158 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
159 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
160\r
161**/\r
162RETURN_STATUS\r
163CbParseFbInfo (\r
164 IN FRAME_BUFFER_INFO* pFbInfo\r
165 );\r
166\r