summaryrefslogtreecommitdiff
path: root/IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c
diff options
context:
space:
mode:
authorYao, Jiewen <Jiewen.Yao@intel.com>2015-08-02 04:02:37 +0000
committerjyao1 <jyao1@Edk2>2015-08-02 04:02:37 +0000
commitb23441875c34bd15badb76e8d0b001ebd5d7010d (patch)
tree2723ccebc4f5589f709021770ea12febe49b34c7 /IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c
parent7669f7349829f0e4755552ba0d6e600492fd8170 (diff)
downloadedk2-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/BaseFspPlatformLib/FspPlatformMemory.c')
-rw-r--r--IntelFspPkg/Library/BaseFspPlatformLib/FspPlatformMemory.c23
1 files changed, 18 insertions, 5 deletions
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));
+ }
}
//