]> git.proxmox.com Git - mirror_edk2.git/blame - CorebootModulePkg/Include/Library/CbParseLib.h
Pkg-Module: CorebootModulePkg
[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
33 \r
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
48 IN UINT32 TableId, \r
49 IN VOID** pMemTable,\r
50 IN UINT32* pMemTableSize\r
51 );\r
52 \r
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
66 IN VOID** pMemTable,\r
67 IN UINT32* pMemTableSize\r
68 );\r
69 \r
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
86 \r
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
94\r
95 @retval RETURN_SUCCESS Successfully find out all the required fadt information.\r
96 @retval RETURN_NOT_FOUND Failed to find the fadt table.\r
97\r
98**/\r
99RETURN_STATUS\r
100CbParseFadtInfo (\r
101 IN UINTN* pPmCtrlReg,\r
102 IN UINTN* pPmTimerReg,\r
103 IN UINTN* pResetReg,\r
104 IN UINTN* pResetValue\r
105 );\r
106 \r
107/**\r
108 Find the serial port information\r
109\r
110 @param pRegBase Pointer to the base address of serial port registers\r
111 @param pRegAccessType Pointer to the access type of serial port registers\r
112 @param pBaudrate Pointer to the serial port baudrate\r
113\r
114 @retval RETURN_SUCCESS Successfully find the serial port information.\r
115 @retval RETURN_NOT_FOUND Failed to find the serial port information .\r
116\r
117**/\r
118RETURN_STATUS\r
119CbParseSerialInfo (\r
120 IN UINT32* pRegBase,\r
121 IN UINT32* pRegAccessType,\r
122 IN UINT32* pBaudrate\r
123 );\r
124\r
125/**\r
126 Search for the coreboot table header\r
127\r
128 @param Level Level of the search depth\r
129 @param HeaderPtr Pointer to the pointer of coreboot table header\r
130\r
131 @retval RETURN_SUCCESS Successfully find the coreboot table header .\r
132 @retval RETURN_NOT_FOUND Failed to find the coreboot table header .\r
133\r
134**/\r
135RETURN_STATUS\r
136CbParseGetCbHeader (\r
137 IN UINTN Level,\r
138 IN VOID** HeaderPtr\r
139 );\r
140 \r
141/**\r
142 Find the video frame buffer information\r
143\r
144 @param pFbInfo Pointer to the FRAME_BUFFER_INFO structure\r
145\r
146 @retval RETURN_SUCCESS Successfully find the video frame buffer information.\r
147 @retval RETURN_NOT_FOUND Failed to find the video frame buffer information .\r
148\r
149**/\r
150RETURN_STATUS\r
151CbParseFbInfo (\r
152 IN FRAME_BUFFER_INFO* pFbInfo\r
153 );\r
154\r