2009-05-27 23:10:18 +02:00
|
|
|
/** @file
|
|
|
|
Build FV related hobs for platform.
|
|
|
|
|
2014-01-21 20:39:13 +01:00
|
|
|
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
2010-04-28 14:43:04 +02:00
|
|
|
This program and the accompanying materials
|
2009-05-27 23:10:18 +02:00
|
|
|
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
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include "PiPei.h"
|
2014-03-04 09:02:59 +01:00
|
|
|
#include "Platform.h"
|
2009-05-27 23:10:18 +02:00
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/HobLib.h>
|
|
|
|
#include <Library/PeiServicesLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2014-01-21 20:39:13 +01:00
|
|
|
Publish PEI & DXE (Decompressed) Memory based FVs to let PEI
|
|
|
|
and DXE know about them.
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Platform PEI FVs were initialized successfully.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
PeiFvInitialization (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
2014-01-21 20:39:13 +01:00
|
|
|
DEBUG ((EFI_D_INFO, "Platform PEI Firmware Volume Initialization\n"));
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2014-01-21 20:39:13 +01:00
|
|
|
//
|
|
|
|
// Create a memory allocation HOB for the PEI FV.
|
|
|
|
//
|
2014-03-04 09:02:59 +01:00
|
|
|
// Allocate as ACPI NVS is S3 is supported
|
2014-01-21 20:39:13 +01:00
|
|
|
//
|
|
|
|
BuildMemoryAllocationHob (
|
|
|
|
PcdGet32 (PcdOvmfPeiMemFvBase),
|
|
|
|
PcdGet32 (PcdOvmfPeiMemFvSize),
|
2014-03-04 09:02:59 +01:00
|
|
|
mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData
|
2009-05-27 23:10:18 +02:00
|
|
|
);
|
|
|
|
|
2014-01-21 20:39:13 +01:00
|
|
|
//
|
|
|
|
// Let DXE know about the DXE FV
|
|
|
|
//
|
|
|
|
BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2010-01-04 17:17:59 +01:00
|
|
|
//
|
2014-01-21 20:39:13 +01:00
|
|
|
// Create a memory allocation HOB for the DXE FV.
|
2010-01-04 17:17:59 +01:00
|
|
|
//
|
|
|
|
BuildMemoryAllocationHob (
|
2014-01-21 20:39:13 +01:00
|
|
|
PcdGet32 (PcdOvmfDxeMemFvBase),
|
|
|
|
PcdGet32 (PcdOvmfDxeMemFvSize),
|
2010-01-04 17:17:59 +01:00
|
|
|
EfiBootServicesData
|
2009-05-27 23:10:18 +02:00
|
|
|
);
|
|
|
|
|
2014-01-21 20:39:13 +01:00
|
|
|
//
|
|
|
|
// Let PEI know about the DXE FV so it can find the DXE Core
|
|
|
|
//
|
|
|
|
PeiServicesInstallFvInfoPpi (
|
|
|
|
NULL,
|
|
|
|
(VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),
|
|
|
|
PcdGet32 (PcdOvmfDxeMemFvSize),
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
);
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
return EFI_SUCCESS;
|
|
|
|
}
|
|
|
|
|