TianoCore EDK2 master
Loading...
Searching...
No Matches
FspApi.h File Reference
#include <Pi/PiStatusCode.h>
#include <Base.h>

Go to the source code of this file.

Data Structures

struct  FSP_UPD_HEADER
 
struct  FSPT_ARCH_UPD
 
struct  FSPT_ARCH2_UPD
 
struct  FSPM_ARCH_UPD
 
struct  FSPM_ARCH2_UPD
 
struct  FSPS_ARCH_UPD
 
struct  FSPS_ARCH2_UPD
 
struct  FSPI_ARCH_UPD
 
struct  FSPT_UPD_COMMON
 
struct  FSPT_UPD_COMMON_FSP22
 
struct  FSPT_UPD_COMMON_FSP24
 
struct  FSPM_UPD_COMMON
 
struct  FSPM_UPD_COMMON_FSP24
 
struct  FSPS_UPD_COMMON
 
struct  FSPS_UPD_COMMON_FSP22
 
struct  FSPS_UPD_COMMON_FSP24
 
struct  FSPI_UPD_COMMON
 
struct  NOTIFY_PHASE_PARAMS
 
struct  FSP_MULTI_PHASE_VARIABLE_REQUEST_INFO_PARAMS
 
struct  FSP_MULTI_PHASE_COMPLETE_VARIABLE_REQUEST_PARAMS
 
struct  FSP_MULTI_PHASE_GET_NUMBER_OF_PHASES_PARAMS
 
struct  FSP_MULTI_PHASE_PARAMS
 

Macros

#define FSP_EVENT_CODE   0xF5000000
 
#define FSP_POST_CODE   (FSP_EVENT_CODE | 0x00F80000)
 
#define ENCODE_RESET_REQUEST(ResetType)    ((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))
 
#define FSP_STATUS_RESET_REQUIRED_COLD   ENCODE_RESET_REQUEST(1)
 
#define FSP_STATUS_RESET_REQUIRED_WARM   ENCODE_RESET_REQUEST(2)
 
#define FSP_STATUS_RESET_REQUIRED_3   ENCODE_RESET_REQUEST(3)
 
#define FSP_STATUS_RESET_REQUIRED_4   ENCODE_RESET_REQUEST(4)
 
#define FSP_STATUS_RESET_REQUIRED_5   ENCODE_RESET_REQUEST(5)
 
#define FSP_STATUS_RESET_REQUIRED_6   ENCODE_RESET_REQUEST(6)
 
#define FSP_STATUS_RESET_REQUIRED_7   ENCODE_RESET_REQUEST(7)
 
#define FSP_STATUS_RESET_REQUIRED_8   ENCODE_RESET_REQUEST(8)
 
#define FSP_STATUS_VARIABLE_REQUEST   ENCODE_RESET_REQUEST(10)
 

Typedefs

typedef EFI_STATUS(EFIAPI * FSP_EVENT_HANDLER) (IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN OPTIONAL EFI_GUID *CallerId, IN OPTIONAL EFI_STATUS_CODE_DATA *Data)
 
typedef UINT32(EFIAPI * FSP_DEBUG_HANDLER) (IN CHAR8 *DebugMessage, IN UINT32 MessageLength)
 
typedef EFI_STATUS(EFIAPI * FSP_TEMP_RAM_INIT) (IN VOID *FsptUpdDataPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_NOTIFY_PHASE) (IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_MEMORY_INIT) (IN VOID *FspmUpdDataPtr, OUT VOID **HobListPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_TEMP_RAM_EXIT) (IN VOID *TempRamExitParamPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_SILICON_INIT) (IN VOID *FspsUpdDataPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_SI_INIT) (IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_SMM_INIT) (IN VOID *FspiUpdDataPtr)
 
typedef EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_INIT) (IN FSP_MULTI_PHASE_PARAMS *MultiPhaseInitParamPtr)
 

Enumerations

enum  FSP_INIT_PHASE { EnumInitPhaseAfterPciEnumeration = 0x20 , EnumInitPhaseReadyToBoot = 0x40 , EnumInitPhaseEndOfFirmware = 0xF0 }
 
