2 Intel FSP API definition from Intel Firmware Support Package External
3 Architecture Specification v1.1, April 2015, revision 001.
5 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #define FSP_STATUS EFI_STATUS
17 FSP Init continuation function prototype.
18 Control will be returned to this callback function after FspInit API call.
20 @param[in] Status Status of the FSP INIT API.
21 @param[in] HobBufferPtr Pointer to the HOB data structure defined in the PI specification.
25 (* CONTINUATION_PROC
) (
34 /// Base address of the microcode region.
36 UINT32 MicrocodeRegionBase
;
38 /// Length of the microcode region.
40 UINT32 MicrocodeRegionLength
;
42 /// Base address of the cacheable flash region.
44 UINT32 CodeRegionBase
;
46 /// Length of the cacheable flash region.
48 UINT32 CodeRegionLength
;
49 } FSP_TEMP_RAM_INIT_PARAMS
;
53 /// Non-volatile storage buffer pointer.
57 /// Runtime buffer pointer
61 /// Continuation function address
63 CONTINUATION_PROC ContinuationFunc
;
68 /// Stack top pointer used by the bootloader.
69 /// The new stack frame will be set up at this location after FspInit API call.
73 /// Current system boot mode.
77 /// User platform configuraiton data region pointer.
81 // Below field is added in FSP EAS v1.1
84 /// The size of memory to be reserved below the top of low usable memory (TOLUM)
85 /// for BootLoader usage. This is optional and value can be zero. If non-zero, the
86 /// size must be a multiple of 4KB.
88 UINT32 BootLoaderTolumSize
;
93 } FSP_INIT_RT_COMMON_BUFFER
;
97 /// Notification code for post PCI enuermation
99 EnumInitPhaseAfterPciEnumeration
= 0x20,
101 /// Notification code before transfering control to the payload
103 EnumInitPhaseReadyToBoot
= 0x40
108 /// Notification phase used for NotifyPhase API
110 FSP_INIT_PHASE Phase
;
111 } NOTIFY_PHASE_PARAMS
;
115 /// Non-volatile storage buffer pointer.
119 /// Runtime buffer pointer
123 /// Pointer to the HOB data structure defined in the PI specification
126 } FSP_MEMORY_INIT_PARAMS
;
131 This FSP API is called soon after coming out of reset and before memory and stack is
132 available. This FSP API will load the microcode update, enable code caching for the
133 region specified by the boot loader and also setup a temporary stack to be used until
134 main memory is initialized.
136 A hardcoded stack can be set up with the following values, and the "esp" register
137 initialized to point to this hardcoded stack.
138 1. The return address where the FSP will return control after setting up a temporary
140 2. A pointer to the input parameter structure
142 However, since the stack is in ROM and not writeable, this FSP API cannot be called
143 using the "call" instruction, but needs to be jumped to.
145 @param[in] TempRaminitParamPtr Address pointer to the FSP_TEMP_RAM_INIT_PARAMS structure.
147 @retval EFI_SUCCESS Temp RAM was initialized successfully.
148 @retval EFI_INVALID_PARAMETER Input parameters are invalid..
149 @retval EFI_NOT_FOUND No valid microcode was found in the microcode region.
150 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
151 @retval EFI_DEVICE_ERROR Temp RAM initialization failed.
153 If this function is successful, the FSP initializes the ECX and EDX registers to point to
154 a temporary but writeable memory range available to the boot loader and returns with
155 FSP_SUCCESS in register EAX. Register ECX points to the start of this temporary
156 memory range and EDX points to the end of the range. Boot loader is free to use the
157 whole range described. Typically the boot loader can reload the ESP register to point
158 to the end of this returned range so that it can be used as a standard stack.
162 (EFIAPI
*FSP_TEMP_RAM_INIT
) (
163 IN FSP_TEMP_RAM_INIT_PARAMS
*FspTempRamInitPtr
167 This FSP API is called after TempRamInitEntry. This FSP API initializes the memory,
168 the CPU and the chipset to enable normal operation of these devices. This FSP API
169 accepts a pointer to a data structure that will be platform dependent and defined for
170 each FSP binary. This will be documented in the Integration Guide for each FSP
172 The boot loader provides a continuation function as a parameter when calling FspInit.
173 After FspInit completes its execution, it does not return to the boot loader from where
174 it was called but instead returns control to the boot loader by calling the continuation
175 function which is passed to FspInit as an argument.
177 @param[in] FspInitParamPtr Address pointer to the FSP_INIT_PARAMS structure.
179 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
180 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
181 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
182 @retval EFI_DEVICE_ERROR FSP initialization failed.
187 IN OUT FSP_INIT_PARAMS
*FspInitParamPtr
190 #define FSP_FSP_INIT FSP_INIT
193 This FSP API is used to notify the FSP about the different phases in the boot process.
194 This allows the FSP to take appropriate actions as needed during different initialization
195 phases. The phases will be platform dependent and will be documented with the FSP
196 release. The current FSP supports two notify phases:
200 @param[in] NotifyPhaseParamPtr Address pointer to the NOTIFY_PHASE_PRAMS
202 @retval EFI_SUCCESS The notification was handled successfully.
203 @retval EFI_UNSUPPORTED The notification was not called in the proper order.
204 @retval EFI_INVALID_PARAMETER The notification code is invalid.
208 (EFIAPI
*FSP_NOTIFY_PHASE
) (
209 IN NOTIFY_PHASE_PARAMS
*NotifyPhaseParamPtr
213 This FSP API is called after TempRamInit and initializes the memory.
214 This FSP API accepts a pointer to a data structure that will be platform dependent
215 and defined for each FSP binary. This will be documented in Integration guide with
217 After FspMemInit completes its execution, it passes the pointer to the HobList and
218 returns to the boot loader from where it was called. BootLoader is responsible to
219 migrate it's stack and data to Memory.
220 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to
221 complete the silicon initialization and provides bootloader an opportunity to get
222 control after system memory is available and before the temporary RAM is torn down.
223 These APIs are mutually exclusive to the FspInit API.
225 @param[in][out] FspMemoryInitParamPtr Address pointer to the FSP_MEMORY_INIT_PARAMS
228 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
229 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
230 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
231 @retval EFI_DEVICE_ERROR FSP initialization failed.
235 (EFIAPI
*FSP_MEMORY_INIT
) (
236 IN OUT FSP_MEMORY_INIT_PARAMS
*FspMemoryInitParamPtr
241 This FSP API is called after FspMemoryInit API. This FSP API tears down the temporary
242 memory setup by TempRamInit API. This FSP API accepts a pointer to a data structure
243 that will be platform dependent and defined for each FSP binary. This will be
244 documented in Integration Guide.
245 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to
246 complete the silicon initialization and provides bootloader an opportunity to get
247 control after system memory is available and before the temporary RAM is torn down.
248 These APIs are mutually exclusive to the FspInit API.
250 @param[in][out] TempRamExitParamPtr Pointer to the Temp Ram Exit parameters structure.
251 This structure is normally defined in the Integration Guide.
252 And if it is not defined in the Integration Guide, pass NULL.
254 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
255 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
256 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
257 @retval EFI_DEVICE_ERROR FSP initialization failed.
261 (EFIAPI
*FSP_TEMP_RAM_EXIT
) (
262 IN OUT VOID
*TempRamExitParamPtr
267 This FSP API is called after TempRamExit API.
268 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the
269 silicon initialization.
270 These APIs are mutually exclusive to the FspInit API.
272 @param[in][out] FspSiliconInitParamPtr Pointer to the Silicon Init parameters structure.
273 This structure is normally defined in the Integration Guide.
274 And if it is not defined in the Integration Guide, pass NULL.
276 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
277 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
278 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
279 @retval EFI_DEVICE_ERROR FSP initialization failed.
283 (EFIAPI
*FSP_SILICON_INIT
) (
284 IN OUT VOID
*FspSiliconInitParamPtr
288 /// FSP API Return Status Code for backward compatibility with v1.0
290 #define FSP_SUCCESS EFI_SUCCESS
291 #define FSP_INVALID_PARAMETER EFI_INVALID_PARAMETER
292 #define FSP_UNSUPPORTED EFI_UNSUPPORTED
293 #define FSP_NOT_READY EFI_NOT_READY
294 #define FSP_DEVICE_ERROR EFI_DEVICE_ERROR
295 #define FSP_OUT_OF_RESOURCES EFI_OUT_OF_RESOURCES
296 #define FSP_VOLUME_CORRUPTED EFI_VOLUME_CORRUPTED
297 #define FSP_NOT_FOUND EFI_NOT_FOUND
298 #define FSP_TIMEOUT EFI_TIMEOUT
299 #define FSP_ABORTED EFI_ABORTED
300 #define FSP_INCOMPATIBLE_VERSION EFI_INCOMPATIBLE_VERSION
301 #define FSP_SECURITY_VIOLATION EFI_SECURITY_VIOLATION
302 #define FSP_CRC_ERROR EFI_CRC_ERROR