From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=david.wei@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 400A921155D21 for ; Mon, 24 Sep 2018 22:56:05 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 22:56:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,300,1534834800"; d="scan'208,217";a="259993493" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 24 Sep 2018 22:54:44 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Sep 2018 22:54:44 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Sep 2018 22:54:43 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.220]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Tue, 25 Sep 2018 13:54:34 +0800 From: "Wei, David" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] [edk2-platforms/devel-IntelAtomProcessorE3900] Clean up build scripts Thread-Index: AdRRC2DlIv9UvSumTraDgnoCDi2rBgAsqOQgALWI3MA= Date: Tue, 25 Sep 2018 05:54:33 +0000 Message-ID: <89954A0B46707A448411A627AD4EEE346911B7C1@SHSMSX101.ccr.corp.intel.com> References: <89954A0B46707A448411A627AD4EEE3469115A4D@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <89954A0B46707A448411A627AD4EEE3469115A4D@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzQ2NmY0MzAtNjE1YS00NGM2LWEyZDAtYjAwMjEzNjFjM2QyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic2JFOURJRks4TGE5eVNGXC9COVJTd09rbVdxRWZmaTRuWStzK0hqZEhWVHdWWHBJc25yUGV3ZVlaMkU3U1p3TVYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [PATCH] [edk2-platforms/devel-IntelAtomProcessorE3900] Clean up build scripts X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2018 05:56:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: David Wei > Thanks, David Wei Intel SSG/STO/UEFI BIOS From: Steele, Kelly Sent: Friday, September 21, 2018 1:58 AM To: edk2-devel@lists.01.org Cc: Wei, David >; Guo, Mang= > Subject: [PATCH] [edk2-platforms/devel-IntelAtomProcessorE3900] Clean up bu= ild scripts >>From 62aef5b6fdb4e85878bafed4ab9c41631689b69d Mon Sep 17 00:00:00 2001 From: Kelly Steele > Date: Thu, 20 Sep 2018 10:47:06 -0700 Subject: [PATCH] [edk2-platforms/devel-IntelAtomProcessorE3900] Clean up bu= ild scripts Went thru the build scripts and cleaned them up. There was a couple of "magic" numbers being used in BuildBxtBios.bat that are derived from defines.dsc. I switched from "magic" numbers to parsing defines.dsc to use what is set there. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Kelly Steele > --- BuildBIOS.bat | 12 +- Platform/BroxtonPlatformPkg/BuildBxtBios.bat | 232 ++++++++----- Platform/BroxtonPlatformPkg/BuildIFWI.bat | 497 ++++++++++++++----------= --- 3 files changed, 410 insertions(+), 331 deletions(-) diff --git a/BuildBIOS.bat b/BuildBIOS.bat index d8275aca14..500c2244c9 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -34,13 +34,14 @@ echo ---- Call Build Script of Broxton ---- if not exist Platform\%PlatformName%PlatformPkg\BuildIFWI.bat ( echo Platform %PlatformName%PlatformPkg does not exist - echo. & echo Error - Unsupported Platform name: %1 + echo. & echo Error - Unsupported Platform name: %1 echo. goto Usage ) -echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFla= gs% /fspw MINN %BuildTarget% -call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFlags% /fspw= MINN %BuildTarget% +echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFla= gs% /fspw MINN %BuildTarget% +call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFlags% /fspw= MINN %BuildTarget% +set ExitCode=3D%ErrorLevel% goto Exit @@ -75,4 +76,7 @@ echo %thisscript% /vs13 /LH /B /x64 Broxton Debug set exitCode=3D1 :Exit -exit /b %exitCode% +( + EndLocal + exit /b %exitCode% +) diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat b/Platform/Broxto= nPlatformPkg/BuildBxtBios.bat index 9858ceae58..2bc2556a8a 100644 --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat @@ -73,8 +73,9 @@ set FSP_BIN_PKG_NAME=3DBroxtonFspBinPkg set STITCH_PATH=3D%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch set ResetVectorPath=3D%WORKSPACE%\%PLATFORM_RC_PACKAGE%\Cpu\ResetVector -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 +PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE +PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\GenBiosId +PATH=3D%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32 ::********************************************************************** :: Parse command line arguments @@ -268,8 +269,8 @@ if "%Arch%"=3D=3D"IA32" ( echo DEFINE X64_CONFIG =3D TRUE >> %= Build_Macros% ) -echo DEFINE UP2_BOARD =3D %UP2_BOARD% >> %Bui= ld_Macros% -echo DEFINE MINNOW3_MODULE_BOARD =3D %MINNOW3_MODULE_BOARD% >> %Bui= ld_Macros% +echo DEFINE UP2_BOARD =3D %UP2_BOARD% >> %Buil= d_Macros% +echo DEFINE MINNOW3_MODULE_BOARD =3D %MINNOW3_MODULE_BOARD% >> %Buil= d_Macros% ::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target= values removed @@ -288,43 +289,63 @@ if /i "%~2" =3D=3D "RELEASE" ( echo BUILD_TYPE =3D D >> Conf\BiosId.env ) -if %BoardId%=3D=3DBG ( - if %FabId%=3D=3DB ( +if "%BoardId%" =3D=3D "BG" ( + if "%FabId%" =3D=3D "A" ( + echo BOARD_REV =3D A >> Conf\BiosId.env + ) else if "%FabId%" =3D=3D "B" ( echo BOARD_REV =3D B >> Conf\BiosId.env ) else ( - echo BOARD_REV =3D A >> Conf\BiosId.env + echo ERROR: Benson Glacier currently only supports Board Fab A & B^^^! + goto BldFail ) ) -if %BoardId%=3D=3DAG ( - echo BOARD_REV =3D A >> Conf\BiosId.env +if "%BoardId%" =3D=3D "AG" ( + if "%FabId%" =3D=3D "A" ( + echo BOARD_REV =3D A >> Conf\BiosId.env + ) else ( + echo ERROR: Aurora Glacier currently only supports Board Fab A^^^! + goto BldFail + ) ) -if %BoardId%=3D=3DMN ( - if %FabId%=3D=3DB ( +if "%BoardId%" =3D=3D "MN" ( + if "%FabId%" =3D=3D "A" ( + echo BOARD_REV =3D A >> Conf\BiosId.env + ) else if "%FabId%" =3D=3D "B" ( echo BOARD_REV =3D B >> Conf\BiosId.env ) else ( - echo BOARD_REV =3D A >> Conf\BiosId.env + echo ERROR: Minnow Baord v3 currently only supports Board Fab A & B^^^= ! + goto BldFail ) ) -if %BoardId%=3D=3DMX ( - if %FabId%=3D=3DC ( +if "%BoardId%" =3D=3D "MX" ( + if "%FabId%" =3D=3D "A" ( + echo BOARD_REV =3D A >> Conf\BiosId.env + ) else if "%FabId%" =3D=3D "C" ( echo BOARD_REV =3D C >> Conf\BiosId.env ) else ( - echo BOARD_REV =3D A >> Conf\BiosId.env + echo ERROR: Minnow Baord v3 Module currently only supports Board Fab A= , B & C^^^! + goto BldFail ) ) -if %BoardId%=3D=3DLH ( - if %FabId%=3D=3DD ( +if "%BoardId%" =3D=3D "LH" ( + if "%FabId%" =3D=3D "D" ( echo BOARD_REV =3D D >> Conf\BiosId.env + ) else ( + echo ERROR: Leaf Hill currently only supports Board Fab D^^^! + goto BldFail ) ) -if %BoardId%=3D=3DUP ( - if %FabId%=3D=3DA ( +if "%BoardId%" =3D=3D "UP" ( + if "%FabId%" =3D=3D "A" ( echo BOARD_REV =3D A >> Conf\BiosId.env + ) else ( + echo ERROR: Up Squared currently only supports Board Fab A^^^! + goto BldFail ) ) @@ -477,17 +498,93 @@ if not exist "%AutoGenPath%" ( ) findstr /L "_PCD_VALUE_" %AutoGenPath% > %STITCH_PATH%\FlashMap.h +:: +:: NOTE: This cannot be inside an if..then block. It freaks out at the Pow= erShell execution. +:: +if not exist "%STITCH_PATH%\FlashMap.h" ( + echo ERROR: Couldn't find %STITCH_PATH%\FlashMap.h + goto BldFail +) + echo. + echo Get NvStorage magic numbers... + :: + :: %STITCH_PATH%\FlashMap.h has the information for the magic numbe= rs below. Parse it. + :: You'll need to account for both hex (0x000000) and int (123456= 7U) value types + :: FLASH_REGION_VPD_OFFSET + :: _PCD_VALUE_PcdFlashNvStorageBase - _PCD_VALUE_PcdFlashBaseAd= dress + :: FLASH_REGION_VPD_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FT= W_WORKING_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE + :: _PCD_VALUE_PcdFlashNvStorageSize + :: + :: Variable to find Position Var= iable 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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D + call :FindVariableInFile _PCD_VALUE_PcdFlashNvStorageBase 3 NvS= torageBase "%STITCH_PATH%\FlashMap.h" + call :FindVariableInFile _PCD_VALUE_PcdFlashBaseAddress 3 Bas= eAddress "%STITCH_PATH%\FlashMap.h" + call :FindVariableInFile _PCD_VALUE_PcdFlashNvStorageSize 3 NvS= torageSize "%STITCH_PATH%\FlashMap.h" + :: Find image offset as opposed to memory offset + del /f /q temp.pcd >NUL 2>&1 + PowerShell ([uint32]$env:NvStorageBase - [uint32]$env:BaseAddress) > t= emp.pcd + set /p VpdOffset=3DNUL 2>&1 + :: Force the variables we care about into DEC string format + set VpdSize=3D%NvStorageSize% + call :ForceToDec VpdOffset + call :ForceToDec VpdSize + :: Dump what we found + echo - NvStorageBase =3D %NvStorageBase% + echo - BaseAddress =3D %BaseAddress% + echo - NvStorageSize =3D %NvStorageSize% + echo - VpdOffset =3D %VpdOffset% + echo - VpdSize =3D %VpdSize% + echo. + +:: +:: NOTE: This cannot be inside an if..then block. It freaks out at the Pow= erShell execution. +:: +if not exist "%WORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" ( + echo ERROR: Couldn't find %WORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Define= s.dsc + goto BldFail +) + echo. + echo Get FSP magic number for rebase... + :: + :: 0xFEF7C000 =3D gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =3D= $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_= EMP_DATA_SIZE) + $(BLD_IBBM_SIZE) + :: %PLATFORM_PATH%\PlatformDsc\Defines.dsc has the information needed to= calculate this magic number. Use it. + :: + :: Variable to find Position Variable Fil= e 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=3D=3D=3D=3D=3D=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 :FindVariableInFile CAR_BASE_ADDRESS 4 CarBaseAddress "%W= ORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" + call :FindVariableInFile BLD_RAM_DATA_SIZE 4 BldRamDataSize "%W= ORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" + call :FindVariableInFile FSP_RAM_DATA_SIZE 4 FspRamDataSize "%W= ORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" + call :FindVariableInFile FSP_EMP_DATA_SIZE 4 FspEmpDataSize "%W= ORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" + call :FindVariableInFile BLD_IBBM_SIZE 4 BldIbbmSize "%W= ORKSPACE%\%PLATFORM_PATH%\PlatformDsc\Defines.dsc" + :: Dump what we found + echo - CAR_BASE_ADDRESS =3D %CarBaseAddress% + echo - BLD_RAM_DATA_SIZE =3D %BldRamDataSize% + echo - FSP_RAM_DATA_SIZE =3D %FspRamDataSize% + echo - FSP_EMP_DATA_SIZE =3D %FspEmpDataSize% + echo - BLD_IBBM_SIZE =3D %BldIbbmSize% + :: Find magic number + del /f /q temp.pcd >NUL 2>&1 + PowerShell ([uint32]$env:CarBaseAddress + [uint32]$env:BldRamDataSize = + [uint32]$env:FspRamDataSize + [uint32]$env:FspEmpDataSize + [uint32]$env:= BldIbbmSize) > temp.pcd + set /p FspBaseAddress=3DNUL 2>&1 + call :ForceToHex FspBaseAddress + echo - FspBaseAddress =3D %FspBaseAddress% + echo. + echo Running FCE... copy /b %BUILD_PATH%\FV\FvIBBM.fv + /b %BUILD_PATH%\FV\Soc.fd /b %BUILD_PAT= H%\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. fce.exe read -i %BUILD_PATH%\FV\Temp.fd 0006 005C 0078 0030 0031 0030 0031 = > %BUILD_PATH%\FV\HiiDefaultData.txt 2>>EDK2.log +if ErrorLevel 1 goto BldFail :: 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\HiiDefaultData= .txt -o %BUILD_PATH%\FV\Bxt%Arch%.fd -g B73FE497-B92E-416e-8326-45AD0D2700= 91 -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 +:: More magic numbers!!! +split -f %BUILD_PATH%\FV\Bxt%Arch%.fd -s %BldIbbmSize% -o %BUILD_PATH%\FV\= FvIBBM.fv if ErrorLevel 1 goto BldFail @echo off @@ -496,13 +593,14 @@ if ErrorLevel 1 goto BldFail if "%BUILD_TYPE%"=3D=3D"R" set BUILD_TYPE=3DR echo Copy BIOS... -echo BIOS_Name=3D%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%= _%VERSION_MINOR% +echo BIOS_Name =3D [%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJ= OR%_%VERSION_MINOR%] 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 >nu= l copy /y %STITCH_PATH%\FlashMap.h %STITCH_PATH%\%BIOS_Name%.map >nu= l set Storage_Folder=3D%STITCH_PATH%\%BIOS_Name% if not exist %Storage_Folder% mkdir %Storage_Folder% +echo Storage_Folder =3D [%Storage_Folder%] copy /y/b %BUILD_PATH%\FV\FvIBBL.fv %Storage_Folder% >nul copy /y/b %BUILD_PATH%\FV\FvIBBM.fv %Storage_Folder% >nul @@ -512,50 +610,15 @@ 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 %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin - python %CORE_PATH%\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f Fsp.fd = -c m -b 0xFEF7A000 -o .\ -n ApolloLakeFsp.fd + pushd %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin + python %CORE_PATH%\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f Fsp.fd = -c m -b %FspBaseAddress% -o .\ -n ApolloLakeFsp.fd python %CORE_PATH%\IntelFsp2Pkg\Tools\SplitFspBin.py split -f ApolloLa= keFsp.fd -o .\ -n FSP.Fv - popd - copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_= T.Fv %Storage_Folder%\FSP_T.Fv - copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_= M.Fv %Storage_Folder%\FSP_M.Fv - copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\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 + popd + copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_T.= Fv %Storage_Folder%\FSP_T.Fv >nul + copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_M.= Fv %Storage_Folder%\FSP_M.Fv >nul + copy /y/b %SILICON_PATH%\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_S.= Fv %Storage_Folder%\FSP_S.Fv >nul ) -::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=3Dnul 2>&1 PowerShell ('0x' + [convert]::tostring($env:_Temp, 16).ToUpper()) > temp= .pcd set /p %~1=3Dnul 2>&1 :ForceToHexExit set _Temp=3D goto :EOF @@ -627,9 +700,10 @@ goto :EOF :ForceToDec call set _Temp=3D%%%~1%% if not "%_Temp:~0,2%" =3D=3D "0x" goto :ForceToDecExit + del /f /q temp.pcd >nul 2>&1 PowerShell ([convert]::toInt64((Get-Item env:_Temp).value, 16)) > temp.p= cd set /p %~1=3Dnul 2>&1 :ForceToDecExit set _Temp=3D goto :EOF diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPl= atformPkg/BuildIFWI.bat index 32126937f8..7fcf66eed7 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -1,248 +1,249 @@ -@echo off -SetLocal EnableDelayedExpansion EnableExtensions - -:: Assign initial values -set thisscript=3D%0 -set exitCode=3D0 -set "Build_Flags=3D " -set "Stitch_Flags=3D " -set Arch=3DX64 -set SkipUsageFlag=3DFALSE -set FabId=3DB -set BoardId=3DMN -set buildthread=3D -cd .. -set WORKSPACE=3D%CD% -if %WORKSPACE:~-1%=3D=3D\ ( - set WORKSPACE=3D%WORKSPACE:~0,-1% -) -echo %WORKSPACE% -set CORE_PATH=3D%WORKSPACE%\edk2 -set EDK_TOOLS_PATH=3D%CORE_PATH%\BaseTools -set PLATFORM_PATH=3Dedk2-platforms\Platform\BroxtonPlatformPkg -set SILICON_PATH=3Dedk2-platforms\Silicon\BroxtonSoC -set STITCH_PATH=3D%PLATFORM_PATH%\Common\Tools\Stitch - -set Minnow_RVP=3DMINN - -:: Parse Optional arguments -:OptLoop -if /i "%~1"=3D=3D"" goto Usage -if /i "%~1"=3D=3D"/?" goto Usage - -::Build Flags -if /i "%~1"=3D=3D"/ia32" ( - set Arch=3DIA32 - set Build_Flags=3D%Build_Flags% /ia32 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/x64" ( - set Arch=3DX64 - set Build_Flags=3D%Build_Flags% /x64 - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/vs08" ( - set Build_Flags=3D%Build_Flags% /vs08 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs10" ( - set Build_Flags=3D%Build_Flags% /vs10 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs12" ( - set Build_Flags=3D%Build_Flags% /vs12 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs13" ( - set Build_Flags=3D%Build_Flags% /vs13 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/vs15" ( - set Build_Flags=3D%Build_Flags% /vs15 - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/FspW" ( - set Build_Flags=3D%Build_Flags% /FspW - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/A" ( - set FabId=3DA - set Build_Flags=3D%Build_Flags% /A - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/B" ( - set FabId=3DB - set Build_Flags=3D%Build_Flags% /B - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/C" ( - set FabId=3DC - set Build_Flags=3D%Build_Flags% /C - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/D" ( - set FabId=3DD - set Build_Flags=3D%Build_Flags% /D - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/MN" ( - set BoardId=3DMN - set Build_Flags=3D%Build_Flags% /MN - shift - goto OptLoop -) -if /i "%~1"=3D=3D"/BG" ( - set BoardId=3DBG - set Build_Flags=3D%Build_Flags% /BG - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/AG" ( - set BoardId=3DAG - set Build_Flags=3D%Build_Flags% /AG - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/MX" ( - set BoardId=3DMX - set Build_Flags=3D%Build_Flags% /MX - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/LH" ( - set BoardId=3DLH - set Build_Flags=3D%Build_Flags% /LH - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/UP" ( - set BoardId=3DUP - set Build_Flags=3D%Build_Flags% /UP - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/m" ( - set buildthread=3D/m - echo. - shift - goto OptLoop -) - -if /i "%~1"=3D=3D"/L" ( - set Stitch_Flags=3DL - shift - goto OptLoop -) - -:: Require 2 input parameters -if "%~2"=3D=3D"" ( - echo. & echo -- ERROR: Not Enough Arguments Provided - echo -- Please review the Help screen %thisscript% "/?" -- & echo. - goto exit -) - -:: Assign required arguments -set Platform_Type=3D%~1 -set Build_Target=3D%~2 - -:: 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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D -echo Build_IFWI: Calling BIOS build Script... -echo. - -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 - goto exit -) - -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=3D=3D=3D=3D=3D -echo. - -call Conf\BiosId.bat -echo BIOS_ID=3D%BIOS_ID% - -:: 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 - -:: Translate Release Build Type -if "%BUILD_TYPE%"=3D=3D"R" set BUILD_TYPE=3DR - -set BIOS_Name=3D%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_= %VERSION_MINOR% - -:: Start Integration process -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=3D=3D=3D=3D=3D -echo Build_IFWI: Calling IFWI Stitching Script... -echo. -echo BIOS ROM input: %BIOS_Name% -echo. -pushd %STITCH_PATH% - echo - call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name= % %FabId% %BoardId% %Stitch_Flags% - call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name% %FabId= % %BoardId% %Stitch_Flags% - @echo off -popd -if ErrorLevel 1 ( - echo echo -- Error Stitching %BIOS_Name% & echo. - set exitCode=3D1 -) -echo. -echo Build_IFWI is finished. -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 - - -goto Exit - -:Usage -if /i "%SkipUsageFlag%" =3D=3D "TRUE" goto Exit -echo Script to build BIOS firmware and stitch the entire IFWI. -echo. -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 -echo /vs10 Set compiler to VisualStudio 2010 -echo /vs12 Set compiler to VisualStudio 2012 -echo /vs13 Set compiler to VisualStudio 2013 -echo /vs15 Set compiler to VisualStudio 2015 -echo. -echo Platform Types: %Minnow_RVP% -echo MINN - Minnow (ApolloLake) -echo. -echo Build Targets: Release, Debug -echo. -set exitCode=3D1 - -:Exit -( - EndLocal - set Arch=3D%Arch% - exit /b %exitCode% -) +@echo off +SetLocal EnableDelayedExpansion EnableExtensions + +:: Assign initial values +set thisscript=3D%0 +set exitCode=3D0 +set "Build_Flags=3D " +set "Stitch_Flags=3D " +set Arch=3DX64 +set SkipUsageFlag=3DFALSE +set FabId=3DB +set BoardId=3DMN +set buildthread=3D +cd .. +set WORKSPACE=3D%CD% +if %WORKSPACE:~-1%=3D=3D\ ( + set WORKSPACE=3D%WORKSPACE:~0,-1% +) +echo %WORKSPACE% +set CORE_PATH=3D%WORKSPACE%\edk2 +set EDK_TOOLS_PATH=3D%CORE_PATH%\BaseTools +set PLATFORM_PATH=3Dedk2-platforms\Platform\BroxtonPlatformPkg +set SILICON_PATH=3Dedk2-platforms\Silicon\BroxtonSoC +set STITCH_PATH=3D%PLATFORM_PATH%\Common\Tools\Stitch + +set Minnow_RVP=3DMINN + +:: Parse Optional arguments +:OptLoop +if /i "%~1"=3D=3D"" goto Usage +if /i "%~1"=3D=3D"/?" goto Usage + +::Build Flags +if /i "%~1"=3D=3D"/ia32" ( + set Arch=3DIA32 + set Build_Flags=3D%Build_Flags% /ia32 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/x64" ( + set Arch=3DX64 + set Build_Flags=3D%Build_Flags% /x64 + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/vs08" ( + set Build_Flags=3D%Build_Flags% /vs08 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs10" ( + set Build_Flags=3D%Build_Flags% /vs10 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs12" ( + set Build_Flags=3D%Build_Flags% /vs12 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs13" ( + set Build_Flags=3D%Build_Flags% /vs13 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/vs15" ( + set Build_Flags=3D%Build_Flags% /vs15 + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/FspW" ( + set Build_Flags=3D%Build_Flags% /FspW + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/A" ( + set FabId=3DA + set Build_Flags=3D%Build_Flags% /A + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/B" ( + set FabId=3DB + set Build_Flags=3D%Build_Flags% /B + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/C" ( + set FabId=3DC + set Build_Flags=3D%Build_Flags% /C + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/D" ( + set FabId=3DD + set Build_Flags=3D%Build_Flags% /D + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/MN" ( + set BoardId=3DMN + set Build_Flags=3D%Build_Flags% /MN + shift + goto OptLoop +) +if /i "%~1"=3D=3D"/BG" ( + set BoardId=3DBG + set Build_Flags=3D%Build_Flags% /BG + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/AG" ( + set BoardId=3DAG + set Build_Flags=3D%Build_Flags% /AG + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/MX" ( + set BoardId=3DMX + set Build_Flags=3D%Build_Flags% /MX + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/LH" ( + set BoardId=3DLH + set Build_Flags=3D%Build_Flags% /LH + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/UP" ( + set BoardId=3DUP + set Build_Flags=3D%Build_Flags% /UP + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/m" ( + set buildthread=3D/m + echo. + shift + goto OptLoop +) + +if /i "%~1"=3D=3D"/L" ( + set Stitch_Flags=3DL + shift + goto OptLoop +) + +:: Require 2 input parameters +if "%~2"=3D=3D"" ( + echo. & echo -- ERROR: Not Enough Arguments Provided + echo -- Please review the Help screen %thisscript% "/?" -- & echo. + goto exit +) + +:: Assign required arguments +set Platform_Type=3D%~1 +set Build_Target=3D%~2 + +:: 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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D +echo Build_IFWI: Calling BIOS build Script... +echo. + +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 + goto exit +) + +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=3D=3D=3D=3D=3D +echo. + +call Conf\BiosId.bat +echo BIOS_ID=3D%BIOS_ID% + +:: 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 + +:: Translate Release Build Type +if "%BUILD_TYPE%"=3D=3D"R" set BUILD_TYPE=3DR + +set BIOS_Name=3D%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_= %VERSION_MINOR% + +:: Start Integration process +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=3D=3D=3D=3D=3D +echo Build_IFWI: Calling IFWI Stitching Script... +echo. +echo BIOS ROM input: %BIOS_Name% +echo. +pushd %STITCH_PATH% + echo - call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name= % %FabId% %BoardId% %Stitch_Flags% + call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name% %FabId= % %BoardId% %Stitch_Flags% + @echo off +popd +if ErrorLevel 1 ( + echo echo -- Error Stitching %BIOS_Name% & echo. + set exitCode=3D1 + goto Exit +) + +echo. +echo Build_IFWI is finished. +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 + + +goto Exit + +:Usage +if /i "%SkipUsageFlag%" =3D=3D "TRUE" goto Exit +echo Script to build BIOS firmware and stitch the entire IFWI. +echo. +echo Usage: %thisscript% [options] ^ ^ +echo. +echo. /? Display this help text +echo /l Log a copy of the build output to EDK2.log +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 +echo /vs10 Set compiler to VisualStudio 2010 +echo /vs12 Set compiler to VisualStudio 2012 +echo /vs13 Set compiler to VisualStudio 2013 +echo /vs15 Set compiler to VisualStudio 2015 +echo. +echo Platform Types: %Minnow_RVP% +echo MINN - Minnow (ApolloLake) +echo. +echo Build Targets: Release, Debug +echo. +set exitCode=3D1 + +:Exit +( + EndLocal + set Arch=3D%Arch% + exit /b %exitCode% +) -- 2.11.0.windows.1