enum  FSP_MULTI_PHASE_ACTION { EnumMultiPhaseGetNumberOfPhases = 0x0 , EnumMultiPhaseExecutePhase = 0x1 , EnumMultiPhaseGetVariableRequestInfo = 0x2 , EnumMultiPhaseCompleteVariableRequest = 0x3 }
 
enum  FSP_VARIABLE_REQUEST_TYPE { EnumFspVariableRequestGetVariable = 0x0 , EnumFspVariableRequestGetNextVariableName = 0x1 , EnumFspVariableRequestSetVariable = 0x2 , EnumFspVariableRequestQueryVariableInfo = 0x3 }
 

Detailed Description

Intel FSP API definition from Intel Firmware Support Package External Architecture Specification v2.0 and above.

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

Definition in file FspApi.h.

Macro Definition Documentation

◆ ENCODE_RESET_REQUEST

#define ENCODE_RESET_REQUEST (   ResetType)     ((EFI_STATUS)((MAX_BIT >> 1) | (ResetType)))

FSP Reset Status code These are defined in FSP EAS v2.4 section 13.2.2 - OEM Status Code

Definition at line 21 of file FspApi.h.

◆ FSP_EVENT_CODE

#define FSP_EVENT_CODE   0xF5000000

FSP Event related definition.

Definition at line 37 of file FspApi.h.

◆ FSP_POST_CODE

#define FSP_POST_CODE   (FSP_EVENT_CODE | 0x00F80000)

Definition at line 38 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_3

#define FSP_STATUS_RESET_REQUIRED_3   ENCODE_RESET_REQUEST(3)

Definition at line 25 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_4

#define FSP_STATUS_RESET_REQUIRED_4   ENCODE_RESET_REQUEST(4)

Definition at line 26 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_5

#define FSP_STATUS_RESET_REQUIRED_5   ENCODE_RESET_REQUEST(5)

Definition at line 27 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_6

#define FSP_STATUS_RESET_REQUIRED_6   ENCODE_RESET_REQUEST(6)

Definition at line 28 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_7

#define FSP_STATUS_RESET_REQUIRED_7   ENCODE_RESET_REQUEST(7)

Definition at line 29 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_8

#define FSP_STATUS_RESET_REQUIRED_8   ENCODE_RESET_REQUEST(8)

Definition at line 30 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_COLD

#define FSP_STATUS_RESET_REQUIRED_COLD   ENCODE_RESET_REQUEST(1)

Definition at line 23 of file FspApi.h.

◆ FSP_STATUS_RESET_REQUIRED_WARM

#define FSP_STATUS_RESET_REQUIRED_WARM   ENCODE_RESET_REQUEST(2)

Definition at line 24 of file FspApi.h.

◆ FSP_STATUS_VARIABLE_REQUEST

#define FSP_STATUS_VARIABLE_REQUEST   ENCODE_RESET_REQUEST(10)

Definition at line 31 of file FspApi.h.

Typedef Documentation

◆ FSP_DEBUG_HANDLER

typedef UINT32(EFIAPI * FSP_DEBUG_HANDLER) (IN CHAR8 *DebugMessage, IN UINT32 MessageLength)

Definition at line 87 of file FspApi.h.

◆ FSP_EVENT_HANDLER

typedef EFI_STATUS(EFIAPI * FSP_EVENT_HANDLER) (IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN OPTIONAL EFI_GUID *CallerId, IN OPTIONAL EFI_STATUS_CODE_DATA *Data)

Definition at line 67 of file FspApi.h.

◆ FSP_MEMORY_INIT

typedef EFI_STATUS(EFIAPI * FSP_MEMORY_INIT) (IN VOID *FspmUpdDataPtr, OUT VOID **HobListPtr)

This FSP API is called after TempRamInit and initializes the memory. This FSP API accepts a pointer to a data structure that will be platform dependent and defined for each FSP binary. This will be documented in Integration guide with each FSP release. After FspMemInit completes its execution, it passes the pointer to the HobList and returns to the boot loader from where it was called. BootLoader is responsible to migrate its stack and data to Memory. FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the silicon initialization and provides bootloader an opportunity to get control after system memory is available and before the temporary RAM is torn down.

