[PATCH] IntelFsp2Pkg: FSPI_UPD is not mandatory.


Chiu, Chasel
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3993
FSPI_UPD is required only When platforms implemented FSP_I component.
Updated the scripts to allow FSPI_UPD not present scenario.
Also fixed FSP_GLOBAL_DATA structure alignment issue and unnecessary
non-backward compatibility change in previous FSP_I patch.

Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
Signed-off-by: Chasel Chiu <chasel.chiu@...>
---
IntelFsp2Pkg/Include/FspGlobalData.h | 5 +++--
IntelFsp2Pkg/Tools/GenCfgOpt.py | 14 ++++++++++----
2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h b/IntelFsp2Pkg/Include/Fs=
pGlobalData.h
index cf94f7b6a5..d1b3dfbfc4 100644
--- a/IntelFsp2Pkg/Include/FspGlobalData.h
+++ b/IntelFsp2Pkg/Include/FspGlobalData.h
@@ -76,15 +76,15 @@ typedef struct {
VOID *TempRamInitUpdPtr;=0D
VOID *MemoryInitUpdPtr;=0D
VOID *SiliconInitUpdPtr;=0D
- VOID *SmmInitUpdPtr;=0D
///=0D
- /// IA32: Offset 0x68; X64: Offset 0x98=0D
+ /// IA32: Offset 0x64; X64: Offset 0x90=0D
/// To store function parameters pointer=0D
/// so it can be retrieved after stack switched.=0D
///=0D
VOID *FunctionParameterPtr;=0D
FSP_INFO_HEADER *FspInfoHeader;=0D
VOID *UpdDataPtr;=0D
+ VOID *SmmInitUpdPtr;=0D
UINTN Reserved5;=0D
///=0D
/// End of UINTN and pointer section=0D
@@ -94,6 +94,7 @@ typedef struct {
UINT16 PerfLen;=0D
UINT16 Reserved7;=0D
UINT32 PerfIdx;=0D
+ UINT32 Reserved8;=0D
UINT64 PerfData[32];=0D
} FSP_GLOBAL_DATA;=0D
=0D
diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt=
.py
index 128b896592..71c48f10e0 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -959,8 +959,13 @@ EndList
UpdTxtFile =3D ''=0D
FvDir =3D self._FvDir=0D
if GuidList[Index] not in self._MacroDict:=0D
- self.Error =3D "%s definition is missing in DSC file" % (G=
uidList[Index])=0D
- return 1=0D
+ NoFSPI =3D False=0D
+ if GuidList[Index] =3D=3D 'FSP_I_UPD_TOOL_GUID':=0D
+ NoFSPI =3D True=0D
+ continue=0D
+ else:=0D
+ self.Error =3D "%s definition is missing in DSC file" =
% (GuidList[Index])=0D
+ return 1=0D
=0D
if UpdTxtFile =3D=3D '':=0D
UpdTxtFile =3D os.path.join(FvDir, self._MacroDict[GuidLis=
t[Index]] + '.txt')=0D
@@ -1296,7 +1301,8 @@ EndList
elif '_S' in SignatureStr[6:6+2]:=0D
TxtBody.append("#define FSPS_UPD_SIGNATURE =
%s /* '%s' */\n\n" % (Item['value'], SignatureStr))=0D
elif '_I' in SignatureStr[6:6+2]:=0D
- TxtBody.append("#define FSPI_UPD_SIGNATURE =
%s /* '%s' */\n\n" % (Item['value'], SignatureStr))=0D
+ if NoFSPI =3D=3D True:=0D
+ TxtBody.append("#define FSPI_UPD_SIGNATURE =
%s /* '%s' */\n\n" % (Item['value'], SignatureStr))=0D
TxtBody.append("\n")=0D
=0D
for Region in ['UPD']:=0D
@@ -1702,7 +1708,7 @@ EndList
=0D
=0D
def Usage():=0D
- print ("GenCfgOpt Version 0.58")=0D
+ print ("GenCfgOpt Version 0.59")=0D
print ("Usage:")=0D
print (" GenCfgOpt UPDTXT PlatformDscFile BuildFvDir =
[-D Macros]")=0D
print (" GenCfgOpt HEADER PlatformDscFile BuildFvDir InputHFile =
[-D Macros]")=0D
--=20
2.35.0.windows.1