Update IntelFspWrapperPkg according to FSP1.1.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16826 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Yao, Jiewen
2015-02-11 04:41:46 +00:00
committed by jyao1
parent d5fb1edfb1
commit d8043ce905
19 changed files with 923 additions and 270 deletions

View File

@@ -61,6 +61,7 @@
IntelFspWrapperPkg/IntelFspWrapperPkg.dec
[LibraryClasses]
BaseLib
[Guids]
gFspHeaderFileGuid ## CONSUMES ## GUID

View File

@@ -1,7 +1,7 @@
/** @file
Provide FSP API related function.
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
@@ -17,6 +17,7 @@
#include <Guid/FspHeaderFile.h>
#include <Library/FspApiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
/**
@@ -26,9 +27,9 @@
@param[in] Function The 32bit code entry to be executed.
@param[in] Param1 The first parameter to pass to 32bit code.
@return FSP_STATUS.
@return EFI_STATUS.
**/
FSP_STATUS
EFI_STATUS
Execute32BitCode (
IN UINT64 Function,
IN UINT64 Param1
@@ -84,22 +85,25 @@ FspFindFspHeader (
@param[in] FspHeader FSP header pointer.
@param[in] FspInitParams Address pointer to the FSP_INIT_PARAMS structure.
@return FSP status returned by FspInit API.
@return EFI status returned by FspInit API.
**/
FSP_STATUS
EFI_STATUS
EFIAPI
CallFspInit (
IN FSP_INFO_HEADER *FspHeader,
IN FSP_INIT_PARAMS *FspInitParams
)
{
FSP_FSP_INIT FspInitApi;
FSP_STATUS FspStatus;
FSP_INIT FspInitApi;
EFI_STATUS Status;
BOOLEAN InterruptState;
FspInitApi = (FSP_FSP_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspInitEntryOffset);
FspStatus = Execute32BitCode ((UINTN)FspInitApi, (UINTN)FspInitParams);
FspInitApi = (FSP_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspInitEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
Status = Execute32BitCode ((UINTN)FspInitApi, (UINTN)FspInitParams);
SetInterruptState (InterruptState);
return FspStatus;
return Status;
}
/**
@@ -108,9 +112,9 @@ CallFspInit (
@param[in] FspHeader FSP header pointer.
@param[in] NotifyPhaseParams Address pointer to the NOTIFY_PHASE_PARAMS structure.
@return FSP status returned by FspNotifyPhase API.
@return EFI status returned by FspNotifyPhase API.
**/
FSP_STATUS
EFI_STATUS
EFIAPI
CallFspNotifyPhase (
IN FSP_INFO_HEADER *FspHeader,
@@ -118,10 +122,94 @@ CallFspNotifyPhase (
)
{
FSP_NOTIFY_PHASE NotifyPhaseApi;
FSP_STATUS FspStatus;
EFI_STATUS Status;
BOOLEAN InterruptState;
NotifyPhaseApi = (FSP_NOTIFY_PHASE)(UINTN)(FspHeader->ImageBase + FspHeader->NotifyPhaseEntryOffset);
FspStatus = Execute32BitCode ((UINTN)NotifyPhaseApi, (UINTN)NotifyPhaseParams);
InterruptState = SaveAndDisableInterrupts ();
Status = Execute32BitCode ((UINTN)NotifyPhaseApi, (UINTN)NotifyPhaseParams);
SetInterruptState (InterruptState);
return FspStatus;
return Status;
}
/**
Call FSP API - FspMemoryInit.
@param[in] FspHeader FSP header pointer.
@param[in,out] FspMemoryInitParams Address pointer to the FSP_MEMORY_INIT_PARAMS structure.
@return EFI status returned by FspMemoryInit API.
**/
EFI_STATUS
EFIAPI
CallFspMemoryInit (
IN FSP_INFO_HEADER *FspHeader,
IN OUT FSP_MEMORY_INIT_PARAMS *FspMemoryInitParams
)
{
FSP_MEMORY_INIT FspMemoryInitApi;
EFI_STATUS Status;
BOOLEAN InterruptState;
FspMemoryInitApi = (FSP_MEMORY_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspMemoryInitEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
Status = Execute32BitCode ((UINTN)FspMemoryInitApi, (UINTN)FspMemoryInitParams);
SetInterruptState (InterruptState);
return Status;
}
/**
Call FSP API - TempRamExit.
@param[in] FspHeader FSP header pointer.
@param[in,out] TempRamExitParam Address pointer to the TempRamExit parameters structure.
@return EFI status returned by TempRamExit API.
**/
EFI_STATUS
EFIAPI
CallTempRamExit (
IN FSP_INFO_HEADER *FspHeader,
IN OUT VOID *TempRamExitParam
)
{
FSP_TEMP_RAM_EXIT TempRamExitApi;
EFI_STATUS Status;
BOOLEAN InterruptState;
TempRamExitApi = (FSP_TEMP_RAM_EXIT)(UINTN)(FspHeader->ImageBase + FspHeader->TempRamExitEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
Status = Execute32BitCode ((UINTN)TempRamExitApi, (UINTN)TempRamExitParam);
SetInterruptState (InterruptState);
return Status;
}
/**
Call FSP API - FspSiliconInit.
@param[in] FspHeader FSP header pointer.
@param[in,out] FspSiliconInitParam Address pointer to the Silicon Init parameters structure.
@return EFI status returned by FspSiliconInit API.
**/
EFI_STATUS
EFIAPI
CallFspSiliconInit (
IN FSP_INFO_HEADER *FspHeader,
IN OUT VOID *FspSiliconInitParam
)
{
FSP_SILICON_INIT FspSiliconInitApi;
EFI_STATUS Status;
BOOLEAN InterruptState;
FspSiliconInitApi = (FSP_SILICON_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspSiliconInitEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
Status = Execute32BitCode ((UINTN)FspSiliconInitApi, (UINTN)FspSiliconInitParam);
SetInterruptState (InterruptState);
return Status;
}

View File

@@ -1,7 +1,7 @@
/** @file
Execute 32-bit code in Protected Mode.
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,8 +16,8 @@
#include <FspApi.h>
typedef
FSP_STATUS
(FSPAPI *FSP_FUNCTION) (
EFI_STATUS
(EFIAPI *FSP_FUNCTION) (
IN VOID *Param1
);
@@ -28,16 +28,16 @@ FSP_STATUS
@param[in] Function The 32bit code entry to be executed.
@param[in] Param1 The first parameter to pass to 32bit code.
@return FSP_STATUS.
@return EFI_STATUS.
**/
FSP_STATUS
EFI_STATUS
Execute32BitCode (
IN UINT64 Function,
IN UINT64 Param1
)
{
FSP_FUNCTION EntryFunc;
FSP_STATUS Status;
EFI_STATUS Status;
EntryFunc = (FSP_FUNCTION) (UINTN) (Function);
Status = EntryFunc ((VOID *)(UINTN)Param1);

View File

@@ -3,7 +3,7 @@
Provide a thunk function to transition from long mode to compatibility mode to execute 32-bit code and then transit
back to long mode.
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
@@ -81,9 +81,9 @@ AsmExecute32BitCode (
@param[in] Function The 32bit code entry to be executed.
@param[in] Param1 The first parameter to pass to 32bit code.
@return FSP_STATUS.
@return EFI_STATUS.
**/
FSP_STATUS
EFI_STATUS
Execute32BitCode (
IN UINT64 Function,
IN UINT64 Param1