summaryrefslogtreecommitdiff
path: root/IntelFspPkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFspPkg/Library')
-rw-r--r--IntelFspPkg/Library/BaseFspCommonLib/FspCommonLib.c85
-rw-r--r--IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c23
-rw-r--r--IntelFspPkg/Library/SecFspSecPlatformLibNull/PlatformSecLibNull.c17
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;
+}
+