Parameters
[in]FspmUpdDataPtrPointer to the FSPM_UPD data structure.
[out]HobListPtrPointer to receive the address of the HOB list.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.
EFI_OUT_OF_RESOURCESStack range requested by FSP is not met.
FSP_STATUS_RESET_REQUIREDxA reset is required. These status codes will not be returned during S3.

Definition at line 636 of file FspApi.h.

◆ FSP_MULTI_PHASE_INIT

typedef EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_INIT) (IN FSP_MULTI_PHASE_PARAMS *MultiPhaseInitParamPtr)

This FSP API provides multi-phase memory and silicon initialization, which brings greater modularity to the existing FspMemoryInit() and FspSiliconInit() API. Increased modularity is achieved by adding an extra API to FSP-M and FSP-S. This allows the bootloader to add board specific initialization steps throughout the MemoryInit and SiliconInit flows as needed. The FspMemoryInit() API is always called before FspMultiPhaseMemInit(); it is the first phase of memory initialization. Similarly, the FspSiliconInit() API is always called before FspMultiPhaseSiInit(); it is the first phase of silicon initialization. After the first phase, subsequent phases are invoked by calling the FspMultiPhaseMem/SiInit() API. The FspMultiPhaseMemInit() API may only be called after the FspMemoryInit() API and before the FspSiliconInit() API; or in the case that FSP-T is being used, before the TempRamExit() API. The FspMultiPhaseSiInit() API may only be called after the FspSiliconInit() API and before NotifyPhase() API; or in the case that FSP-I is being used, before the FspSmmInit() API. The multi-phase APIs may not be called at any other time.

Parameters
[in,out]FSP_MULTI_PHASE_PARAMSFor action - EnumMultiPhaseGetNumberOfPhases: FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr will contain how many phases supported by FSP. For action - EnumMultiPhaseExecutePhase: FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr shall be NULL.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.
FSP_STATUS_RESET_REQUIRED_*A reset is required. These status codes will not be returned during S3.
FSP_STATUS_VARIABLE_REQUESTA variable request has been made by FSP that needs boot loader handling.

Definition at line 754 of file FspApi.h.

◆ FSP_MULTI_PHASE_SI_INIT

typedef EFI_STATUS(EFIAPI * FSP_MULTI_PHASE_SI_INIT) (IN FSP_MULTI_PHASE_PARAMS *MultiPhaseSiInitParamPtr)

This FSP API is expected to be called after FspSiliconInit but before FspNotifyPhase. This FSP API provides multi-phase silicon initialization; which brings greater modularity beyond the existing FspSiliconInit() API. Increased modularity is achieved by adding an extra API to FSP-S. This allows the bootloader to add board specific initialization steps throughout the SiliconInit flow as needed.

Parameters
[in,out]FSP_MULTI_PHASE_PARAMSFor action - EnumMultiPhaseGetNumberOfPhases: FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr will contain how many phases supported by FSP. For action - EnumMultiPhaseExecutePhase: FSP_MULTI_PHASE_PARAMS->MultiPhaseParamPtr shall be NULL.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.
FSP_STATUS_RESET_REQUIREDxA reset is required. These status codes will not be returned during S3.

Definition at line 705 of file FspApi.h.

◆ FSP_NOTIFY_PHASE

typedef EFI_STATUS(EFIAPI * FSP_NOTIFY_PHASE) (IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr)

This FSP API is used to notify the FSP about the different phases in the boot process. This allows the FSP to take appropriate actions as needed during different initialization phases. The phases will be platform dependent and will be documented with the FSP release. The current FSP supports two notify phases: Post PCI enumeration Ready To Boot

Parameters
[in]NotifyPhaseParamPtrAddress pointer to the NOTIFY_PHASE_PRAMS
Return values
EFI_SUCCESSThe notification was handled successfully.
EFI_UNSUPPORTEDThe notification was not called in the proper order.
EFI_INVALID_PARAMETERThe notification code is invalid.

Definition at line 608 of file FspApi.h.

◆ FSP_SILICON_INIT

typedef EFI_STATUS(EFIAPI * FSP_SILICON_INIT) (IN VOID *FspsUpdDataPtr)

This FSP API is called after TempRamExit API. FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the silicon initialization.

