1 | /** @file
|
---|
2 | Build FV related hobs for platform.
|
---|
3 |
|
---|
4 | Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
---|
5 | Copyright (c) 2019, Citrix Systems, Inc.
|
---|
6 |
|
---|
7 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 |
|
---|
9 | **/
|
---|
10 |
|
---|
11 | #include "PiPei.h"
|
---|
12 | #include "Platform.h"
|
---|
13 | #include <Library/DebugLib.h>
|
---|
14 | #include <Library/HobLib.h>
|
---|
15 | #include <Library/PeiServicesLib.h>
|
---|
16 | #include <Library/PcdLib.h>
|
---|
17 |
|
---|
18 |
|
---|
19 | /**
|
---|
20 | Publish PEI & DXE (Decompressed) Memory based FVs to let PEI
|
---|
21 | and DXE know about them.
|
---|
22 |
|
---|
23 | @retval EFI_SUCCESS Platform PEI FVs were initialized successfully.
|
---|
24 |
|
---|
25 | **/
|
---|
26 | EFI_STATUS
|
---|
27 | PeiFvInitialization (
|
---|
28 | VOID
|
---|
29 | )
|
---|
30 | {
|
---|
31 | DEBUG ((DEBUG_INFO, "Platform PEI Firmware Volume Initialization\n"));
|
---|
32 |
|
---|
33 | //
|
---|
34 | // Create a memory allocation HOB for the PEI FV.
|
---|
35 | //
|
---|
36 | // Allocate as ACPI NVS is S3 is supported
|
---|
37 | //
|
---|
38 | BuildMemoryAllocationHob (
|
---|
39 | PcdGet32 (PcdOvmfPeiMemFvBase),
|
---|
40 | PcdGet32 (PcdOvmfPeiMemFvSize),
|
---|
41 | EfiBootServicesData
|
---|
42 | );
|
---|
43 |
|
---|
44 | //
|
---|
45 | // Let DXE know about the DXE FV
|
---|
46 | //
|
---|
47 | BuildFvHob (PcdGet32 (PcdOvmfDxeMemFvBase), PcdGet32 (PcdOvmfDxeMemFvSize));
|
---|
48 |
|
---|
49 | //
|
---|
50 | // Create a memory allocation HOB for the DXE FV.
|
---|
51 | //
|
---|
52 | // If "secure" S3 is needed, then SEC will decompress both PEI and DXE
|
---|
53 | // firmware volumes at S3 resume too, hence we need to keep away the OS from
|
---|
54 | // DXEFV as well. Otherwise we only need to keep away DXE itself from the
|
---|
55 | // DXEFV area.
|
---|
56 | //
|
---|
57 | BuildMemoryAllocationHob (
|
---|
58 | PcdGet32 (PcdOvmfDxeMemFvBase),
|
---|
59 | PcdGet32 (PcdOvmfDxeMemFvSize),
|
---|
60 | EfiBootServicesData
|
---|
61 | );
|
---|
62 |
|
---|
63 | //
|
---|
64 | // Let PEI know about the DXE FV so it can find the DXE Core
|
---|
65 | //
|
---|
66 | PeiServicesInstallFvInfoPpi (
|
---|
67 | NULL,
|
---|
68 | (VOID *)(UINTN) PcdGet32 (PcdOvmfDxeMemFvBase),
|
---|
69 | PcdGet32 (PcdOvmfDxeMemFvSize),
|
---|
70 | NULL,
|
---|
71 | NULL
|
---|
72 | );
|
---|
73 |
|
---|
74 | return EFI_SUCCESS;
|
---|
75 | }
|
---|
76 |
|
---|