]> git.proxmox.com Git - mirror_edk2.git/blame - CorebootModulePkg/Include/Coreboot.h
FatBinPkg: Update EBC/IA32/X64/IPF binaries
[mirror_edk2.git] / CorebootModulePkg / Include / Coreboot.h
CommitLineData
fce4ecd9
MM
1/** @file\r
2 Coreboot PEI module include file.\r
3\r
165c0059 4 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
fce4ecd9
MM
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15/*\r
16 * This file is part of the libpayload project.\r
17 *\r
18 * Copyright (C) 2008 Advanced Micro Devices, Inc.\r
19 *\r
20 * Redistribution and use in source and binary forms, with or without\r
21 * modification, are permitted provided that the following conditions\r
22 * are met:\r
23 * 1. Redistributions of source code must retain the above copyright\r
24 * notice, this list of conditions and the following disclaimer.\r
25 * 2. Redistributions in binary form must reproduce the above copyright\r
26 * notice, this list of conditions and the following disclaimer in the\r
27 * documentation and/or other materials provided with the distribution.\r
28 * 3. The name of the author may not be used to endorse or promote products\r
29 * derived from this software without specific prior written permission.\r
30 *\r
31 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\r
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
41 * SUCH DAMAGE.\r
42 */\r
43\r
44\r
45#ifndef _COREBOOT_PEI_H_INCLUDED_\r
46#define _COREBOOT_PEI_H_INCLUDED_\r
47\r
08248f45 48#if defined(_MSC_VER)\r
fce4ecd9 49#pragma warning( disable : 4200 )\r
08248f45 50#endif\r
fce4ecd9
MM
51\r
52#define DYN_CBMEM_ALIGN_SIZE (4096)\r
53\r
165c0059
GD
54#define IMD_ENTRY_MAGIC (~0xC0389481)\r
55#define CBMEM_ENTRY_MAGIC (~0xC0389479)\r
56\r
fce4ecd9
MM
57struct cbmem_entry {\r
58 UINT32 magic;\r
59 UINT32 start;\r
60 UINT32 size;\r
61 UINT32 id;\r
62};\r
63\r
64struct cbmem_root {\r
65 UINT32 max_entries;\r
66 UINT32 num_entries;\r
67 UINT32 locked;\r
68 UINT32 size;\r
69 struct cbmem_entry entries[0];\r
70};\r
71\r
165c0059
GD
72struct imd_entry {\r
73 UINT32 magic;\r
74 UINT32 start_offset;\r
75 UINT32 size;\r
76 UINT32 id;\r
77};\r
78\r
79struct imd_root {\r
80 UINT32 max_entries;\r
81 UINT32 num_entries;\r
82 UINT32 flags;\r
83 UINT32 entry_align; \r
84 UINT32 max_offset;\r
85 struct imd_entry entries[0];\r
86};\r
87\r
fce4ecd9
MM
88struct cbuint64 {\r
89 UINT32 lo;\r
90 UINT32 hi;\r
91};\r
92\r
93#define CB_HEADER_SIGNATURE 0x4F49424C\r
94\r
95struct cb_header {\r
96 UINT32 signature;\r
97 UINT32 header_bytes;\r
98 UINT32 header_checksum;\r
99 UINT32 table_bytes;\r
100 UINT32 table_checksum;\r
101 UINT32 table_entries;\r
102};\r
103\r
104struct cb_record {\r
105 UINT32 tag;\r
106 UINT32 size;\r
107};\r
108\r
109#define CB_TAG_UNUSED 0x0000\r
110#define CB_TAG_MEMORY 0x0001\r
111\r
112struct cb_memory_range {\r
113 struct cbuint64 start;\r
114 struct cbuint64 size;\r
115 UINT32 type;\r
116};\r
117\r
118#define CB_MEM_RAM 1\r
119#define CB_MEM_RESERVED 2\r
120#define CB_MEM_ACPI 3\r
121#define CB_MEM_NVS 4\r
122#define CB_MEM_UNUSABLE 5\r
123#define CB_MEM_VENDOR_RSVD 6\r
124#define CB_MEM_TABLE 16\r
125\r
126struct cb_memory {\r
127 UINT32 tag;\r
128 UINT32 size;\r
129 struct cb_memory_range map[0];\r
130};\r
131\r
132#define CB_TAG_MAINBOARD 0x0003\r
133\r
134struct cb_mainboard {\r
135 UINT32 tag;\r
136 UINT32 size;\r
137 UINT8 vendor_idx;\r
138 UINT8 part_number_idx;\r
139 UINT8 strings[0];\r
140};\r
141#define CB_TAG_VERSION 0x0004\r
142#define CB_TAG_EXTRA_VERSION 0x0005\r
143#define CB_TAG_BUILD 0x0006\r
144#define CB_TAG_COMPILE_TIME 0x0007\r
145#define CB_TAG_COMPILE_BY 0x0008\r
146#define CB_TAG_COMPILE_HOST 0x0009\r
147#define CB_TAG_COMPILE_DOMAIN 0x000a\r
148#define CB_TAG_COMPILER 0x000b\r
149#define CB_TAG_LINKER 0x000c\r
150#define CB_TAG_ASSEMBLER 0x000d\r
151\r
152struct cb_string {\r
153 UINT32 tag;\r
154 UINT32 size;\r
155 UINT8 string[0];\r
156};\r
157\r
158#define CB_TAG_SERIAL 0x000f\r
159\r
160struct cb_serial {\r
161 UINT32 tag;\r
162 UINT32 size;\r
163#define CB_SERIAL_TYPE_IO_MAPPED 1\r
164#define CB_SERIAL_TYPE_MEMORY_MAPPED 2\r
165 UINT32 type;\r
166 UINT32 baseaddr;\r
167 UINT32 baud;\r
168};\r
169\r
170#define CB_TAG_CONSOLE 0x00010\r
171\r
172struct cb_console {\r
173 UINT32 tag;\r
174 UINT32 size;\r
175 UINT16 type;\r
176};\r
177\r
178#define CB_TAG_CONSOLE_SERIAL8250 0\r
179#define CB_TAG_CONSOLE_VGA 1 // OBSOLETE\r
180#define CB_TAG_CONSOLE_BTEXT 2 // OBSOLETE\r
181#define CB_TAG_CONSOLE_LOGBUF 3\r
182#define CB_TAG_CONSOLE_SROM 4 // OBSOLETE\r
183#define CB_TAG_CONSOLE_EHCI 5\r
184\r
185#define CB_TAG_FORWARD 0x00011\r
186\r
187struct cb_forward {\r
188 UINT32 tag;\r
189 UINT32 size;\r
190 UINT64 forward;\r
191};\r
192\r
193#define CB_TAG_FRAMEBUFFER 0x0012\r
194struct cb_framebuffer {\r
195 UINT32 tag;\r
196 UINT32 size;\r
197\r
198 UINT64 physical_address;\r
199 UINT32 x_resolution;\r
200 UINT32 y_resolution;\r
201 UINT32 bytes_per_line;\r
202 UINT8 bits_per_pixel;\r
203 UINT8 red_mask_pos;\r
204 UINT8 red_mask_size;\r
205 UINT8 green_mask_pos;\r
206 UINT8 green_mask_size;\r
207 UINT8 blue_mask_pos;\r
208 UINT8 blue_mask_size;\r
209 UINT8 reserved_mask_pos;\r
210 UINT8 reserved_mask_size;\r
211};\r
212\r
213#define CB_TAG_VDAT 0x0015\r
214struct cb_vdat {\r
215 UINT32 tag;\r
216 UINT32 size; /* size of the entire entry */\r
217 UINT64 vdat_addr;\r
218 UINT32 vdat_size;\r
219};\r
220\r
221#define CB_TAG_TIMESTAMPS 0x0016\r
222#define CB_TAG_CBMEM_CONSOLE 0x0017\r
223#define CB_TAG_MRC_CACHE 0x0018\r
224struct cb_cbmem_tab {\r
225 UINT32 tag;\r
226 UINT32 size;\r
227 UINT64 cbmem_tab;\r
228};\r
229\r
230/* Helpful macros */\r
231\r
232#define MEM_RANGE_COUNT(_rec) \\r
233 (((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0]))\r
234\r
235#define MEM_RANGE_PTR(_rec, _idx) \\r
236 (void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \\r
237 + (sizeof((_rec)->map[0]) * (_idx)))\r
238\r
239\r
240#endif // _COREBOOT_PEI_H_INCLUDED_\r