Skip to content

Commit

Permalink
MinPlatformPkg: Isolate FSP dependency for PlatformInitPreMem
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddyDengKC committed Oct 18, 2024
1 parent f521ffc commit adda9ec
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <PiPei.h>

UINT8
EFIAPI
FspGetModeSelection (
VOID
)
{
return PcdGet8 (PcdFspModeSelection);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <PiPei.h>

UINT8
EFIAPI
FspGetModeSelection (
VOID
)
{
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ GetPlatformMemorySize (
IN OUT UINT64 *MemorySize
);

UINT8
EFIAPI
FspGetModeSelection (
VOID
);

/**
This function checks the memory range in PEI.
Expand Down Expand Up @@ -505,7 +511,7 @@ PlatformInitPreMem (

BuildMemoryTypeInformation ();

if ((!PcdGetBool (PcdFspWrapperBootMode)) || (PcdGet8 (PcdFspModeSelection) == 0)) {
if ((!PcdGetBool (PcdFspWrapperBootMode)) || (FspGetModeSelection() == 0)) {
//
// Install memory relating PPIs for EDKII native build and FSP dispatch mode
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

[Sources]
PlatformInitPreMem.c
FspSupport.c

[Ppis]
gEfiPeiMemoryDiscoveredPpiGuid
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
### @file
# Component information file for the Platform Init Pre-Memory PEI module.
#
# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
###

[Defines]
INF_VERSION = 0x00010017
BASE_NAME = PlatformInitPreMemNonFsp
FILE_GUID = BEB6F1A6-F6BC-4C34-AB32-F0390A428479
VERSION_STRING = 1.0
MODULE_TYPE = PEIM
ENTRY_POINT = PlatformInitPreMemEntryPoint

[LibraryClasses]
BaseMemoryLib
BoardInitLib
DebugLib
HobLib
IoLib
MemoryAllocationLib
PeimEntryPoint
PeiServicesLib
TestPointCheckLib
TimerLib
SetCacheMtrrLib
ReportCpuHobLib

[Packages]
MinPlatformPkg/MinPlatformPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec

[Pcd]
gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit ## CONSUMES

[FixedPcd]
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiReclaimMemorySize ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtDataMemorySize ## CONSUMES
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtCodeMemorySize ## CONSUMES

[Sources]
PlatformInitPreMem.c
FspSupportNull.c

[Ppis]
gEfiPeiMemoryDiscoveredPpiGuid
gEfiPeiMasterBootModePpiGuid ## PRODUCES
gEfiPeiBootInRecoveryModePpiGuid ## PRODUCES
gPlatformInitTempRamExitPpiGuid ## PRODUCES
gEfiPeiReadOnlyVariable2PpiGuid
gPeiBaseMemoryTestPpiGuid
gPeiPlatformMemorySizePpiGuid

[Guids]
gEfiMemoryTypeInformationGuid

[Depex]
gEfiPeiReadOnlyVariable2PpiGuid

0 comments on commit adda9ec

Please sign in to comment.