1 /** @file
2   Intel FSP Info Header definition from Intel Firmware Support Package External
3   Architecture Specification v1.1, April 2015, revision 001.
4 
5   Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef _FSP_INFO_HEADER_H_
11 #define _FSP_INFO_HEADER_H_
12 
13 #define FSP_HEADER_REVISION_1   1
14 #define FSP_HEADER_REVISION_2   2
15 
16 #define FSPE_HEADER_REVISION_1  1
17 #define FSPP_HEADER_REVISION_1  1
18 
19 ///
20 /// Fixed FSP header offset in the FSP image
21 ///
22 #define  FSP_INFO_HEADER_OFF    0x94
23 
24 #define  OFFSET_IN_FSP_INFO_HEADER(x)  (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x
25 
26 #define FSP_INFO_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'H')
27 
28 #pragma pack(1)
29 
30 typedef struct  {
31   ///
32   /// Byte 0x00: Signature ('FSPH') for the FSP Information Header
33   ///
34   UINT32  Signature;
35   ///
36   /// Byte 0x04: Length of the FSP Information Header
37   ///
38   UINT32  HeaderLength;
39   ///
40   /// Byte 0x08: Reserved
41   ///
42   UINT8   Reserved1[3];
43   ///
44   /// Byte 0x0B: Revision of the FSP Information Header
45   ///
46   UINT8   HeaderRevision;
47   ///
48   /// Byte 0x0C: Revision of the FSP binary
49   ///
50   UINT32  ImageRevision;
51 
52 
53   ///
54   /// Byte 0x10: Signature string that will help match the FSP Binary to a supported
55   /// hardware configuration.
56   ///
57   CHAR8   ImageId[8];
58   ///
59   /// Byte 0x18: Size of the entire FSP binary
60   ///
61   UINT32  ImageSize;
62   ///
63   /// Byte 0x1C: FSP binary preferred base address
64   ///
65   UINT32  ImageBase;
66 
67 
68   ///
69   /// Byte 0x20: Attribute for the FSP binary
70   ///
71   UINT32  ImageAttribute;
72   ///
73   /// Byte 0x24: Offset of the FSP configuration region
74   ///
75   UINT32  CfgRegionOffset;
76   ///
77   /// Byte 0x28: Size of the FSP configuration region
78   ///
79   UINT32  CfgRegionSize;
80   ///
81   /// Byte 0x2C: Number of API entries this FSP supports
82   ///
83   UINT32  ApiEntryNum;
84 
85 
86   ///
87   /// Byte 0x30: The offset for the API to setup a temporary stack till the memory
88   ///            is initialized.
89   ///
90   UINT32  TempRamInitEntryOffset;
91   ///
92   /// Byte 0x34: The offset for the API to initialize the CPU and the chipset (SOC)
93   ///
94   UINT32  FspInitEntryOffset;
95   ///
96   /// Byte 0x38: The offset for the API to inform the FSP about the different stages
97   ///            in the boot process
98   ///
99   UINT32  NotifyPhaseEntryOffset;
100 
101   ///
102   /// Below fields are added in FSP Revision 2
103   ///
104 
105   ///
106   /// Byte 0x3C: The offset for the API to initialize the memory
107   ///
108   UINT32  FspMemoryInitEntryOffset;
109   ///
110   /// Byte 0x40: The offset for the API to tear down temporary RAM
111   ///
112   UINT32  TempRamExitEntryOffset;
113   ///
114   /// Byte 0x44: The offset for the API to initialize the CPU and chipset
115   ///
116   UINT32  FspSiliconInitEntryOffset;
117 
118 } FSP_INFO_HEADER;
119 
120 ///
121 /// Below structure is added in FSP version 2
122 ///
123 #define FSP_INFO_EXTENDED_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'E')
124 
125 typedef struct  {
126   ///
127   /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header
128   ///
129   UINT32  Signature;
130   ///
131   /// Byte 0x04: Length of the table in bytes, including all additional FSP producer defined data.
132   ///
133   UINT32  Length;
134   ///
135   /// Byte 0x08: FSP producer defined revision of the table.
136   ///
137   UINT8   Revision;
138   ///
139   /// Byte 0x09: Reserved for future use.
140   ///
141   UINT8   Reserved;
142   ///
143   /// Byte 0x0A: FSP producer identification string
144   ///
145   CHAR8   FspProducerId[6];
146   ///
147   /// Byte 0x10: FSP producer implementation revision number. Larger numbers are assumed to be newer revisions.
148   ///
149   UINT32  FspProducerRevision;
150   ///
151   /// Byte 0x14: Size of the FSP producer defined data (n) in bytes.
152   ///
153   UINT32  FspProducerDataSize;
154   ///
155   /// Byte 0x18: FSP producer defined data of size (n) defined by FspProducerDataSize.
156   ///
157 
158 } FSP_INFO_EXTENDED_HEADER;
159 
160 //
161 // A generic table search algorithm for additional tables can be implemented with a
162 // signature search algorithm until a terminator signature 'FSPP' is found.
163 //
164 #define FSP_FSPP_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'P')
165 
166 #pragma pack()
167 
168 #endif
169