IntelFsp2WrapperPkg/FspiWrapperPeim : Support dispatch mode

Add FSP-SMM code for dispatch mode.

Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Chen Gang C <gang.c.chen@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Hongbin1 Zhang 2024-10-07 13:29:56 +08:00 committed by mergify[bot]
parent 6fd8533b62
commit e374edc180
3 changed files with 43 additions and 3 deletions

View File

@ -10,7 +10,37 @@
#include <PiPei.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
/**
Do FSP SMM initialization in Dispatch mode.
@retval FSP SMM initialization status.
**/
EFI_STATUS
EFIAPI
FspiWrapperInitDispatchMode (
VOID
)
{
//
// FSP-I Wrapper running in Dispatch mode and reports FSP-I FV to PEI dispatcher.
//
PeiServicesInstallFvInfoPpi (
&((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspiBaseAddress))->FileSystemGuid,
(VOID *)(UINTN)PcdGet32 (PcdFspiBaseAddress),
(UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspiBaseAddress))->FvLength,
NULL,
NULL
);
return EFI_SUCCESS;
}
/**
This is the entrypoint of PEIM.
@ -27,6 +57,11 @@ FspiWrapperPeimEntryPoint (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
EFI_STATUS Status;
return EFI_SUCCESS;
DEBUG ((DEBUG_INFO, "FspiWrapperPeimEntryPoint\n"));
Status = FspiWrapperInitDispatchMode ();
return Status;
}

View File

@ -30,14 +30,18 @@
PeimEntryPoint
PeiServicesLib
PeiServicesTablePointerLib
DebugLib
MemoryAllocationLib
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
[Ppis]
[Pcd]
gIntelFsp2WrapperTokenSpaceGuid.PcdFspiBaseAddress ## CONSUMES
[Guids]
@ -45,4 +49,4 @@
FspiWrapperPeim.c
[Depex]
TRUE
gEfiPeiMemoryDiscoveredPpiGuid

View File

@ -98,10 +98,11 @@
gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x00000001|UINT8|0x4000000A
#
## These are the base address of FSP-M/S
## These are the base address of FSP-M/S/I
#
gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00001000
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001
gIntelFsp2WrapperTokenSpaceGuid.PcdFspiBaseAddress|0x00000000|UINT32|0x00001002
#
# To provide flexibility for platform to pre-allocate FSP UPD buffer
#