Skip to content

Commit

Permalink
IntelFsp2WrapperPkg/FspiWrapperPeim : Support dispatch mode
Browse files Browse the repository at this point in the history
Add FSP-SMM code for dispatch mode.

Signed-off-by: Hongbin1 Zhang <[email protected]>
Cc: Chasel Chiu <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Duggapu Chinni B <[email protected]>
Cc: Chen Gang C <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Ted Kuo <[email protected]>
Cc: Ashraf Ali S <[email protected]>
Cc: Ray Ni <[email protected]>
  • Loading branch information
hongbin123 committed Oct 11, 2024
1 parent 4e9442b commit 1d200a0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
37 changes: 36 additions & 1 deletion IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}
6 changes: 5 additions & 1 deletion IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@
PeimEntryPoint
PeiServicesLib
PeiServicesTablePointerLib
DebugLib
MemoryAllocationLib

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

[Ppis]

[Pcd]
gIntelFsp2WrapperTokenSpaceGuid.PcdFspiBaseAddress ## CONSUMES

[Guids]

[Sources]
FspiWrapperPeim.c

[Depex]
TRUE
gEfiPeiMemoryDiscoveredPpiGuid
3 changes: 2 additions & 1 deletion IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit 1d200a0

Please sign in to comment.