summaryrefslogtreecommitdiff
path: root/OvmfPkg/PlatformPei
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2014-01-21 19:39:13 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-01-21 19:39:13 +0000
commitb36f701d4f925172516cfdee72915e3217c92551 (patch)
tree0619ef84b0868d8b15513b5cbd2d7b111bcc527b /OvmfPkg/PlatformPei
parent4b4b783dbe49102e5acaa9852e737820a645a559 (diff)
downloadedk2-platforms-b36f701d4f925172516cfdee72915e3217c92551.tar.xz
OvmfPkg: Split MAINFV into a separate PEI and DXE FVs
By splitting the PEI and DXE phases into separate FVs, we can only reserve the PEI FV for ACPI S3 support. This should save about 7MB. Unfortunately, this all has to happen in a single commit. DEC: * Remove PcdOvmfMemFv(Base|Size) * Add PcdOvmfPeiMemFv(Base|Size) * Add PcdOvmfDxeMemFv(Base|Size) FDF: * Add new PEIFV. Move PEI modules here. * Remove MAINFV * Add PEIFV and DXEFV into FVMAIN_COMPACT - They are added as 2 sections of a file, and compressed together so they should retain good compression * PcdOvmf(Pei|Dxe)MemFv(Base|Size) are set SEC: * Find both the PEI and DXE FVs after decompression. - Copy them separately to their memory locations. Platform PEI driver: * Fv.c: Publish both FVs as appropriate * MemDetect.c: PcdOvmfMemFv(Base|Size) => PcdOvmfDxeMemFv(Base|Size) OVMF.fd before: Non-volatile data storage FVMAIN_COMPACT uncompressed FV FFS file LZMA compressed MAINFV uncompressed individual PEI modules uncompressed FV FFS file compressed with PI_NONE DXEFV uncompressed individual DXE modules uncompressed SECFV uncompressed OVMF.fd after: Non-volatile data storage FVMAIN_COMPACT uncompressed FV FFS file LZMA compressed PEIFV uncompressed individual PEI modules uncompressed DXEFV uncompressed individual DXE modules uncompressed SECFV uncompressed Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15151 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r--OvmfPkg/PlatformPei/Fv.c46
-rw-r--r--OvmfPkg/PlatformPei/MemDetect.c4
-rw-r--r--OvmfPkg/PlatformPei/PlatformPei.inf8
3 files changed, 38 insertions, 20 deletions
diff --git a/OvmfPkg/PlatformPei/Fv.c b/OvmfPkg/PlatformPei/Fv.c
index f389e277c9..fbdb597043 100644
--- a/OvmfPkg/PlatformPei/Fv.c
+++ b/OvmfPkg/PlatformPei/Fv.c
@@ -1,7 +1,7 @@
/** @file
Build FV related hobs for platform.
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -20,10 +20,8 @@
/**
- Perform a call-back into the SEC simulator to get address of the Firmware Hub
-
- @param FfsHeader Ffs Header availible to every PEIM
- @param PeiServices General purpose services available to every PEIM.
+ Publish PEI & DXE (Decompressed) Memory based FVs to let PEI
+ and DXE know about them.
@retval EFI_SUCCESS Platform PEI FVs were initialized successfully.
@@ -33,26 +31,44 @@ PeiFvInitialization (
VOID
)
{
- DEBUG ((EFI_D_ERROR, "Platform PEI Firmware Volume Initialization\n"));
+ DEBUG ((EFI_D_INFO, "Platform PEI Firmware Volume Initialization\n"));
- DEBUG (
- (EFI_D_ERROR, "Firmware Volume HOB: 0x%x 0x%x\n",
- PcdGet32 (PcdOvmfMemFvBase),
- PcdGet32 (PcdOvmfMemFvSize)
- )
+ //
+ // Create a memory allocation HOB for the PEI FV.
+ //
+ // This is marked as ACPI NVS so it will still be available on S3 resume.
+ //
+ BuildMemoryAllocationHob (
+ PcdGet32 (PcdOvmfPeiMemFvBase),
+ PcdGet32 (PcdOvmfPeiMemFvSize),
+ EfiACPIMemoryNVS
);
- BuildFvHob (PcdGet32 (PcdOvmfMemFvBase), PcdGet32 (PcdOvmfMemFvSize));
+ //
+ // Let DXE know about the DXE FV
+ //
+ BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));
//
- // Create a memory allocation HOB.
+ // Create a memory allocation HOB for the DXE FV.
//
BuildMemoryAllocationHob (
- PcdGet32 (PcdOvmfMemFvBase),
- PcdGet32 (PcdOvmfMemFvSize),
+ PcdGet32 (PcdOvmfDxeMemFvBase),
+ PcdGet32 (PcdOvmfDxeMemFvSize),
EfiBootServicesData
);
+ //
+ // Let PEI know about the DXE FV so it can find the DXE Core
+ //
+ PeiServicesInstallFvInfoPpi (
+ NULL,
+ (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),
+ PcdGet32 (PcdOvmfDxeMemFvSize),
+ NULL,
+ NULL
+ );
+
return EFI_SUCCESS;
}
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index a1de762681..bd57b7792e 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -1,7 +1,7 @@
/**@file
Memory Detection for Virtual Machines.
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -104,7 +104,7 @@ PublishPeiMemory (
//
// Determine the range of memory to use during PEI
//
- MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize);
+ MemoryBase = PcdGet32 (PcdOvmfDxeMemFvBase) + PcdGet32 (PcdOvmfDxeMemFvSize);
MemorySize = LowerMemorySize - MemoryBase;
if (MemorySize > SIZE_64MB) {
MemoryBase = LowerMemorySize - SIZE_64MB;
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 7fe9d471cb..7c646ab8a0 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -2,7 +2,7 @@
# Platform PEI driver
#
# This module provides platform specific function to detect boot mode.
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -58,8 +58,10 @@
PcdLib
[Pcd]
- gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvBase
- gUefiOvmfPkgTokenSpaceGuid.PcdOvmfMemFvSize
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize