]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Include/FspApi.h
Update IntelFspPkg according to FSP1.1.
[mirror_edk2.git] / IntelFspPkg / Include / FspApi.h
index 0ec930b0ca2541295d4848db7ccddaab5c714a3c..bf073033f4d4308df20a1b5af553577570269347 100644 (file)
@@ -2,7 +2,7 @@
   Intel FSP API definition from Intel Firmware Support Package External\r
   Architecture Specification, April 2014, revision 001.\r
 \r
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -16,7 +16,7 @@
 #ifndef _FSP_API_H_\r
 #define _FSP_API_H_\r
 \r
-typedef UINT32 FSP_STATUS;\r
+#define FSP_STATUS EFI_STATUS\r
 #define FSPAPI EFIAPI\r
 \r
 /**\r
@@ -29,7 +29,7 @@ typedef UINT32 FSP_STATUS;
 typedef\r
 VOID\r
 (* CONTINUATION_PROC) (\r
-  IN FSP_STATUS Status,\r
+  IN EFI_STATUS Status,\r
   IN VOID       *HobListPtr\r
   );\r
 \r
@@ -107,6 +107,21 @@ typedef struct {
   FSP_INIT_PHASE     Phase;\r
 } NOTIFY_PHASE_PARAMS;\r
 \r
+typedef struct {\r
+  ///\r
+  /// Non-volatile storage buffer pointer.\r
+  ///\r
+  VOID               *NvsBufferPtr;\r
+  ///\r
+  /// Runtime buffer pointer\r
+  ///\r
+  VOID               *RtBufferPtr;\r
+  ///\r
+  /// Pointer to the HOB data structure defined in the PI specification\r
+  ///\r
+  VOID               **HobListPtr;\r
+} FSP_MEMORY_INIT_PARAMS;\r
+\r
 #pragma pack()\r
 \r
 /**\r
@@ -126,11 +141,11 @@ typedef struct {
 \r
   @param[in] TempRaminitParamPtr Address pointer to the FSP_TEMP_RAM_INIT_PARAMS structure.\r
 \r
-  @retval FSP_SUCCESS           Temp RAM was initialized successfully.\r
-  @retval FSP_INVALID_PARAMETER Input parameters are invalid..\r
-  @retval FSP_NOT_FOUND         No valid microcode was found in the microcode region.\r
-  @retval FSP_UNSUPPORTED       The FSP calling conditions were not met.\r
-  @retval FSP_DEVICE_ERROR      Temp RAM initialization failed.\r
+  @retval EFI_SUCCESS           Temp RAM was initialized successfully.\r
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid..\r
+  @retval EFI_NOT_FOUND         No valid microcode was found in the microcode region.\r
+  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.\r
+  @retval EFI_DEVICE_ERROR      Temp RAM initialization failed.\r
 \r
   If this function is successful, the FSP initializes the ECX and EDX registers to point to\r
   a temporary but writeable memory range available to the boot loader and returns with\r
@@ -140,8 +155,8 @@ typedef struct {
   to the end of this returned range so that it can be used as a standard stack.\r
 **/\r
 typedef\r
