xref: /aosp_15_r20/external/coreboot/src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /** @file
2   Intel FSP Header File definition from Intel Firmware Support Package External
3   Architecture Specification v2.0.
4 
5   Copyright (c) 2014 - 2016, 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 
16 #ifndef __FSP_HEADER_FILE_H__
17 #define __FSP_HEADER_FILE_H__
18 
19 #define FSP_HEADER_REVISION_3   3
20 
21 #define FSPE_HEADER_REVISION_1  1
22 #define FSPP_HEADER_REVISION_1  1
23 
24 ///
25 /// Fixed FSP header offset in the FSP image
26 ///
27 #define FSP_INFO_HEADER_OFF    0x94
28 
29 #define OFFSET_IN_FSP_INFO_HEADER(x)  (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x
30 
31 #define FSP_INFO_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'H')
32 
33 #define FSP_SIG         0x48505346      /* 'FSPH' */
34 
35 #pragma pack(1)
36 
37 ///
38 /// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
39 ///
40 typedef struct {
41   ///
42   /// Byte 0x00: Signature ('FSPH') for the FSP Information Header.
43   ///
44   UINT32  Signature;
45   ///
46   /// Byte 0x04: Length of the FSP Information Header.
47   ///
48   UINT32  HeaderLength;
49   ///
50   /// Byte 0x08: Reserved.
51   ///
52   UINT8   Reserved1[2];
53   ///
54   /// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.
55   ///
56   UINT8   SpecVersion;
57   ///
58   /// Byte 0x0B: Revision of the FSP Information Header.
59   ///
60   UINT8   HeaderRevision;
61   ///
62   /// Byte 0x0C: Revision of the FSP binary.
63   ///
64   UINT32  ImageRevision;
65   ///
66   /// Byte 0x10: Signature string that will help match the FSP Binary to a supported HW configuration.
67   ///
68   CHAR8   ImageId[8];
69   ///
70   /// Byte 0x18: Size of the entire FSP binary.
71   ///
72   UINT32  ImageSize;
73   ///
74   /// Byte 0x1C: FSP binary preferred base address.
75   ///
76   UINT32  ImageBase;
77   ///
78   /// Byte 0x20: Attribute for the FSP binary.
79   ///
80   UINT16  ImageAttribute;
81   ///
82   /// Byte 0x22: Attributes of the FSP Component.
83   ///
84   UINT16  ComponentAttribute;
85   ///
86   /// Byte 0x24: Offset of the FSP configuration region.
87   ///
88   UINT32  CfgRegionOffset;
89   ///
90   /// Byte 0x28: Size of the FSP configuration region.
91   ///
92   UINT32  CfgRegionSize;
93   ///
94   /// Byte 0x2C: Reserved2.
95   ///
96   UINT32  Reserved2;
97   ///
98   /// Byte 0x30: The offset for the API to setup a temporary stack till the memory is initialized.
99   ///
100   UINT32  TempRamInitEntryOffset;
101   ///
102   /// Byte 0x34: Reserved3.
103   ///
104   UINT32  Reserved3;
105   ///
106   /// Byte 0x38: The offset for the API to inform the FSP about the different stages in the boot process.
107   ///
108   UINT32  NotifyPhaseEntryOffset;
109   ///
110   /// Byte 0x3C: The offset for the API to initialize the memory.
111   ///
112   UINT32  FspMemoryInitEntryOffset;
113   ///
114   /// Byte 0x40: The offset for the API to tear down temporary RAM.
115   ///
116   UINT32  TempRamExitEntryOffset;
117   ///
118   /// Byte 0x44: The offset for the API to initialize the CPU and chipset.
119   ///
120   UINT32  FspSiliconInitEntryOffset;
121 } FSP_INFO_HEADER;
122 
123 ///
124 /// Signature of the FSP Extended Header
125 ///
126 #define FSP_INFO_EXTENDED_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'E')
127 
128 ///
129 /// FSP Information Extended Header as described in FSP v2.0 Spec section 5.1.2.
130 ///
131 typedef struct {
132   ///
133   /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header.
134   ///
135   UINT32  Signature;
136   ///
137   /// Byte 0x04: Length of the table in bytes, including all additional FSP producer defined data.
138   ///
139   UINT32  Length;
140   ///
141   /// Byte 0x08: FSP producer defined revision of the table.
142   ///
143   UINT8   Revision;
144   ///
145   /// Byte 0x09: Reserved for future use.
146   ///
147   UINT8   Reserved;
148   ///
149   /// Byte 0x0A: FSP producer identification string
150   ///
151   CHAR8   FspProducerId[6];
152   ///
153   /// Byte 0x10: FSP producer implementation revision number. Larger numbers are assumed to be newer revisions.
154   ///
155   UINT32  FspProducerRevision;
156   ///
157   /// Byte 0x14: Size of the FSP producer defined data (n) in bytes.
158   ///
159   UINT32  FspProducerDataSize;
160   ///
161   /// Byte 0x18: FSP producer defined data of size (n) defined by FspProducerDataSize.
162   ///
163 } FSP_INFO_EXTENDED_HEADER;
164 
165 //
166 // A generic table search algorithm for additional tables can be implemented with a
167 // signature search algorithm until a terminator signature 'FSPP' is found.
168 //
169 #define FSP_FSPP_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'P')
170 #define FSP_PATCH_TABLE_SIGNATURE  FSP_FSPP_SIGNATURE
171 
172 ///
173 /// FSP Patch Table as described in FSP v2.0 Spec section 5.1.5.
174 ///
175 typedef struct {
176   ///
177   /// Byte 0x00: FSP Patch Table Signature "FSPP".
178   ///
179   UINT32  Signature;
180   ///
181   /// Byte 0x04: Size including the PatchData.
182   ///
183   UINT16  HeaderLength;
184   ///
185   /// Byte 0x06: Revision is set to 0x01.
186   ///
187   UINT8   HeaderRevision;
188   ///
189   /// Byte 0x07: Reserved for future use.
190   ///
191   UINT8   Reserved;
192   ///
193   /// Byte 0x08: Number of entries to Patch.
194   ///
195   UINT32  PatchEntryNum;
196   ///
197   /// Byte 0x0C: Patch Data.
198   ///
199 //UINT32  PatchData[];
200 } FSP_PATCH_TABLE;
201 
202 #pragma pack()
203 
204 extern EFI_GUID gFspHeaderFileGuid;
205 
206 #endif
207