Vlv2TbltDevicePkg: Sync the branch changes to Trunk,

Add 'yL' build option to enable SPI lock for MinnowBoard Max.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18777 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tim He 2015-11-12 08:33:12 +00:00 committed by timhe
parent 0ce8410ed7
commit 83586b5d50
6 changed files with 40 additions and 11 deletions

View File

@ -86,6 +86,12 @@ if /i "%~1"=="/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
@ -93,6 +99,7 @@ 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"
@ -151,16 +158,10 @@ 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

View File

@ -6,9 +6,10 @@ 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
@ -60,6 +61,9 @@ for (( i=1; i<=$#; ))
elif [ "$1" == "/nV" ]; then
Stitch_Flags="$Stitch_Flags /nV"
shift
elif [ "$1" == "/yL" ]; then
Build_Flags="$Build_Flags /yL"
shift
else
break
fi

View File

@ -19,6 +19,7 @@ SetLocal EnableDelayedExpansion EnableExtensions
set exitCode=0
set BackupRom=1
set UpdateVBios=1
set SpiLock=0
set Stitch_Config=Stitch_Config.txt
copy /y nul Stitching.log >nul
@ -47,6 +48,12 @@ if /i "%~1"=="/nB" (
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
@ -103,6 +110,11 @@ for /f "delims== tokens=1,2" %%i in (%Stitch_Config%) do (
)
)
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
@ -168,7 +180,7 @@ for %%i in (%BIOS_Names%) do (
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%
@ -178,7 +190,8 @@ for %%i in (%BIOS_Names%) do (
echo.
echo Generating IFWI... %BIOS_ID%.bin
echo.
copy /b/y IFWIHeader\!IFWI_HEADER!.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin + IFWIHeader\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 ===========================================================================
)

View File

@ -29,6 +29,7 @@ echo -e $(date)
Build_Flags=
exitCode=0
Arch=X64
SpiLock=0
## Clean up previous build files.
if [ -e $(pwd)/EDK2.log ]; then
@ -104,6 +105,9 @@ for (( i=1; i<=$#; ))
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
@ -206,6 +210,13 @@ 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
@ -223,7 +234,7 @@ BIOS_Name="$BOARD_ID"_"$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR".RO
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.1067
cat ./$PLATFORM_PACKAGE/Stitch/IFWIHeader/IFWI_HEADER.bin ./Vlv2MiscBinariesPkg/SEC/$SEC_VERSION/VLV_SEC_REGION.bin ./$PLATFORM_PACKAGE/Stitch/IFWIHeader/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 ..."