-FSP_STATUS\r
-(FSPAPI *FSP_TEMP_RAM_INIT) (\r
+EFI_STATUS\r
+(EFIAPI *FSP_TEMP_RAM_INIT) (\r
   IN FSP_TEMP_RAM_INIT_PARAMS *FspTempRamInitPtr\r
   );\r
 \r
@@ -158,17 +173,19 @@ FSP_STATUS
 \r
   @param[in] FspInitParamPtr Address pointer to the FSP_INIT_PARAMS structure.\r
 \r
-  @retval FSP_SUCCESS           FSP execution environment was initialized successfully.\r
-  @retval FSP_INVALID_PARAMETER Input parameters are invalid.\r
-  @retval FSP_UNSUPPORTED       The FSP calling conditions were not met.\r
-  @retval FSP_DEVICE_ERROR      FSP initialization failed.\r
+  @retval EFI_SUCCESS           FSP execution environment was initialized successfully.\r
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.\r
+  @retval EFI_DEVICE_ERROR      FSP initialization failed.\r
 **/\r
 typedef\r
-FSP_STATUS\r
-(FSPAPI *FSP_FSP_INIT) (\r
+EFI_STATUS\r
+(EFIAPI *FSP_INIT) (\r
   IN OUT FSP_INIT_PARAMS *FspInitParamPtr\r
   );\r
 \r
+#define FSP_FSP_INIT FSP_INIT\r
+\r
 /**\r
   This FSP API is used to notify the FSP about the different phases in the boot process.\r
   This allows the FSP to take appropriate actions as needed during different initialization\r
@@ -179,31 +196,107 @@ FSP_STATUS
 \r
   @param[in] NotifyPhaseParamPtr Address pointer to the NOTIFY_PHASE_PRAMS\r
 \r
-  @retval FSP_SUCCESS           The notification was handled successfully.\r
-  @retval FSP_UNSUPPORTED       The notification was not called in the proper order.\r
-  @retval FSP_INVALID_PARAMETER The notification code is invalid.\r
+  @retval EFI_SUCCESS           The notification was handled successfully.\r
+  @retval EFI_UNSUPPORTED       The notification was not called in the proper order.\r
+  @retval EFI_INVALID_PARAMETER The notification code is invalid.\r
 **/\r
 typedef\r
-FSP_STATUS\r
-(FSPAPI *FSP_NOTIFY_PHASE) (\r
+EFI_STATUS\r
+(EFIAPI *FSP_NOTIFY_PHASE) (\r
   IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr\r
   );\r
 \r
+/**\r
+  This FSP API is called after TempRamInit and initializes the memory.\r
+  This FSP API accepts a pointer to a data structure that will be platform dependent\r
+  and defined for each FSP binary. This will be documented in Integration guide with\r
+  each FSP release.\r
+  After FspMemInit completes its execution, it passes the pointer to the HobList and\r
+  returns to the boot loader from where it was called. Bootloader is responsible to \r
+  migrate it\92s stack and data to Memory.\r
+  FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to\r
+  complete the silicon initialization and provides bootloader an opportunity to get\r
+  control after system memory is available and before the temporary RAM is torn down.\r
+  These APIs are mutually exclusive to the FspInit API.\r
+\r
+  @param[in][out] FspMemoryInitParamPtr Address pointer to the FSP_MEMORY_INIT_PARAMS\r
+                                        structure.\r
+\r
+  @retval EFI_SUCCESS           FSP execution environment was initialized successfully.\r
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.\r
+  @retval EFI_DEVICE_ERROR      FSP initialization failed.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FSP_MEMORY_INIT) (\r
+  IN OUT FSP_MEMORY_INIT_PARAMS *FspMemoryInitParamPtr\r
+  );\r
+\r
+\r
+/**\r
+  This FSP API is called after FspMemoryInit API. This FSP API tears down the temporary\r
+  memory setup by TempRamInit API. This FSP API accepts a pointer to a data structure\r
+  that will be platform dependent and defined for each FSP binary. This will be\r
+  documented in Integration Guide.\r
+  FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to\r
+  complete the silicon initialization and provides bootloader an opportunity to get\r
+  control after system memory is available and before the temporary RAM is torn down.\r
+  These APIs are mutually exclusive to the FspInit API.\r
+\r
+  @param[in][out] TempRamExitParamPtr Pointer to the Temp Ram Exit parameters structure.\r
+                                      This structure is normally defined in the Integration Guide.\r
+                                      And if it is not defined in the Integration Guide, pass NULL.\r
+\r
+  @retval EFI_SUCCESS           FSP execution environment was initialized successfully.\r
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.\r
+  @retval EFI_DEVICE_ERROR      FSP initialization failed.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FSP_TEMP_RAM_EXIT) (\r
+  IN OUT VOID *TempRamExitParamPtr\r
+  );\r
+\r
+\r
+/**\r
+  This FSP API is called after TempRamExit API.\r
+  FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate method to complete the\r
+  silicon initialization.\r
+  These APIs are mutually exclusive to the FspInit API.\r
+\r
+  @param[in][out] FspSiliconInitParamPtr Pointer to the Silicon Init parameters structure.\r
+                                         This structure is normally defined in the Integration Guide.\r
+                                         And if it is not defined in the Integration Guide, pass NULL.\r
+\r
+  @retval EFI_SUCCESS           FSP execution environment was initialized successfully.\r
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.\r
+  @retval EFI_DEVICE_ERROR      FSP initialization failed.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FSP_SILICON_INIT) (\r
+  IN OUT VOID *FspSiliconInitParamPtr\r
+  );\r
+\r
 ///\r
-/// FSP API Return Status Code\r
-///\r
-#define FSP_SUCCESS              0x00000000\r
-#define FSP_INVALID_PARAMETER    0x80000002\r
-#define FSP_UNSUPPORTED          0x80000003\r
-#define FSP_NOT_READY            0x80000006\r
-#define FSP_DEVICE_ERROR         0x80000007\r
-#define FSP_OUT_OF_RESOURCES     0x80000009\r
-#define FSP_VOLUME_CORRUPTED     0x8000000A\r
-#define FSP_NOT_FOUND            0x8000000E\r
-#define FSP_TIMEOUT              0x80000012\r
-#define FSP_ABORTED              0x80000015\r
-#define FSP_INCOMPATIBLE_VERSION 0x80000010\r
-#define FSP_SECURITY_VIOLATION   0x8000001A\r
-#define FSP_CRC_ERROR            0x8000001B\r
+/// FSP API Return Status Code for backward compatibility with v1.0\r
+///@{\r
+#define FSP_SUCCESS              EFI_SUCCESS\r
+#define FSP_INVALID_PARAMETER    EFI_INVALID_PARAMETER\r
+#define FSP_UNSUPPORTED          EFI_UNSUPPORTED\r
+#define FSP_NOT_READY            EFI_NOT_READY\r
+#define FSP_DEVICE_ERROR         EFI_DEVICE_ERROR\r
+#define FSP_OUT_OF_RESOURCES     EFI_OUT_OF_RESOURCES\r
+#define FSP_VOLUME_CORRUPTED     EFI_VOLUME_CORRUPTED\r
+#define FSP_NOT_FOUND            EFI_NOT_FOUND\r
+#define FSP_TIMEOUT              EFI_TIMEOUT\r
+#define FSP_ABORTED              EFI_ABORTED\r
+#define FSP_INCOMPATIBLE_VERSION EFI_INCOMPATIBLE_VERSION\r
+#define FSP_SECURITY_VIOLATION   EFI_SECURITY_VIOLATION\r
+#define FSP_CRC_ERROR            EFI_CRC_ERROR\r
+///@}\r
 \r
 #endif\r