]>
Commit | Line | Data |
---|---|---|
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 | 17 | typedef 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 | |
28 | @retval Others The poiter to the record found.\r | |
29 | \r | |
30 | **/\r | |
31 | VOID *\r | |
32 | EFIAPI\r | |
33 | FindCbTag (\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 | |
48 | RETURN_STATUS\r | |
3176d84f | 49 | EFIAPI\r |
fce4ecd9 | 50 | CbParseMemoryInfo (\r |
2d90b74d | 51 | IN CB_MEM_INFO_CALLBACK MemInfoCallback,\r |
52 | IN VOID *pParam\r | |
fce4ecd9 | 53 | );\r |
24ca2f35 | 54 | |
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 | |
67 | RETURN_STATUS\r | |
3176d84f | 68 | EFIAPI\r |
fce4ecd9 | 69 | CbParseCbMemTable (\r |
24ca2f35 | 70 | IN UINT32 TableId, |
fce4ecd9 MM |
71 | IN VOID** pMemTable,\r |
72 | IN UINT32* pMemTableSize\r | |
73 | );\r | |
24ca2f35 | 74 | |
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 | |
86 | RETURN_STATUS\r | |
3176d84f | 87 | EFIAPI\r |
fce4ecd9 | 88 | CbParseAcpiTable (\r |
2e1fffce | 89 | IN VOID** pMemTable,\r |
fce4ecd9 MM |
90 | IN UINT32* pMemTableSize\r |
91 | );\r | |
24ca2f35 | 92 | |
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 | |
104 | RETURN_STATUS\r | |
3176d84f | 105 | EFIAPI\r |
fce4ecd9 MM |
106 | CbParseSmbiosTable (\r |
107 | IN VOID** pMemTable,\r | |
108 | IN UINT32* pMemTableSize\r | |
109 | );\r | |
24ca2f35 | 110 | |
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 | |
117 | @param pResetValue Pointer to the value to be writen 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 | |
125 | RETURN_STATUS\r | |
3176d84f | 126 | EFIAPI\r |
fce4ecd9 MM |
127 | CbParseFadtInfo (\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 |
24ca2f35 | 135 | |
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 | |
24ca2f35 | 141 | @param pRegWidth Pointer to the register width in bytes |
fce4ecd9 | 142 | @param pBaudrate Pointer to the serial port baudrate\r |
24ca2f35 LL |
143 | @param pInputHertz Pointer to the input clock frequency |
144 | @param pUartPciAddr Pointer to the UART PCI bus, dev and func address | |
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 | |
150 | RETURN_STATUS\r | |
3176d84f | 151 | EFIAPI\r |
fce4ecd9 | 152 | CbParseSerialInfo (\r |
24ca2f35 LL |
153 | OUT UINT32 *pRegBase, |
154 | OUT UINT32 *pRegAccessType, | |
155 | OUT UINT32 *pRegWidth, | |
156 | OUT UINT32 *pBaudrate, | |
157 | OUT UINT32 *pInputHertz, | |
158 | OUT UINT32 *pUartPciAddr | |
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 | |
171 | RETURN_STATUS\r | |
3176d84f | 172 | EFIAPI\r |
fce4ecd9 MM |
173 | CbParseGetCbHeader (\r |
174 | IN UINTN Level,\r | |
175 | IN VOID** HeaderPtr\r | |
176 | );\r | |
24ca2f35 | 177 | |
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 | |
187 | RETURN_STATUS\r | |
3176d84f | 188 | EFIAPI\r |
fce4ecd9 MM |
189 | CbParseFbInfo (\r |
190 | IN FRAME_BUFFER_INFO* pFbInfo\r | |
191 | );\r | |
192 | \r |