Update IntelFspPkg according to FSP1.1.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16825 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao, Jiewen
2015-02-11 02:57:40 +00:00
committed by jyao1
parent 6cffee0cb0
commit d5fb1edfb1
23 changed files with 908 additions and 501 deletions

View File

@@ -2,7 +2,7 @@
Intel FSP API definition from Intel Firmware Support Package External
Architecture Specification, April 2014, revision 001.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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,7 +16,7 @@
#ifndef _FSP_API_H_
#define _FSP_API_H_
typedef UINT32 FSP_STATUS;
#define FSP_STATUS EFI_STATUS
#define FSPAPI EFIAPI
/**
@@ -29,7 +29,7 @@ typedef UINT32 FSP_STATUS;
typedef
VOID
(* CONTINUATION_PROC) (
IN FSP_STATUS Status,
IN EFI_STATUS Status,
IN VOID *HobListPtr
);
@@ -107,6 +107,21 @@ 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()
/**
@@ -126,11 +141,11 @@ typedef struct {
@param[in] TempRaminitParamPtr Address pointer to the FSP_TEMP_RAM_INIT_PARAMS structure.
@retval FSP_SUCCESS Temp RAM was initialized successfully.
@retval FSP_INVALID_PARAMETER Input parameters are invalid..
@retval FSP_NOT_FOUND No valid microcode was found in the microcode region.
@retval FSP_UNSUPPORTED The FSP calling conditions were not met.
@retval FSP_DEVICE_ERROR Temp RAM initialization failed.
@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_UNSUPPORTED The FSP calling conditions were not met.
@retval EFI_DEVICE_ERROR Temp 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
@@ -140,8 +155,8 @@ typedef struct {
to the end of this returned range so that it can be used as a standard stack.
**/
typedef
FSP_STATUS
(FSPAPI *FSP_TEMP_RAM_INIT) (
EFI_STATUS
(EFIAPI *FSP_TEMP_RAM_INIT) (
IN FSP_TEMP_RAM_INIT_PARAMS *FspTempRamInitPtr
);
@@ -158,17 +173,19 @@ FSP_STATUS
@param[in] FspInitParamPtr Address pointer to the FSP_INIT_PARAMS structure.
@retval FSP_SUCCESS FSP execution environment was initialized successfully.
@retval FSP_INVALID_PARAMETER Input parameters are invalid.
@retval FSP_UNSUPPORTED The FSP calling conditions were not met.
@retval FSP_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
FSP_STATUS
(FSPAPI *FSP_FSP_INIT) (
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
@@ -179,31 +196,107 @@ FSP_STATUS
@param[in] NotifyPhaseParamPtr Address pointer to the NOTIFY_PHASE_PRAMS
@retval FSP_SUCCESS The notification was handled successfully.
@retval FSP_UNSUPPORTED The notification was not called in the proper order.
@retval FSP_INVALID_PARAMETER The notification code is invalid.
@retval EFI_SUCCESS The notification was handled successfully.
@retval EFI_UNSUPPORTED The notification was not called in the proper order.
@retval EFI_INVALID_PARAMETER The notification code is invalid.
**/
typedef
FSP_STATUS
(FSPAPI *FSP_NOTIFY_PHASE) (
EFI_STATUS
(EFIAPI *FSP_NOTIFY_PHASE) (
IN NOTIFY_PHASE_PARAMS *NotifyPhaseParamPtr
);
/**
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 it<69>s 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.
These APIs are mutually exclusive to the FspInit API.
@param[in][out] FspMemoryInitParamPtr Address pointer to the FSP_MEMORY_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_MEMORY_INIT) (
IN OUT FSP_MEMORY_INIT_PARAMS *FspMemoryInitParamPtr
);
/**
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.
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.
@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
);
/**
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.
@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_SILICON_INIT) (
IN OUT VOID *FspSiliconInitParamPtr
);
///
/// FSP API Return Status Code
///
#define FSP_SUCCESS 0x00000000
#define FSP_INVALID_PARAMETER 0x80000002
#define FSP_UNSUPPORTED 0x80000003
#define FSP_NOT_READY 0x80000006
#define FSP_DEVICE_ERROR 0x80000007
#define FSP_OUT_OF_RESOURCES 0x80000009
#define FSP_VOLUME_CORRUPTED 0x8000000A
#define FSP_NOT_FOUND 0x8000000E
#define FSP_TIMEOUT 0x80000012
#define FSP_ABORTED 0x80000015
#define FSP_INCOMPATIBLE_VERSION 0x80000010
#define FSP_SECURITY_VIOLATION 0x8000001A
#define FSP_CRC_ERROR 0x8000001B
/// 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

View File

@@ -2,7 +2,7 @@
Intel FSP Info Header definition from Intel Firmware Support Package External
Architecture Specification, April 2014, revision 001.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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,6 +16,12 @@
#ifndef _FSP_INFO_HEADER_H_
#define _FSP_INFO_HEADER_H_
#define FSP_HEADER_REVISION_1 1
#define FSP_HEADER_REVISION_2 2
#define FSPE_HEADER_REVISION_1 1
#define FSPP_HEADER_REVISION_1 1
///
/// Fixed FSP header offset in the FSP image
///
@@ -27,79 +33,125 @@
typedef struct {
///
/// Signature ('FSPH') for the FSP Information Header
/// Byte 0x00: Signature ('FSPH') for the FSP Information Header
///
UINT32 Signature;
///
/// Length of the FSP Information Header
/// Byte 0x04: Length of the FSP Information Header
///
UINT32 HeaderLength;
///
/// Reserved
/// Byte 0x08: Reserved
///
UINT8 Reserved1[3];
///
/// Revision of the FSP Information Header
/// Byte 0x0B: Revision of the FSP Information Header
///
UINT8 HeaderRevision;
///
/// Revision of the FSP binary
/// Byte 0x0C: Revision of the FSP binary
///
UINT32 ImageRevision;
///
/// Signature string that will help match the FSP Binary to a supported
/// Byte 0x10: Signature string that will help match the FSP Binary to a supported
/// hardware configuration.
///
CHAR8 ImageId[8];
///
/// Size of the entire FSP binary
/// Byte 0x18: Size of the entire FSP binary
///
UINT32 ImageSize;
///
/// FSP binary preferred base address
/// Byte 0x18: FSP binary preferred base address
///
UINT32 ImageBase;
///
/// Attribute for the FSP binary
/// Byte 0x20: Attribute for the FSP binary
///
UINT32 ImageAttribute;
///
/// Offset of the FSP configuration region
/// Byte 0x24: Offset of the FSP configuration region
///
UINT32 CfgRegionOffset;
///
/// Size of the FSP configuration region
/// Byte 0x24: Size of the FSP configuration region
///
UINT32 CfgRegionSize;
///
/// Number of API entries this FSP supports
/// Byte 0x2C: Number of API entries this FSP supports
///
UINT32 ApiEntryNum;
///
/// TempRamInit API entry offset
/// Byte 0x30: The offset for the API to setup a temporary stack till the memory
/// is initialized.
///
UINT32 TempRamInitEntryOffset;
///
/// FspInit API entry offset
/// Byte 0x34: The offset for the API to initialize the CPU and the chipset (SOC)
///
UINT32 FspInitEntryOffset;
///
/// NotifyPhase API entry offset
/// Byte 0x38: The offset for the API to inform the FSP about the different stages
/// in the boot process
///
UINT32 NotifyPhaseEntryOffset;
///
/// Reserved
/// Below field is added in FSP 1.1
///
UINT32 Reserved2;
///
/// Byte 0x3C: The offset for the API to initialize the memory
///
UINT32 FspMemoryInitEntryOffset;
///
/// Byte 0x40: The offset for the API to tear down temporary RAM
///
UINT32 TempRamExitEntryOffset;
///
/// Byte 0x44: The offset for the API to initialize the CPU and chipset
///
UINT32 FspSiliconInitEntryOffset;
} FSP_INFO_HEADER;
///
/// Below structure is added in FSP 1.1
///
typedef struct {
///
/// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header
///
UINT32 Signature;
///
/// Byte 0x04: Length of the FSP Extended Header
///
UINT32 HeaderLength;
///
/// Byte 0x08: Revision of the FSP Extended Header
///
UINT8 Revision;
///
/// Byte 0x09: Reserved for future use.
///
UINT8 Reserved;
///
/// Byte 0x0A: An OEM-supplied string that defines the OEM
///
CHAR8 OemId[6];
///
/// Byte 0x10: An OEM-supplied revision number. Larger numbers are assumed to be newer revisions.
///
UINT32 OemRevision;
} FSP_EXTENTED_HEADER;
#pragma pack()
#endif

View File

@@ -2,7 +2,7 @@
Intel FSP Hob Guid definition from Intel Firmware Support Package External
Architecture Specification, April 2014, revision 001.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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,7 +16,9 @@
#ifndef __GUID_HOB_FSP_EAS_GUID__
#define __GUID_HOB_FSP_EAS_GUID__
extern EFI_GUID gFspBootLoaderTemporaryMemoryGuid;
extern EFI_GUID gFspBootLoaderTempMemoryGuid;
extern EFI_GUID gFspBootLoaderTemporaryMemoryGuid; // Same as gFspBootLoaderTempMemoryGuid
extern EFI_GUID gFspReservedMemoryResourceHobGuid;
extern EFI_GUID gFspNonVolatileStorageHobGuid;

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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
@@ -170,4 +170,37 @@ SetFspMeasurePoint (
IN UINT8 Id
);
/**
This function gets the FSP info header pointer.
@retval FspInfoHeader FSP info header pointer
**/
FSP_INFO_HEADER *
EFIAPI
GetFspInfoHeader (
VOID
);
/**
This function gets FSP API calling mode
@retval API calling mode
**/
UINT8
EFIAPI
GetFspApiCallingMode (
VOID
);
/**
This function sets FSP API calling mode
@param[in] Mode API calling mode
**/
VOID
EFIAPI
SetFspApiCallingMode (
UINT8 Mode
);
#endif

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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
@@ -37,6 +37,16 @@ FspMigrateTemporaryMemory (
VOID
);
/**
Set a new stack frame for the continuation function
**/
VOID
EFIAPI
FspSetNewStackFrame (
VOID
);
/**
This function transfer control to the ContinuationFunc passed in by the
bootloader.

View File

@@ -1,27 +0,0 @@
/** @file
Copyright (c) 2014, 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
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _FSP_RETURN_LIB_H_
#define _FSP_RETURN_LIB_H_
/**
Return the control from FSP to the Caller.
**/
VOID
EFIAPI
AsmFspReturn (
VOID
);
#endif

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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
@@ -34,6 +34,8 @@ typedef struct {
FSP_PLAT_DATA PlatformData;
FSP_INFO_HEADER *FspInfoHeader;
VOID *UpdDataRgnPtr;
UINT8 ApiMode;
UINT8 Reserved[3];
UINT32 PerfIdx;
UINT64 PerfData[32];
// UINT64 PerfData[FixedPcdGet32(PcdFspMaxPerfEntry)];

View File

@@ -1,6 +1,6 @@
/** @file
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, 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
@@ -25,6 +25,7 @@ typedef struct {
UINT8 Reserved;
UINT32 PatchEntryNum;
UINT32 PatchData[FixedPcdGet32(PcdFspMaxPatchEntry)];
UINT32 VpdBase;
} FSP_PATCH_TABLE;
#pragma pack()