]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/PlatformPei/Fv.c
Add initial version of Open Virtual Machine Firmware (OVMF) platform.
[mirror_edk2.git] / OvmfPkg / PlatformPei / Fv.c
1 /** @file
2 Build FV related hobs for platform.
3
4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "PiPei.h"
16 #include <Library/DebugLib.h>
17 #include <Library/PeimEntryPoint.h>
18 #include <Library/HobLib.h>
19 #include <Library/PeiServicesLib.h>
20 #include <Library/PeiServicesTablePointerLib.h>
21 #include <Library/PcdLib.h>
22
23
24 /**
25 Perform a call-back into the SEC simulator to get address of the Firmware Hub
26
27 @param FfsHeader Ffs Header availible to every PEIM
28 @param PeiServices General purpose services available to every PEIM.
29
30 @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.
31
32 **/
33 EFI_STATUS
34 PeiFvInitialization (
35 VOID
36 )
37 {
38 EFI_PHYSICAL_ADDRESS FdBase;
39
40 DEBUG ((EFI_D_ERROR, "Platform PEI Firmware Volume Initialization\n"));
41
42 DEBUG (
43 (EFI_D_ERROR, "Firmware Volume HOB: 0x%x 0x%x\n",
44 PcdGet32 (PcdOvmfFlashFvRecoveryBase),
45 PcdGet32 (PcdOvmfFlashFvRecoverySize)
46 )
47 );
48
49 FdBase = PcdGet32 (PcdOvmfFlashFvRecoveryBase) - PcdGet32 (PcdVariableStoreSize) - PcdGet32 (PcdFlashNvStorageFtwSpareSize);
50 BuildFvHob (PcdGet32 (PcdOvmfFlashFvRecoveryBase), PcdGet32 (PcdOvmfFlashFvRecoverySize));
51
52 BuildResourceDescriptorHob (
53 EFI_RESOURCE_FIRMWARE_DEVICE,
54 (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
55 FdBase,
56 PcdGet32 (PcdOvmfFirmwareFdSize)
57 );
58
59 return EFI_SUCCESS;
60 }
61