Skip to content

Commit

Permalink
IntelFsp2WrapperPkg: Add FSP 2.4 MultiPhase interface.
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3916

Provide FSP 2.4 MultiPhase wrapper support library.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
  • Loading branch information
ChaselChiu authored and mergify[bot] committed Aug 31, 2022
1 parent df25a54 commit 31a94f7
Show file tree
Hide file tree
Showing 7 changed files with 566 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/** @file
Provide FSP wrapper MultiPhase handling functions.
Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef __FSP_WRAPPER_MULTI_PHASE_PROCESS_LIB_H__
#define __FSP_WRAPPER_MULTI_PHASE_PROCESS_LIB_H__

/**
FSP Wrapper Platform MultiPhase Handler
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
@param[in] PhaseIndex - Indicates current execution phase of FSP MultiPhase initialization.
@retval EFI_STATUS Always return EFI_SUCCESS
**/
VOID
EFIAPI
FspWrapperPlatformMultiPhaseHandler (
IN OUT VOID **FspHobListPtr,
IN UINT8 ComponentIndex,
IN UINT32 PhaseIndex
);

/**
FSP Wrapper Variable Request Handler
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
@retval EFI_UNSUPPORTED FSP Wrapper cannot support the specific variable request
@retval EFI_STATUS Return FSP returned status
**/EFI_STATUS
EFIAPI
FspWrapperVariableRequestHandler (
IN OUT VOID **FspHobListPtr,
IN UINT8 ComponentIndex
);

/**
FSP Wrapper MultiPhase Handler
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
@retval EFI_STATUS Always return EFI_SUCCESS
**/
EFI_STATUS
EFIAPI
FspWrapperMultiPhaseHandler (
IN OUT VOID **FspHobListPtr,
IN UINT8 ComponentIndex
);

#endif
10 changes: 9 additions & 1 deletion IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @file
# Provides drivers and definitions to support fsp in EDKII bios.
#
# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand All @@ -28,6 +28,14 @@

## @libraryclass Provide FSP TPM measurement related function.
FspMeasurementLib|Include/Library/FspMeasurementLib.h

## @libraryclass Provide MultiPhase handling related functions.
FspWrapperMultiPhaseProcessLib|Include/Library/FspWrapperMultiPhaseProcessLib.h

## @libraryclass Provide MultiPhase platform actions related functions.
FspWrapperPlatformMultiPhaseLib|Include/Library/FspWrapperMultiPhaseProcessLib.h


[Guids]
#
# GUID defined in package
Expand Down
6 changes: 5 additions & 1 deletion IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## @file
# Provides drivers and definitions to support fsp in EDKII bios.
#
# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand Down Expand Up @@ -48,6 +48,8 @@
FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/BaseFspWrapperApiTestLibNull.inf
FspMeasurementLib|IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLib.inf
FspWrapperPlatformMultiPhaseLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
FspWrapperMultiPhaseProcessLib|IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf

# FSP platform sample
FspWrapperPlatformLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
Expand Down Expand Up @@ -91,6 +93,8 @@
IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformMultiPhaseLibSample/BaseFspWrapperPlatformMultiPhaseLibSample.inf
IntelFsp2WrapperPkg/Library/FspWrapperMultiPhaseProcessLib/FspWrapperMultiPhaseProcessLib.inf

[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## @file
# FSP Wrapper to handle platform specific actions for
# FSP MultiPhase (SeparatePhase) Initialization.
#
# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = BaseFspWrapperPlatformMultiPhaseLibSample
FILE_GUID = DB63E5AA-21C6-40BB-879A-CD1762C8427B
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = FspWrapperPlatformMultiPhaseLib

#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64
#

[Sources]
FspWrapperPlatformMultiPhaseLibSample.c

[Packages]
MdePkg/MdePkg.dec
IntelFsp2Pkg/IntelFsp2Pkg.dec
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec

[LibraryClasses]
DebugLib
BaseLib
PcdLib
PeiServicesLib
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/** @file
FSP Wrapper to handle platform specific actions for
FSP MultiPhase (SeparatePhase) Initialization.
Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>

/**
FSP Wrapper Platform MultiPhase Handler
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
@param[in] PhaseIndex - Indicates current execution phase of FSP MultiPhase initialization.
@retval EFI_STATUS Always return EFI_SUCCESS
**/
VOID
EFIAPI
FspWrapperPlatformMultiPhaseHandler (
IN OUT VOID **FspHobListPtr,
IN UINT8 ComponentIndex,
IN UINT32 PhaseIndex
)
{
/* Example platform actions as below
switch (ComponentIndex) {
case FspMultiPhaseMemInitApiIndex:
switch (PhaseIndex) {
case 1:
PlatformAction1 ();
break;
}
break;
case FspMultiPhaseSiInitApiIndex:
switch (PhaseIndex) {
case 1:
PlatformAction2 ();
break;
}
break;
}
*/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## @file
# FSP wrapper to handle FSP MultiPhase (SeparatePhase) Initialization.
#
# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = FspWrapperMultiPhaseProcessLib
FILE_GUID = 11E657B7-C3D8-405B-94C5-516840E67B75
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
LIBRARY_CLASS = FspWrapperMultiPhaseProcessLib

#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32
#

[Sources]
PeiFspWrapperMultiPhaseProcessLib.c

[Packages]
MdePkg/MdePkg.dec
IntelFsp2Pkg/IntelFsp2Pkg.dec
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
MdeModulePkg/MdeModulePkg.dec

[LibraryClasses]
BaseMemoryLib
DebugLib
BaseLib
PcdLib
FspWrapperPlatformLib
PeiServicesLib
FspWrapperPlatformMultiPhaseLib

[Ppis]
gEfiPeiReadOnlyVariable2PpiGuid
gEdkiiPeiVariablePpiGuid

[Pcd]
gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES

0 comments on commit 31a94f7

Please sign in to comment.