]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/PlatformPei/Fv.c
OvmfPkg: Split MAINFV into a separate PEI and DXE FVs
[mirror_edk2.git] / OvmfPkg / PlatformPei / Fv.c
index f389e277c958a937f9218bf65100452e737635b2..fbdb597043ec5a124d5422c65b1484b3e339e796 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
 \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 +31,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
+  // This is marked as ACPI NVS so it will still be available on S3 resume.\r
+  //\r
+  BuildMemoryAllocationHob (\r
+    PcdGet32 (PcdOvmfPeiMemFvBase),\r
+    PcdGet32 (PcdOvmfPeiMemFvSize),\r
+    EfiACPIMemoryNVS\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