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:Nate DeSimone <nathaniel.l.desimone@intel.com> Reviewed-by:
Chasel Chiu <chasel.chiu@intel.com> Reviewed-by:
Michael Kubacki <michael.a.kubacki@intel.com>
Loading
Please register or sign in to comment