]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFsp2Pkg/Include/Guid/FspHeaderFile.h
IntelFsp2WrapperPkg: Support 64bit FspResetType for X64 build.
[mirror_edk2.git] / IntelFsp2Pkg / Include / Guid / FspHeaderFile.h
CommitLineData
cf1d4549
JY
1/** @file\r
2 Intel FSP Header File definition from Intel Firmware Support Package External\r
f2cdb268 3 Architecture Specification v2.0 and above.\r
cf1d4549 4\r
00aa71ce 5 Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>\r
9672cd30 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
cf1d4549
JY
7\r
8**/\r
9\r
00aa71ce
TK
10#include <Base.h>\r
11\r
cf1d4549
JY
12#ifndef __FSP_HEADER_FILE_H__\r
13#define __FSP_HEADER_FILE_H__\r
14\r
111f2228 15#define FSP_HEADER_REVISION_3 3\r
cf1d4549
JY
16\r
17#define FSPE_HEADER_REVISION_1 1\r
18#define FSPP_HEADER_REVISION_1 1\r
19\r
20///\r
21/// Fixed FSP header offset in the FSP image\r
22///\r
111f2228 23#define FSP_INFO_HEADER_OFF 0x94\r
cf1d4549
JY
24\r
25#define OFFSET_IN_FSP_INFO_HEADER(x) (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x\r
26\r
27#define FSP_INFO_HEADER_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'H')\r
28\r
00aa71ce
TK
29#define IMAGE_ATTRIBUTE_GRAPHICS_SUPPORT BIT0\r
30#define IMAGE_ATTRIBUTE_DISPATCH_MODE_SUPPORT BIT1\r
31#define IMAGE_ATTRIBUTE_64BIT_MODE_SUPPORT BIT2\r
32#define FSP_IA32 0\r
33#define FSP_X64 1\r
34\r
cf1d4549
JY
35#pragma pack(1)\r
36\r
37///\r
38/// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.\r
39///\r
40typedef struct {\r
41 ///\r
42 /// Byte 0x00: Signature ('FSPH') for the FSP Information Header.\r
43 ///\r
111f2228 44 UINT32 Signature;\r
cf1d4549
JY
45 ///\r
46 /// Byte 0x04: Length of the FSP Information Header.\r
47 ///\r
111f2228 48 UINT32 HeaderLength;\r
cf1d4549
JY
49 ///\r
50 /// Byte 0x08: Reserved.\r
51 ///\r
111f2228 52 UINT8 Reserved1[2];\r
cf1d4549
JY
53 ///\r
54 /// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.\r
4cc1458d 55 /// For revision v2.3 the value will be 0x23.\r
cf1d4549 56 ///\r
111f2228 57 UINT8 SpecVersion;\r
cf1d4549
JY
58 ///\r
59 /// Byte 0x0B: Revision of the FSP Information Header.\r
00aa71ce 60 /// The Current value for this field is 0x7.\r
cf1d4549 61 ///\r
111f2228 62 UINT8 HeaderRevision;\r
cf1d4549
JY
63 ///\r
64 /// Byte 0x0C: Revision of the FSP binary.\r
4cc1458d
CC
65 /// Major.Minor.Revision.Build\r
66 /// If FSP HeaderRevision is <= 5, the ImageRevision can be decoded as follows:\r
67 /// 7 : 0 - Build Number\r
68 /// 15 : 8 - Revision\r
69 /// 23 : 16 - Minor Version\r
70 /// 31 : 24 - Major Version\r
71 /// If FSP HeaderRevision is >= 6, ImageRevision specifies the low-order bytes of the build number and revision\r
72 /// while ExtendedImageRevision specifies the high-order bytes of the build number and revision.\r
73 /// 7 : 0 - Low Byte of Build Number\r
74 /// 15 : 8 - Low Byte of Revision\r
75 /// 23 : 16 - Minor Version\r
76 /// 31 : 24 - Major Version\r
cf1d4549 77 ///\r
111f2228 78 UINT32 ImageRevision;\r
cf1d4549
JY
79 ///\r
80 /// Byte 0x10: Signature string that will help match the FSP Binary to a supported HW configuration.\r
81 ///\r
111f2228 82 CHAR8 ImageId[8];\r
cf1d4549
JY
83 ///\r
84 /// Byte 0x18: Size of the entire FSP binary.\r
85 ///\r
111f2228 86 UINT32 ImageSize;\r
cf1d4549
JY
87 ///\r
88 /// Byte 0x1C: FSP binary preferred base address.\r
89 ///\r
111f2228 90 UINT32 ImageBase;\r
cf1d4549
JY
91 ///\r
92 /// Byte 0x20: Attribute for the FSP binary.\r
00aa71ce
TK
93 /// Bit 0: Graphics Support - Set to 1 when FSP supports enabling Graphics Display.\r
94 /// Bit 1: Dispatch Mode Support - Set to 1 when FSP supports the optional Dispatch Mode API defined in Section 7.2 and 9. This bit is only valid if FSP HeaderRevision is >= 4.\r
95 /// Bit 2: 64-bit mode support - Set to 1 to indicate FSP supports 64-bit long mode interfaces. Set to 0 to indicate FSP supports 32-bit mode interfaces. This bit is only valid if FSP HeaderRevision is >= 7.\r
96 /// Bits 15:3 - Reserved\r
cf1d4549 97 ///\r
111f2228 98 UINT16 ImageAttribute;\r
cf1d4549
JY
99 ///\r
100 /// Byte 0x22: Attributes of the FSP Component.\r
101 ///\r
111f2228 102 UINT16 ComponentAttribute;\r
cf1d4549
JY
103 ///\r
104 /// Byte 0x24: Offset of the FSP configuration region.\r
105 ///\r
111f2228 106 UINT32 CfgRegionOffset;\r
cf1d4549
JY
107 ///\r
108 /// Byte 0x28: Size of the FSP configuration region.\r
109 ///\r
111f2228 110 UINT32 CfgRegionSize;\r
cf1d4549
JY
111 ///\r
112 /// Byte 0x2C: Reserved2.\r
113 ///\r
111f2228 114 UINT32 Reserved2;\r
cf1d4549
JY
115 ///\r
116 /// Byte 0x30: The offset for the API to setup a temporary stack till the memory is initialized.\r
117 ///\r
111f2228 118 UINT32 TempRamInitEntryOffset;\r
cf1d4549
JY
119 ///\r
120 /// Byte 0x34: Reserved3.\r
121 ///\r
111f2228 122 UINT32 Reserved3;\r
cf1d4549
JY
123 ///\r
124 /// Byte 0x38: The offset for the API to inform the FSP about the different stages in the boot process.\r
125 ///\r
111f2228 126 UINT32 NotifyPhaseEntryOffset;\r
cf1d4549
JY
127 ///\r
128 /// Byte 0x3C: The offset for the API to initialize the memory.\r
129 ///\r
111f2228 130 UINT32 FspMemoryInitEntryOffset;\r
cf1d4549
JY
131 ///\r
132 /// Byte 0x40: The offset for the API to tear down temporary RAM.\r
133 ///\r
111f2228 134 UINT32 TempRamExitEntryOffset;\r
cf1d4549
JY
135 ///\r
136 /// Byte 0x44: The offset for the API to initialize the CPU and chipset.\r
137 ///\r
111f2228 138 UINT32 FspSiliconInitEntryOffset;\r
f2cdb268
CC
139 ///\r
140 /// Byte 0x48: Offset for the API for the optional Multi-Phase processor and chipset initialization.\r
141 /// This value is only valid if FSP HeaderRevision is >= 5.\r
142 /// If the value is set to 0x00000000, then this API is not available in this component.\r
143 ///\r
111f2228 144 UINT32 FspMultiPhaseSiInitEntryOffset;\r
4cc1458d
CC
145 ///\r
146 /// Byte 0x4C: Extended revision of the FSP binary.\r
147 /// This value is only valid if FSP HeaderRevision is >= 6.\r
148 /// ExtendedImageRevision specifies the high-order byte of the revision and build number in the FSP binary revision.\r
149 /// 7 : 0 - High Byte of Build Number\r
150 /// 15 : 8 - High Byte of Revision\r
151 /// The FSP binary build number can be decoded as follows:\r
152 /// Build Number = (ExtendedImageRevision[7:0] << 8) | ImageRevision[7:0]\r
153 /// Revision = (ExtendedImageRevision[15:8] << 8) | ImageRevision[15:8]\r
154 /// Minor Version = ImageRevision[23:16]\r
155 /// Major Version = ImageRevision[31:24]\r
156 ///\r
111f2228 157 UINT16 ExtendedImageRevision;\r
4cc1458d
CC
158 ///\r
159 /// Byte 0x4E: Reserved4.\r
160 ///\r
111f2228 161 UINT16 Reserved4;\r
cf1d4549
JY
162} FSP_INFO_HEADER;\r
163\r
164///\r
165/// Signature of the FSP Extended Header\r
166///\r
167#define FSP_INFO_EXTENDED_HEADER_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'E')\r
168\r
169///\r
170/// FSP Information Extended Header as described in FSP v2.0 Spec section 5.1.2.\r
171///\r
172typedef struct {\r
173 ///\r
174 /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header.\r
175 ///\r
111f2228 176 UINT32 Signature;\r
cf1d4549
JY
177 ///\r
178 /// Byte 0x04: Length of the table in bytes, including all additional FSP producer defined data.\r
179 ///\r
111f2228 180 UINT32 Length;\r
cf1d4549
JY
181 ///\r
182 /// Byte 0x08: FSP producer defined revision of the table.\r
183 ///\r
111f2228 184 UINT8 Revision;\r
cf1d4549
JY
185 ///\r
186 /// Byte 0x09: Reserved for future use.\r
187 ///\r
111f2228 188 UINT8 Reserved;\r
cf1d4549 189 ///\r
e37bb20c 190 /// Byte 0x0A: FSP producer identification string\r
cf1d4549 191 ///\r
111f2228 192 CHAR8 FspProducerId[6];\r
cf1d4549
JY
193 ///\r
194 /// Byte 0x10: FSP producer implementation revision number. Larger numbers are assumed to be newer revisions.\r
195 ///\r
111f2228 196 UINT32 FspProducerRevision;\r
cf1d4549
JY
197 ///\r
198 /// Byte 0x14: Size of the FSP producer defined data (n) in bytes.\r
199 ///\r
111f2228 200 UINT32 FspProducerDataSize;\r
cf1d4549
JY
201 ///\r
202 /// Byte 0x18: FSP producer defined data of size (n) defined by FspProducerDataSize.\r
203 ///\r
204} FSP_INFO_EXTENDED_HEADER;\r
205\r
206//\r
207// A generic table search algorithm for additional tables can be implemented with a\r
208// signature search algorithm until a terminator signature 'FSPP' is found.\r
209//\r
111f2228 210#define FSP_FSPP_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'P')\r
cf1d4549
JY
211#define FSP_PATCH_TABLE_SIGNATURE FSP_FSPP_SIGNATURE\r
212\r
213///\r
214/// FSP Patch Table as described in FSP v2.0 Spec section 5.1.5.\r
215///\r
216typedef struct {\r
217 ///\r
218 /// Byte 0x00: FSP Patch Table Signature "FSPP".\r
219 ///\r
111f2228 220 UINT32 Signature;\r
cf1d4549
JY
221 ///\r
222 /// Byte 0x04: Size including the PatchData.\r
223 ///\r
111f2228 224 UINT16 HeaderLength;\r
cf1d4549
JY
225 ///\r
226 /// Byte 0x06: Revision is set to 0x01.\r
227 ///\r
111f2228 228 UINT8 HeaderRevision;\r
cf1d4549
JY
229 ///\r
230 /// Byte 0x07: Reserved for future use.\r
231 ///\r
111f2228 232 UINT8 Reserved;\r
cf1d4549
JY
233 ///\r
234 /// Byte 0x08: Number of entries to Patch.\r
235 ///\r
111f2228 236 UINT32 PatchEntryNum;\r
cf1d4549
JY
237 ///\r
238 /// Byte 0x0C: Patch Data.\r
239 ///\r
111f2228 240 // UINT32 PatchData[];\r
cf1d4549
JY
241} FSP_PATCH_TABLE;\r
242\r
243#pragma pack()\r
244\r
111f2228 245extern EFI_GUID gFspHeaderFileGuid;\r
cf1d4549
JY
246\r
247#endif\r