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