]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/PlatformPei/Fv.c
OvmfPkg/PlatformPei: Allocate PEI FV as ACPI NVS if S3 is supported
[mirror_edk2.git] / OvmfPkg / PlatformPei / Fv.c
index f389e277c958a937f9218bf65100452e737635b2..3ed775c850832f472df524cf8f0522662ec5dae5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Build FV related hobs for platform.\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, 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
@@ -13,6 +13,7 @@
 **/\r
 \r
 #include "PiPei.h"\r
+#include "Platform.h"\r
 #include <Library/DebugLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/PeiServicesLib.h>\r
 \r
 \r
 /**\r
-  Perform a call-back into the SEC simulator to get address of the Firmware Hub\r
-\r
-  @param  FfsHeader     Ffs Header availible to every PEIM\r
-  @param  PeiServices   General purpose services available to every PEIM.\r
+  Publish PEI & DXE (Decompressed) Memory based FVs to let PEI\r
+  and DXE know about them.\r
 \r
   @retval EFI_SUCCESS   Platform PEI FVs were initialized successfully.\r
 \r
@@ -33,26 +32,44 @@ PeiFvInitialization (
   VOID\r
   )\r
 {\r
-  DEBUG ((EFI_D_ERROR, "Platform PEI Firmware Volume Initialization\n"));\r
+  DEBUG ((EFI_D_INFO, "Platform PEI Firmware Volume Initialization\n"));\r
 \r
-  DEBUG (\r
-    (EFI_D_ERROR, "Firmware Volume HOB: 0x%x 0x%x\n",\r
-      PcdGet32 (PcdOvmfMemFvBase),\r
-      PcdGet32 (PcdOvmfMemFvSize)\r
-      )\r
+  //\r
+  // Create a memory allocation HOB for the PEI FV.\r
+  //\r
+  // Allocate as ACPI NVS is S3 is supported\r
+  //\r
+  BuildMemoryAllocationHob (\r
+    PcdGet32 (PcdOvmfPeiMemFvBase),\r
+    PcdGet32 (PcdOvmfPeiMemFvSize),\r
+    mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData\r
     );\r
 \r
-  BuildFvHob (PcdGet32 (PcdOvmfMemFvBase), PcdGet32 (PcdOvmfMemFvSize));\r
+  //\r
+  // Let DXE know about the DXE FV\r
+  //\r
+  BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));\r
 \r
   //\r
-  // Create a memory allocation HOB.\r
+  // Create a memory allocation HOB for the DXE FV.\r
   //\r
   BuildMemoryAllocationHob (\r
-    PcdGet32 (PcdOvmfMemFvBase),\r
-    PcdGet32 (PcdOvmfMemFvSize),\r
+    PcdGet32 (PcdOvmfDxeMemFvBase),\r
+    PcdGet32 (PcdOvmfDxeMemFvSize),\r
     EfiBootServicesData\r
     );\r
 \r
+  //\r
+  // Let PEI know about the DXE FV so it can find the DXE Core\r
+  //\r
+  PeiServicesInstallFvInfoPpi (\r
+    NULL,\r
+    (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),\r
+    PcdGet32 (PcdOvmfDxeMemFvSize),\r
+    NULL,\r
+    NULL\r
+    );\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r