Skip to content
Commit 0d076ec2 authored by Nate DeSimone's avatar Nate DeSimone
Browse files

MinPlatformPkg: Remove BoardInitLib dependency from PlatformSecLib



SecFspWrapperPlatformSecLib contains the implementation of
SecPlatformDisableTemporaryMemory(), which SecMain in UefiCpuPkg will
call as part of its implementation of EFI_PEI_TEMPORARY_RAM_DONE_PPI.
For platforms that use FSP, the implementation of
SecPlatformDisableTemporaryMemory() can be made generic since the chipset
specifics will be contained in FspTempRamExit().

The Minimum Platform Specification provides the BoardPkg two
interface hook points, BoardInitBeforeTempRamExit() and
BoardInitAfterTempRamExit() which must be called during
SecPlatformDisableTemporaryMemory(). Due to EFI_PEI_TEMPORARY_RAM_DONE_PPI
being a special case of a PPI that is implemented in SEC, these two
functions are the only ones in BoardInitLib that need to be called
by SEC.

Linking BoardInitLib with SEC places many restrictions on the
implementation of that library. The features available to SEC phase
code are very minimal. Since this code runs during PEI phase, these
restrictions are not actually required.

Instead of directly linking with BoardInitLib,
SecPlatformDisableTemporaryMemory() shall call BoardInitLib indirectly
through a PPI (PLATFORM_INIT_TEMP_RAM_EXIT_PPI.) This PPI is produced
by PlatformInitPreMem, which implements the other BoardInitLib calls
already, so this change should also slightly reduce the size of the
final binary image since less PE/COFF images will need to link with
BoardInitLib.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: default avatarNate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: default avatarChasel Chiu <chasel.chiu@intel.com>
Reviewed-by: default avatarMichael Kubacki <michael.a.kubacki@intel.com>
parent eed57c63
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment