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