diff options
author | Yao, Jiewen <Jiewen.Yao@intel.com> | 2015-08-02 04:02:37 +0000 |
---|---|---|
committer | jyao1 <jyao1@Edk2> | 2015-08-02 04:02:37 +0000 |
commit | b23441875c34bd15badb76e8d0b001ebd5d7010d (patch) | |
tree | 2723ccebc4f5589f709021770ea12febe49b34c7 /IntelFspPkg/Library | |
parent | 7669f7349829f0e4755552ba0d6e600492fd8170 (diff) | |
download | edk2-platforms-b23441875c34bd15badb76e8d0b001ebd5d7010d.tar.xz |
Add Dual-FSP support (MemoryInitUpd/SiliconInitUpd)
Add FspUpdSignatureCheck() API in FspSecPlatformLib, so that FspSecCore can check if UPD data is valid in FSP API.
Add Set/GetFspMemoryInitUpdDataPointer() and Set/GetFspSiliconInitUpdDataPointer() API in FspCommonLib,
so that core can set this UdpDataPointer and platform code may get UpdDataPointer easily.
Add UpdateMemSiUpdInitOffsetValue function in GenCfgOpt.py tool, so that the MemoryInitUpdOffset and SiUpdInitOffset is recorded.
Add missing EMBED comment in GenCfgOptUserManual.docx
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18123 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFspPkg/Library')
3 files changed, 120 insertions, 5 deletions
diff --git a/IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c index 7de84a0a7e..a31d16bb70 100644 --- a/IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c +++ b/IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c @@ -289,6 +289,91 @@ GetFspUpdDataPointer ( return FspData->UpdDataRgnPtr;
}
+
+/**
+ This function sets the memory init UPD data pointer.
+
+ @param[in] MemoryInitUpdPtr memory init UPD data pointer.
+**/
+VOID
+EFIAPI
+SetFspMemoryInitUpdDataPointer (
+ IN VOID *MemoryInitUpdPtr
+ )
+{
+ FSP_GLOBAL_DATA *FspData;
+
+ //
+ // Get the Fsp Global Data Pointer
+ //
+ FspData = GetFspGlobalDataPointer ();
+
+ //
+ // Set the memory init UPD pointer.
+ //
+ FspData->MemoryInitUpdPtr = MemoryInitUpdPtr;
+}
+
+/**
+ This function gets the memory init UPD data pointer.
+
+ @return memory init UPD data pointer.
+**/
+VOID *
+EFIAPI
+GetFspMemoryInitUpdDataPointer (
+ VOID
+ )
+{
+ FSP_GLOBAL_DATA *FspData;
+
+ FspData = GetFspGlobalDataPointer ();
+ return FspData->MemoryInitUpdPtr;
+}
+
+
+/**
+ This function sets the silicon init UPD data pointer.
+
+ @param[in] SiliconInitUpdPtr silicon init UPD data pointer.
+**/
+VOID
+EFIAPI
+SetFspSiliconInitUpdDataPointer (
+ IN VOID *SiliconInitUpdPtr
+ )
+{
+ FSP_GLOBAL_DATA *FspData;
+
+ //
+ // Get the Fsp Global Data Pointer
+ //
+ FspData = GetFspGlobalDataPointer ();
+
+ //
+ // Set the silicon init UPD data pointer.
+ //
+ FspData->SiliconInitUpdPtr = SiliconInitUpdPtr;
+}
+
+/**
+ This function gets the silicon init UPD data pointer.
+
+ @return silicon init UPD data pointer.
+**/
+VOID *
+EFIAPI
+GetFspSiliconInitUpdDataPointer (
+ VOID
+ )
+{
+ FSP_GLOBAL_DATA *FspData;
+
+ FspData = GetFspGlobalDataPointer ();
+ return FspData->SiliconInitUpdPtr;
+}
+
+
/**
Set FSP measurement point timestamp.
diff --git a/IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c b/IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c index 97cae9ad9d..ed5db933f1 100644 --- a/IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c +++ b/IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c @@ -86,7 +86,9 @@ FspMigrateTemporaryMemory ( FSP_INIT_PARAMS *FspInitParams;
UINT32 *NewStackTop;
VOID *BootLoaderTempRamHob;
- VOID *UpdDataRgnPtr;
+ UINT32 UpdDataRgnPtr;
+ UINT32 MemoryInitUpdPtr;
+ UINT32 SiliconInitUpdPtr;
VOID *PlatformDataPtr;
UINT8 ApiMode;
@@ -105,7 +107,7 @@ FspMigrateTemporaryMemory ( if (ApiMode == 0) {
BootLoaderTempRamHob = BuildGuidHob (&gFspBootLoaderTemporaryMemoryGuid, BootLoaderTempRamSize);
} else {
- BootLoaderTempRamHob = (VOID *)AllocatePool (BootLoaderTempRamSize);
+ BootLoaderTempRamHob = (VOID *)AllocatePages (EFI_SIZE_TO_PAGES (BootLoaderTempRamSize));
}
ASSERT(BootLoaderTempRamHob != NULL);
@@ -150,9 +152,20 @@ FspMigrateTemporaryMemory ( //
// Update UPD pointer in FSP Global Data
//
- UpdDataRgnPtr = ((FSP_INIT_RT_COMMON_BUFFER *)FspInitParams->RtBufferPtr)->UpdDataRgnPtr;
- if (UpdDataRgnPtr != NULL) {
- SetFspUpdDataPointer (UpdDataRgnPtr);
+ if (ApiMode == 0) {
+ UpdDataRgnPtr = (UINT32)((UINT32 *)GetFspUpdDataPointer ());
+ if (UpdDataRgnPtr >= BootLoaderTempRamStart && UpdDataRgnPtr < BootLoaderTempRamEnd) {
+ MemoryInitUpdPtr = (UINT32)((UINT32 *)GetFspMemoryInitUpdDataPointer ());
+ SiliconInitUpdPtr = (UINT32)((UINT32 *)GetFspSiliconInitUpdDataPointer ());
+ SetFspUpdDataPointer ((VOID *)(UpdDataRgnPtr + OffsetGap));
+ SetFspMemoryInitUpdDataPointer ((VOID *)(MemoryInitUpdPtr + OffsetGap));
+ SetFspSiliconInitUpdDataPointer ((VOID *)(SiliconInitUpdPtr + OffsetGap));
+ }
+ } else {
+ MemoryInitUpdPtr = (UINT32)((UINT32 *)GetFspMemoryInitUpdDataPointer ());
+ if (MemoryInitUpdPtr >= BootLoaderTempRamStart && MemoryInitUpdPtr < BootLoaderTempRamEnd) {
+ SetFspMemoryInitUpdDataPointer ((VOID *)(MemoryInitUpdPtr + OffsetGap));
+ }
}
//
diff --git a/IntelFspPkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c b/IntelFspPkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c index 4de2a1d755..d72d05f2e2 100644 --- a/IntelFspPkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c +++ b/IntelFspPkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c @@ -14,4 +14,21 @@ #include <PiPei.h>
+/**
+ This function check the signture of UPD.
+
+ @param[in] ApiIdx Internal index of the FSP API.
+ @param[in] ApiParam Parameter of the FSP API.
+
+**/
+EFI_STATUS
+EFIAPI
+FspUpdSignatureCheck (
+ IN UINT32 ApiIdx,
+ IN VOID *ApiParam
+ )
+{
+ return EFI_SUCCESS;
+}
+
|