summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongbin1 Zhang <hongbin1.zhang@intel.com>2024-10-07 13:29:56 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-20 06:29:58 +0000
commite374edc1802bed974b4881df18510d17f6ec1796 (patch)
tree73d995264d5f62774bf9f3b25e8c2af610920f2a
parent6fd8533b6282047f418a07aa288296335c2f9fc4 (diff)
downloadedk2-e374edc1802bed974b4881df18510d17f6ec1796.tar.gz
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>
-rw-r--r--IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c37
-rw-r--r--IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf6
-rw-r--r--IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec3
3 files changed, 43 insertions, 3 deletions
diff --git a/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c b/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c
index f3efaa6da1..3d1d66c314 100644
--- a/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.c
@@ -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;
}
diff --git a/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf b/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf
index 156033523e..07ab497333 100644
--- a/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspiWrapperPeim/FspiWrapperPeim.inf
@@ -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
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index 6865ffaf13..7649da74e8 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -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
#