summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/SecCore/SecMain.c
diff options
context:
space:
mode:
authorChasel, Chiu <chasel.chiu@intel.com>2019-02-12 20:38:08 +0800
committerChasel, Chiu <chasel.chiu@intel.com>2019-02-15 13:42:34 +0800
commit373c2c5b888d029d7103206556bb85f33d980569 (patch)
tree62312c9fc8979ca93412da148a0df8ac46f605d5 /UefiCpuPkg/SecCore/SecMain.c
parent9b23c7ba9c599cd8208518d41d6a1d51713c0f9d (diff)
downloadedk2-373c2c5b888d029d7103206556bb85f33d980569.tar.gz
edk2-373c2c5b888d029d7103206556bb85f33d980569.tar.bz2
edk2-373c2c5b888d029d7103206556bb85f33d980569.zip
UefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1524 EFI_PEI_CORE_FV_LOCATION_PPI may be passed by platform when PeiCore not in BFV so SecCore has to search PeiCore either from the FV location provided by EFI_PEI_CORE_FV_LOCATION_PPI or from BFV. Test: Verified on internal platform and booting successfully. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'UefiCpuPkg/SecCore/SecMain.c')
-rw-r--r--UefiCpuPkg/SecCore/SecMain.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c
index b24e190617..d84eb675f5 100644
--- a/UefiCpuPkg/SecCore/SecMain.c
+++ b/UefiCpuPkg/SecCore/SecMain.c
@@ -1,7 +1,7 @@
/** @file
C functions in SEC
- Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2008 - 2019, 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
@@ -232,22 +232,45 @@ SecStartupPhase2(
EFI_PEI_PPI_DESCRIPTOR *AllSecPpiList;
EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint;
+ PeiCoreEntryPoint = NULL;
SecCoreData = (EFI_SEC_PEI_HAND_OFF *) Context;
AllSecPpiList = (EFI_PEI_PPI_DESCRIPTOR *) SecCoreData->PeiTemporaryRamBase;
+
//
// Find Pei Core entry point. It will report SEC and Pei Core debug information if remote debug
// is enabled.
//
- FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase, &PeiCoreEntryPoint);
- if (PeiCoreEntryPoint == NULL)
- {
- CpuDeadLoop ();
+ PpiList = SecPlatformMain (SecCoreData);
+ if (PpiList != NULL) {
+ for (Index = 0;
+ (PpiList[Index].Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) != EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+ Index++) {
+ if (CompareGuid (PpiList[Index].Guid, &gEfiPeiCoreFvLocationPpiGuid) && (((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation != 0)) {
+ FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) ((EFI_PEI_CORE_FV_LOCATION_PPI *) PpiList[Index].Ppi)->PeiCoreFvLocation, &PeiCoreEntryPoint);
+ if (PeiCoreEntryPoint != NULL) {
+ break;
+ } else {
+ //
+ // PeiCore not found
+ //
+ CpuDeadLoop ();
+ }
+ }
+ }
+ }
+ //
+ // If EFI_PEI_CORE_FV_LOCATION_PPI not found, try to locate PeiCore from BFV.
+ //
+ if (PeiCoreEntryPoint == NULL) {
+ FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->BootFirmwareVolumeBase, &PeiCoreEntryPoint);
+ if (PeiCoreEntryPoint == NULL) {
+ CpuDeadLoop ();
+ }
}
//
// Perform platform specific initialization before entering PeiCore.
//
- PpiList = SecPlatformMain (SecCoreData);
if (PpiList != NULL) {
//
// Remove the terminal flag from the terminal PPI