Hi Yes, this is sample code we provide in FSP open source library, because we do have requirement to all FSP hon to PEI Hob, so that platform does not need convert them one by one by themselves.
I do call this function in FspSiliconInit, so I think FSP hob is finalized at that moment. And it is approved working in EDKII FSP wrapper. Thank you Yao Jiewen -----Original Message----- From: Rangarajan, Ravi P Sent: Tuesday, October 27, 2015 1:08 AM To: Yao, Jiewen; edk2-devel@lists.01.org Cc: Ma, Maurice; Kinney, Michael D Subject: RE: [patch] Publish FspHob to PEI Hob by default, because most platforms use such logic. Why do we need to add FSP Hobs to PEI Hobs? The issue is with FSP 1.1, the HOB list is not complete by FspMemoryInit and more Hobs can be added during FspSiliconInit. Is it possible to append the two lists together? PEI HOB list followed by FSP HOB list. New PEI HOBs will be inserted before FSP HOB starts. -----Original Message----- From: Yao, Jiewen Sent: Sunday, October 25, 2015 11:23 PM To: edk2-devel@lists.01.org Cc: Yao, Jiewen; Ma, Maurice; Rangarajan, Ravi P; Kinney, Michael D Subject: [patch] Publish FspHob to PEI Hob by default, because most platforms use such logic. PcdDataBaseHobGuid GuidHob is excluded because PCD database in FSP is different with the one in PEI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao, Jiewen <jiewen....@intel.com> Cc: Ma, Maurice <maurice...@intel.com>; Cc: Rangarajan, Ravi P <ravi.p.rangara...@intel.com> Cc: Kinney, Michael D <michael.d.kin...@intel.com> --- .../FspHobProcessLibSample.c | 38 ++++++++++++++++++++++ .../PeiFspHobProcessLibSample.inf | 1 + 2 files changed, 39 insertions(+) diff --git a/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c b/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c index 099980e..471b0fa 100644 --- a/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c +++ b/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcess +++ LibSample.c @@ -25,6 +25,7 @@ #include <Guid/GuidHobFspEas.h> #include <Guid/MemoryTypeInformation.h> +#include <Guid/PcdDataBaseHobGuid.h> #include <Ppi/Capsule.h> // @@ -335,6 +336,41 @@ FspHobProcessForMemoryResource ( } /** + Process FSP HOB list + + @param[in] FspHobList Pointer to the HOB data structure produced by FSP. + +**/ +VOID +ProcessFspHobList ( + IN VOID *FspHobList + ) +{ + EFI_PEI_HOB_POINTERS FspHob; + + FspHob.Raw = FspHobList; + + // + // Add all the HOBs from FSP binary to FSP wrapper + // + while (!END_OF_HOB_LIST (FspHob)) { + if (FspHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) { + // + // Skip FSP binary creates PcdDataBaseHobGuid + // + if (!CompareGuid(&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) { + BuildGuidDataHob ( + &FspHob.Guid->Name, + GET_GUID_HOB_DATA(FspHob), + GET_GUID_HOB_DATA_SIZE(FspHob) + ); + } + } + FspHob.Raw = GET_NEXT_HOB (FspHob); + } +} + +/** BIOS process FspBobList for other data (not Memory Resource Descriptor). @param[in] FspHobList Pointer to the HOB data structure produced by FSP. @@ -347,6 +383,8 @@ FspHobProcessForOtherData ( IN VOID *FspHobList ) { + ProcessFspHobList (FspHobList); + return EFI_SUCCESS; } diff --git a/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProcessLibSample.inf b/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProcessLibSample.inf index 12f922c..c7f35f7 100644 --- a/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProcessLibSample.inf +++ b/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProc +++ essLibSample.inf @@ -70,6 +70,7 @@ [Guids] gFspReservedMemoryResourceHobGuid ## CONSUMES ## HOB gEfiMemoryTypeInformationGuid ## CONSUMES ## GUID + gPcdDataBaseHobGuid ## CONSUMES ## HOB [Ppis] gEfiPeiCapsulePpiGuid ## CONSUMES -- 1.9.5.msysgit.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel