Update FSP header file to follow:
https://firmware.intel.com/sites/default/files/FSP_EAS_v2.0_Draft%20External.pdf

The FSP1.1 compatibility is NOT maintained.

The new Intel platform follows FSP2.0.
The old platform can either use an old UDK branch,
or move FSP1.1 support to platform directory.

Cc: Giri P Mudusuru <giri.p.mudus...@intel.com>
Cc: Maurice Ma <maurice...@intel.com>
Cc: Ravi P Rangarajan <ravi.p.rangara...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen....@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudus...@intel.com>
Reviewed-by: Maurice Ma <maurice...@intel.com>
Reviewed-by: Ravi P Rangarajan <ravi.p.rangara...@intel.com>
---
 IntelFspPkg/Include/FspApi.h        | 242 +++++++-------------
 IntelFspPkg/Include/FspInfoHeader.h |  39 ++--
 2 files changed, 104 insertions(+), 177 deletions(-)

diff --git a/IntelFspPkg/Include/FspApi.h b/IntelFspPkg/Include/FspApi.h
index 5404a84..f7c7168 100644
--- a/IntelFspPkg/Include/FspApi.h
+++ b/IntelFspPkg/Include/FspApi.h
@@ -1,8 +1,8 @@
 /** @file
   Intel FSP API definition from Intel Firmware Support Package External
-  Architecture Specification v1.1, April 2015, revision 001.
+  Architecture Specification v2.0.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -16,97 +16,87 @@
 #ifndef _FSP_API_H_
 #define _FSP_API_H_
 
-#define FSP_STATUS EFI_STATUS
-#define FSPAPI EFIAPI
-
-/**
-  FSP Init continuation function prototype.
-  Control will be returned to this callback function after FspInit API call.
-
-  @param[in] Status Status of the FSP INIT API.
-  @param[in] HobBufferPtr Pointer to the HOB data structure defined in the PI 
specification.
-**/
-typedef
-VOID
-(* CONTINUATION_PROC) (
-  IN EFI_STATUS Status,
-  IN VOID       *HobListPtr
-  );
-
 #pragma pack(1)
-
 typedef struct {
   ///
-  /// Base address of the microcode region.
-  ///
-  UINT32              MicrocodeRegionBase;
-  ///
-  /// Length of the microcode region.
+  /// UPD Region Signature. This signature will be
+  /// "XXXXXX_T" for FSP-T
+  /// "XXXXXX_M" for FSP-M
+  /// "XXXXXX_S" for FSP-S
+  /// Where XXXXXX is an unique signature
   ///
-  UINT32              MicrocodeRegionLength;
+  UINT64                      Signature;
   ///
-  /// Base address of the cacheable flash region.
+  /// Revision of the Data structure. For FSP v2.0 value is 1.
   ///
-  UINT32              CodeRegionBase;
-  ///
-  /// Length of the cacheable flash region.
-  ///
-  UINT32              CodeRegionLength;
-} FSP_TEMP_RAM_INIT_PARAMS;
+  UINT8                       Revision;
+  UINT8                       Reserved[23];
+} FSP_UPD_HEADER;
 
 typedef struct {
   ///
-  /// Non-volatile storage buffer pointer.
-  ///
-  VOID               *NvsBufferPtr;
+  /// Revision of the structure. For FSP v2.0 value is 1.
   ///
-  /// Runtime buffer pointer
+  UINT8                       Revision;
+  UINT8                       Reserved[3];
   ///
-  VOID               *RtBufferPtr;
+  /// Pointer to the non-volatile storage (NVS) data buffer.
+  /// If it is NULL it indicates the NVS data is not available.
   ///
-  /// Continuation function address
+  VOID                        *NvsBufferPtr;
   ///
-  CONTINUATION_PROC   ContinuationFunc;
-} FSP_INIT_PARAMS;
-
-typedef struct {
-  ///
-  /// Stack top pointer used by the bootloader.
-  /// The new stack frame will be set up at this location after FspInit API 
call.
-  ///
-  UINT32             *StackTop;
+  /// Pointer to the temporary stack base address to be
+  /// consumed inside FspMemoryInit() API.
   ///
-  /// Current system boot mode.
+  VOID                        *StackBase;
   ///
-  UINT32              BootMode;
+  /// Temporary stack size to be consumed inside
+  /// FspMemoryInit() API.
   ///
-  /// User platform configuraiton data region pointer.
+  UINT32                      StackSize;
   ///
-  VOID               *UpdDataRgnPtr;
-  //
-  // Below field is added in FSP EAS v1.1
-  //
+  /// Size of memory to be reserved by FSP below "top
+  /// of low usable memory" for bootloader usage.
   ///
-  /// The size of memory to be reserved below the top of low usable memory 
(TOLUM)
-  /// for BootLoader usage. This is optional and value can be zero. If 
non-zero, the
-  /// size must be a multiple of 4KB.
+  UINT32                      BootLoaderTolumSize;
   ///
-  UINT32              BootLoaderTolumSize;
+  /// Current boot mode.
   ///
-  /// Reserved
-  ///
-  UINT32              Reserved[6];
-} FSP_INIT_RT_COMMON_BUFFER;
+  UINT32                      BootMode;
+  UINT8                       Reserved1[8];
+} FSPM_ARCH_UPD;
+
+typedef struct {
+  FSP_UPD_HEADER              FspUpdHeader;
+} FSPT_UPD_COMMON;
+
+typedef struct {
+  FSP_UPD_HEADER              FspUpdHeader;
+  FSPM_ARCH_UPD               FspmArchUpd;
+} FSPM_UPD_COMMON;
+
+typedef struct {
+  FSP_UPD_HEADER              FspUpdHeader;
+} FSPS_UPD_COMMON;
 
 typedef enum {
   ///
-  /// Notification code for post PCI enuermation
+  /// This stage is notified when the bootloader completes the
+  /// PCI enumeration and the resource allocation for the
+  /// PCI devices is complete.
   ///
   EnumInitPhaseAfterPciEnumeration = 0x20,
   ///
-  /// Notification code before transfering control to the payload
+  /// This stage is notified just before the bootloader hand-off
+  /// to the OS loader.
+  ///
+  EnumInitPhaseReadyToBoot         = 0x40,
+  ///
+  /// This stage is notified just before the firmware/Preboot
+  /// environment transfers management of all system resources
+  /// to the OS or next level execution environment.
   ///
-  EnumInitPhaseReadyToBoot         = 0x40
+  EnumInitPhaseEndOfFirmware       = 0xF0
 } FSP_INIT_PHASE;
 
 typedef struct {
@@ -116,21 +106,6 @@ typedef struct {
   FSP_INIT_PHASE     Phase;
 } NOTIFY_PHASE_PARAMS;
 
-typedef struct {
-  ///
-  /// Non-volatile storage buffer pointer.
-  ///
-  VOID               *NvsBufferPtr;
-  ///
-  /// Runtime buffer pointer
-  ///
-  VOID               *RtBufferPtr;
-  ///
-  /// Pointer to the HOB data structure defined in the PI specification
-  ///
-  VOID               **HobListPtr;
-} FSP_MEMORY_INIT_PARAMS;
-
 #pragma pack()
 
 /**
@@ -148,11 +123,10 @@ typedef struct {
   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.
 
-  @param[in] TempRaminitParamPtr Address pointer to the 
FSP_TEMP_RAM_INIT_PARAMS structure.
+  @param[in] FsptUpdDataPtr     Pointer to the FSPT_UPD data structure.
 
-  @retval EFI_SUCCESS           Temp RAM was initialized successfully.
-  @retval EFI_INVALID_PARAMETER Input parameters are invalid..
-  @retval EFI_NOT_FOUND         No valid microcode was found in the microcode 
region.
+  @retval EFI_SUCCESS           Temporary RAM was initialized successfully.
+  @retval EFI_INVALID_PARAMETER Input parameters are invalid.
   @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.
   @retval EFI_DEVICE_ERROR      Temp RAM initialization failed.
 
@@ -166,36 +140,10 @@ typedef struct {
 typedef
 EFI_STATUS
 (EFIAPI *FSP_TEMP_RAM_INIT) (
-  IN FSP_TEMP_RAM_INIT_PARAMS *FspTempRamInitPtr
+  IN  VOID    *FsptUpdDataPtr
   );
 
 /**
-  This FSP API is called after TempRamInitEntry. This FSP API initializes the 
memory,
-  the CPU and the chipset to enable normal operation of these devices. 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 the Integration Guide for each 
FSP
-  release.
-  The boot loader provides a continuation function as a parameter when calling 
FspInit.
-  After FspInit completes its execution, it does not return to the boot loader 
from where
-  it was called but instead returns control to the boot loader by calling the 
continuation
-  function which is passed to FspInit as an argument.
-
-  @param[in] FspInitParamPtr Address pointer to the FSP_INIT_PARAMS structure.
-
-  @retval EFI_SUCCESS           FSP execution environment was initialized 
successfully.
-  @retval EFI_INVALID_PARAMETER Input parameters are invalid.
-  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.
-  @retval EFI_DEVICE_ERROR      FSP initialization failed.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *FSP_INIT) (
-  IN OUT FSP_INIT_PARAMS *FspInitParamPtr
-  );
-
-#define FSP_FSP_INIT FSP_INIT
-
-/**
   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
@@ -226,20 +174,22 @@ EFI_STATUS
   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.
-  These APIs are mutually exclusive to the FspInit API.
 
-  @param[in][out] FspMemoryInitParamPtr Address pointer to the 
FSP_MEMORY_INIT_PARAMS
-                                        structure.
+  @param[in]  FspmUpdDataPtr          Pointer to the FSPM_UPD data sructure.
+  @param[out] HobListPtr              Pointer to receive the address of the 
HOB list.
 
-  @retval EFI_SUCCESS           FSP execution environment was initialized 
successfully.
-  @retval EFI_INVALID_PARAMETER Input parameters are invalid.
-  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.
-  @retval EFI_DEVICE_ERROR      FSP initialization failed.
+  @retval EFI_SUCCESS                 FSP execution environment was 
initialized successfully.
+  @retval EFI_INVALID_PARAMETER       Input parameters are invalid.
+  @retval EFI_UNSUPPORTED             The FSP calling conditions were not met.
+  @retval EFI_DEVICE_ERROR            FSP initialization failed.
+  @retval EFI_OUT_OF_RESOURCES        Stack range requested by FSP is not met.
+  @retval FSP_STATUS_RESET_REQUIREDx  A reset is reuired. These status codes 
will not be returned during S3.
 **/
 typedef
 EFI_STATUS
 (EFIAPI *FSP_MEMORY_INIT) (
-  IN OUT FSP_MEMORY_INIT_PARAMS *FspMemoryInitParamPtr
+  IN  VOID    *FspmUpdDataPtr,
+  OUT VOID    **HobListPtr
   );
 
 
@@ -251,21 +201,20 @@ EFI_STATUS
   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.
-  These APIs are mutually exclusive to the FspInit API.
 
-  @param[in][out] TempRamExitParamPtr Pointer 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.
+  @param[in] TempRamExitParamPtr Pointer 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.
 
-  @retval EFI_SUCCESS           FSP execution environment was initialized 
successfully.
-  @retval EFI_INVALID_PARAMETER Input parameters are invalid.
-  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.
-  @retval EFI_DEVICE_ERROR      FSP initialization failed.
+  @retval EFI_SUCCESS            FSP execution environment was initialized 
successfully.
+  @retval EFI_INVALID_PARAMETER  Input parameters are invalid.
+  @retval EFI_UNSUPPORTED        The FSP calling conditions were not met.
+  @retval EFI_DEVICE_ERROR       FSP initialization failed.
 **/
 typedef
 EFI_STATUS
 (EFIAPI *FSP_TEMP_RAM_EXIT) (
-  IN OUT VOID *TempRamExitParamPtr
+  IN  VOID    *TempRamExitParamPtr
   );
 
 
@@ -273,39 +222,20 @@ EFI_STATUS
   This FSP API is called after TempRamExit API.
   FspMemoryInit, TempRamExit and FspSiliconInit APIs provide an alternate 
method to complete the
   silicon initialization.
-  These APIs are mutually exclusive to the FspInit API.
 
-  @param[in][out] FspSiliconInitParamPtr Pointer to the Silicon Init 
parameters structure.
-                                         This structure is normally defined in 
the Integration Guide.
-                                         And if it is not defined in the 
Integration Guide, pass NULL.
+  @param[in] FspsUpdDataPtr     Pointer to the FSPS_UPD data structure.
+                                If NULL, FSP will use the default parameters.
 
-  @retval EFI_SUCCESS           FSP execution environment was initialized 
successfully.
-  @retval EFI_INVALID_PARAMETER Input parameters are invalid.
-  @retval EFI_UNSUPPORTED       The FSP calling conditions were not met.
-  @retval EFI_DEVICE_ERROR      FSP initialization failed.
+  @retval EFI_SUCCESS                 FSP execution environment was 
initialized successfully.
+  @retval EFI_INVALID_PARAMETER       Input parameters are invalid.
+  @retval EFI_UNSUPPORTED             The FSP calling conditions were not met.
+  @retval EFI_DEVICE_ERROR            FSP initialization failed.
+  @retval FSP_STATUS_RESET_REQUIREDx  A reset is reuired. These status codes 
will not be returned during S3.
 **/
 typedef
 EFI_STATUS
 (EFIAPI *FSP_SILICON_INIT) (
-  IN OUT VOID *FspSiliconInitParamPtr
+  IN  VOID    *FspsUpdDataPtr
   );
 
-///
-/// FSP API Return Status Code for backward compatibility with v1.0
-///@{
-#define FSP_SUCCESS              EFI_SUCCESS
-#define FSP_INVALID_PARAMETER    EFI_INVALID_PARAMETER
-#define FSP_UNSUPPORTED          EFI_UNSUPPORTED
-#define FSP_NOT_READY            EFI_NOT_READY
-#define FSP_DEVICE_ERROR         EFI_DEVICE_ERROR
-#define FSP_OUT_OF_RESOURCES     EFI_OUT_OF_RESOURCES
-#define FSP_VOLUME_CORRUPTED     EFI_VOLUME_CORRUPTED
-#define FSP_NOT_FOUND            EFI_NOT_FOUND
-#define FSP_TIMEOUT              EFI_TIMEOUT
-#define FSP_ABORTED              EFI_ABORTED
-#define FSP_INCOMPATIBLE_VERSION EFI_INCOMPATIBLE_VERSION
-#define FSP_SECURITY_VIOLATION   EFI_SECURITY_VIOLATION
-#define FSP_CRC_ERROR            EFI_CRC_ERROR
-///@}
-
 #endif
diff --git a/IntelFspPkg/Include/FspInfoHeader.h 
b/IntelFspPkg/Include/FspInfoHeader.h
index 1ee2fa5..79414e1 100644
--- a/IntelFspPkg/Include/FspInfoHeader.h
+++ b/IntelFspPkg/Include/FspInfoHeader.h
@@ -1,8 +1,8 @@
 /** @file
   Intel FSP Info Header definition from Intel Firmware Support Package External
-  Architecture Specification v1.1, April 2015, revision 001.
+  Architecture Specification v2.0.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -45,7 +45,12 @@ typedef struct  {
   ///
   /// Byte 0x08: Reserved
   ///
-  UINT8   Reserved1[3];
+  UINT8   Reserved1[2];
+  ///
+  /// Byte 0x0A: Indicates compliance with a revision of this specification in 
the
+  /// BCD format.
+  ///
+  UINT8   SpecVersion;
   ///
   /// Byte 0x0B: Revision of the FSP Information Header
   ///
@@ -54,8 +59,6 @@ typedef struct  {
   /// Byte 0x0C: Revision of the FSP binary
   ///
   UINT32  ImageRevision;
-
-
   ///
   /// Byte 0x10: Signature string that will help match the FSP Binary to a 
supported
   /// hardware configuration.
@@ -69,12 +72,14 @@ typedef struct  {
   /// Byte 0x1C: FSP binary preferred base address
   ///
   UINT32  ImageBase;
-
-
   ///
   /// Byte 0x20: Attribute for the FSP binary
   ///
-  UINT32  ImageAttribute;
+  UINT16  ImageAttribute;
+  ///
+  /// Byte 0x22: Attributes of the FSP Component
+  ///
+  UINT16  ComponentAttribute;
   ///
   /// Byte 0x24: Offset of the FSP configuration region
   ///
@@ -84,30 +89,23 @@ typedef struct  {
   ///
   UINT32  CfgRegionSize;
   ///
-  /// Byte 0x2C: Number of API entries this FSP supports
+  /// Byte 0x2C: Reserved2
   ///
-  UINT32  ApiEntryNum;
-
-
+  UINT32  Reserved2;
   ///
   /// Byte 0x30: The offset for the API to setup a temporary stack till the 
memory
   ///            is initialized.
   ///
   UINT32  TempRamInitEntryOffset;
   ///
-  /// Byte 0x34: The offset for the API to initialize the CPU and the chipset 
(SOC)
+  /// Byte 0x34: Reserved3
   ///
-  UINT32  FspInitEntryOffset;
+  UINT32  Reserved3;
   ///
   /// Byte 0x38: The offset for the API to inform the FSP about the different 
stages
   ///            in the boot process
   ///
   UINT32  NotifyPhaseEntryOffset;
-
-  ///
-  /// Below fields are added in FSP Revision 2
-  ///
-
   ///
   /// Byte 0x3C: The offset for the API to initialize the memory
   ///
@@ -120,11 +118,10 @@ typedef struct  {
   /// Byte 0x44: The offset for the API to initialize the CPU and chipset
   ///
   UINT32  FspSiliconInitEntryOffset;
-
 } FSP_INFO_HEADER;
 
 ///
-/// Below structure is added in FSP version 2
+/// Signature of the FSP Extended Header
 ///
 #define FSP_INFO_EXTENDED_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'E')
 
-- 
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to