]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/PlatformPei/Fv.c
OvmfPkg: Split MAINFV into a separate PEI and DXE FVs
[mirror_edk2.git] / OvmfPkg / PlatformPei / Fv.c
CommitLineData
49ba9447 1/** @file\r
2 Build FV related hobs for platform.\r
3\r
b36f701d 4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
56d7640a 5 This program and the accompanying materials\r
49ba9447 6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "PiPei.h"\r
16#include <Library/DebugLib.h>\r
49ba9447 17#include <Library/HobLib.h>\r
18#include <Library/PeiServicesLib.h>\r
49ba9447 19#include <Library/PcdLib.h>\r
20\r
21\r
22/**\r
b36f701d
JJ
23 Publish PEI & DXE (Decompressed) Memory based FVs to let PEI\r
24 and DXE know about them.\r
49ba9447 25\r
26 @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.\r
27\r
28**/\r
29EFI_STATUS\r
30PeiFvInitialization (\r
31 VOID\r
32 )\r
33{\r
b36f701d 34 DEBUG ((EFI_D_INFO, "Platform PEI Firmware Volume Initialization\n"));\r
49ba9447 35\r
b36f701d
JJ
36 //\r
37 // Create a memory allocation HOB for the PEI FV.\r
38 //\r
39 // This is marked as ACPI NVS so it will still be available on S3 resume.\r
40 //\r
41 BuildMemoryAllocationHob (\r
42 PcdGet32 (PcdOvmfPeiMemFvBase),\r
43 PcdGet32 (PcdOvmfPeiMemFvSize),\r
44 EfiACPIMemoryNVS\r
49ba9447 45 );\r
46\r
b36f701d
JJ
47 //\r
48 // Let DXE know about the DXE FV\r
49 //\r
50 BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));\r
49ba9447 51\r
c1c2669c 52 //\r
b36f701d 53 // Create a memory allocation HOB for the DXE FV.\r
c1c2669c 54 //\r
55 BuildMemoryAllocationHob (\r
b36f701d
JJ
56 PcdGet32 (PcdOvmfDxeMemFvBase),\r
57 PcdGet32 (PcdOvmfDxeMemFvSize),\r
c1c2669c 58 EfiBootServicesData\r
49ba9447 59 );\r
60\r
b36f701d
JJ
61 //\r
62 // Let PEI know about the DXE FV so it can find the DXE Core\r
63 //\r
64 PeiServicesInstallFvInfoPpi (\r
65 NULL,\r
66 (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),\r
67 PcdGet32 (PcdOvmfDxeMemFvSize),\r
68 NULL,\r
69 NULL\r
70 );\r
71\r
49ba9447 72 return EFI_SUCCESS;\r
73}\r
74\r