diff options
author | Lu, ShifeiX A <shifeix.a.lu@intel.com> | 2017-09-14 13:59:07 +0800 |
---|---|---|
committer | zwei4 <david.wei@intel.com> | 2017-09-14 14:24:54 +0800 |
commit | 6cd1979741110bc949153e1f019bbff33e040fed (patch) | |
tree | 185653158a8ff0ee225b5b7a07241b90d69dbdbc /Platform | |
parent | d0985c22d5c2c7e24fcf82f8bd77dad44eb342b8 (diff) | |
download | edk2-platforms-6cd1979741110bc949153e1f019bbff33e040fed.tar.xz |
Build Script.
Change build script to generate different BIOS ID to differentiate Minnow3 and Benson Glacier board.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Diffstat (limited to 'Platform')
-rw-r--r-- | Platform/BroxtonPlatformPkg/BuildBios.bat | 39 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/BuildBios.sh | 67 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/BuildIFWI.bat | 20 | ||||
-rwxr-xr-x | Platform/BroxtonPlatformPkg/BuildIFWI.sh | 5 | ||||
-rw-r--r-- | Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat | 40 |
5 files changed, 127 insertions, 44 deletions
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat index 7aca176505..3ac411ed41 100644 --- a/Platform/BroxtonPlatformPkg/BuildBios.bat +++ b/Platform/BroxtonPlatformPkg/BuildBios.bat @@ -25,6 +25,7 @@ set exitCode=0 set Arch=X64
set Compiler=VS2013
set FabId=B
+set BoardId=MN
if not defined BiosVersion set BiosVersion=DEV
@@ -165,6 +166,18 @@ if /i "%~1"=="/B" ( shift
goto OptLoop
)
+if /i "%~1"=="/MN" (
+ set BoardId=MN
+ echo.
+ shift
+ goto OptLoop
+)
+if /i "%~1"=="/BG" (
+ set BoardId=BG
+ echo.
+ shift
+ goto OptLoop
+)
:: Required argument(s)
if "%~2"=="" (
@@ -178,7 +191,11 @@ echo. & echo -- Setting compiler to %Compiler% -- & echo. :: BOARD_ID needs to be exactly 7 characters (GenBiosId.exe limitation)
echo Setting %1 platform configuration and BIOS ID...
if /i "%~1" == "%Minnow_RVP%" (
- set BOARD_ID=MINNOWV
+ if %BoardId%==MN (
+ set BOARD_ID=MINNOW3
+ ) else if %BoardId%==BG (
+ set BOARD_ID=BENSONV
+ )
set ENBDT_PF_BUILD=TRUE
set PLATFORM_NAME=BroxtonPlatformPkg
set PLATFORM_PACKAGE=%PLATFORM_PATH%
@@ -216,9 +233,9 @@ if "%Arch%"=="IA32" ( ::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target values removed
if "%Arch%"=="X64" (
- findstr /b /v "BOARD_ID BUILD_TYPE VERSION_MINOR" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+ findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
) else if "%Arch%"=="IA32" (
- findstr /b /v "BOARD_ID BUILD_TYPE VERSION_MINOR BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+ findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
echo BOARD_EXT = I32 >> Conf\BiosId.env
)
@@ -230,10 +247,16 @@ if /i "%~2" == "RELEASE" ( echo BUILD_TYPE = D >> Conf\BiosId.env
)
-if %FabId%==B (
- echo VERSION_MINOR = 0B >> Conf\BiosId.env
-) else (
- echo VERSION_MINOR = 0A >> Conf\BiosId.env
+if %BoardId%==BG (
+ echo BOARD_REV = A >> Conf\BiosId.env
+)
+
+if %BoardId%==MN (
+ if %FabId%==B (
+ echo BOARD_REV = B >> Conf\BiosId.env
+ ) else (
+ echo BOARD_REV = A >> Conf\BiosId.env
+ )
)
:: Set the Build_Type, Version_Major, and Version_Minor environment variables
@@ -405,7 +428,7 @@ if ErrorLevel 1 goto BldFail if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R
echo Copy BIOS...
-set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
+set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
copy /y/b %BUILD_PATH%\FV\Soc.fd %STITCH_PATH%\%BIOS_Name%.ROM >nul
copy /y %STITCH_PATH%\FlashMap.h %STITCH_PATH%\%BIOS_Name%.map >nul
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBios.sh index 3fa450b607..91f84a1e36 100644 --- a/Platform/BroxtonPlatformPkg/BuildBios.sh +++ b/Platform/BroxtonPlatformPkg/BuildBios.sh @@ -29,6 +29,7 @@ SV_String=_ exitCode=0 Arch=X64 FabId=B +BoardId=MN ## Initialize all the build flags to FALSE ## depending on the cmd line input, some will be set to TRUE prior to building @@ -97,6 +98,9 @@ for (( i=1; i<=$#; )) if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then Arch=X64 shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then + BoardId=BG + shift elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then FabId=B shift @@ -119,12 +123,16 @@ fi ## Remove the values for Platform_Type and Build_Target from BiosId.env and stage in Conf/ cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env $WORKSPACE/Conf/BiosId.env sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env +sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env -sed -i '/^VERSION_MINOR/d' $WORKSPACE/Conf/BiosId.env - -BOARD_ID=MNW3 -echo BOARD_ID = MINNOWV >> $WORKSPACE/Conf/BiosId.env +if [ $BoardId == "MN" ]; then + BOARD_ID=MNW3 + echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env +else + BOARD_ID=BEN1 + echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env +fi ENBDT_PF_BUILD=TRUE PLATFORM_NAME=BroxtonPlatformPkg PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg @@ -164,14 +172,22 @@ else echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env fi -if [ $FabId == "B" ]; then - VERSION_MINOR=0B - echo VERSION_MINOR = 0B >> $WORKSPACE/Conf/BiosId.env -else - VERSION_MINOR=0A - echo VERSION_MINOR = 0A >> $WORKSPACE/Conf/BiosId.env +if [ $BoardId == "BG" ]; then + BOARD_REV=A + echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env fi +if [ $BoardId == "MN" ]; then + if [ $FabId == "B" ]; then + BOARD_REV=B + echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env + else + BOARD_REV=A + echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env + fi +fi + + ##********************************************************************** ## Additional EDK Build Setup/Configuration ##********************************************************************** @@ -262,7 +278,7 @@ cp $BUILD_PATH/FV/SOC.fd $BUILD_PATH/FV/Bxt"$Arch".fd ## VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-4) VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-2) -BIOS_Name="$BOARD_ID""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR" +BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR" cp -f $BUILD_PATH/FV/FVOBB.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch @@ -270,16 +286,25 @@ cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Too cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -if [ $FabId == "B" ]; then -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -else -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch +if [ $BoardId == "BG" ]; then + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch +fi + +if [ $BoardId == "MN" ]; then + if [ $FabId == "B" ]; then + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + else + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + fi fi # diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat index 838f9b3999..1af0bf9d33 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -7,6 +7,7 @@ set "Build_Flags= " set Arch=X64 set SkipUsageFlag=FALSE set FabId=B
+set BoardId=MN
set WORKSPACE=%CD% if %WORKSPACE:~-1%==\ ( set WORKSPACE=%WORKSPACE:~0,-1% @@ -90,7 +91,18 @@ if /i "%~1"=="/B" ( shift goto OptLoop ) - +if /i "%~1"=="/MN" (
+ set BoardId=MN
+ set Build_Flags=%Build_Flags% /MN
+ shift
+ goto OptLoop
+)
+if /i "%~1"=="/BG" (
+ set BoardId=BG
+ set Build_Flags=%Build_Flags% /BG
+ shift
+ goto OptLoop
+)
:: Require 2 input parameters if "%~2"=="" ( @@ -130,7 +142,7 @@ del /f/q ver_strings >nul :: Translate Release Build Type if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R -set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR% +set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
:: Start Integration process echo ================================================================================ @@ -139,8 +151,8 @@ echo. echo BIOS ROM input: %BIOS_Name% echo. pushd %STITCH_PATH% - echo - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
- call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
+ echo - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId% %BoardId%
+ call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId% %BoardId%
@echo off popd if ErrorLevel 1 ( diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh index 82d5f4504b..73766ccb4d 100755 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh @@ -35,6 +35,7 @@ exitCode=0 Build_Flags= Arch=IA32 FabId=B +BoardId=MN ## Parse Optional arguments @@ -55,6 +56,10 @@ for (( i=1; i<=$#; )) Arch=X64 Build_Flags="$Build_Flags /x64" shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then + BoardId=BG + Build_Flags="$Build_Flags /BG" + shift elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then FabId=B Build_Flags="$Build_Flags /B" diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat index c3bb2bd7c6..679b0eec1a 100644 --- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat +++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat @@ -30,6 +30,7 @@ if /i "%~1"=="Help" goto Usage set FspWrapper=FALSE
set FabId=B
+set BoardId=MN
if /i "%~2"=="B" (
set FabId=B
@@ -39,6 +40,14 @@ if /i "%~2"=="A" ( set FabId=A
)
+if /i "%~3"=="MN" (
+ set BoardId=MN
+)
+
+if /i "%~3"=="BG" (
+ set BoardId=BG
+)
+
:OptLoop1
if /i "%~1"=="/FspW" (
@@ -95,6 +104,8 @@ if not "!BIOS_Name!"=="!BIOS_Name:_R_=!" ( if /i "!Platform_Type!"=="MINN" (
set Platform_Type=MINN
+) else if /i "!Platform_Type!"=="BENS" (
+ set Platform_Type=BENS
) else (
echo Error - Unsupported PlatformType: !Platform_Type!
goto Usage
@@ -119,18 +130,25 @@ copy /y /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS copy /y /b %BIOS_Names%\IBB.Fv .\BIOS_COMPONENTS
copy /y /b %BIOS_Names%\OBB.Fv .\BIOS_COMPONENTS
copy /y /b %BIOS_Names%\NvStorage.Fv .\BIOS_COMPONENTS
-if %FabId%==B (
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
- copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
- ) else (
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
- copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
- copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
- )
+if %BoardId%==BG (
+ copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk1.bin .
+ copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk2.bin .
+ copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk3.bin .
+ copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+) else if %BoardId%==MN (
+ if %FabId%==B (
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
+ copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+ ) else (
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
+ copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
+ copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+ )
+)
move /y spi_out.bin %BIOS_ID%.bin >> Stitching.log
if !ERRORLEVEL! NEQ 0 (
|