From nobody Fri May 3 13:31:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1509328736535600.5275990824512; Sun, 29 Oct 2017 18:58:56 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 593622034CF96; Sun, 29 Oct 2017 18:55:04 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 32B032034C0B2 for ; Sun, 29 Oct 2017 18:55:03 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2017 18:58:52 -0700 Received: from shwdeopenpsi011.ccr.corp.intel.com (HELO SHWDEOPENPSI011.local) ([10.239.9.136]) by fmsmga005.fm.intel.com with SMTP; 29 Oct 2017 18:58:50 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=shifeix.a.lu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,317,1505804400"; d="scan'208";a="168752605" Date: Mon, 30 Oct 2017 09:58:51 +0800 From: lushifex To: edk2-devel@lists.01.org Message-ID: X-Mailer: TortoiseGit MIME-Version: 1.0 Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: , david.wei@intel.com Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Enhance build script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jarlstrom, Laurie Signed-off-by: lushifex Reviewed-by: zwei4 --- BuildBIOS.bat | 104 +---- BuildBIOS.sh | 28 +- Platform/BroxtonPlatformPkg/BuildBios.bat | 613 -----------------------= ---- Platform/BroxtonPlatformPkg/BuildBios.sh | 333 --------------- Platform/BroxtonPlatformPkg/BuildBxtBios.bat | 612 +++++++++++++++++++++++= +++ Platform/BroxtonPlatformPkg/BuildBxtBios.sh | 333 +++++++++++++++ Platform/BroxtonPlatformPkg/BuildIFWI.bat | 12 +- Platform/BroxtonPlatformPkg/BuildIFWI.sh | 16 +- 8 files changed, 1003 insertions(+), 1048 deletions(-) delete mode 100644 Platform/BroxtonPlatformPkg/BuildBios.bat delete mode 100644 Platform/BroxtonPlatformPkg/BuildBios.sh create mode 100644 Platform/BroxtonPlatformPkg/BuildBxtBios.bat create mode 100644 Platform/BroxtonPlatformPkg/BuildBxtBios.sh diff --git a/BuildBIOS.bat b/BuildBIOS.bat index baf7cdd..7b2394f 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -1,18 +1,12 @@ @echo off echo %date% %time% echo. +setlocal EnableDelayedExpansion EnableExtensions =20 set exitCode=3D0 -set WORKSPACE=3D%CD% -set CORE_PATH=3D%CD% set BuildFlags=3D -set PlatformName=3D -set BuildTarget=3DDebug -set Compiler=3D/vs13 -set Arch=3D/x64 -set FabId=3D/B -set BoardId=3D/MN -set buildthread=3D + +set thisscript=3D%0 =20 :: Optional arguments :OptLoop @@ -20,82 +14,15 @@ set buildthread=3D if /i "%~1"=3D=3D"" goto Usage if /i "%~1"=3D=3D"/?" goto Usage =20 -if /i "%~1"=3D=3D"/IA32" ( - set Arch=3D/IA32 - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/x64" ( - set Arch=3D/x64 - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/vs08" ( - set Compiler=3D/vs08 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs10" ( - set Compiler=3D/vs10 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs12" ( - set Compiler=3D/vs12 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs13" ( - set Compiler=3D/vs13 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs15" ( - set Compiler=3D/vs15 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/A" ( - set FabId=3D/A - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/B" ( - set FabId=3D/B - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/MN" ( - set BoardId=3D/MN - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/BG" ( - set BoardId=3D/BG - echo. - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/m" ( - set buildthread=3D/m - echo. +set BuildOption=3D%~1 +if "!BuildOption:~0,1!"=3D=3D"/" ( + set BuildFlags=3D%BuildFlags% %BuildOption% shift goto OptLoop ) =20 :: Required argument(s) -:: Require 2 input parameters +:: Require 2 input parameters , first parameter without a "/" is Platform = Name if "%~2"=3D=3D"" goto Usage =20 :: Assign required arguments @@ -104,17 +31,26 @@ set BuildTarget=3D%~2 =20 :OptLoopEnd echo ---- Call Build Script of Broxton ---- -echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthre= ad% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarge= t%=20 -call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compi= ler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%=20 + +if not exist Platform\%PlatformName%PlatformPkg\BuildIFWI.bat ( + echo Platform %PlatformName%PlatformPkg does not exist + echo. & echo Error - Unsupported Platform name: %1=20 + echo. + goto Usage +) + +echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFla= gs% /fspw MINN %BuildTarget%=20 +call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFlags% /fspw= MINN %BuildTarget%=20 =20 goto Exit =20 :Usage -echo Usage: BuildBIOS.bat [options] ^ ^ +echo Usage: %thisscript% [options] ^ ^ echo. echo Options: echo. /? Display this help text echo. +echo /m Set the build thread count to number of processors echo /vs13 Set Compiler to vs2013 build (default: vs2013) echo /x64 Set Arch to X64 (default: X64) echo /IA32 Set Arch to IA32 (default: X64) @@ -126,7 +62,7 @@ echo PlatformName: Broxton echo BuildTargets: Release, Debug =20 echo Examples: -echo BuildBIOS.bat /vs13 /B /x64 Broxton Debug +echo %thisscript% /vs13 /B /x64 Broxton Debug =20 set exitCode=3D1 =20 diff --git a/BuildBIOS.sh b/BuildBIOS.sh index aea8daa..5ea0dd8 100755 --- a/BuildBIOS.sh +++ b/BuildBIOS.sh @@ -16,7 +16,7 @@ function Usage () { echo echo "Script to build BIOS firmware and stitch the entire IFWI." echo - echo "Usage: BuildBIOS.sh Build_Flags [PlatformName] Target_Flag" + echo "Usage: BuildBios.sh Build_Flags [PlatformName] Target_Flag" echo echo " Build_Flags: /MN Minnow3 Board (default:= MN)" echo " Build_Flags: /BG Benson Glacier Board" @@ -51,7 +51,11 @@ fi ## Build Flags for (( i=3D1; i<=3D$#; )) do - if [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/BG" ]; then + if [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/MN" ]; then + BoardId=3DMN + Build_Flags=3D"$Build_Flags /MN" + shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/BG" ]; then BoardId=3DBG Build_Flags=3D"$Build_Flags /BG" shift @@ -68,14 +72,22 @@ for (( i=3D1; i<=3D$#; )) fi done =20 -Target_Flag=3DRelease +if [ "$1" =3D=3D "Broxton" ]; then + shift + else + echo "No parameter for board : assume Broxton" =20 +fi + +Target_Flag=3DDebug + if [ "$1" =3D=3D "Debug" ]; then Target_Flag=3DDebug - shift -fi -if [ "$1" =3D=3D "Release" ]; then +elif [ "$1" =3D=3D "Release" ]; then Target_Flag=3DRelease - shift +else + echo "Error - Invalid Target" + echo " Please review the Help screen" + Usage fi =20 echo $Build_Flags @@ -84,7 +96,7 @@ echo $Target_Flag export WORKSPACE=3D`pwd` export PACKAGES_PATH=3D$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WOR= KSPACE/Platform:$WORKSPACE/Platform/BroxtonPlatformPkg:$WORKSPACE/Silicon/B= roxtonSoC:$WORKSPACE/Platform/BroxtonPlatformPkg/Common =20 -. edksetup.sh +. edksetup.sh BaseTools =20 make -C BaseTools =20 diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPl= atformPkg/BuildBios.bat deleted file mode 100644 index 04fe6cc..0000000 --- a/Platform/BroxtonPlatformPkg/BuildBios.bat +++ /dev/null @@ -1,613 +0,0 @@ -@echo off -::echo on -setlocal EnableDelayedExpansion EnableExtensions -echo. -echo %date% %time% -echo. - -::********************************************************************** -:: Initial Setup -::********************************************************************** -set WORKSPACE=3D%CD% -if %WORKSPACE:~-1%=3D=3D\ ( - set WORKSPACE=3D%WORKSPACE:~0,-1% -) -set CORE_PATH=3D%WORKSPACE%\Core -set PLATFORM_PATH=3DPlatform\BroxtonPlatformPkg -set SILICON_PATH=3DSilicon\BroxtonSoC -set AslPath=3D%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe -set PACKAGES_PATH=3D%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%\Platform;= %WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON_PATH%;%WORKSPACE%\%PLATFOR= M_PATH%\Common ; -set EDK_TOOLS_BIN=3D%WORKSPACE%\BaseTools\Bin\Win32 -set /a build_threads=3D1 -set "Nasm_Flags=3D-D ARCH_IA32 -D DEBUG_PORT80" -set "Build_Flags=3D " -set exitCode=3D0 -set Arch=3DX64 -set Compiler=3DVS2013 -set FabId=3DB -set BoardId=3DMN -if not defined BiosVersion set BiosVersion=3DDEV - - -:: Clean up previous build files. -echo Clean up old build files... -if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log -if exist %WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log -if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target= .txt -if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_= def.txt -if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf\build_= rule.txt -if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\Framew= orkDatabase.db -if exist %WORKSPACE%\Stitch\*.bin del %WORKSPACE%\Stitch\*.bin -if exist conf\.cache rmdir /q/s conf\.cache - - -:: Override tools_def.txt -echo Creating Conf folder and build config files... -if not exist %WORKSPACE%\Conf md %WORKSPACE%\Conf -copy /y %CORE_PATH%\BaseTools\Conf\*.template %WORKSPACE%\Conf\*.txt -copy /y %WORKSPACE%\%PLATFORM_PATH%\DeviceCommonPkg\Override\BaseTools\Con= f\tools_def.template %WORKSPACE%\Conf\tools_def.txt - -:: Setup EDK environment. Edksetup puts new copies of target.txt, tools_de= f.txt, build_rule.txt in WorkSpace\Conf -:: Also run edksetup as soon as possible to avoid it from changing environ= ment variables we're overriding -set "VCINSTALLDIR=3D" -set EDK_TOOLS_PATH=3D%WORKSPACE%\BaseTools -call edksetup.bat -@echo off - -set Minnow_RVP=3DMINN - -:: Initialize all the build flags to FALSE -:: Then based on the cmd line input, some will be set to TRUE prior to bui= lding. -:: Note: These variable names match the actual Build Macro names in DSC fo= r clarity. -set ENBDT_PF_BUILD=3DFALSE -set SrcDebug=3DFALSE -set APLK_SETUP_ENABLE_BUILD=3DFALSE -set FSP_BUILD=3DFALSE -set FSP_WRAPPER=3DFALSE - -:: Set Defaults of platform specific environment variables. -set EFI_SOURCE=3D%CD% -set EDK_SOURCE=3D%CD% -set PLATFORM_NAME=3DBxtPlatformPkg -set PLATFORM_PACKAGE=3D%PLATFORM_PATH%\BxtPlatformPkg -set PLATFORM_RC_PACKAGE=3DSilicon\BroxtonSoC\BroxtonSiPkg -set COMMON_PLATFORM_PACKAGE=3D%PLATFORM_PATH%\BxtPlatformPkg -set FSP_BIN_PKG_NAME=3DBroxtonFspBinPkg -set STITCH_PATH=3D%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch - -PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\GenBiosId;%WORKSPAC= E%\%PLATFORM_PATH%\Common\Tools\nasm\Win32 -PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE;%WORKSPACE%\%PL= ATFORM_PATH%\Common\Tools\nasm\Win32 - -::********************************************************************** -:: Parse command line arguments -::********************************************************************** - -:: Optional arguments -:OptLoop -if /i "%~1"=3D=3D"" goto Usage -if /i "%~1"=3D=3D"/?" goto Usage - -if /i "%~1"=3D=3D"/l" ( - set Build_Flags=3D%Build_Flags% -j EDK2.log - shift - goto OptLoop -) -if /i "%~1" =3D=3D "/c" ( - echo Removing previous Build files... - if exist build ( - del /f/s/q build > nul - rmdir /s/q build - ) - if exist Conf\.cache ( - del /f/s/q Conf\.cache > nul - rmdir /s/q Conf\.cache - ) - echo. - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/ia32" ( - set Arch=3DIA32 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/x64" ( - set Arch=3DX64 - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/vs08" ( - set Compiler=3DVS2008 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs10" ( - set Compiler=3DVS2010 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs12" ( - set Compiler=3DVS2012 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs13" ( - set Compiler=3DVS2013 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs15" ( - set Compiler=3DVS2015 - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/FspW" ( - set FSP_WRAPPER=3DTRUE - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/A" ( - set FabId=3DA - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/B" ( - set FabId=3DB - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/MN" ( - set BoardId=3DMN - echo. - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/BG" ( - set BoardId=3DBG - echo. - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/m" ( - if defined NUMBER_OF_PROCESSORS ( - set /a build_threads=3D%NUMBER_OF_PROCESSORS% - ) - shift - goto OptLoop -) - -:: Required argument(s) -if "%~2"=3D=3D"" ( - echo. & echo -- ERROR: Not Enough Arguments Provided - echo -- Please review the Help screen "/?" -- & echo. - goto ExitFail -) - -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" =3D=3D "%Minnow_RVP%" ( - if %BoardId%=3D=3DMN ( - set BOARD_ID=3DMINNOW3 - ) else if %BoardId%=3D=3DBG ( - set BOARD_ID=3DBENSONV - ) - set ENBDT_PF_BUILD=3DTRUE - set PLATFORM_NAME=3DBroxtonPlatformPkg - set PLATFORM_PACKAGE=3D%PLATFORM_PATH% - set APLK_SETUP_ENABLE_BUILD=3DTRUE -) else ( - echo. & echo Error - Unsupported PlatformType: %1 - echo Please review the Help screen "/?" & echo. - goto ExitFail -) -set Platform_Type=3D%~1 - -:: -:: Tack on BIOS Version -:: - -::********************************************************************** -:: Additional EDK Build Setup/Configuration -::********************************************************************** - -::Setup DefineAtBuildMacros config file -set Build_Macros=3D.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc -copy /y nul %Build_Macros% >nul - -::output platform specific build macros to DefineAtBuildMacros.dsc -echo DEFINE ENBDT_PF_BUILD =3D %ENBDT_PF_BUILD% >> %Buil= d_Macros% - -echo DEFINE APLK_SETUP_ENABLE_BUILD =3D %APLK_SETUP_ENABLE_BUILD% >> %Buil= d_Macros% - -if "%Arch%"=3D=3D"IA32" ( - echo DEFINE X64_CONFIG =3D FALSE >> %= Build_Macros% -) else if "%Arch%"=3D=3D"X64" ( - echo DEFINE X64_CONFIG =3D TRUE >> %= Build_Macros% -) - -::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target= values removed - -if "%Arch%"=3D=3D"X64" ( - findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosI= d.env > Conf\BiosId.env -) else if "%Arch%"=3D=3D"IA32" ( - findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACK= AGE%\BiosId.env > Conf\BiosId.env - echo BOARD_EXT =3D I32 >> Conf\BiosId.env -) - -if /i "%~2" =3D=3D "RELEASE" ( - set target=3DRELEASE - echo BUILD_TYPE =3D R >> Conf\BiosId.env -) else ( - set target=3DDEBUG - echo BUILD_TYPE =3D D >> Conf\BiosId.env -) - -if %BoardId%=3D=3DBG ( - echo BOARD_REV =3D A >> Conf\BiosId.env -) - -if %BoardId%=3D=3DMN ( - if %FabId%=3D=3DB ( - echo BOARD_REV =3D B >> Conf\BiosId.env - ) else ( - echo BOARD_REV =3D A >> Conf\BiosId.env - ) -) - -:: Set the Build_Type, Version_Major, and Version_Minor environment variab= les -find /v "#" Conf\BiosId.env > ver_strings -for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j -del /f/q ver_strings >nul -:: Do this after parsing "ver_strings" -echo BOARD_ID =3D %BOARD_ID% >> Conf\BiosId.env - -echo. -echo Setting the Build environment for Visual Studio... -if "%Compiler%"=3D=3D"VS2008" ( - if defined VS90COMNTOOLS ( - call "%VS90COMNTOOLS%\vsvars32.bat" >nul - if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Stu= dio 9.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2008 - ) else set TOOL_CHAIN_TAG=3DVS2008x86 - ) else ( - echo --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not defin= ed ^^! - goto BldFail - ) -) else if "%Compiler%"=3D=3D"VS2010" ( - if defined VS100COMNTOOLS ( - call "%VS100COMNTOOLS%\vsvars32.bat" >nul - if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 10.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2010 - ) else set TOOL_CHAIN_TAG=3DVS2010x86 - ) else ( - echo --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not def= ined ^^! - goto BldFail - ) -) else if "%Compiler%"=3D=3D"VS2012" ( - if defined VS110COMNTOOLS ( - call "%VS110COMNTOOLS%\vsvars32.bat" >nul - if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 11.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2012 - ) else set TOOL_CHAIN_TAG=3DVS2012x86 - ) else ( - echo --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not def= ined ^^! - goto BldFail - ) -) else if "%Compiler%"=3D=3D"VS2013" ( - if defined VS120COMNTOOLS ( - call "%VS120COMNTOOLS%\vsvars32.bat" >nul - if /I "%VS120COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 12.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2013 - ) else set TOOL_CHAIN_TAG=3DVS2013x86 - ) else ( - echo --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not def= ined ^^! - echo See help ^(/?^) for how specify a different VS version. - goto BldFail - ) -) else if "%Compiler%"=3D=3D"VS2015" ( - if defined VS140COMNTOOLS ( - call "%VS140COMNTOOLS%\vsvars32.bat" >nul - if /I "%VS140COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 14.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2015 - ) else set TOOL_CHAIN_TAG=3DVS2015x86 - - ) else ( - echo --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not def= ined ^^! - echo See help ^(/?^) for how specify a different VS version. - goto BldFail - ) -) - -::********************************************************************** -:: Build BIOS -::********************************************************************** - -echo Setup build directory for GenBiosId... -set BUILD_PATH=3DBuild\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG% -if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 - -echo Creating BiosId... -GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Conf\= BiosId.bat -if "%Arch%"=3D=3D"X64" ( - if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64 - GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob Con= f\BiosId.bat -) else if "%Arch%"=3D=3D"IA32" ( - if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 - GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Co= nf\BiosId.bat -) - -if ErrorLevel 1 goto BldFail - -echo Building ResetVector... - -set ResetVectorPath=3D%WORKSPACE%\%PLATFORM_RC_PACKAGE%\Cpu\ResetVector - -pushd %ResetVectorPath%\Vtf0 - nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw ResetVectorCode= .asm - python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawSection.= py Bin\ResetVector.ia32.port80.raw -popd - -pushd %ResetVectorPath%\Vtf1 - nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw ResetVectorCode= .asm - python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawSection.= py Bin\ResetVector.ia32.port80.raw -popd - -:: SaveWorkSpace w/a is needed when using subst for Workspace builds (eg. = R:/) -set SaveWorkSpace=3D%WORKSPACE% -set WORKSPACE=3D%CD% -if "%Arch%"=3D=3D"X64" ( -set ActivePlatform=3D%PLATFORM_PACKAGE%\PlatformPkgX64.dsc -) else if "%Arch%"=3D=3D"IA32" ( -set ActivePlatform=3D%PLATFORM_PACKAGE%\PlatformPkgIA32.dsc -) - -echo Modifying Conf files for this build... -:: Remove lines with these tags from target.txt -findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG ACTIVE_PLATFORM MAX_CONC= URRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp - -if "%Arch%"=3D=3D"IA32" ( - echo TARGET_ARCH =3D IA32 >> Conf\tar= get.txt.tmp -) else if "%Arch%"=3D=3D"X64" ( - echo TARGET_ARCH =3D IA32 X64 >> Conf\tar= get.txt.tmp -) -echo TARGET =3D %TARGET% >> Conf\tar= get.txt.tmp -echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% >> Conf\tar= get.txt.tmp -echo ACTIVE_PLATFORM =3D %ActivePlatform% >> Conf\tar= get.txt.tmp -echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% >> Conf\tar= get.txt.tmp - -move /Y Conf\target.txt.tmp Conf\target.txt >nul -echo *_VS2008x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt -echo *_VS2010x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt -echo *_VS2012x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt -echo *_VS2013x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt -echo *_VS2015x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt - -echo. -echo Invoking normal EDK2 build... -build %Build_Flags% -if ErrorLevel 1 goto BldFail - -set WORKSPACE=3D%SaveWorkSpace% - -::********************************************************************** -:: Post Build processing and cleanup -::********************************************************************** -echo Create FlashMap.h... - -set PLAT_INIT_PRE_MEM=3DPlatformPreMemPei - -set AutoGenPath=3D%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\PlatformSett= ings\PlatformPreMemPei\%PLAT_INIT_PRE_MEM%\DEBUG\AutoGen.h - -if not exist "%AutoGenPath%" ( - echo ERROR: Couldn't find %AutoGenPath% so we can generate FlashMap.h - goto BldFail -) -findstr /L "_PCD_VALUE_" %AutoGenPath% > %STITCH_PATH%\FlashMap.h - -echo Running FCE... -copy /b %BUILD_PATH%\FV\FvIBBM.fv + /b %BUILD_PATH%\FV\Soc.fd /b %BUILD_PA= TH%\FV\Temp.fd -:: Extract Hii data from build and store a copy in HiiDefaultData.txt -:: UQI 0006 005C 0078 0030 0031 0030 0031 is for question prompt(STR_IPU_E= NABLED) -:: First 0006 is the length of string; Next six byte values are mapped to = STR_IPU_ENABLED string value defined in Platform\BroxtonPlatformPkg\Common\= PlatformSettings\PlatformSetupDxe\VfrStrings.uni. -fce.exe read -i %BUILD_PATH%\FV\Temp.fd 0006 005C 0078 0030 0031 0030 0031= > %BUILD_PATH%\FV\HiiDefaultData.txt 2>>EDK2.log -:: Generate the Setup variable and save changes to BxtXXX.fd -:: B73FE497-B92E-416e-8326-45AD0D270091 is the GUID of IBBM FV -fce.exe update -i %BUILD_PATH%\FV\Temp.fd -s %BUILD_PATH%\FV\HiiDefaultDat= a.txt -o %BUILD_PATH%\FV\Bxt%Arch%.fd -g B73FE497-B92E-416e-8326-45AD0D270= 091 -a 1>>EDK2.log 2>&1 -split -f %BUILD_PATH%\FV\Bxt%Arch%.fd -s 0x35000 -o %BUILD_PATH%\FV\FvIBBM= .fv - -if ErrorLevel 1 goto BldFail - -@echo off - -:: Translate Release Build Type -if "%BUILD_TYPE%"=3D=3D"R" set BUILD_TYPE=3DR - -echo Copy BIOS... -set BIOS_Name=3D%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_= %VERSION_MINOR% -copy /y/b %BUILD_PATH%\FV\Soc.fd %STITCH_PATH%\%BIOS_Name%.ROM >n= ul -copy /y %STITCH_PATH%\FlashMap.h %STITCH_PATH%\%BIOS_Name%.map >n= ul - -set Storage_Folder=3D%STITCH_PATH%\%BIOS_Name% -if not exist %Storage_Folder% mkdir %Storage_Folder% - -copy /y/b %BUILD_PATH%\FV\FvIBBL.fv %Storage_Folder% >nul -copy /y/b %BUILD_PATH%\FV\FvIBBM.fv %Storage_Folder% >nul -copy /y/b %BUILD_PATH%\FV\FvIBBR.fv %Storage_Folder% >nul -copy /y/b %BUILD_PATH%\FV\FvOBB.fv %Storage_Folder% >nul -copy /y/b %BUILD_PATH%\FV\FvOBBX.fv %Storage_Folder% >nul -copy /y/b %BUILD_PATH%\FV\FvOBBY.fv %Storage_Folder% >nul - -if /i "%FSP_WRAPPER%" =3D=3D "TRUE" ( -:: 0xFEF7A000 =3D gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =3D $= (CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EM= P_DATA_SIZE) + $(BLD_IBBM_SIZE) - pushd %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPk= g\FspBin - python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f Fs= p.fd -c m -b 0xFEF7A000 -o .\ -n ApolloLakeFsp.fd - python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py split -f Apo= lloLakeFsp.fd -o .\ -n FSP.Fv - popd - copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv - copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv - copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_S.Fv %Storage_Folder%\FSP_S.Fv -) - -echo Get NvStorage Base and Size... -if not exist "%STITCH_PATH%\FlashMap.h" ( - echo ERROR: Couldn't find %STITCH_PATH%\FlashMap.h - goto BldFail -) - -::generate NvStorage.Fv -:: %STITCH_PATH%\FlashMap.h has the information for the magic numbers= below. Parse it. -:: You'll need to account for both hex (0x000000) and int (1234567U= ) value types -:: FLASH_REGION_VPD_OFFSET -:: _PCD_VALUE_PcdFlashNvStorageBase - _PCD_VALUE_PcdFlashBaseAddr= ess -:: FLASH_REGION_VPD_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_= WORKING_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE -:: _PCD_VALUE_PcdFlashNvStorageSize -:: -:: PCD to find Variable File= to search -::=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase "%STI= TCH_PATH%\FlashMap.h" - call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress BaseAddress "%STI= TCH_PATH%\FlashMap.h" - call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize "%STI= TCH_PATH%\FlashMap.h" -:: Find image offset as opposed to memory offset - PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd - set /p VpdOffset=3D temp= .pcd - set /p %~1=3D temp.p= cd - set /p %~1=3D ^ -echo. -echo. /? Display this help text -echo /l Log a copy of the build output to EDK2.log -echo /c CleanAll before building -echo /x64 Set Arch to X64 (default) -echo /ia32 Set Arch to IA32 -echo /vs08 Set compiler to VisualStudio 2008 -echo /vs10 Set compiler to VisualStudio 2010 -echo /vs12 Set compiler to VisualStudio 2012 -echo /vs13 Set compiler to VisualStudio 2013 (default) -echo /vs15 Set compiler to VisualStudio 2015 -echo Platform Types: %Minnow_RVP% -echo Build Targets: Debug, Release -echo. -echo *********************************************************************= ****** -:ExitFail -echo. -set exitCode=3D1 -goto Exit - -:BldFail -set exitCode=3D1 -echo -- Error: EDKII BIOS Build has failed! -echo See EDK2.log for more details - -:Exit -echo %date% %time% -( - EndLocal - set BiosVersion=3D%BiosVersion% - exit /b %ExitCode% -) diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPla= tformPkg/BuildBios.sh deleted file mode 100644 index b6127e2..0000000 --- a/Platform/BroxtonPlatformPkg/BuildBios.sh +++ /dev/null @@ -1,333 +0,0 @@ -# -# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BS= D License -# which accompanies this distribution. The full text of the license may b= e found at -# http://opensource.org/licenses/bsd-license.php -#=20 -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. -# - -##********************************************************************** -## Function define -##********************************************************************** -function ErrorExit() { - echo - echo "Press any key......" - read - exit 0 -} - -echo -e $(date) -##********************************************************************** -## Initial Setup -##********************************************************************** - -Build_Flags=3D -SV_String=3D_ -exitCode=3D0 -Arch=3DX64 -FabId=3DB -BoardId=3DMN - -## Initialize all the build flags to FALSE -## depending on the cmd line input, some will be set to TRUE prior to buil= ding -ENBDT_PF_BUILD=3DFALSE -TABLET_PF_BUILD=3DFALSE -BYTI_PF_BUILD=3DFALSE -CSLE_ENABLE=3DFALSE -VP_BIOS_ENABLE=3DFALSE -SV_BIOS_ENABLE=3DFALSE -PPV_BIOS_ENABLE=3DFALSE -RVVP_BIOS_ENABLE=3DFALSE -RVV_BIOS_ENABLE=3DFALSE -SrcDebug=3DFALSE - -## Clean up previous build files. -if [ -e $(pwd)/EDK2.log ]; then - rm $(pwd)/EDK2.log -fi - -if [ -e $(pwd)/Unitool.log ]; then - rm $(pwd)/Unitool.log -fi - -if [ -e $(pwd)/Conf/target.txt ]; then - rm $(pwd)/Conf/target.txt -fi - -if [ -e $(pwd)/Conf/BiosId.env ]; then - rm $(pwd)/Conf/BiosId.env -fi - -if [ -e $(pwd)/Conf/build_rule.txt ]; then - rm $(pwd)/Conf/build_rule.txt -fi - -if [ -e $(pwd)/FlashMap.h ]; then - rm $(pwd)/FlashMap.h -fi - -## Override tools_def.txt -#cp $WORKSPACE\BaseTools\Conf\tools_def.template $WORKSPACE\Conf\tools_def= .txt -#:: Override tools_def.txt -echo Creating Conf folder and build config files... -cp $WORKSPACE/BaseTools/Conf/target.template $WORKSPACE/Conf/target.txt -cp $WORKSPACE/BaseTools/Conf/tools_def.template $WORKSPACE/Conf/tools_def.= txt -cp $WORKSPACE/BaseTools/Conf/build_rule.template $WORKSPACE/Conf/build_rul= e.txt - - - - -TOOL_CHAIN_TAG=3DGCC5 - -## Define platform specific environment variables. -PLATFORM_NAME=3DBroxtonPlatformPkg -PLATFORM_PACKAGE=3DPlatform/BroxtonPlatformPkg -EFI_SOURCE=3D$WORKSPACE -EDK_SOURCE=3D$WORKSPACE - -##********************************************************************** -## Parse command line arguments -##********************************************************************** - -## Optional arguments -for (( i=3D1; i<=3D$#; )) - do - if [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/X64" ]; then - Arch=3DX64 - shift - elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/BG" ]; then - BoardId=3DBG - shift - elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/B" ]; then - FabId=3DB - shift - elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/A" ]; then - FabId=3DA - shift - else - break - fi - done - -## Required argument(s) -if [ "$2" =3D=3D "" ]; then - echo=20 - echo "Not Enough Arguments Provided" - echo "Please review the Help screen" - ErrorExit -fi - -## Remove the values for Platform_Type and Build_Target from BiosId.env an= d 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 - -if [ $BoardId =3D=3D "MN" ]; then - BOARD_ID=3DMNW3 - echo BOARD_ID =3D MINNOW3 >> $WORKSPACE/Conf/BiosId.env -else - BOARD_ID=3DBEN1 - echo BOARD_ID =3D BENSONV >> $WORKSPACE/Conf/BiosId.env -fi -ENBDT_PF_BUILD=3DTRUE -PLATFORM_NAME=3DBroxtonPlatformPkg -PLATFORM_PACKAGE=3DPlatform/BroxtonPlatformPkg =20 -Platform_Type=3D$1 - -## Create new DefineAtBuildMacros.dsc file -Build_Macros=3D$WORKSPACE/$PLATFORM_PACKAGE/DefineAtBuildMacros.dsc -if [ -f "$Build_Macros" ]; then - rm $Build_Macros -fi -touch $Build_Macros - -## Output platform specific build macros to DefineAtBuildMacros.dsc -echo DEFINE ENBDT_PF_BUILD =3D $ENBDT_PF_BUILD >> $Build_Macros -echo DEFINE TABLET_PF_BUILD =3D $TABLET_PF_BUILD >> $Build_Macros -echo DEFINE BYTI_PF_BUILD =3D $BYTI_PF_BUILD >> $Build_Macros -echo DEFINE CSLE_ENABLE =3D $CSLE_ENABLE >> $Build_Macros -echo DEFINE VP_BIOS_ENABLE =3D $VP_BIOS_ENABLE >> $Build_Macros -echo DEFINE SV_BIOS_ENABLE =3D $SV_BIOS_ENABLE >> $Build_Macros -echo DEFINE PPV_BIOS_ENABLE =3D $PPV_BIOS_ENABLE >> $Build_Macros -echo DEFINE RVVP_BIOS_ENABLE =3D $RVVP_BIOS_ENABLE >> $Build_Macros -echo DEFINE RVV_BIOS_ENABLE =3D $RVV_BIOS_ENABLE >> $Build_Macros - -if [ $Arch =3D=3D "IA32" ]; then - echo DEFINE X64_CONFIG =3D FALSE >> $Build_Macros -else - echo DEFINE X64_CONFIG =3D TRUE >> $Build_Macros -fi - -if [ "$(echo $2 | tr 'a-z' 'A-Z')" =3D=3D "RELEASE" ]; then - TARGET=3DRELEASE - BUILD_TYPE=3DR - echo BUILD_TYPE =3D R >> $WORKSPACE/Conf/BiosId.env -else - TARGET=3DDEBUG - BUILD_TYPE=3DD - echo BUILD_TYPE =3D D >> $WORKSPACE/Conf/BiosId.env -fi - -if [ $BoardId =3D=3D "BG" ]; then - BOARD_REV=3DA - echo BOARD_REV =3D A >> $WORKSPACE/Conf/BiosId.env -fi - -if [ $BoardId =3D=3D "MN" ]; then - if [ $FabId =3D=3D "B" ]; then - BOARD_REV=3DB - echo BOARD_REV =3D B >> $WORKSPACE/Conf/BiosId.env - else - BOARD_REV=3DA - echo BOARD_REV =3D A >> $WORKSPACE/Conf/BiosId.env - fi -fi - - -##********************************************************************** -## Additional EDK Build Setup/Configuration -##********************************************************************** -echo "Ensuring correct build directory is present for GenBiosId..." -ACTIVE_PLATFORM=3D$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc -#TOOL_CHAIN_TAG=3DGCC47 -MAX_CONCURRENT_THREAD_NUMBER=3D1 -sed -i '/^ACTIVE_PLATFORM/d' $WORKSPACE/Conf/target.txt -sed -i '/^TARGET /d' $WORKSPACE/Conf/target.txt -sed -i '/^TARGET_ARCH/d' $WORKSPACE/Conf/target.txt -sed -i '/^TOOL_CHAIN_TAG/d' $WORKSPACE/Conf/target.txt -sed -i '/^MAX_CONCURRENT_THREAD_NUMBER/d' $WORKSPACE/Conf/target.txt -echo ACTIVE_PLATFORM =3D $ACTIVE_PLATFORM >> Con= f/target.txt -echo TARGET =3D $TARGET >> Con= f/target.txt -echo TOOL_CHAIN_TAG =3D $TOOL_CHAIN_TAG >> Con= f/target.txt -echo MAX_CONCURRENT_THREAD_NUMBER =3D $MAX_CONCURRENT_THREAD_NUMBER >> Con= f/target.txt -if [ $Arch =3D=3D "IA32" ]; then - echo TARGET_ARCH =3D IA32 >> Con= f/target.txt -else - echo TARGET_ARCH =3D IA32 X64 >> Con= f/target.txt -fi - -### -### Update ASL path for GCC47 & 46 -### - -## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule - echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =3D --add-gnu-debuglink=3D\$\(DE= BUG_DIR\)/\$\(MODULE_NAME\).debug >> $WORKSPACE/Conf/tools_def.txt -###=20 - -##********************************************************************** -## Build BIOS -##********************************************************************** -echo "Creating BiosId..." -BUILD_PATH=3DBuild/$PLATFORM_NAME/"$TARGET"_"$TOOL_CHAIN_TAG" -if [ ! -d "$BUILD_PATH/$Arch" ]; then - mkdir -p $BUILD_PATH/$Arch -fi -if [ -e "$BUILD_PATH/$Arch/BiosId.bin" ]; then - rm -f $BUILD_PATH/$Arch/BiosId.bin -fi -./Platform/BroxtonPlatformPkg/Common/Tools/GenBiosId/GenBiosId -i Conf/Bio= sId.env -o $BUILD_PATH/$Arch/BiosId.bin - - - -echo -echo "**** Replace DebugLib.h to save space.... ****" -cp PlatformTools/GCC/DebugLib.h Core/MdePkg/Include/Library/ - -echo -echo "**** Copy ResetVector to original folder ****" -echo "**** Due to nasm can't execute in Ubuntu ****" - - -echo "Invoking EDK2 build..." - -build $Build_Flags - -##********************************************************************** -## Post Build processing and cleanup -##********************************************************************** - -# -# FSP Rebase and Split -# -# 0xFEF7A000 =3D gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =3D $= (CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EM= P_DATA_SIZE) + $(BLD_IBBM_SIZE) -pushd $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp= Bin -python $WORKSPACE/Core/IntelFsp2Pkg/Tools/SplitFspBin.py rebase -f Fsp.fd = -c m -b 0xFEF7A000 -o ./ -n ApolloLakeFsp.fd -python $WORKSPACE/Core/IntelFsp2Pkg/Tools/SplitFspBin.py split -f ApolloLa= keFsp.fd -o ./ -n FSP.Fv -popd -cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_T.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_M.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch -cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_S.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch - -echo "Running fce..." -cat $BUILD_PATH/FV/FVIBBM.Fv $BUILD_PATH/FV/SOC.fd > $BUILD_PATH/FV/Temp.fd -# Extract Hii data from build and store a copy in HiiDefaultData.txt -# UQI 0006 005C 0078 0030 0031 0030 0031 is for question prompt(STR_IPU_EN= ABLED) -# First 0006 is the length of string; Next six byte values are mapped to S= TR_IPU_ENABLED string value defined in Platform/BroxtonPlatformPkg/Common/P= latformSettings/PlatformSetupDxe/VfrStrings.uni. -./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i $BUILD_PATH/FV/Temp.fd 00= 06 005C 0078 0030 0031 0030 0031 > $BUILD_PATH/FV/HiiDefaultData.txt - -## copy the Setup variable to the SetupDefault variable and save changes t= o BxtXXX.fd -./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE update -i $BUILD_PATH/FV/Temp.fd = -s $BUILD_PATH/FV/HiiDefaultData.txt -o $BUILD_PATH/FV/Bxt"$Arch".fd -g B73= FE497-B92E-416e-8326-45AD0D270091 -a 1>>EDK2.log 2>&1 -#echo "Skip FCE tool..." -Split -f $BUILD_PATH/FV/Bxt"$Arch".fd -s 0x35000 -o $BUILD_PATH/FV/FVIBBM.= Fv -#cp $BUILD_PATH/FV/SOC.fd $BUILD_PATH/FV/Bxt"$Arch".fd - -## Set the Board_Id, Build_Type, Version_Major, and Version_Minor environm= ent variables -##find /v "#" Conf\BiosId.env > ver_strings -##for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j -##del /f/q ver_strings >nul -## -VERSION_MAJOR=3D$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 = | cut -c 1-4) -VERSION_MINOR=3D$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 = | cut -c 1-2) -BIOS_Name=3D"$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VER= SION_MAJOR"_"$VERSION_MINOR" - -cp -f $BUILD_PATH/FV/FVOBB.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch -cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch -cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch -cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch -cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch - -if [ $BoardId =3D=3D "BG" ]; then - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Commo= n/Tools/Stitch -fi - -if [ $BoardId =3D=3D "MN" ]; then - if [ $FabId =3D=3D "B" ]; then - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch - else - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch - cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch - fi -fi - -# -# Assmeble components -# -pushd $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch - -cat FVIBBL.Fv > IBBL.Fv - -cat FVIBBM.Fv FSP_M.Fv > IBB.Fv - -cat FSP_S.Fv FVIBBR.Fv FVOBB.Fv FVOBBX.Fv > OBB.Fv - -cat SpiChunk1.bin IBBL.Fv IBB.Fv SpiChunk2.bin OBB.Fv NvStorage.Fv SpiChun= k3.bin > $BIOS_Name"_GCC".bin - -popd - -echo -echo Check if SPI IFWI image is generated at below location: -echo $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/$BIOS_Name= "_GCC".bin -echo -echo diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat b/Platform/Broxto= nPlatformPkg/BuildBxtBios.bat new file mode 100644 index 0000000..7804dc5 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat @@ -0,0 +1,612 @@ +@echo off +::echo on +setlocal EnableDelayedExpansion EnableExtensions +echo. +echo %date% %time% +echo. + +::********************************************************************** +:: Initial Setup +::********************************************************************** +set WORKSPACE=3D%CD% +if %WORKSPACE:~-1%=3D=3D\ ( + set WORKSPACE=3D%WORKSPACE:~0,-1% +) +set CORE_PATH=3D%WORKSPACE%\Core +set PLATFORM_PATH=3DPlatform\BroxtonPlatformPkg +set SILICON_PATH=3DSilicon\BroxtonSoC +set AslPath=3D%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe +set PACKAGES_PATH=3D%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%\Platform;= %WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON_PATH%;%WORKSPACE%\%PLATFOR= M_PATH%\Common ; +set EDK_TOOLS_BIN=3D%WORKSPACE%\BaseTools\Bin\Win32 +set /a build_threads=3D1 +set "Nasm_Flags=3D-D ARCH_IA32 -D DEBUG_PORT80" +set "Build_Flags=3D " +set exitCode=3D0 +set Arch=3DX64 +set Compiler=3DVS2013 +set FabId=3DB +set BoardId=3DMN +if not defined BiosVersion set BiosVersion=3DDEV + + +:: Clean up previous build files. +echo Clean up old build files... +if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log +if exist %WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log +if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target= .txt +if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_= def.txt +if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf\build_= rule.txt +if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\Framew= orkDatabase.db +if exist %WORKSPACE%\Stitch\*.bin del %WORKSPACE%\Stitch\*.bin +if exist conf\.cache rmdir /q/s conf\.cache + + +:: Override tools_def.txt +echo Creating Conf folder and build config files... +if not exist %WORKSPACE%\Conf md %WORKSPACE%\Conf +copy /y %WORKSPACE%\BaseTools\Conf\*.template %WORKSPACE%\Conf\*.txt + +:: Setup EDK environment. Edksetup puts new copies of target.txt, tools_de= f.txt, build_rule.txt in WorkSpace\Conf +:: Also run edksetup as soon as possible to avoid it from changing environ= ment variables we're overriding +set "VCINSTALLDIR=3D" +set EDK_TOOLS_PATH=3D%WORKSPACE%\BaseTools +call edksetup.bat +@echo off + +set Minnow_RVP=3DMINN + +:: Initialize all the build flags to FALSE +:: Then based on the cmd line input, some will be set to TRUE prior to bui= lding. +:: Note: These variable names match the actual Build Macro names in DSC fo= r clarity. +set ENBDT_PF_BUILD=3DFALSE +set SrcDebug=3DFALSE +set APLK_SETUP_ENABLE_BUILD=3DFALSE +set FSP_BUILD=3DFALSE +set FSP_WRAPPER=3DFALSE + +:: Set Defaults of platform specific environment variables. +set EFI_SOURCE=3D%CD% +set EDK_SOURCE=3D%CD% +set PLATFORM_NAME=3DBxtPlatformPkg +set PLATFORM_PACKAGE=3D%PLATFORM_PATH%\BxtPlatformPkg +set PLATFORM_RC_PACKAGE=3DSilicon\BroxtonSoC\BroxtonSiPkg +set COMMON_PLATFORM_PACKAGE=3D%PLATFORM_PATH%\BxtPlatformPkg +set FSP_BIN_PKG_NAME=3DBroxtonFspBinPkg +set STITCH_PATH=3D%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch + +PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\GenBiosId;%WORKSPAC= E%\%PLATFORM_PATH%\Common\Tools\nasm\Win32 +PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE;%WORKSPACE%\%PL= ATFORM_PATH%\Common\Tools\nasm\Win32 + +::********************************************************************** +:: Parse command line arguments +::********************************************************************** + +:: Optional arguments +:OptLoop +if /i "%~1"=3D=3D"" goto Usage +if /i "%~1"=3D=3D"/?" goto Usage + +if /i "%~1"=3D=3D"/l" ( + set Build_Flags=3D%Build_Flags% -j EDK2.log + shift + goto OptLoop +) +if /i "%~1" =3D=3D "/c" ( + echo Removing previous Build files... + if exist build ( + del /f/s/q build > nul + rmdir /s/q build + ) + if exist Conf\.cache ( + del /f/s/q Conf\.cache > nul + rmdir /s/q Conf\.cache + ) + echo. + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/ia32" ( + set Arch=3DIA32 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/x64" ( + set Arch=3DX64 + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/vs08" ( + set Compiler=3DVS2008 + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs10" ( + set Compiler=3DVS2010 + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs12" ( + set Compiler=3DVS2012 + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs13" ( + set Compiler=3DVS2013 + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs15" ( + set Compiler=3DVS2015 + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/FspW" ( + set FSP_WRAPPER=3DTRUE + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/A" ( + set FabId=3DA + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/B" ( + set FabId=3DB + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/MN" ( + set BoardId=3DMN + echo. + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/BG" ( + set BoardId=3DBG + echo. + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/m" ( + if defined NUMBER_OF_PROCESSORS ( + set /a build_threads=3D%NUMBER_OF_PROCESSORS% + ) + shift + goto OptLoop +) + +:: Required argument(s) +if "%~2"=3D=3D"" ( + echo. & echo -- ERROR: Not Enough Arguments Provided + echo -- Please review the Help screen "/?" -- & echo. + goto ExitFail +) + +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" =3D=3D "%Minnow_RVP%" ( + if %BoardId%=3D=3DMN ( + set BOARD_ID=3DMINNOW3 + ) else if %BoardId%=3D=3DBG ( + set BOARD_ID=3DBENSONV + ) + set ENBDT_PF_BUILD=3DTRUE + set PLATFORM_NAME=3DBroxtonPlatformPkg + set PLATFORM_PACKAGE=3D%PLATFORM_PATH% + set APLK_SETUP_ENABLE_BUILD=3DTRUE +) else ( + echo. & echo Error - Unsupported PlatformType: %1 + echo Please review the Help screen "/?" & echo. + goto ExitFail +) +set Platform_Type=3D%~1 + +:: +:: Tack on BIOS Version +:: + +::********************************************************************** +:: Additional EDK Build Setup/Configuration +::********************************************************************** + +::Setup DefineAtBuildMacros config file +set Build_Macros=3D.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc +copy /y nul %Build_Macros% >nul + +::output platform specific build macros to DefineAtBuildMacros.dsc +echo DEFINE ENBDT_PF_BUILD =3D %ENBDT_PF_BUILD% >> %Buil= d_Macros% + +echo DEFINE APLK_SETUP_ENABLE_BUILD =3D %APLK_SETUP_ENABLE_BUILD% >> %Buil= d_Macros% + +if "%Arch%"=3D=3D"IA32" ( + echo DEFINE X64_CONFIG =3D FALSE >> %= Build_Macros% +) else if "%Arch%"=3D=3D"X64" ( + echo DEFINE X64_CONFIG =3D TRUE >> %= Build_Macros% +) + +::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target= values removed + +if "%Arch%"=3D=3D"X64" ( + findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosI= d.env > Conf\BiosId.env +) else if "%Arch%"=3D=3D"IA32" ( + findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACK= AGE%\BiosId.env > Conf\BiosId.env + echo BOARD_EXT =3D I32 >> Conf\BiosId.env +) + +if /i "%~2" =3D=3D "RELEASE" ( + set target=3DRELEASE + echo BUILD_TYPE =3D R >> Conf\BiosId.env +) else ( + set target=3DDEBUG + echo BUILD_TYPE =3D D >> Conf\BiosId.env +) + +if %BoardId%=3D=3DBG ( + echo BOARD_REV =3D A >> Conf\BiosId.env +) + +if %BoardId%=3D=3DMN ( + if %FabId%=3D=3DB ( + echo BOARD_REV =3D B >> Conf\BiosId.env + ) else ( + echo BOARD_REV =3D A >> Conf\BiosId.env + ) +) + +:: Set the Build_Type, Version_Major, and Version_Minor environment variab= les +find /v "#" Conf\BiosId.env > ver_strings +for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j +del /f/q ver_strings >nul +:: Do this after parsing "ver_strings" +echo BOARD_ID =3D %BOARD_ID% >> Conf\BiosId.env + +echo. +echo Setting the Build environment for Visual Studio... +if "%Compiler%"=3D=3D"VS2008" ( + if defined VS90COMNTOOLS ( + call "%VS90COMNTOOLS%\vsvars32.bat" >nul + if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Stu= dio 9.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2008 + ) else set TOOL_CHAIN_TAG=3DVS2008x86 + ) else ( + echo --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not defin= ed ^^! + goto BldFail + ) +) else if "%Compiler%"=3D=3D"VS2010" ( + if defined VS100COMNTOOLS ( + call "%VS100COMNTOOLS%\vsvars32.bat" >nul + if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 10.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2010 + ) else set TOOL_CHAIN_TAG=3DVS2010x86 + ) else ( + echo --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not def= ined ^^! + goto BldFail + ) +) else if "%Compiler%"=3D=3D"VS2012" ( + if defined VS110COMNTOOLS ( + call "%VS110COMNTOOLS%\vsvars32.bat" >nul + if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 11.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2012 + ) else set TOOL_CHAIN_TAG=3DVS2012x86 + ) else ( + echo --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not def= ined ^^! + goto BldFail + ) +) else if "%Compiler%"=3D=3D"VS2013" ( + if defined VS120COMNTOOLS ( + call "%VS120COMNTOOLS%\vsvars32.bat" >nul + if /I "%VS120COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 12.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2013 + ) else set TOOL_CHAIN_TAG=3DVS2013x86 + ) else ( + echo --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not def= ined ^^! + echo See help ^(/?^) for how specify a different VS version. + goto BldFail + ) +) else if "%Compiler%"=3D=3D"VS2015" ( + if defined VS140COMNTOOLS ( + call "%VS140COMNTOOLS%\vsvars32.bat" >nul + if /I "%VS140COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual St= udio 14.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2015 + ) else set TOOL_CHAIN_TAG=3DVS2015x86 + + ) else ( + echo --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not def= ined ^^! + echo See help ^(/?^) for how specify a different VS version. + goto BldFail + ) +) + +::********************************************************************** +:: Build BIOS +::********************************************************************** + +echo Setup build directory for GenBiosId... +set BUILD_PATH=3DBuild\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG% +if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 + +echo Creating BiosId... +GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Conf\= BiosId.bat +if "%Arch%"=3D=3D"X64" ( + if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64 + GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob Con= f\BiosId.bat +) else if "%Arch%"=3D=3D"IA32" ( + if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 + GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Co= nf\BiosId.bat +) + +if ErrorLevel 1 goto BldFail + +echo Building ResetVector... + +set ResetVectorPath=3D%WORKSPACE%\%PLATFORM_RC_PACKAGE%\Cpu\ResetVector + +pushd %ResetVectorPath%\Vtf0 + nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw ResetVectorCode= .asm + python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawSection.= py Bin\ResetVector.ia32.port80.raw +popd + +pushd %ResetVectorPath%\Vtf1 + nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw ResetVectorCode= .asm + python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawSection.= py Bin\ResetVector.ia32.port80.raw +popd + +:: SaveWorkSpace w/a is needed when using subst for Workspace builds (eg. = R:/) +set SaveWorkSpace=3D%WORKSPACE% +set WORKSPACE=3D%CD% +if "%Arch%"=3D=3D"X64" ( +set ActivePlatform=3D%PLATFORM_PACKAGE%\PlatformPkgX64.dsc +) else if "%Arch%"=3D=3D"IA32" ( +set ActivePlatform=3D%PLATFORM_PACKAGE%\PlatformPkgIA32.dsc +) + +echo Modifying Conf files for this build... +:: Remove lines with these tags from target.txt +findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG ACTIVE_PLATFORM MAX_CONC= URRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp + +if "%Arch%"=3D=3D"IA32" ( + echo TARGET_ARCH =3D IA32 >> Conf\tar= get.txt.tmp +) else if "%Arch%"=3D=3D"X64" ( + echo TARGET_ARCH =3D IA32 X64 >> Conf\tar= get.txt.tmp +) +echo TARGET =3D %TARGET% >> Conf\tar= get.txt.tmp +echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% >> Conf\tar= get.txt.tmp +echo ACTIVE_PLATFORM =3D %ActivePlatform% >> Conf\tar= get.txt.tmp +echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% >> Conf\tar= get.txt.tmp + +move /Y Conf\target.txt.tmp Conf\target.txt >nul +echo *_VS2008x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt +echo *_VS2010x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt +echo *_VS2012x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt +echo *_VS2013x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt +echo *_VS2015x86_*_ASL_PATH =3D %AslPath% >> Conf\tools_def.txt + +echo. +echo Invoking normal EDK2 build... +build %Build_Flags% +if ErrorLevel 1 goto BldFail + +set WORKSPACE=3D%SaveWorkSpace% + +::********************************************************************** +:: Post Build processing and cleanup +::********************************************************************** +echo Create FlashMap.h... + +set PLAT_INIT_PRE_MEM=3DPlatformPreMemPei + +set AutoGenPath=3D%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\PlatformSett= ings\PlatformPreMemPei\%PLAT_INIT_PRE_MEM%\DEBUG\AutoGen.h + +if not exist "%AutoGenPath%" ( + echo ERROR: Couldn't find %AutoGenPath% so we can generate FlashMap.h + goto BldFail +) +findstr /L "_PCD_VALUE_" %AutoGenPath% > %STITCH_PATH%\FlashMap.h + +echo Running FCE... +copy /b %BUILD_PATH%\FV\FvIBBM.fv + /b %BUILD_PATH%\FV\Soc.fd /b %BUILD_PA= TH%\FV\Temp.fd +:: Extract Hii data from build and store a copy in HiiDefaultData.txt +:: UQI 0006 005C 0078 0030 0031 0030 0031 is for question prompt(STR_IPU_E= NABLED) +:: First 0006 is the length of string; Next six byte values are mapped to = STR_IPU_ENABLED string value defined in Platform\BroxtonPlatformPkg\Common\= PlatformSettings\PlatformSetupDxe\VfrStrings.uni. +fce.exe read -i %BUILD_PATH%\FV\Temp.fd 0006 005C 0078 0030 0031 0030 0031= > %BUILD_PATH%\FV\HiiDefaultData.txt 2>>EDK2.log +:: Generate the Setup variable and save changes to BxtXXX.fd +:: B73FE497-B92E-416e-8326-45AD0D270091 is the GUID of IBBM FV +fce.exe update -i %BUILD_PATH%\FV\Temp.fd -s %BUILD_PATH%\FV\HiiDefaultDat= a.txt -o %BUILD_PATH%\FV\Bxt%Arch%.fd -g B73FE497-B92E-416e-8326-45AD0D270= 091 -a 1>>EDK2.log 2>&1 +split -f %BUILD_PATH%\FV\Bxt%Arch%.fd -s 0x35000 -o %BUILD_PATH%\FV\FvIBBM= .fv + +if ErrorLevel 1 goto BldFail + +@echo off + +:: Translate Release Build Type +if "%BUILD_TYPE%"=3D=3D"R" set BUILD_TYPE=3DR + +echo Copy BIOS... +set BIOS_Name=3D%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_= %VERSION_MINOR% +copy /y/b %BUILD_PATH%\FV\Soc.fd %STITCH_PATH%\%BIOS_Name%.ROM >n= ul +copy /y %STITCH_PATH%\FlashMap.h %STITCH_PATH%\%BIOS_Name%.map >n= ul + +set Storage_Folder=3D%STITCH_PATH%\%BIOS_Name% +if not exist %Storage_Folder% mkdir %Storage_Folder% + +copy /y/b %BUILD_PATH%\FV\FvIBBL.fv %Storage_Folder% >nul +copy /y/b %BUILD_PATH%\FV\FvIBBM.fv %Storage_Folder% >nul +copy /y/b %BUILD_PATH%\FV\FvIBBR.fv %Storage_Folder% >nul +copy /y/b %BUILD_PATH%\FV\FvOBB.fv %Storage_Folder% >nul +copy /y/b %BUILD_PATH%\FV\FvOBBX.fv %Storage_Folder% >nul +copy /y/b %BUILD_PATH%\FV\FvOBBY.fv %Storage_Folder% >nul + +if /i "%FSP_WRAPPER%" =3D=3D "TRUE" ( +:: 0xFEF7A000 =3D gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =3D $= (CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EM= P_DATA_SIZE) + $(BLD_IBBM_SIZE) + pushd %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPk= g\FspBin + python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f Fs= p.fd -c m -b 0xFEF7A000 -o .\ -n ApolloLakeFsp.fd + python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py split -f Apo= lloLakeFsp.fd -o .\ -n FSP.Fv + popd + copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv + copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv + copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi= nPkg\FspBin\FSP_S.Fv %Storage_Folder%\FSP_S.Fv +) + +echo Get NvStorage Base and Size... +if not exist "%STITCH_PATH%\FlashMap.h" ( + echo ERROR: Couldn't find %STITCH_PATH%\FlashMap.h + goto BldFail +) + +::generate NvStorage.Fv +:: %STITCH_PATH%\FlashMap.h has the information for the magic numbers= below. Parse it. +:: You'll need to account for both hex (0x000000) and int (1234567U= ) value types +:: FLASH_REGION_VPD_OFFSET +:: _PCD_VALUE_PcdFlashNvStorageBase - _PCD_VALUE_PcdFlashBaseAddr= ess +:: FLASH_REGION_VPD_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_= WORKING_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE +:: _PCD_VALUE_PcdFlashNvStorageSize +:: +:: PCD to find Variable File= to search +::=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase "%STI= TCH_PATH%\FlashMap.h" + call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress BaseAddress "%STI= TCH_PATH%\FlashMap.h" + call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize "%STI= TCH_PATH%\FlashMap.h" +:: Find image offset as opposed to memory offset + PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd + set /p VpdOffset=3D temp= .pcd + set /p %~1=3D temp.p= cd + set /p %~1=3D ^ +echo. +echo. /? Display this help text +echo /l Log a copy of the build output to EDK2.log +echo /c CleanAll before building +echo /x64 Set Arch to X64 (default) +echo /ia32 Set Arch to IA32 +echo /vs08 Set compiler to VisualStudio 2008 +echo /vs10 Set compiler to VisualStudio 2010 +echo /vs12 Set compiler to VisualStudio 2012 +echo /vs13 Set compiler to VisualStudio 2013 (default) +echo /vs15 Set compiler to VisualStudio 2015 +echo Platform Types: %Minnow_RVP% +echo Build Targets: Debug, Release +echo. +echo *********************************************************************= ****** +:ExitFail +echo. +set exitCode=3D1 +goto Exit + +:BldFail +set exitCode=3D1 +echo -- Error: EDKII BIOS Build has failed! +echo See EDK2.log for more details + +:Exit +echo %date% %time% +( + EndLocal + set BiosVersion=3D%BiosVersion% + exit /b %ExitCode% +) diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh b/Platform/Broxton= PlatformPkg/BuildBxtBios.sh new file mode 100644 index 0000000..d0b677f --- /dev/null +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh @@ -0,0 +1,333 @@ +# +# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BS= D License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +#=20 +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. +# + +##********************************************************************** +## Function define +##********************************************************************** +function ErrorExit() { + echo + echo "Press any key......" + read + exit 0 +} + +echo -e $(date) +##********************************************************************** +## Initial Setup +##********************************************************************** + +Build_Flags=3D +SV_String=3D_ +exitCode=3D0 +Arch=3DX64 +FabId=3DB +BoardId=3DMN + +## Initialize all the build flags to FALSE +## depending on the cmd line input, some will be set to TRUE prior to buil= ding +ENBDT_PF_BUILD=3DFALSE +TABLET_PF_BUILD=3DFALSE +BYTI_PF_BUILD=3DFALSE +CSLE_ENABLE=3DFALSE +VP_BIOS_ENABLE=3DFALSE +SV_BIOS_ENABLE=3DFALSE +PPV_BIOS_ENABLE=3DFALSE +RVVP_BIOS_ENABLE=3DFALSE +RVV_BIOS_ENABLE=3DFALSE +SrcDebug=3DFALSE + +## Clean up previous build files. +if [ -e $(pwd)/EDK2.log ]; then + rm $(pwd)/EDK2.log +fi + +if [ -e $(pwd)/Unitool.log ]; then + rm $(pwd)/Unitool.log +fi + +if [ -e $(pwd)/Conf/target.txt ]; then + rm $(pwd)/Conf/target.txt +fi + +if [ -e $(pwd)/Conf/BiosId.env ]; then + rm $(pwd)/Conf/BiosId.env +fi + +if [ -e $(pwd)/Conf/build_rule.txt ]; then + rm $(pwd)/Conf/build_rule.txt +fi + +if [ -e $(pwd)/FlashMap.h ]; then + rm $(pwd)/FlashMap.h +fi + +## Override tools_def.txt +#cp $WORKSPACE\BaseTools\Conf\tools_def.template $WORKSPACE\Conf\tools_def= .txt +#:: Override tools_def.txt +echo Creating Conf folder and build config files... +cp $WORKSPACE/BaseTools/Conf/target.template $WORKSPACE/Conf/target.txt +cp $WORKSPACE/BaseTools/Conf/tools_def.template $WORKSPACE/Conf/tools_def.= txt +cp $WORKSPACE/BaseTools/Conf/build_rule.template $WORKSPACE/Conf/build_rul= e.txt + + + + +TOOL_CHAIN_TAG=3DGCC5 + +## Define platform specific environment variables. +PLATFORM_NAME=3DBroxtonPlatformPkg +PLATFORM_PACKAGE=3DPlatform/BroxtonPlatformPkg +EFI_SOURCE=3D$WORKSPACE +EDK_SOURCE=3D$WORKSPACE + +##********************************************************************** +## Parse command line arguments +##********************************************************************** + +## Optional arguments +for (( i=3D1; i<=3D$#; )) + do + if [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/X64" ]; then + Arch=3DX64 + shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/MN" ]; then + BoardId=3DMN + shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/BG" ]; then + BoardId=3DBG + shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/B" ]; then + FabId=3DB + shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/A" ]; then + FabId=3DA + shift + else + break + fi + done + +## Required argument(s) +if [ "$2" =3D=3D "" ]; then + echo=20 + echo "Not Enough Arguments Provided" + echo "Please review the Help screen" + ErrorExit +fi + +## Remove the values for Platform_Type and Build_Target from BiosId.env an= d 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 + +if [ $BoardId =3D=3D "MN" ]; then + BOARD_ID=3DMNW3 + echo BOARD_ID =3D MINNOW3 >> $WORKSPACE/Conf/BiosId.env +else + BOARD_ID=3DBEN1 + echo BOARD_ID =3D BENSONV >> $WORKSPACE/Conf/BiosId.env +fi +ENBDT_PF_BUILD=3DTRUE +PLATFORM_NAME=3DBroxtonPlatformPkg +PLATFORM_PACKAGE=3DPlatform/BroxtonPlatformPkg =20 +Platform_Type=3D$1 + +## Create new DefineAtBuildMacros.dsc file +Build_Macros=3D$WORKSPACE/$PLATFORM_PACKAGE/DefineAtBuildMacros.dsc +if [ -f "$Build_Macros" ]; then + rm $Build_Macros +fi +touch $Build_Macros + +## Output platform specific build macros to DefineAtBuildMacros.dsc +echo DEFINE ENBDT_PF_BUILD =3D $ENBDT_PF_BUILD >> $Build_Macros +echo DEFINE TABLET_PF_BUILD =3D $TABLET_PF_BUILD >> $Build_Macros +echo DEFINE BYTI_PF_BUILD =3D $BYTI_PF_BUILD >> $Build_Macros +echo DEFINE CSLE_ENABLE =3D $CSLE_ENABLE >> $Build_Macros +echo DEFINE VP_BIOS_ENABLE =3D $VP_BIOS_ENABLE >> $Build_Macros +echo DEFINE SV_BIOS_ENABLE =3D $SV_BIOS_ENABLE >> $Build_Macros +echo DEFINE PPV_BIOS_ENABLE =3D $PPV_BIOS_ENABLE >> $Build_Macros +echo DEFINE RVVP_BIOS_ENABLE =3D $RVVP_BIOS_ENABLE >> $Build_Macros +echo DEFINE RVV_BIOS_ENABLE =3D $RVV_BIOS_ENABLE >> $Build_Macros + +if [ $Arch =3D=3D "IA32" ]; then + echo DEFINE X64_CONFIG =3D FALSE >> $Build_Macros +else + echo DEFINE X64_CONFIG =3D TRUE >> $Build_Macros +fi + +if [ "$(echo $2 | tr 'a-z' 'A-Z')" =3D=3D "RELEASE" ]; then + TARGET=3DRELEASE + BUILD_TYPE=3DR + echo BUILD_TYPE =3D R >> $WORKSPACE/Conf/BiosId.env +else + TARGET=3DDEBUG + BUILD_TYPE=3DD + echo BUILD_TYPE =3D D >> $WORKSPACE/Conf/BiosId.env +fi + +if [ $BoardId =3D=3D "BG" ]; then + BOARD_REV=3DA + echo BOARD_REV =3D A >> $WORKSPACE/Conf/BiosId.env +fi + +if [ $BoardId =3D=3D "MN" ]; then + if [ $FabId =3D=3D "B" ]; then + BOARD_REV=3DB + echo BOARD_REV =3D B >> $WORKSPACE/Conf/BiosId.env + else + BOARD_REV=3DA + echo BOARD_REV =3D A >> $WORKSPACE/Conf/BiosId.env + fi +fi + + +##********************************************************************** +## Additional EDK Build Setup/Configuration +##********************************************************************** +echo "Ensuring correct build directory is present for GenBiosId..." +ACTIVE_PLATFORM=3D$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc +#TOOL_CHAIN_TAG=3DGCC47 +MAX_CONCURRENT_THREAD_NUMBER=3D1 +sed -i '/^ACTIVE_PLATFORM/d' $WORKSPACE/Conf/target.txt +sed -i '/^TARGET /d' $WORKSPACE/Conf/target.txt +sed -i '/^TARGET_ARCH/d' $WORKSPACE/Conf/target.txt +sed -i '/^TOOL_CHAIN_TAG/d' $WORKSPACE/Conf/target.txt +sed -i '/^MAX_CONCURRENT_THREAD_NUMBER/d' $WORKSPACE/Conf/target.txt +echo ACTIVE_PLATFORM =3D $ACTIVE_PLATFORM >> Con= f/target.txt +echo TARGET =3D $TARGET >> Con= f/target.txt +echo TOOL_CHAIN_TAG =3D $TOOL_CHAIN_TAG >> Con= f/target.txt +echo MAX_CONCURRENT_THREAD_NUMBER =3D $MAX_CONCURRENT_THREAD_NUMBER >> Con= f/target.txt +if [ $Arch =3D=3D "IA32" ]; then + echo TARGET_ARCH =3D IA32 >> Con= f/target.txt +else + echo TARGET_ARCH =3D IA32 X64 >> Con= f/target.txt +fi + +### +### Update ASL path for GCC47 & 46 +### + +## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule + echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG =3D --add-gnu-debuglink=3D\$\(DE= BUG_DIR\)/\$\(MODULE_NAME\).debug >> $WORKSPACE/Conf/tools_def.txt +###=20 + +##********************************************************************** +## Build BIOS +##********************************************************************** +echo "Creating BiosId..." +BUILD_PATH=3DBuild/$PLATFORM_NAME/"$TARGET"_"$TOOL_CHAIN_TAG" +if [ ! -d "$BUILD_PATH/$Arch" ]; then + mkdir -p $BUILD_PATH/$Arch +fi +if [ -e "$BUILD_PATH/$Arch/BiosId.bin" ]; then + rm -f $BUILD_PATH/$Arch/BiosId.bin +fi +./Platform/BroxtonPlatformPkg/Common/Tools/GenBiosId/GenBiosId -i Conf/Bio= sId.env -o $BUILD_PATH/$Arch/BiosId.bin + + +echo +echo "**** Copy ResetVector to original folder ****" +echo "**** Due to nasm can't execute in Ubuntu ****" + + +echo "Invoking EDK2 build..." + +build $Build_Flags + +echo "check if Build was successful" + +##********************************************************************** +## Post Build processing and cleanup +##********************************************************************** + +# +# FSP Rebase and Split +# +# 0xFEF7A000 =3D gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =3D $= (CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EM= P_DATA_SIZE) + $(BLD_IBBM_SIZE) +pushd $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp= Bin +python $WORKSPACE/Core/IntelFsp2Pkg/Tools/SplitFspBin.py rebase -f Fsp.fd = -c m -b 0xFEF7A000 -o ./ -n ApolloLakeFsp.fd +python $WORKSPACE/Core/IntelFsp2Pkg/Tools/SplitFspBin.py split -f ApolloLa= keFsp.fd -o ./ -n FSP.Fv +popd +cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_T.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch +cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_M.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch +cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspB= in/FSP_S.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + +echo "Running fce..." +cat $BUILD_PATH/FV/FVIBBM.Fv $BUILD_PATH/FV/SOC.fd > $BUILD_PATH/FV/Temp.fd +# Extract Hii data from build and store a copy in HiiDefaultData.txt +# UQI 0006 005C 0078 0030 0031 0030 0031 is for question prompt(STR_IPU_EN= ABLED) +# First 0006 is the length of string; Next six byte values are mapped to S= TR_IPU_ENABLED string value defined in Platform/BroxtonPlatformPkg/Common/P= latformSettings/PlatformSetupDxe/VfrStrings.uni. +./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i $BUILD_PATH/FV/Temp.fd 00= 06 005C 0078 0030 0031 0030 0031 > $BUILD_PATH/FV/HiiDefaultData.txt + +## copy the Setup variable to the SetupDefault variable and save changes t= o BxtXXX.fd +./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE update -i $BUILD_PATH/FV/Temp.fd = -s $BUILD_PATH/FV/HiiDefaultData.txt -o $BUILD_PATH/FV/Bxt"$Arch".fd -g B73= FE497-B92E-416e-8326-45AD0D270091 -a 1>>EDK2.log 2>&1 +#echo "Skip FCE tool..." +Split -f $BUILD_PATH/FV/Bxt"$Arch".fd -s 0x35000 -o $BUILD_PATH/FV/FVIBBM.= Fv +#cp $BUILD_PATH/FV/SOC.fd $BUILD_PATH/FV/Bxt"$Arch".fd + +## Set the Board_Id, Build_Type, Version_Major, and Version_Minor environm= ent variables +##find /v "#" Conf\BiosId.env > ver_strings +##for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j +##del /f/q ver_strings >nul +## +VERSION_MAJOR=3D$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 = | cut -c 1-4) +VERSION_MINOR=3D$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 = | cut -c 1-2) +BIOS_Name=3D"$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VER= SION_MAJOR"_"$VERSION_MINOR" + +cp -f $BUILD_PATH/FV/FVOBB.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch +cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch +cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch +cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch +cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch + +if [ $BoardId =3D=3D "BG" ]; then + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common/= Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benson= Glacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Commo= n/Tools/Stitch +fi + +if [ $BoardId =3D=3D "MN" ]; then + if [ $FabId =3D=3D "B" ]; then + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch + else + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk1.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk2.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/SpiChunk3.bin $WORKSPACE/Platform/BroxtonPlatformPkg/Common= /Tools/Stitch + cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minn= owBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch + fi +fi + +# +# Assmeble components +# +pushd $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + +cat FVIBBL.Fv > IBBL.Fv + +cat FVIBBM.Fv FSP_M.Fv > IBB.Fv + +cat FSP_S.Fv FVIBBR.Fv FVOBB.Fv FVOBBX.Fv > OBB.Fv + +cat SpiChunk1.bin IBBL.Fv IBB.Fv SpiChunk2.bin OBB.Fv NvStorage.Fv SpiChun= k3.bin > $BIOS_Name"_GCC".bin + +popd + +echo +echo Check if SPI IFWI image is generated at below location: +echo $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/$BIOS_Name= "_GCC".bin +echo +echo diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPl= atformPkg/BuildIFWI.bat index 5042580..04d338d 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -2,6 +2,7 @@ SetLocal EnableDelayedExpansion EnableExtensions =20 :: Assign initial values +set thisscript=3D%0 set exitCode=3D0 set "Build_Flags=3D " set Arch=3DX64 @@ -116,7 +117,7 @@ if /i "%~1"=3D=3D"/m" ( :: Require 2 input parameters if "%~2"=3D=3D"" ( echo. & echo -- ERROR: Not Enough Arguments Provided - echo -- Please review the Help screen "/?" -- & echo. + echo -- Please review the Help screen %thisscript% "/?" -- & echo. goto exit ) =20 @@ -129,8 +130,8 @@ echo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D echo Build_IFWI: Calling BIOS build Script... echo. =20 -echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Bui= ld_Target% -call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Build_Flags%= %Platform_Type% %Build_Target% +echo - call BuildBxtBios.bat %buildthread% %Build_Flags% %Platform_Type% %= Build_Target% +call %WORKSPACE%\%PLATFORM_PATH%\BuildBxtBios.bat %buildthread% %Build_Fla= gs% %Platform_Type% %Build_Target% if ErrorLevel 1 ( echo echo -- Error Building BIOS & echo. set exitCode=3D1 @@ -170,7 +171,7 @@ if ErrorLevel 1 ( ) echo. echo Build_IFWI is finished. -echo The final IFWI file is located in Stitch\ +echo The final IFWI file is located in %WORKSPACE%\%PLATFORM_PATH%\Common\= Tools\Stitch\ echo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 =20 @@ -180,11 +181,12 @@ goto Exit if /i "%SkipUsageFlag%" =3D=3D "TRUE" goto Exit echo Script to build BIOS firmware and stitch the entire IFWI. echo. -echo Usage: BuildIFWI.bat [options] ^ ^ +echo Usage: %thisscript% [options] ^ ^ echo. echo. /? Display this help text echo /l Log a copy of the build output to EDK2.log echo /c CleanAll before building +echo /m Set the build thread count to number of processors echo /FspW Build FSP and FSP Wrapper echo /x64 Set Arch to X64 (default) echo /vs08 Set compiler to VisualStudio 2008 diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPla= tformPkg/BuildIFWI.sh index 73766cc..f5fb4b4 100755 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh @@ -19,10 +19,12 @@ function Usage () { echo echo "Usage: BuildIFWI.sh Build_Flags Platform_Type Build_Target" echo - echo " Build_Flags: /A Set FabId to A (default= : FAB_B)" - echo " Build_Flags: /B Set FabId to B (default= : FAB_B)" - echo " Platform_Type [optional]: Broxton " =20 - echo " Build_Target: Release, Debug " + echo " Build_Flags: /MN Minnow3 Board (default:= MN) " + echo " Build_Flags: /BG Benson Glacier Board " + echo " Build_Flags: /A Set FabId to A (default= : FAB_B) " + echo " Build_Flags: /B Set FabId to B (default= : FAB_B) " + echo " Platform_Type [optional]: Broxton " =20 + echo " Build_Target: Release, Debug " echo echo "Press any key......" read @@ -56,6 +58,10 @@ for (( i=3D1; i<=3D$#; )) Arch=3DX64 Build_Flags=3D"$Build_Flags /x64" shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/MN" ]; then + BoardId=3DMN + Build_Flags=3D"$Build_Flags /MN" + shift elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/BG" ]; then BoardId=3DBG Build_Flags=3D"$Build_Flags /BG" @@ -94,7 +100,7 @@ fi ## Build BIOS echo "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" echo "Build_IFWI: Calling BIOS build Script..." -bash Platform/BroxtonPlatformPkg/BuildBios.sh $Build_Flags $Platform_Type = $Build_Target +bash Platform/BroxtonPlatformPkg/BuildBxtBios.sh $Build_Flags $Platform_Ty= pe $Build_Target =20 echo echo Finished Building Process. --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel