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.115; helo=mga14.intel.com; envelope-from=mang.guo@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 8EDB020968909 for ; Thu, 5 Jul 2018 00:13:04 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 00:13:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,311,1526367600"; d="dat'59?scan'59,208,59";a="54563122" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 05 Jul 2018 00:13:03 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 5 Jul 2018 00:13:03 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 5 Jul 2018 00:13:02 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.100]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.81]) with mapi id 14.03.0319.002; Thu, 5 Jul 2018 15:13:01 +0800 From: "Guo, Mang" To: "edk2-devel@lists.01.org" CC: "Wei, David" Thread-Topic: [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Add SpiAccess build option Thread-Index: AdQUL4oZHQZ55Nq0S3eA3Lp1I4abGA== Date: Thu, 5 Jul 2018 07:13:00 +0000 Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1526A9C85@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <22D2C85ED001C54AA20BFE3B0E4751D1526A9C85@SHSMSX103.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Add SpiAccess build option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2018 07:13:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Add SpiAccess build option to change flash region access permission for hos= t CPU. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Guo Mang --- BuildBIOS.bat | 1 + BuildBIOS.sh | 5 +++++ Platform/BroxtonPlatformPkg/BuildBxtBios.sh | 15 ++++++++++++--- Platform/BroxtonPlatformPkg/BuildIFWI.bat | 15 ++++++++------- Platform/BroxtonPlatformPkg/BuildIFWI.sh | 5 +++++ .../Common/Tools/Stitch/IFWIStitch_Simple.bat | 20 ++++++++++++++++= ++-- 6 files changed, 49 insertions(+), 12 deletions(-) diff --git a/BuildBIOS.bat b/BuildBIOS.bat index dab34d2..b04150c 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -62,6 +62,7 @@ echo /MX MinnowBoard 3 Module echo /BG Benson Glacier Board echo /AG Aurora Glacier Board echo /LH LeafHill CRB Board +echo /L Flash region access permission for host CPU echo PlatformName: Broxton echo BuildTargets: Release, Debug =20 diff --git a/BuildBIOS.sh b/BuildBIOS.sh index b80f8c7..c7e1532 100755 --- a/BuildBIOS.sh +++ b/BuildBIOS.sh @@ -25,6 +25,7 @@ function Usage () { echo " Build_Flags: /A Set FabId to A " echo " Build_Flags: /B Set FabId to B (default= : FAB_B)" echo " Build_Flags: /D Set FabId to D " + echo " Build_Flags: /L Flash region access per= mission for host CPU" echo " PlatformName [optional]: Broxton " =20 echo " Target_Flag: Release, Debug " echo @@ -82,6 +83,10 @@ for (( i=3D1; i<=3D$#; )) FabId=3DA Build_Flags=3D"$Build_Flags /A" shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/L" ]; then + FabId=3DA + Build_Flags=3D"$Build_Flags /L" + shift else break fi diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh b/Platform/Broxton= PlatformPkg/BuildBxtBios.sh index 6358eeb..80ed924 100755 --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh @@ -30,6 +30,7 @@ exitCode=3D0 Arch=3DX64 FabId=3DB BoardId=3DMN +SpiAccessControl=3D0 =20 ## Initialize all the build flags to FALSE ## depending on the cmd line input, some will be set to TRUE prior to buil= ding @@ -126,6 +127,9 @@ for (( i=3D1; i<=3D$#; )) elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/A" ]; then FabId=3DA shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/L" ]; then + SpiAccessControl=3D1 + shift else break fi @@ -394,10 +398,12 @@ if [ $BoardId =3D=3D "MX" ]; then cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_B/SpiChunk1.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_B/SpiChunk2.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_B/SpiChunk3.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_B/SpiChunk1SpiAccessControl.bin $PLATFORM_PATH/Platform/Broxton= PlatformPkg/Common/Tools/Stitch else cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_A/SpiChunk1.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_A/SpiChunk2.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_A/SpiChunk3.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Comm= on/Tools/Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/MinnowBoard3Nex= t/IFWI/FAB_A/SpiChunk1SpiAccessControl.bin $PLATFORM_PATH/Platform/Broxton= PlatformPkg/Common/Tools/Stitch fi fi =20 @@ -406,6 +412,7 @@ if [ $BoardId =3D=3D "LH" ]; then cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/F= AB_D/SpiChunk1.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools= /Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/F= AB_D/SpiChunk2.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools= /Stitch cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/F= AB_D/SpiChunk3.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools= /Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/F= AB_D/SpiChunk1SpiAccessControl.bin $PLATFORM_PATH/Platform/BroxtonPlatform= Pkg/Common/Tools/Stitch fi fi =20 @@ -419,9 +426,11 @@ cat FVIBBL.Fv > IBBL.Fv cat FVIBBM.Fv FSP_M.Fv > IBB.Fv =20 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 - +if [ $SpiAccessControl =3D=3D 0 ]; then + cat SpiChunk1.bin IBBL.Fv IBB.Fv SpiChunk2.bin OBB.Fv NvStorage.Fv SpiCh= unk3.bin > $BIOS_Name"_GCC".bin +else + cat SpiChunk1SpiAccessControl.bin IBBL.Fv IBB.Fv SpiChunk2.bin OBB.Fv Nv= Storage.Fv SpiChunk3.bin > $BIOS_Name"_GCC".bin +fi popd =20 echo diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPl= atformPkg/BuildIFWI.bat index f4c887d..35f4c8d 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -5,6 +5,7 @@ SetLocal EnableDelayedExpansion EnableExtensions set thisscript=3D%0 set exitCode=3D0 set "Build_Flags=3D " +set "Stitch_Flags=3D " set Arch=3DX64 set SkipUsageFlag=3DFALSE set FabId=3DB @@ -30,11 +31,6 @@ if /i "%~1"=3D=3D"" goto Usage if /i "%~1"=3D=3D"/?" goto Usage =20 ::Build Flags -if /i "%~1"=3D=3D"/l" ( - set Build_Flags=3D%Build_Flags% /l - shift - goto OptLoop -) if /i "%~1" =3D=3D "/c" ( set Build_Flags=3D%Build_Flags% /c shift @@ -143,6 +139,11 @@ if /i "%~1"=3D=3D"/m" ( goto OptLoop ) =20 +if /i "%~1"=3D=3D"/L" ( + set Stitch_Flags=3DL + shift + goto OptLoop +) =20 :: Require 2 input parameters if "%~2"=3D=3D"" ( @@ -191,8 +192,8 @@ echo. echo BIOS ROM input: %BIOS_Name% echo. pushd %STITCH_PATH% - echo - call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name= % %FabId% %BoardId% - call IFWIStitch_Simple.bat %WORKSPACE%\%STITCH_PATH%\%BIOS_Name% %FabId= % %BoardId% + 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 ( diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPla= tformPkg/BuildIFWI.sh index cca9c34..128d8d6 100755 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh @@ -26,6 +26,7 @@ function Usage () { echo " Build_Flags: /A Set FabId to A" echo " Build_Flags: /B Set FabId to B (default= )" echo " Build_Flags: /D Set FabId to D" + echo " Build_Flags: /L Flash region access per= mission for host CPU" echo " Platform_Type [optional]: Broxton " =20 echo " Build_Target: Release, Debug " echo @@ -89,6 +90,10 @@ for (( i=3D1; i<=3D$#; )) FabId=3DA Build_Flags=3D"$Build_Flags /A" shift + elif [ "$(echo $1 | tr 'a-z' 'A-Z')" =3D=3D "/L" ]; then + FabId=3DA + Build_Flags=3D"$Build_Flags /L" + shift else break fi diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Sim= ple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple= .bat index 351ccd8..b8abaf3 100644 --- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat +++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat @@ -30,6 +30,7 @@ if /i "%~1"=3D=3D"Help" goto Usage set FspWrapper=3DFALSE set FabId=3DB set BoardId=3DMN +set SpiAccessControl=3D0 =20 if /i "%~2"=3D=3D"B" ( set FabId=3DB @@ -59,6 +60,10 @@ if /i "%~3"=3D=3D"LH" ( set BoardId=3DLH ) =20 +if /i "%~4"=3D=3D"L" ( + set SpiAccessControl=3D1 +) + :OptLoop1 =20 if /i "%~1"=3D=3D"/FspW" ( @@ -126,6 +131,7 @@ set IFWI_Name=3D!IFWI_Prefix!_%IFWI_Suffix% echo. echo ------------------------------------------ echo. +echo %SpiAccessControl% echo Generating SPI Image... mkdir BIOS_COMPONENTS copy /y /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS @@ -168,12 +174,22 @@ if %BoardId%=3D=3DBG ( copy /y /b ..\..\..\Board\MinnowBoard3Next\IFWI\FAB_A\SpiChunk1= .bin . copy /y /b ..\..\..\Board\MinnowBoard3Next\IFWI\FAB_A\SpiChunk2= .bin . copy /y /b ..\..\..\Board\MinnowBoard3Next\IFWI\FAB_A\SpiChunk3= .bin . - copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPO= NENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvSto= rage.Fv+SpiChunk3.bin spi_out.bin + copy /y /b ..\..\..\Board\MinnowBoard3Next\IFWI\FAB_A\SpiChunk1= SpiAccessControl.bin . + if %SpiAccessControl% EQU 0 ( + copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COM= PONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvS= torage.Fv+SpiChunk3.bin spi_out.bin + ) else ( + copy /y /b SpiChunk1SpiAccessControl.bin+.\BIOS_COMPONENTS\IB= BL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIO= S_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin + ) ) else if %BoardId%=3D=3DLH ( copy /y /b ..\..\..\Board\LeafHill\IFWI\FAB_D\SpiChunk1.bin . copy /y /b ..\..\..\Board\LeafHill\IFWI\FAB_D\SpiChunk2.bin . copy /y /b ..\..\..\Board\LeafHill\IFWI\FAB_D\SpiChunk3.bin . - copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPO= NENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvSto= rage.Fv+SpiChunk3.bin spi_out.bin + copy /y /b ..\..\..\Board\LeafHill\IFWI\FAB_D\SpiChunk1SpiAcces= sControl.bin . + if %SpiAccessControl% EQU 0 ( + copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COM= PONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvS= torage.Fv+SpiChunk3.bin spi_out.bin + ) else ( + copy /y /b SpiChunk1SpiAccessControl.bin+.\BIOS_COMPONENTS\IB= BL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIO= S_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin + ) ) move /y spi_out.bin %BIOS_ID%.bin >> Stitching.log =20 --=20 2.10.1.windows.1