Parameters
[in]FspsUpdDataPtrPointer to the FSPS_UPD data structure. If NULL, FSP will use the default parameters.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.
FSP_STATUS_RESET_REQUIREDxA reset is required. These status codes will not be returned during S3.

Definition at line 681 of file FspApi.h.

◆ FSP_SMM_INIT

typedef EFI_STATUS(EFIAPI * FSP_SMM_INIT) (IN VOID *FspiUpdDataPtr)

This FSP API initializes SMM and provide any OS runtime silicon services, including Reliability, Availability, and Serviceability (RAS) features implemented by the CPU.

Parameters
[in]FspiUpdDataPtrPointer to the FSPI_UPD data structure. If NULL, FSP will use the default parameters.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.
FSP_STATUS_RESET_REQUIREDxA reset is required. These status codes will not be returned during S3.

Definition at line 724 of file FspApi.h.

◆ FSP_TEMP_RAM_EXIT

typedef EFI_STATUS(EFIAPI * FSP_TEMP_RAM_EXIT) (IN VOID *TempRamExitParamPtr)

This FSP API is called after FspMemoryInit API. This FSP API tears down the temporary memory setup by TempRamInit API. This FSP API accepts a pointer to a data structure that will be platform dependent and defined for each FSP binary. This will be documented in Integration Guide. FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the silicon initialization and provides bootloader an opportunity to get control after system memory is available and before the temporary RAM is torn down.

Parameters
[in]TempRamExitParamPtrPointer to the Temp Ram Exit parameters structure. This structure is normally defined in the Integration Guide. And if it is not defined in the Integration Guide, pass NULL.
Return values
EFI_SUCCESSFSP execution environment was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORFSP initialization failed.

Definition at line 661 of file FspApi.h.

◆ FSP_TEMP_RAM_INIT

typedef EFI_STATUS(EFIAPI * FSP_TEMP_RAM_INIT) (IN VOID *FsptUpdDataPtr)

This FSP API is called soon after coming out of reset and before memory and stack is available. This FSP API will load the microcode update, enable code caching for the region specified by the boot loader and also setup a temporary stack to be used until main memory is initialized.

A hardcoded stack can be set up with the following values, and the "esp" register initialized to point to this hardcoded stack.

  1. The return address where the FSP will return control after setting up a temporary stack.
  2. A pointer to the input parameter structure

However, since the stack is in ROM and not writeable, this FSP API cannot be called using the "call" instruction, but needs to be jumped to.

Parameters
[in]FsptUpdDataPtrPointer to the FSPT_UPD data structure.
Return values
EFI_SUCCESSTemporary RAM was initialized successfully.
EFI_INVALID_PARAMETERInput parameters are invalid.
EFI_UNSUPPORTEDThe FSP calling conditions were not met.
EFI_DEVICE_ERRORTemp RAM initialization failed.

If this function is successful, the FSP initializes the ECX and EDX registers to point to a temporary but writeable memory range available to the boot loader and returns with FSP_SUCCESS in register EAX. Register ECX points to the start of this temporary memory range and EDX points to the end of the range. Boot loader is free to use the whole range described. Typically the boot loader can reload the ESP register to point to the end of this returned range so that it can be used as a standard stack.

Definition at line 588 of file FspApi.h.

Enumeration Type Documentation

◆ FSP_INIT_PHASE

Enumeration of FSP_INIT_PHASE for NOTIFY_PHASE.

Enumerator
EnumInitPhaseAfterPciEnumeration 

This stage is notified when the bootloader completes the PCI enumeration and the resource allocation for the PCI devices is complete.

EnumInitPhaseReadyToBoot 

This stage is notified just before the bootloader hand-off to the OS loader.

EnumInitPhaseEndOfFirmware 

This stage is notified just before the firmware/Preboot environment transfers management of all system resources to the OS or next level execution environment.

Definition at line 464 of file FspApi.h.

◆ FSP_MULTI_PHASE_ACTION

Action definition for FspMultiPhaseSiInit API

Definition at line 497 of file FspApi.h.

◆ FSP_VARIABLE_REQUEST_TYPE

enum FSP_VARIABLE_REQUEST_TYPE

Definition at line 504 of file FspApi.h.