]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFsp2Pkg/Include/FspEas/FspApi.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / IntelFsp2Pkg / Include / FspEas / FspApi.h
1 /** @file
2 Intel FSP API definition from Intel Firmware Support Package External
3 Architecture Specification v2.0 and above.
4
5 Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _FSP_API_H_
11 #define _FSP_API_H_
12
13 #include <Pi/PiStatusCode.h>
14 #include <Base.h>
15
16 ///
17 /// FSP Reset Status code
18 /// These are defined in FSP EAS v2.4 section 13.2.2 - OEM Status Code
19 /// @{
20
21 #define ENCODE_RESET_REQUEST(ResetType) \
22 ((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
23 #define FSP_STATUS_RESET_REQUIRED_COLD ENCODE_RESET_REQUEST(1)
24 #define FSP_STATUS_RESET_REQUIRED_WARM ENCODE_RESET_REQUEST(2)
25 #define FSP_STATUS_RESET_REQUIRED_3 ENCODE_RESET_REQUEST(3)
26 #define FSP_STATUS_RESET_REQUIRED_4 ENCODE_RESET_REQUEST(4)
27 #define FSP_STATUS_RESET_REQUIRED_5 ENCODE_RESET_REQUEST(5)
28 #define FSP_STATUS_RESET_REQUIRED_6 ENCODE_RESET_REQUEST(6)
29 #define FSP_STATUS_RESET_REQUIRED_7 ENCODE_RESET_REQUEST(7)
30 #define FSP_STATUS_RESET_REQUIRED_8 ENCODE_RESET_REQUEST(8)
31 #define FSP_STATUS_VARIABLE_REQUEST ENCODE_RESET_REQUEST(10)
32 /// @}
33
34 ///
35 /// FSP Event related definition.
36 ///
37 #define FSP_EVENT_CODE 0xF5000000
38 #define FSP_POST_CODE (FSP_EVENT_CODE | 0x00F80000)
39
40 /*
41 FSP may optionally include the capability of generating events messages to aid in the debugging of firmware issues.
42 These events fall under three catagories: Error, Progress, and Debug. The event reporting mechanism follows the
43 status code services described in section 6 and 7 of the PI Specification v1.7 Volume 3.
44
45 @param[in] Type Indicates the type of event being reported.
46 See MdePkg/Include/Pi/PiStatusCode.h for the definition of EFI_STATUS_CODE_TYPE.
47 @param[in] Value Describes the current status of a hardware or software entity.
48 This includes information about the class and subclass that is used to classify the entity as well as an operation.
49 For progress events, the operation is the current activity. For error events, it is the exception.
50 For debug events, it is not defined at this time.
51 See MdePkg/Include/Pi/PiStatusCode.h for the definition of EFI_STATUS_CODE_VALUE.
52 @param[in] Instance The enumeration of a hardware or software entity within the system.
53 A system may contain multiple entities that match a class/subclass pairing. The instance differentiates between them.
54 An instance of 0 indicates that instance information is unavailable, not meaningful, or not relevant.
55 Valid instance numbers start with 1.
56 @param[in] *CallerId This parameter can be used to identify the sub-module within the FSP generating the event.
57 This parameter may be NULL.
58 @param[in] *Data This optional parameter may be used to pass additional data. The contents can have event-specific data.
59 For example, the FSP provides a EFI_STATUS_CODE_STRING_DATA instance to this parameter when sending debug messages.
60 This parameter is NULL when no additional data is provided.
61
62 @retval EFI_SUCCESS The event was handled successfully.
63 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
64 @retval EFI_DEVICE_ERROR The event handler failed.
65 */
66 typedef
67 EFI_STATUS
68 (EFIAPI *FSP_EVENT_HANDLER)(
69 IN EFI_STATUS_CODE_TYPE Type,
70 IN EFI_STATUS_CODE_VALUE Value,
71 IN UINT32 Instance,
72 IN OPTIONAL EFI_GUID *CallerId,
73 IN OPTIONAL EFI_STATUS_CODE_DATA *Data
74 );
75
76 /*
77 Handler for FSP-T debug log messages, provided by the bootloader.
78
79 @param[in] DebugMessage A pointer to the debug message to be written to the log.
80 @param[in] MessageLength Number of bytes to written to the debug log.
81
82 @retval UINT32 The return value indicates the number of bytes actually written to
83 the debug log. If the return value is less than MessageLength,
84 an error occurred.
85 */
86 typedef
87 UINT32
88 (EFIAPI *FSP_DEBUG_HANDLER)(
89 IN CHAR8 *DebugMessage,
90 IN UINT32 MessageLength
91 );
92
93 #pragma pack(1)
94 ///
95 /// FSP_UPD_HEADER Configuration.
96 ///
97 typedef struct {
98 ///
99 /// UPD Region Signature. This signature will be
100 /// "XXXXXX_T" for FSP-T
101 /// "XXXXXX_M" for FSP-M
102 /// "XXXXXX_S" for FSP-S
103 /// "XXXXXX_I" for FSP-I
104 /// Where XXXXXX is an unique signature
105 ///
106 UINT64 Signature;
107 ///
108 /// Revision of the Data structure.
109 /// For FSP spec 2.0/2.1, this value is 1 and only FSPM_UPD having ARCH_UPD.
110 /// For FSP spec 2.2 and above, this value is 2 and ARCH_UPD present in all UPD structures.
111 ///
112 UINT8 Revision;
113 UINT8 Reserved[23];
114 } FSP_UPD_HEADER;
115
116 ///
117 /// FSPT_ARCH_UPD Configuration.
118 ///
119 typedef struct {
120 ///
121 /// Revision of the structure is 1 for this version of the specification.
122 ///
123 UINT8 Revision;
124 UINT8 Reserved[3];
125 ///
126 /// Length of the structure in bytes. The current value for this field is 32.
127 ///
128 UINT32 Length;
129 ///
130 /// FspDebugHandler Optional debug handler for the bootloader to receive debug messages
131 /// occurring during FSP execution.
132 ///
133 FSP_DEBUG_HANDLER FspDebugHandler;
134 UINT8 Reserved1[20];
135 } FSPT_ARCH_UPD;
136
137 ///
138 /// FSPT_ARCH2_UPD Configuration for FSP 2.4 and above.
139 ///
140 typedef struct {
141 ///
142 /// Revision of the structure is 2 for this version of the specification.
143 ///
144 UINT8 Revision;
145 UINT8 Reserved[3];
146 ///
147 /// Length of the structure in bytes. The current value for this field is 32.
148 ///
149 UINT32 Length;
150 ///
151 /// FspDebugHandler Optional debug handler for the bootloader to receive debug messages
152 /// occurring during FSP execution.
153 ///
154 EFI_PHYSICAL_ADDRESS FspDebugHandler;
155 UINT8 Reserved1[16];
156 } FSPT_ARCH2_UPD;
157
158 ///
159 /// FSPM_ARCH_UPD Configuration.
160 ///
161 typedef struct {
162 ///
163 /// Revision of the structure. For FSP v2.0 value is 1.
164 ///
165 UINT8 Revision;
166 UINT8 Reserved[3];
167 ///
168 /// Pointer to the non-volatile storage (NVS) data buffer.
169 /// If it is NULL it indicates the NVS data is not available.
170 ///
171 VOID *NvsBufferPtr;
172 ///
173 /// Pointer to the temporary stack base address to be
174 /// consumed inside FspMemoryInit() API.
175 ///
176 VOID *StackBase;
177 ///
178 /// Temporary stack size to be consumed inside
179 /// FspMemoryInit() API.
180 ///
181 UINT32 StackSize;
182 ///
183 /// Size of memory to be reserved by FSP below "top
184 /// of low usable memory" for bootloader usage.
185 ///
186 UINT32 BootLoaderTolumSize;
187 ///
188 /// Current boot mode.
189 ///
190 UINT32 BootMode;
191 ///
192 /// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
193 /// This value is only valid if Revision is >= 2.
194 ///
195 FSP_EVENT_HANDLER *FspEventHandler;
196 UINT8 Reserved1[4];
197 } FSPM_ARCH_UPD;
198
199 ///
200 /// FSPM_ARCH2_UPD Configuration for FSP 2.4 and above.
201 ///
202 typedef struct {
203 ///
204 /// Revision of the structure is 3 for this version of the specification.
205 ///
206 UINT8 Revision;
207 UINT8 Reserved[3];
208 ///
209 /// Length of the structure in bytes. The current value for this field is 64.
210 ///
211 UINT32 Length;
212 ///
213 /// Pointer to the non-volatile storage (NVS) data buffer.
214 /// If it is NULL it indicates the NVS data is not available.
215 /// This value is deprecated starting with v2.4 of the FSP specification,
216 /// and will be removed in an upcoming version of the FSP specification.
217 ///
218 EFI_PHYSICAL_ADDRESS NvsBufferPtr;
219 ///
220 /// Pointer to the temporary stack base address to be
221 /// consumed inside FspMemoryInit() API.
222 ///
223 EFI_PHYSICAL_ADDRESS StackBase;
224 ///
225 /// Temporary stack size to be consumed inside
226 /// FspMemoryInit() API.
227 ///
228 UINT64 StackSize;
229 ///
230 /// Size of memory to be reserved by FSP below "top
231 /// of low usable memory" for bootloader usage.
232 ///
233 UINT32 BootLoaderTolumSize;
234 ///
235 /// Current boot mode.
236 ///
237 UINT32 BootMode;
238 ///
239 /// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
240 /// This value is only valid if Revision is >= 2.
241 ///
242 EFI_PHYSICAL_ADDRESS FspEventHandler;
243 UINT8 Reserved1[16];
244 } FSPM_ARCH2_UPD;
245
246 ///
247 /// FSPS_ARCH_UPD Configuration.
248 ///
249 typedef struct {
250 ///
251 /// Revision of the structure is 1 for this version of the specification.
252 ///
253 UINT8 Revision;
254 UINT8 Reserved[3];
255 ///
256 /// Length of the structure in bytes. The current value for this field is 32.
257 ///
258 UINT32 Length;
259 ///
260 /// FspEventHandler Optional event handler for the bootloader to be informed of events
261 /// occurring during FSP execution.
262 ///
263 FSP_EVENT_HANDLER FspEventHandler;
264 ///
265 /// A FSP binary may optionally implement multi-phase silicon initialization,
266 /// This is only supported if the FspMultiPhaseSiInitEntryOffset field in FSP_INFO_HEADER
267 /// is non-zero.
268 /// To enable multi-phase silicon initialization, the bootloader must set
269 /// EnableMultiPhaseSiliconInit to a non-zero value.
270 ///
271 UINT8 EnableMultiPhaseSiliconInit;
272 UINT8 Reserved1[19];
273 } FSPS_ARCH_UPD;
274
275 ///
276 /// FSPS_ARCH2_UPD Configuration for FSP 2.4 and above.
277 ///
278 typedef struct {
279 ///
280 /// Revision of the structure is 2 for this version of the specification.
281 ///
282 UINT8 Revision;
283 UINT8 Reserved[3];
284 ///
285 /// Length of the structure in bytes. The current value for this field is 32.
286 ///
287 UINT32 Length;
288 ///
289 /// FspEventHandler Optional event handler for the bootloader to be informed of events
290 /// occurring during FSP execution.
291 ///
292 EFI_PHYSICAL_ADDRESS FspEventHandler;
293 UINT8 Reserved1[16];
294 } FSPS_ARCH2_UPD;
295
296 ///
297 /// FSPI_ARCH_UPD Configuration.
298 ///
299 typedef struct {
300 ///
301 /// Revision of the structure is 1 for this version of the specification.
302 ///
303 UINT8 Revision;
304 UINT8 Reserved[3];
305 ///
306 /// Length of the structure in bytes. The current value for this field is 64.
307 ///
308 UINT32 Length;
309 ///
310 /// The physical memory-mapped base address of the bootloader SMM firmware volume (FV).
311 ///
312 EFI_PHYSICAL_ADDRESS BootloaderSmmFvBaseAddress;
313 ///
314 /// The length in bytes of the bootloader SMM firmware volume (FV).
315 ///
316 UINT64 BootloaderSmmFvLength;
317 ///
318 /// The physical memory-mapped base address of the bootloader SMM FV context data.
319 /// This data is provided to bootloader SMM drivers through a HOB by the FSP MM Foundation.
320 ///
321 EFI_PHYSICAL_ADDRESS BootloaderSmmFvContextData;
322 ///
323 /// The length in bytes of the bootloader SMM FV context data.
324 /// This data is provided to bootloader SMM drivers through a HOB by the FSP MM Foundation.
325 ///
326 UINT16 BootloaderSmmFvContextDataLength;
327 UINT8 Reserved1[30];
328 } FSPI_ARCH_UPD;
329
330 ///
331 /// FSPT_UPD_COMMON Configuration.
332 ///
333 typedef struct {
334 ///
335 /// FSP_UPD_HEADER Configuration.
336 ///
337 FSP_UPD_HEADER FspUpdHeader;
338 } FSPT_UPD_COMMON;
339
340 ///
341 /// FSPT_UPD_COMMON Configuration for FSP spec. 2.2 and above.
342 ///
343 typedef struct {
344 ///
345 /// FSP_UPD_HEADER Configuration.
346 ///
347 FSP_UPD_HEADER FspUpdHeader;
348
349 ///
350 /// FSPT_ARCH_UPD Configuration.
351 ///
352 FSPT_ARCH_UPD FsptArchUpd;
353 } FSPT_UPD_COMMON_FSP22;
354
355 ///
356 /// FSPT_UPD_COMMON Configuration for FSP spec. 2.4 and above.
357 ///
358 typedef struct {
359 ///
360 /// FSP_UPD_HEADER Configuration.
361 ///
362 FSP_UPD_HEADER FspUpdHeader;
363
364 ///
365 /// FSPT_ARCH2_UPD Configuration.
366 ///
367 FSPT_ARCH2_UPD FsptArchUpd;
368 } FSPT_UPD_COMMON_FSP24;
369
370 ///
371 /// FSPM_UPD_COMMON Configuration.
372 ///
373 typedef struct {
374 ///
375 /// FSP_UPD_HEADER Configuration.
376 ///
377 FSP_UPD_HEADER FspUpdHeader;
378 ///
379 /// FSPM_ARCH_UPD Configuration.
380 ///
381 FSPM_ARCH_UPD FspmArchUpd;
382 } FSPM_UPD_COMMON;
383
384 ///
385 /// FSPM_UPD_COMMON Configuration for FSP spec. 2.4 and above.
386 ///
387 typedef struct {
388 ///
389 /// FSP_UPD_HEADER Configuration.
390 ///
391 FSP_UPD_HEADER FspUpdHeader;
392 ///
393 /// FSPM_ARCH2_UPD Configuration.
394 ///
395 FSPM_ARCH2_UPD FspmArchUpd;
396 } FSPM_UPD_COMMON_FSP24;
397
398 ///
399 /// FSPS_UPD_COMMON Configuration.
400 ///
401 typedef struct {
402 ///
403 /// FSP_UPD_HEADER Configuration.
404 ///
405 FSP_UPD_HEADER FspUpdHeader;
406 } FSPS_UPD_COMMON;
407
408 ///
409 /// FSPS_UPD_COMMON Configuration for FSP spec. 2.2 and above.
410 ///
411 typedef struct {
412 ///
413 /// FSP_UPD_HEADER Configuration.
414 ///
415 FSP_UPD_HEADER FspUpdHeader;
416
417 ///
418 /// FSPS_ARCH_UPD Configuration.
419 ///
420 FSPS_ARCH_UPD FspsArchUpd;
421 } FSPS_UPD_COMMON_FSP22;
422
423 ///
424 /// FSPS_UPD_COMMON Configuration for FSP spec. 2.4 and above.
425 ///
426 typedef struct {
427 ///
428 /// FSP_UPD_HEADER Configuration.
429 ///
430 FSP_UPD_HEADER FspUpdHeader;
431
432 ///
433 /// FSPS_ARCH2_UPD Configuration.
434 ///
435 FSPS_ARCH2_UPD FspsArchUpd;
436 } FSPS_UPD_COMMON_FSP24;
437
438 ///
439 /// FSPI_UPD_COMMON Configuration.
440 ///
441 typedef struct {
442 ///
443 /// FSP_UPD_HEADER Configuration.
444 ///
445 FSP_UPD_HEADER FspUpdHeader;
446
447 ///
448 /// FSPI_ARCH_UPD Configuration.
449 ///
450 FSPI_ARCH_UPD FspiArchUpd;
451 } FSPI_UPD_COMMON;
452
453 ///
454 /// Enumeration of FSP_INIT_PHASE for NOTIFY_PHASE.
455 ///
456 typedef enum {
457 ///
458 /// This stage is notified when the bootloader completes the
459 /// PCI enumeration and the resource allocation for the
460 /// PCI devices is complete.
461 ///
462 EnumInitPhaseAfterPciEnumeration = 0x20,
463 ///
464 /// This stage is notified just before the bootloader hand-off
465 /// to the OS loader.
466 ///
467 EnumInitPhaseReadyToBoot = 0x40,
468 ///
469 /// This stage is notified just before the firmware/Preboot
470 /// environment transfers management of all system resources
471 /// to the OS or next level execution environment.
472 ///
473 EnumInitPhaseEndOfFirmware = 0xF0
474 } FSP_INIT_PHASE;
475
476 ///
477 /// Definition of NOTIFY_PHASE_PARAMS.
478 ///
479 typedef struct {
480 ///
481 /// Notification phase used for NotifyPhase API
482 ///
483 FSP_INIT_PHASE Phase;
484 } NOTIFY_PHASE_PARAMS;
485
486 ///
487 /// Action definition for FspMultiPhaseSiInit API
488 ///
489 typedef enum {
490 EnumMultiPhaseGetNumberOfPhases = 0x0,
491 EnumMultiPhaseExecutePhase = 0x1,
492 EnumMultiPhaseGetVariableRequestInfo = 0x2,
493 EnumMultiPhaseCompleteVariableRequest = 0x3
494 } FSP_MULTI_PHASE_ACTION;
495
496 typedef enum {
497 EnumFspVariableRequestGetVariable = 0x0,
498 EnumFspVariableRequestGetNextVariableName = 0x1,
499 EnumFspVariableRequestSetVariable = 0x2,
500 EnumFspVariableRequestQueryVariableInfo = 0x3
501 } FSP_VARIABLE_REQUEST_TYPE;
502
503 #pragma pack(16)
504 typedef struct {
505 IN FSP_VARIABLE_REQUEST_TYPE VariableRequest;
506 IN OUT CHAR16 *VariableName;
507 IN OUT UINT64 *VariableNameSize;
508 IN OUT EFI_GUID *VariableGuid;
509 IN OUT UINT32 *Attributes;
510 IN OUT UINT64 *DataSize;
511 IN OUT VOID *Data;
512 OUT UINT64 *MaximumVariableStorageSize;
513 OUT UINT64 *RemainingVariableStorageSize;
514 OUT UINT64 *MaximumVariableSize;
515 } FSP_MULTI_PHASE_VARIABLE_REQUEST_INFO_PARAMS;
516
517 typedef struct {
518 EFI_STATUS VariableRequestStatus;
519 } FSP_MULTI_PHASE_COMPLETE_VARIABLE_REQUEST_PARAMS;
520 #pragma pack()
521
522 ///
523 /// Data structure returned by FSP when bootloader calling
524 /// FspMultiPhaseSiInit API with action 0 (EnumMultiPhaseGetNumberOfPhases)
525 ///
526 typedef struct {
527 UINT32 NumberOfPhases;
528 UINT32 PhasesExecuted;
529 } FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS;
530
531 ///
532 /// FspMultiPhaseSiInit function parameter.
533 ///
534 /// For action 0 (EnumMultiPhaseGetNumberOfPhases):
535 /// - PhaseIndex must be 0.
536 /// - MultiPhaseParamPtr should point to an instance of FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS.
537 ///
538 /// For action 1 (EnumMultiPhaseExecutePhase):
539 /// - PhaseIndex will be the phase that will be executed by FSP.
540 /// - MultiPhaseParamPtr shall be NULL.
541 ///
542 typedef struct {
543 IN FSP_MULTI_PHASE_ACTION MultiPhaseAction;
544 IN UINT32 PhaseIndex;
545 IN OUT VOID *MultiPhaseParamPtr;
546 } FSP_MULTI_PHASE_PARAMS;
547
548 #pragma pack()
549
550 /**
551 This FSP API is called soon after coming out of reset and before memory and stack is
552 available. This FSP API will load the microcode update, enable code caching for the
553 region specified by the boot loader and also setup a temporary stack to be used until
554 main memory is initialized.
555
556 A hardcoded stack can be set up with the following values, and the "esp" register
557 initialized to point to this hardcoded stack.
558 1. The return address where the FSP will return control after setting up a temporary
559 stack.
560 2. A pointer to the input parameter structure
561
562 However, since the stack is in ROM and not writeable, this FSP API cannot be called
563 using the "call" instruction, but needs to be jumped to.
564
565 @param[in] FsptUpdDataPtr Pointer to the FSPT_UPD data structure.
566
567 @retval EFI_SUCCESS Temporary RAM was initialized successfully.
568 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
569 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
570 @retval EFI_DEVICE_ERROR Temp RAM initialization failed.
571
572 If this function is successful, the FSP initializes the ECX and EDX registers to point to
573 a temporary but writeable memory range available to the boot loader and returns with
574 FSP_SUCCESS in register EAX. Register ECX points to the start of this temporary
575 memory range and EDX points to the end of the range. Boot loader is free to use the
576 whole range described. Typically the boot loader can reload the ESP register to point
577 to the end of this returned range so that it can be used as a standard stack.
578 **/
579 typedef
580 EFI_STATUS
581 (EFIAPI *FSP_TEMP_RAM_INIT)(
582 IN VOID *FsptUpdDataPtr
583 );
584
585 /**
586 This FSP API is used to notify the FSP about the different phases in the boot process.
587 This allows the FSP to take appropriate actions as needed during different initialization
588 phases. The phases will be platform dependent and will be documented with the FSP
589 release. The current FSP supports two notify phases:
590 Post PCI enumeration
591 Ready To Boot
592
593 @param[in] NotifyPhaseParamPtr Address pointer to the NOTIFY_PHASE_PRAMS
594
595 @retval EFI_SUCCESS The notification was handled successfully.
596 @retval EFI_UNSUPPORTED The notification was not called in the proper order.
597 @retval EFI_INVALID_PARAMETER The notification code is invalid.
598 **/
599 typedef
600 EFI_STATUS
601 (EFIAPI *FSP_NOTIFY_PHASE)(
602 IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr
603 );
604
605 /**
606 This FSP API is called after TempRamInit and initializes the memory.
607 This FSP API accepts a pointer to a data structure that will be platform dependent
608 and defined for each FSP binary. This will be documented in Integration guide with
609 each FSP release.
610 After FspMemInit completes its execution, it passes the pointer to the HobList and
611 returns to the boot loader from where it was called. BootLoader is responsible to
612 migrate its stack and data to Memory.
613 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to
614 complete the silicon initialization and provides bootloader an opportunity to get
615 control after system memory is available and before the temporary RAM is torn down.
616
617 @param[in] FspmUpdDataPtr Pointer to the FSPM_UPD data structure.
618 @param[out] HobListPtr Pointer to receive the address of the HOB list.
619
620 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
621 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
622 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
623 @retval EFI_DEVICE_ERROR FSP initialization failed.
624 @retval EFI_OUT_OF_RESOURCES Stack range requested by FSP is not met.
625 @retval FSP_STATUS_RESET_REQUIREDx A reset is required. These status codes will not be returned during S3.
626 **/
627 typedef
628 EFI_STATUS
629 (EFIAPI *FSP_MEMORY_INIT)(
630 IN VOID *FspmUpdDataPtr,
631 OUT VOID **HobListPtr
632 );
633
634 /**
635 This FSP API is called after FspMemoryInit API. This FSP API tears down the temporary
636 memory setup by TempRamInit API. This FSP API accepts a pointer to a data structure
637 that will be platform dependent and defined for each FSP binary. This will be
638 documented in Integration Guide.
639 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to
640 complete the silicon initialization and provides bootloader an opportunity to get
641 control after system memory is available and before the temporary RAM is torn down.
642
643 @param[in] TempRamExitParamPtr Pointer to the Temp Ram Exit parameters structure.
644 This structure is normally defined in the Integration Guide.
645 And if it is not defined in the Integration Guide, pass NULL.
646
647 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
648 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
649 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
650 @retval EFI_DEVICE_ERROR FSP initialization failed.
651 **/
652 typedef
653 EFI_STATUS
654 (EFIAPI *FSP_TEMP_RAM_EXIT)(
655 IN VOID *TempRamExitParamPtr
656 );
657
658 /**
659 This FSP API is called after TempRamExit API.
660 FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the
661 silicon initialization.
662
663 @param[in] FspsUpdDataPtr Pointer to the FSPS_UPD data structure.
664 If NULL, FSP will use the default parameters.
665
666 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
667 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
668 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
669 @retval EFI_DEVICE_ERROR FSP initialization failed.
670 @retval FSP_STATUS_RESET_REQUIREDx A reset is required. These status codes will not be returned during S3.
671 **/
672 typedef
673 EFI_STATUS
674 (EFIAPI *FSP_SILICON_INIT)(
675 IN VOID *FspsUpdDataPtr
676 );
677
678 /**
679 This FSP API is expected to be called after FspSiliconInit but before FspNotifyPhase.
680 This FSP API provides multi-phase silicon initialization; which brings greater modularity
681 beyond the existing FspSiliconInit() API. Increased modularity is achieved by adding an
682 extra API to FSP-S. This allows the bootloader to add board specific initialization steps
683 throughout the SiliconInit flow as needed.
684
685 @param[in,out] FSP_MULTI_PHASE_PARAMS For action - EnumMultiPhaseGetNumberOfPhases:
686 FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr will contain
687 how many phases supported by FSP.
688 For action - EnumMultiPhaseExecutePhase:
689 FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr shall be NULL.
690 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
691 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
692 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
693 @retval EFI_DEVICE_ERROR FSP initialization failed.
694 @retval FSP_STATUS_RESET_REQUIREDx A reset is required. These status codes will not be returned during S3.
695 **/
696 typedef
697 EFI_STATUS
698 (EFIAPI *FSP_MULTI_PHASE_SI_INIT)(
699 IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr
700 );
701
702 /**
703 This FSP API initializes SMM and provide any OS runtime silicon services,
704 including Reliability, Availability, and Serviceability (RAS) features implemented by the CPU.
705
706 @param[in] FspiUpdDataPtr Pointer to the FSPI_UPD data structure.
707 If NULL, FSP will use the default parameters.
708
709 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
710 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
711 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
712 @retval EFI_DEVICE_ERROR FSP initialization failed.
713 @retval FSP_STATUS_RESET_REQUIREDx A reset is required. These status codes will not be returned during S3.
714 **/
715 typedef
716 EFI_STATUS
717 (EFIAPI *FSP_SMM_INIT)(
718 IN VOID *FspiUpdDataPtr
719 );
720
721 /**
722 This FSP API provides multi-phase memory and silicon initialization, which brings greater modularity to the existing
723 FspMemoryInit() and FspSiliconInit() API. Increased modularity is achieved by adding an extra API to FSP-M and FSP-S.
724 This allows the bootloader to add board specific initialization steps throughout the MemoryInit and SiliconInit flows as needed.
725 The FspMemoryInit() API is always called before FspMultiPhaseMemInit(); it is the first phase of memory initialization. Similarly,
726 the FspSiliconInit() API is always called before FspMultiPhaseSiInit(); it is the first phase of silicon initialization.
727 After the first phase, subsequent phases are invoked by calling the FspMultiPhaseMem/SiInit() API.
728 The FspMultiPhaseMemInit() API may only be called after the FspMemoryInit() API and before the FspSiliconInit() API;
729 or in the case that FSP-T is being used, before the TempRamExit() API. The FspMultiPhaseSiInit() API may only be called after
730 the FspSiliconInit() API and before NotifyPhase() API; or in the case that FSP-I is being used, before the FspSmmInit() API.
731 The multi-phase APIs may not be called at any other time.
732
733 @param[in,out] FSP_MULTI_PHASE_PARAMS For action - EnumMultiPhaseGetNumberOfPhases:
734 FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr will contain
735 how many phases supported by FSP.
736 For action - EnumMultiPhaseExecutePhase:
737 FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr shall be NULL.
738 @retval EFI_SUCCESS FSP execution environment was initialized successfully.
739 @retval EFI_INVALID_PARAMETER Input parameters are invalid.
740 @retval EFI_UNSUPPORTED The FSP calling conditions were not met.
741 @retval EFI_DEVICE_ERROR FSP initialization failed.
742 @retval FSP_STATUS_RESET_REQUIRED_* A reset is required. These status codes will not be returned during S3.
743 @retval FSP_STATUS_VARIABLE_REQUEST A variable request has been made by FSP that needs boot loader handling.
744 **/
745 typedef
746 EFI_STATUS
747 (EFIAPI *FSP_MULTI_PHASE_INIT)(
748 IN FSP_MULTI_PHASE_PARAMS *MultiPhaseInitParamPtr
749 );
750
751 #endif