Update IntelFspPkg to support FSP1.1

-- Add BootLoaderTolumSize support
-- Extend FspApiCallingCheck with ApiParam for BootLoaderTolumSize
-- Rename all Bootloader to BootLoader as official name
-- Rename Ucode to Microcode
-- Remove FspSelfCheck API, because it is merged into SecPlatformInit
-- Add GetFspVpdDataPointer() in FspCommonLib.h
-- Document FspSecPlatformLib.h
-- Reorg FSP_PLAT_DATA data structure to let it match FSP spec.
-- Move helper function in FspSecCore to reduce platform enabling effort
-- Fix LibraryClasses declaration in DEC file.
-- Enhance PatchFv to check if it is valid FSP bin.


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>
Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17196 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao, Jiewen
2015-04-23 08:52:21 +00:00
committed by jyao1
parent 3b7f0a488b
commit 9da591867c
32 changed files with 1094 additions and 373 deletions

View File

@@ -97,10 +97,10 @@ SecGetPlatformData (
TopOfCar = PcdGet32 (PcdTemporaryRamBase) + PcdGet32 (PcdTemporaryRamSize);
FspPlatformData->DataPtr = NULL;
FspPlatformData->CodeRegionSize = 0;
FspPlatformData->MicrocodeRegionBase = 0;
FspPlatformData->MicrocodeRegionSize = 0;
FspPlatformData->CodeRegionBase = 0;
FspPlatformData->MicorcodeRegionBase = 0;
FspPlatformData->MicorcodeRegionSize = 0;
FspPlatformData->CodeRegionSize = 0;
//
// Pointer to the size field
@@ -114,7 +114,7 @@ SecGetPlatformData (
//
DwordSize = 4;
StackPtr = StackPtr - 1 - DwordSize;
CopyMem (&(FspPlatformData->CodeRegionBase), StackPtr, (DwordSize << 2));
CopyMem (&(FspPlatformData->MicrocodeRegionBase), StackPtr, (DwordSize << 2));
StackPtr--;
} else if (*(StackPtr - 1) == FSP_PER0_SIGNATURE) {
//
@@ -138,14 +138,14 @@ SecGetPlatformData (
It needs to be done as soon as possible after the stack is setup.
@param[in,out] PeiFspData Pointer of the FSP global data.
@param[in] BootloaderStack Bootloader stack.
@param[in] BootLoaderStack BootLoader stack.
@param[in] ApiIdx The index of the FSP API.
**/
VOID
FspGlobalDataInit (
IN OUT FSP_GLOBAL_DATA *PeiFspData,
IN UINT32 BootloaderStack,
IN UINT32 BootLoaderStack,
IN UINT8 ApiIdx
)
{
@@ -162,7 +162,7 @@ FspGlobalDataInit (
ZeroMem ((VOID *)PeiFspData, sizeof(FSP_GLOBAL_DATA));
PeiFspData->Signature = FSP_GLOBAL_DATA_SIGNATURE;
PeiFspData->CoreStack = BootloaderStack;
PeiFspData->CoreStack = BootLoaderStack;
PeiFspData->PerfIdx = 2;
SetFspMeasurePoint (FSP_PERF_ID_API_FSPINIT_ENTRY);
@@ -239,25 +239,34 @@ FspDataPointerFixUp (
This function check the FSP API calling condition.
@param[in] ApiIdx Internal index of the FSP API.
@param[in] ApiParam Parameter of the FSP API.
**/
EFI_STATUS
EFIAPI
FspApiCallingCheck (
UINT32 ApiIdx
IN UINT32 ApiIdx,
IN VOID *ApiParam
)
{
EFI_STATUS Status;
FSP_GLOBAL_DATA *FspData;
EFI_STATUS Status;
FSP_GLOBAL_DATA *FspData;
FSP_INIT_PARAMS *FspInitParams;
FSP_INIT_RT_COMMON_BUFFER *FspRtBuffer;
FspInitParams = (FSP_INIT_PARAMS *) ApiParam;
FspRtBuffer = ((FSP_INIT_RT_COMMON_BUFFER *)FspInitParams->RtBufferPtr);
Status = EFI_SUCCESS;
FspData = GetFspGlobalDataPointer ();
FspData = GetFspGlobalDataPointer ();
if (ApiIdx == 1) {
//
// FspInit check
//
if ((UINT32)FspData != 0xFFFFFFFF) {
Status = EFI_UNSUPPORTED;
} else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0)) {
Status = EFI_INVALID_PARAMETER;
}
} else if (ApiIdx == 2) {
//
@@ -276,6 +285,8 @@ FspApiCallingCheck (
//
if ((UINT32)FspData != 0xFFFFFFFF) {
Status = EFI_UNSUPPORTED;
} else if ((FspRtBuffer == NULL) || ((FspRtBuffer->BootLoaderTolumSize % EFI_PAGE_SIZE) != 0)) {
Status = EFI_INVALID_PARAMETER;
}
} else if (ApiIdx == 4) {
//
@@ -305,3 +316,17 @@ FspApiCallingCheck (
return Status;
}
/**
This function gets the boot FV offset in FSP.
@return the boot firmware volumen offset inside FSP binary
**/
UINT32
EFIAPI
GetBootFirmwareVolumeOffset (
VOID
)
{
return PcdGet32 (PcdFspBootFirmwareVolumeBase) - PcdGet32 (PcdFspAreaBaseAddress);
}