]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/Include/FspApi.h
DynamicTablesPkg: GTDT updates for ACPI 6.3
[mirror_edk2.git] / IntelFspPkg / Include / FspApi.h
index 934a5766c3bce6091d05006d5700138acb6fe4f4..8dafae0e7efe6360a436c5755fd8e13d40e857ec 100644 (file)
@@ -1,22 +1,16 @@
 /** @file\r
   Intel FSP API definition from Intel Firmware Support Package External\r
-  Architecture Specification, April 2014, revision 001.\r
+  Architecture Specification v1.1, April 2015, revision 001.\r
 \r
-  Copyright (c) 2014, 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
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #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 +23,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
@@ -83,10 +77,19 @@ typedef struct {
   /// User platform configuraiton data region pointer.\r
   ///\r
   VOID               *UpdDataRgnPtr;\r
+  //\r
+  // Below field is added in FSP EAS v1.1\r
+  //\r
+  ///\r
+  /// The size of memory to be reserved below the top of low usable memory (TOLUM)\r
+  /// for BootLoader usage. This is optional and value can be zero. If non-zero, the\r
+  /// size must be a multiple of 4KB.\r
+  ///\r
+  UINT32              BootLoaderTolumSize;\r
   ///\r
   /// Reserved\r
   ///\r
-  UINT32              Reserved[7];\r
+  UINT32              Reserved[6];\r
 } FSP_INIT_RT_COMMON_BUFFER;\r
 \r
 typedef enum {\r
@@ -107,6 +110,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 +144,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 +158,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 +176,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 +199,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_NOTFY_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's 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