From 68d47eea422d64eeb9872b927620f579f4ccfc0f Mon Sep 17 00:00:00 2001 From: "Chasel, Chiu" Date: Fri, 12 Apr 2019 16:54:47 +0800 Subject: IntelFsp2WrapperPkg: Perform post FSP-S process. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1716 In API mode FSP wrapper will perform some post FSP-S process but such process was skipped in Dispatch mode which may impact some of the boot loaders. To align behavior between API and Dispatch, an End-of-Pei callback is introduced to perform same process in Dispatch mode. Note: If boot loader implemented its own PostFspsHobProcess (), it has to check PcdFspModeSelection and support each mode properly. Test: Verified on internal platform and both FSP API and Dispatch modes booted successfully. Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Star Zeng Reviewed-by: Nate DeSimone --- .../FspWrapperHobProcessLibSample.c | 18 +++++++++++++++--- .../PeiFspWrapperHobProcessLibSample.inf | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'IntelFsp2WrapperPkg/Library') diff --git a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c index 1c7f661c47..54cebe127c 100644 --- a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c +++ b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c @@ -1,7 +1,7 @@ /** @file Sample to provide FSP wrapper hob process related function. - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -378,7 +378,19 @@ PostFspsHobProcess ( IN VOID *FspHobList ) { - ProcessFspHobList (FspHobList); - + // + // PostFspsHobProcess () will be called in both FSP API and Dispatch modes to + // align the same behavior and support a variety of boot loader implementations. + // Boot loader provided library function is recommended to support both API and + // Dispatch modes by checking PcdFspModeSelection. + // + if (PcdGet8 (PcdFspModeSelection) == 1) { + // + // Only in FSP API mode the wrapper has to build hobs basing on FSP output data. + // In this case FspHobList cannot be NULL. + // + ASSERT (FspHobList != NULL); + ProcessFspHobList (FspHobList); + } return EFI_SUCCESS; } diff --git a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/PeiFspWrapperHobProcessLibSample.inf b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/PeiFspWrapperHobProcessLibSample.inf index 938ffae494..6d9e306313 100644 --- a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/PeiFspWrapperHobProcessLibSample.inf +++ b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/PeiFspWrapperHobProcessLibSample.inf @@ -1,7 +1,7 @@ ## @file # Sample to provide FSP wrapper hob process related function. # -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -61,6 +61,7 @@ [Pcd] gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize ## CONSUMES gIntelFsp2WrapperTokenSpaceGuid.PcdPeiRecoveryMinMemSize ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES [Guids] gFspReservedMemoryResourceHobGuid ## CONSUMES ## HOB -- cgit v1.2.3