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