Signed-off-by: Tim He <tim...@intel.com> --- Vlv2TbltDevicePkg/Build_IFWI.bat | 15 ++++++++------- Vlv2TbltDevicePkg/Build_IFWI.sh | 6 +++++- Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat | 17 +++++++++++++++-- Vlv2TbltDevicePkg/bld_vlv.sh | 13 ++++++++++++- 4 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/Vlv2TbltDevicePkg/Build_IFWI.bat b/Vlv2TbltDevicePkg/Build_IFWI.bat index a07a826..e33a3bd 100644 --- a/Vlv2TbltDevicePkg/Build_IFWI.bat +++ b/Vlv2TbltDevicePkg/Build_IFWI.bat @@ -84,17 +84,24 @@ if /i "%~1"=="/nM" ( if /i "%~1"=="/nB" ( set Stitch_Flags=%Stitch_Flags% /nB shift goto OptLoop ) +if /i "%~1"=="/yL" ( + set Stitch_Flags=%Stitch_Flags% /yL + shift + goto OptLoop +) + :: Require 2 input parameters if "%~2"=="" goto Usage :: Assign required arguments set Platform_Type=%~1 set Build_Target=%~2 + if "%~3"=="" ( set "IFWI_Suffix= " ) else set "IFWI_Suffix=/S %~3" :: Build BIOS @@ -149,20 +156,14 @@ goto Exit :Usage echo Script to build BIOS firmware and stitch the entire IFWI. echo. echo Usage: Build_IFWI.bat [options] PlatformType BuildTarget [IFWI Suffix] echo. -echo /q Quiet mode. Only display Fatal Errors (slightly faster) -echo /l Log a copy of the build output to EDK2.log echo /c CleanAll before building -echo /ecp ECP build enable -echo /src Build silicon source code (default binary) echo /x64 Set Arch to X64 (default: X64) echo /IA32 Set Arch to IA32 (default: X64) -echo /nG Do NOT update the GOP driver when stitching (ie keep src version) -echo /nM Do NOT update the Microcode when stitching (ie keep src version) -echo /nB Do NOT create a backup of BIOS.ROM before modifying it for Stitch +echo /yL Enable SPI lock echo. echo Platform Types: MNW2 echo Build Targets: Release, Debug echo IFWI Suffix: Suffix to append to end of IFWI filename (default: MM_DD_YYYY) echo. diff --git a/Vlv2TbltDevicePkg/Build_IFWI.sh b/Vlv2TbltDevicePkg/Build_IFWI.sh index f5e499c..4a11a1c 100755 --- a/Vlv2TbltDevicePkg/Build_IFWI.sh +++ b/Vlv2TbltDevicePkg/Build_IFWI.sh @@ -4,13 +4,14 @@ ##********************************************************************** function Usage ( ) { echo echo "Script to build BIOS firmware and stitch the entire IFWI." echo - echo "Usage: Build_IFWI.bat PlatformType BuildTarget " + echo "Usage: Build_IFWI.bat [options] PlatformType BuildTarget " echo echo + echo " /yL [option] : Enable SPI lock" echo " Platform Types: MNW2" echo " Build Targets: Release, Debug" echo echo " See Stitch/Stitch_Config.txt for additional stitching settings." echo @@ -58,10 +59,13 @@ for (( i=1; i<=$#; )) Stitch_Flags="$Stitch_Flags /nB" shift elif [ "$1" == "/nV" ]; then Stitch_Flags="$Stitch_Flags /nV" shift + elif [ "$1" == "/yL" ]; then + Build_Flags="$Build_Flags /yL" + shift else break fi done diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat index bc9d3c3..f3a9cf3 100644 --- a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat +++ b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat @@ -17,10 +17,11 @@ SetLocal EnableDelayedExpansion EnableExtensions :: Set script defaults set exitCode=0 set BackupRom=1 set UpdateVBios=1 +set SpiLock=0 set Stitch_Config=Stitch_Config.txt copy /y nul Stitching.log >nul :: Set default Suffix as: YYYY_MM_DD_HHMM set hour=%time: =0% @@ -45,10 +46,16 @@ if /i "%~1"=="/nV" ( if /i "%~1"=="/nB" ( set BackupRom=0 shift goto OptLoop ) +if /i "%~1"=="/yL" ( + set SpiLock=1 + shift + goto OptLoop +) + if /i "%~1"=="/B" ( if "%~2"=="" goto Usage if not exist %~2 echo BIOS not found. & goto Usage set BIOS_Names=%~2 set BIOS_File_Name=%~n2 @@ -101,10 +108,15 @@ for /f "delims== tokens=1,2" %%i in (%Stitch_Config%) do ( if /i "%%j"=="PV" set Source_Prefix=PV_ if /i "%%j"=="PR1" set Source_Prefix=PR1_ ) ) +if %SpiLock% EQU 1 ( + set IFWI_HEADER_FILE=IFWIHeader\!IFWI_HEADER!_SPILOCK.bin +) else ( + set IFWI_HEADER_FILE=IFWIHeader\!IFWI_HEADER!.bin +) :: ********************************************************************** :: The Main Stitching Loop :: ********************************************************************** echo %date% %time% >>Stitching.log 2>&1 @@ -166,21 +178,22 @@ for %%i in (%BIOS_Names%) do ( echo ********** Stitching !BIOS_Rom! ********** >>Stitching.log echo. >>Stitching.log echo. echo Stitching IFWI for !BIOS_Rom! ... echo --------------------------------------------------------------------------- - echo IFWI Header: !IFWI_HEADER!.bin, SEC version: !SEC_VERSION!, + echo IFWI Header: !IFWI_HEADER_FILE!, SEC version: !SEC_VERSION!, echo BIOS Version: !BIOS_Version! echo Platform Type: !Platform_Type!, IFWI Prefix: %BIOS_ID% echo --------------------------------------------------------------------------- echo ----------------------------- echo. echo Generating IFWI... %BIOS_ID%.bin echo. - copy /b/y IFWIHeader\!IFWI_HEADER!.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\Vacant.bin + !BIOS_Rom! %BIOS_ID%.bin + + copy /b/y !IFWI_HEADER_FILE! + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\Vacant.bin + !BIOS_Rom! %BIOS_ID%.bin echo. echo =========================================================================== ) @echo off diff --git a/Vlv2TbltDevicePkg/bld_vlv.sh b/Vlv2TbltDevicePkg/bld_vlv.sh index aff7df9..569865f 100755 --- a/Vlv2TbltDevicePkg/bld_vlv.sh +++ b/Vlv2TbltDevicePkg/bld_vlv.sh @@ -27,10 +27,11 @@ echo -e $(date) #WORKSPACE=$(pwd) #build_threads=($NUMBER_OF_PROCESSORS)+1 Build_Flags= exitCode=0 Arch=X64 +SpiLock=0 ## Clean up previous build files. if [ -e $(pwd)/EDK2.log ]; then rm $(pwd)/EDK2.log fi @@ -102,10 +103,13 @@ for (( i=1; i<=$#; )) echo DEFINE ECP_BUILD_ENABLE = TRUE >> $auto_config_inc shift elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then Arch=X64 shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/YL" ]; then + SpiLock=1 + shift else break fi done @@ -204,10 +208,17 @@ fi echo "Invoking EDK2 build..." build +if [ $SpiLock == "1" ]; then + IFWI_HEADER_FILE=./$PLATFORM_PACKAGE/Stitch/IFWIHeader/IFWI_HEADER_SPILOCK.bin +else + IFWI_HEADER_FILE=./$PLATFORM_PACKAGE/Stitch/IFWIHeader/IFWI_HEADER.bin +fi + +echo $IFWI_HEADER_FILE ##********************************************************************** ## Post Build processing and cleanup ##********************************************************************** @@ -221,11 +232,11 @@ VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c BOARD_ID=$(grep '^BOARD_ID' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-7) BIOS_Name="$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR".ROM BIOS_ID="$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"_GCC.bin cp -f $BUILD_PATH/FV/VLV.fd $WORKSPACE/$BIOS_Name SEC_VERSION=1.0.2.1060v5 -cat ./$PLATFORM_PACKAGE/Stitch/IFWIHeader/IFWI_HEADER.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/VLV_SEC_REGION.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/Vacant.bin $BIOS_Name > ./$PLATFORM_PACKAGE/Stitch/$BIOS_ID +cat $IFWI_HEADER_FILE ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/VLV_SEC_REGION.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/Vacant.bin $BIOS_Name > ./$PLATFORM_PACKAGE/Stitch/$BIOS_ID echo Skip "Running BIOS_Signing ..." echo -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel