summaryrefslogtreecommitdiffstats
path: root/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h
blob: e5a9d7a2b4bcd8b074b39df8cfee03073b9097a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
/** @file
  Intel FSP Header File definition from Intel Firmware Support Package External
  Architecture Specification v2.0 and above.

  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef __FSP_HEADER_FILE_H__
#define __FSP_HEADER_FILE_H__

#define FSP_HEADER_REVISION_3  3

#define FSPE_HEADER_REVISION_1  1
#define FSPP_HEADER_REVISION_1  1

///
/// Fixed FSP header offset in the FSP image
///
#define FSP_INFO_HEADER_OFF  0x94

#define OFFSET_IN_FSP_INFO_HEADER(x)  (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x

#define FSP_INFO_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'H')

#pragma pack(1)

///
/// FSP Information Header as described in FSP v2.0 Spec section 5.1.1.
///
typedef struct {
  ///
  /// Byte 0x00: Signature ('FSPH') for the FSP Information Header.
  ///
  UINT32    Signature;
  ///
  /// Byte 0x04: Length of the FSP Information Header.
  ///
  UINT32    HeaderLength;
  ///
  /// Byte 0x08: Reserved.
  ///
  UINT8     Reserved1[2];
  ///
  /// Byte 0x0A: Indicates compliance with a revision of this specification in the BCD format.
  ///            For revision v2.3 the value will be 0x23.
  ///
  UINT8     SpecVersion;
  ///
  /// Byte 0x0B: Revision of the FSP Information Header.
  ///            The Current value for this field is 0x6.
  ///
  UINT8     HeaderRevision;
  ///
  /// Byte 0x0C: Revision of the FSP binary.
  ///            Major.Minor.Revision.Build
  ///            If FSP HeaderRevision is <= 5, the ImageRevision can be decoded as follows:
  ///               7 : 0  - Build Number
  ///              15 : 8  - Revision
  ///              23 : 16 - Minor Version
  ///              31 : 24 - Major Version
  ///            If FSP HeaderRevision is >= 6, ImageRevision specifies the low-order bytes of the build number and revision
  ///            while ExtendedImageRevision specifies the high-order bytes of the build number and revision.
  ///               7 : 0  - Low Byte of Build Number
  ///              15 : 8  - Low Byte of Revision
  ///              23 : 16 - Minor Version
  ///              31 : 24 - Major Version
  ///
  UINT32    ImageRevision;
  ///
  /// Byte 0x10: Signature string that will help match the FSP Binary to a supported HW configuration.
  ///
  CHAR8     ImageId[8];
  ///
  /// Byte 0x18: Size of the entire FSP binary.
  ///
  UINT32    ImageSize;
  ///
  /// Byte 0x1C: FSP binary preferred base address.
  ///
  UINT32    ImageBase;
  ///
  /// Byte 0x20: Attribute for the FSP binary.
  ///
  UINT16    ImageAttribute;
  ///
  /// Byte 0x22: Attributes of the FSP Component.
  ///
  UINT16    ComponentAttribute;
  ///
  /// Byte 0x24: Offset of the FSP configuration region.
  ///
  UINT32    CfgRegionOffset;
  ///
  /// Byte 0x28: Size of the FSP configuration region.
  ///
  UINT32    CfgRegionSize;
  ///
  /// Byte 0x2C: Reserved2.
  ///
  UINT32    Reserved2;
  ///
  /// Byte 0x30: The offset for the API to setup a temporary stack till the memory is initialized.
  ///
  UINT32    TempRamInitEntryOffset;
  ///
  /// Byte 0x34: Reserved3.
  ///
  UINT32    Reserved3;
  ///
  /// Byte 0x38: The offset for the API to inform the FSP about the different stages in the boot process.
  ///
  UINT32    NotifyPhaseEntryOffset;
  ///
  /// Byte 0x3C: The offset for the API to initialize the memory.
  ///
  UINT32    FspMemoryInitEntryOffset;
  ///
  /// Byte 0x40: The offset for the API to tear down temporary RAM.
  ///
  UINT32    TempRamExitEntryOffset;
  ///
  /// Byte 0x44: The offset for the API to initialize the CPU and chipset.
  ///
  UINT32    FspSiliconInitEntryOffset;
  ///
  /// Byte 0x48: Offset for the API for the optional Multi-Phase processor and chipset initialization.
  ///            This value is only valid if FSP HeaderRevision is >= 5.
  ///            If the value is set to 0x00000000, then this API is not available in this component.
  ///
  UINT32    FspMultiPhaseSiInitEntryOffset;
  ///
  /// Byte 0x4C: Extended revision of the FSP binary.
  ///            This value is only valid if FSP HeaderRevision is >= 6.
  ///            ExtendedImageRevision specifies the high-order byte of the revision and build number in the FSP binary revision.
  ///               7 : 0 - High Byte of Build Number
  ///              15 : 8 - High Byte of Revision
  ///            The FSP binary build number can be decoded as follows:
  ///            Build Number = (ExtendedImageRevision[7:0] << 8) | ImageRevision[7:0]
  ///            Revision = (ExtendedImageRevision[15:8] << 8) | ImageRevision[15:8]
  ///            Minor Version = ImageRevision[23:16]
  ///            Major Version = ImageRevision[31:24]
  ///
  UINT16    ExtendedImageRevision;
  ///
  /// Byte 0x4E: Reserved4.
  ///
  UINT16    Reserved4;
} FSP_INFO_HEADER;

///
/// Signature of the FSP Extended Header
///
#define FSP_INFO_EXTENDED_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'E')

///
/// FSP Information Extended Header as described in FSP v2.0 Spec section 5.1.2.
///
typedef struct {
  ///
  /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header.
  ///
  UINT32    Signature;
  ///
  /// Byte 0x04: Length of the table in bytes, including all additional FSP producer defined data.
  ///
  UINT32    Length;
  ///
  /// Byte 0x08: FSP producer defined revision of the table.
  ///
  UINT8     Revision;
  ///
  /// Byte 0x09: Reserved for future use.
  ///
  UINT8     Reserved;
  ///
  /// Byte 0x0A: FSP producer identification string
  ///
  CHAR8     FspProducerId[6];
  ///
  /// Byte 0x10: FSP producer implementation revision number. Larger numbers are assumed to be newer revisions.
  ///
  UINT32    FspProducerRevision;
  ///
  /// Byte 0x14: Size of the FSP producer defined data (n) in bytes.
  ///
  UINT32    FspProducerDataSize;
  ///
  /// Byte 0x18: FSP producer defined data of size (n) defined by FspProducerDataSize.
  ///
} FSP_INFO_EXTENDED_HEADER;

//
// A generic table search algorithm for additional tables can be implemented with a
// signature search algorithm until a terminator signature 'FSPP' is found.
//
#define FSP_FSPP_SIGNATURE         SIGNATURE_32 ('F', 'S', 'P', 'P')
#define FSP_PATCH_TABLE_SIGNATURE  FSP_FSPP_SIGNATURE

///
/// FSP Patch Table as described in FSP v2.0 Spec section 5.1.5.
///
typedef struct {
  ///
  /// Byte 0x00: FSP Patch Table Signature "FSPP".
  ///
  UINT32    Signature;
  ///
  /// Byte 0x04: Size including the PatchData.
  ///
  UINT16    HeaderLength;
  ///
  /// Byte 0x06: Revision is set to 0x01.
  ///
  UINT8     HeaderRevision;
  ///
  /// Byte 0x07: Reserved for future use.
  ///
  UINT8     Reserved;
  ///
  /// Byte 0x08: Number of entries to Patch.
  ///
  UINT32    PatchEntryNum;
  ///
  /// Byte 0x0C: Patch Data.
  ///
  // UINT32  PatchData[];
} FSP_PATCH_TABLE;

#pragma pack()

extern EFI_GUID  gFspHeaderFileGuid;

#endif