]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
EmbeddedPkg/PrePiLib: Correct function name
[mirror_edk2.git] / IntelFsp2WrapperPkg / FspmWrapperPeim / FspmWrapperPeim.c
index 7b7c5f5d86a465fd3062a5f5a853ffbcdfe593c2..18f04b541a21714a115dab64cd2516ff16a30103 100644 (file)
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi\r
   notify to call FspSiliconInit API.\r
 \r
-  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,7 +65,7 @@ PeiFspMemoryInit (
   FspHobListPtr = NULL;\r
   FspmUpdDataPtr = NULL;\r
 \r
-  FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));\r
+  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));\r
   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));\r
   if (FspmHeaderPtr == NULL) {\r
     return EFI_DEVICE_ERROR;\r
@@ -155,8 +155,20 @@ FspmWrapperInit (
 {\r
   EFI_STATUS           Status;\r
 \r
-  Status = PeiFspMemoryInit ();\r
-  ASSERT_EFI_ERROR (Status);\r
+  Status = EFI_SUCCESS;\r
+\r
+  if (PcdGet8 (PcdFspModeSelection) == 1) {\r
+    Status = PeiFspMemoryInit ();\r
+    ASSERT_EFI_ERROR (Status);\r
+  } else {\r
+    PeiServicesInstallFvInfoPpi (\r
+      NULL,\r
+      (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),\r
+      (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength,\r
+      NULL,\r
+      NULL\r
+      );\r
+  }\r
 \r
   return Status;\r
 }\r