diff options
author | Chasel, Chiu <chasel.chiu@intel.com> | 2019-04-12 16:54:47 +0800 |
---|---|---|
committer | Chasel Chiu <chasel.chiu@intel.com> | 2019-04-16 12:46:58 +0800 |
commit | 68d47eea422d64eeb9872b927620f579f4ccfc0f (patch) | |
tree | 1f3b0682ab8f1e2bb9d6c438e46de97be0f3837e /IntelFsp2WrapperPkg/Library | |
parent | eb33b3994d06de418222e664cb1c17369436e93c (diff) | |
download | edk2-68d47eea422d64eeb9872b927620f579f4ccfc0f.tar.gz |
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 <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Diffstat (limited to 'IntelFsp2WrapperPkg/Library')
2 files changed, 17 insertions, 4 deletions
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.<BR>
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
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.<BR>
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
#
# 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
|