public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
@ 2017-06-08  7:58 lushifex
  2017-06-08  8:01 ` Wei, David
  0 siblings, 1 reply; 12+ messages in thread
From: lushifex @ 2017-06-08  7:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

Change build script to differentiate FAB A and FAB B Board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 BuildBIOS.bat                                      | 14 +++++-----
 BuildBIOS.sh                                       | 31 +++++++++++++++++++++-
 Platform/BroxtonPlatformPkg/BuildBios.bat          | 15 +++--------
 Platform/BroxtonPlatformPkg/BuildBios.sh           | 23 ++++++++++++----
 Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 10 +++----
 Platform/BroxtonPlatformPkg/BuildIFWI.sh           |  9 +++++++
 .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 22 +++++++--------
 7 files changed, 83 insertions(+), 41 deletions(-)

diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index 51ed30b..3bc68e5 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -10,7 +10,7 @@ set PlatformName=
 set BuildTarget=Debug
 set Compiler=/vs13
 set Arch=/x64
-set Stepping=/B
+set FabId=/B
 
 :: Optional arguments
 :OptLoop
@@ -61,13 +61,13 @@ if /i "%~1"=="/vs15" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=/A
+    set FabId=/A
     echo.
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=/B
+    set FabId=/B
     echo.
     shift
     goto OptLoop
@@ -83,8 +83,8 @@ set BuildTarget=%~2
 
 :OptLoopEnd
 echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %Stepping% /fspw %BuildFlags% MINN %BuildTarget% 
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %Stepping% /fspw %BuildFlags% MINN %BuildTarget% 
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
 
 goto Exit
 
@@ -97,8 +97,8 @@ echo.
 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)
-echo        /A     Set stepping to A (default: B stepping)
-echo        /B     Set stepping to B (default: B stepping)
+echo        /A     Set FabId to A (default:  FAB_B)
+echo        /B     Set FabId to B (default:  FAB_B)
 echo        PlatformName:  Broxton
 echo        BuildTargets:  Release, Debug
 
diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index fb67f04..c241d87 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -8,6 +8,34 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
+
+##**********************************************************************
+## Initial Setup
+##**********************************************************************
+
+Build_Flags=
+
+## Parse Optional arguments
+if [ "$1" == "/?" ]; then
+  Usage
+fi
+
+## Build Flags
+for (( i=1; i<=$#; ))
+  do
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      Build_Flags="$Build_Flags /B"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      Build_Flags="$Build_Flags /A"
+      shift
+    else
+      break
+    fi
+  done
+
 Target_Flag=Release
 if [ "$1" == "Debug" ]; then
   Target_Flag=Debug
@@ -18,6 +46,7 @@ if [ "$1" == "Release" ]; then
   shift
 fi
 
+echo $Build_Flags
 echo $Target_Flag
 
 export WORKSPACE=`pwd`
@@ -27,5 +56,5 @@ export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WORKSPACE/P
 
 make -C BaseTools
 
-bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh APLI $Target_Flag
+bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh $Build_Flags APLI $Target_Flag
 
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 80de2f4..5e06a98 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -24,7 +24,7 @@ set "Build_Flags= "
 set exitCode=0
 set Arch=X64
 set Compiler=VS2013
-set Stepping=B
+set FabId=B
 if not defined BiosVersion set BiosVersion=DEV
 
 
@@ -154,13 +154,13 @@ if /i "%~1"=="/FspW" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=A
+    set FabId=A
     echo.
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=B
+    set FabId=B
     echo.
     shift
     goto OptLoop
@@ -409,7 +409,6 @@ 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%" == "TRUE" (
-  if %Stepping%==B (
 ::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
     pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin
     python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f ApolloLakeFsp.fd -c m -b 0xFEF7A000 -o .\ -n FSP.fd
@@ -418,14 +417,6 @@ if /i "%FSP_WRAPPER%" == "TRUE" (
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_S.Fv %Storage_Folder%\FSP_S.Fv
-  ) else (
-    pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP
-    python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py split -f FSP.fd -o .\ -n FSP.Fv
-    popd
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_S.Fv %Storage_Folder%\FSP_S.Fv
-  )
 )
 
 echo Get NvStorage Base and Size...
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBios.sh
index fb6ac67..a1f4766 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBios.sh
@@ -28,6 +28,7 @@ Build_Flags=
 SV_String=_
 exitCode=0
 Arch=X64
+FabId=B
 
 ## Initialize all the build flags to FALSE
 ## depending on the cmd line input, some will be set to TRUE prior to building
@@ -129,6 +130,12 @@ for (( i=1; i<=$#; ))
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
       Arch=X64
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
       VP_BIOS_ENABLE=TRUE
       shift
@@ -294,12 +301,18 @@ cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Too
 cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-
 
+if [ $FabId == "B" ]; then
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+else
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+fi
 
 #
 # Assmeble components
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index e8e1c4f..9c645a7 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -6,7 +6,7 @@ set exitCode=0
 set "Build_Flags= "
 set Arch=X64
 set SkipUsageFlag=FALSE
-set Stepping=B
+set FabId=B
 set WORKSPACE=%CD%
 if %WORKSPACE:~-1%==\ (
   set WORKSPACE=%WORKSPACE:~0,-1%
@@ -79,13 +79,13 @@ if /i "%~1"=="/FspW" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=A
+    set FabId=A
     set Build_Flags=%Build_Flags% /A
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=B
+    set FabId=B
     set Build_Flags=%Build_Flags% /B
     shift
     goto OptLoop
@@ -139,8 +139,8 @@ echo.
 echo BIOS ROM input:  %BIOS_Name%
 echo.
 pushd %STITCH_PATH%
-   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %Stepping%
-   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %Stepping%
+   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
+   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
    @echo off
 popd
 if ErrorLevel 1 (
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index c21904f..69ed67a 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -60,6 +60,7 @@ exitCode=0
 Build_Flags=
 Stitch_Flags=
 Arch=IA32
+FabId=B
 
 ## Description of each Platform/Board_ID
 ##   APLK - Netbook/Desktop (PCCG)
@@ -107,6 +108,14 @@ for (( i=1; i<=$#; ))
       Arch=X64
       Build_Flags="$Build_Flags /x64"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      Build_Flags="$Build_Flags /B"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      Build_Flags="$Build_Flags /A"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
       Build_Flags="$Build_Flags /vp"
       shift
diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
index 326fade..c3bb2bd 100644
--- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
+++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
@@ -29,14 +29,14 @@ if "%~1"=="/?"      goto Usage
 if /i "%~1"=="Help" goto Usage
 
 set FspWrapper=FALSE
-set Stepping=B
+set FabId=B
 
 if /i "%~2"=="B" (
-    set Stepping=B
+    set FabId=B
 )
 
 if /i "%~2"=="A" (
-    set Stepping=A
+    set FabId=A
 )
 
 :OptLoop1
@@ -119,16 +119,16 @@ copy /y /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\IBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\OBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\NvStorage.Fv .\BIOS_COMPONENTS
-if %Stepping%==B (
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk3.bin .
+if %FabId%==B (
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
   copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
   ) else (
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk3.bin .
-  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
+  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
   )
 
 move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
  2017-06-08  7:58 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
@ 2017-06-08  8:01 ` Wei, David
  0 siblings, 0 replies; 12+ messages in thread
From: Wei, David @ 2017-06-08  8:01 UTC (permalink / raw)
  To: Lu, ShifeiX A, edk2-devel@lists.01.org

Reviewed-by: zwei4  <david.wei@intel.com> 

Thanks,
David  Wei                                 

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of lushifex
Sent: Thursday, June 08, 2017 3:58 PM
To: edk2-devel@lists.01.org
Cc: Wei, David <david.wei@intel.com>
Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.

Change build script to differentiate FAB A and FAB B Board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 BuildBIOS.bat                                      | 14 +++++-----
 BuildBIOS.sh                                       | 31 +++++++++++++++++++++-
 Platform/BroxtonPlatformPkg/BuildBios.bat          | 15 +++--------
 Platform/BroxtonPlatformPkg/BuildBios.sh           | 23 ++++++++++++----
 Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 10 +++----
 Platform/BroxtonPlatformPkg/BuildIFWI.sh           |  9 +++++++
 .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 22 +++++++--------
 7 files changed, 83 insertions(+), 41 deletions(-)

diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index 51ed30b..3bc68e5 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -10,7 +10,7 @@ set PlatformName=
 set BuildTarget=Debug
 set Compiler=/vs13
 set Arch=/x64
-set Stepping=/B
+set FabId=/B
 
 :: Optional arguments
 :OptLoop
@@ -61,13 +61,13 @@ if /i "%~1"=="/vs15" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=/A
+    set FabId=/A
     echo.
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=/B
+    set FabId=/B
     echo.
     shift
     goto OptLoop
@@ -83,8 +83,8 @@ set BuildTarget=%~2
 
 :OptLoopEnd
 echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %Stepping% /fspw %BuildFlags% MINN %BuildTarget% 
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %Stepping% /fspw %BuildFlags% MINN %BuildTarget% 
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
 
 goto Exit
 
@@ -97,8 +97,8 @@ echo.
 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)
-echo        /A     Set stepping to A (default: B stepping)
-echo        /B     Set stepping to B (default: B stepping)
+echo        /A     Set FabId to A (default:  FAB_B)
+echo        /B     Set FabId to B (default:  FAB_B)
 echo        PlatformName:  Broxton
 echo        BuildTargets:  Release, Debug
 
diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index fb67f04..c241d87 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -8,6 +8,34 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
+
+##**********************************************************************
+## Initial Setup
+##**********************************************************************
+
+Build_Flags=
+
+## Parse Optional arguments
+if [ "$1" == "/?" ]; then
+  Usage
+fi
+
+## Build Flags
+for (( i=1; i<=$#; ))
+  do
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      Build_Flags="$Build_Flags /B"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      Build_Flags="$Build_Flags /A"
+      shift
+    else
+      break
+    fi
+  done
+
 Target_Flag=Release
 if [ "$1" == "Debug" ]; then
   Target_Flag=Debug
@@ -18,6 +46,7 @@ if [ "$1" == "Release" ]; then
   shift
 fi
 
+echo $Build_Flags
 echo $Target_Flag
 
 export WORKSPACE=`pwd`
@@ -27,5 +56,5 @@ export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WORKSPACE/P
 
 make -C BaseTools
 
-bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh APLI $Target_Flag
+bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh $Build_Flags APLI $Target_Flag
 
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 80de2f4..5e06a98 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -24,7 +24,7 @@ set "Build_Flags= "
 set exitCode=0
 set Arch=X64
 set Compiler=VS2013
-set Stepping=B
+set FabId=B
 if not defined BiosVersion set BiosVersion=DEV
 
 
@@ -154,13 +154,13 @@ if /i "%~1"=="/FspW" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=A
+    set FabId=A
     echo.
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=B
+    set FabId=B
     echo.
     shift
     goto OptLoop
@@ -409,7 +409,6 @@ 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%" == "TRUE" (
-  if %Stepping%==B (
 ::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
     pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin
     python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py rebase -f ApolloLakeFsp.fd -c m -b 0xFEF7A000 -o .\ -n FSP.fd
@@ -418,14 +417,6 @@ if /i "%FSP_WRAPPER%" == "TRUE" (
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
     copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_S.Fv %Storage_Folder%\FSP_S.Fv
-  ) else (
-    pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP
-    python %WORKSPACE%\Core\IntelFsp2Pkg\Tools\SplitFspBin.py split -f FSP.fd -o .\ -n FSP.Fv
-    popd
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspGold\FSP\FSP_S.Fv %Storage_Folder%\FSP_S.Fv
-  )
 )
 
 echo Get NvStorage Base and Size...
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBios.sh
index fb6ac67..a1f4766 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBios.sh
@@ -28,6 +28,7 @@ Build_Flags=
 SV_String=_
 exitCode=0
 Arch=X64
+FabId=B
 
 ## Initialize all the build flags to FALSE
 ## depending on the cmd line input, some will be set to TRUE prior to building
@@ -129,6 +130,12 @@ for (( i=1; i<=$#; ))
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
       Arch=X64
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
       VP_BIOS_ENABLE=TRUE
       shift
@@ -294,12 +301,18 @@ cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Too
 cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/B_Stepping/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-
 
+if [ $FabId == "B" ]; then
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+else
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+fi
 
 #
 # Assmeble components
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index e8e1c4f..9c645a7 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -6,7 +6,7 @@ set exitCode=0
 set "Build_Flags= "
 set Arch=X64
 set SkipUsageFlag=FALSE
-set Stepping=B
+set FabId=B
 set WORKSPACE=%CD%
 if %WORKSPACE:~-1%==\ (
   set WORKSPACE=%WORKSPACE:~0,-1%
@@ -79,13 +79,13 @@ if /i "%~1"=="/FspW" (
     goto OptLoop
 )
 if /i "%~1"=="/A" (
-    set Stepping=A
+    set FabId=A
     set Build_Flags=%Build_Flags% /A
     shift
     goto OptLoop
 )
 if /i "%~1"=="/B" (
-    set Stepping=B
+    set FabId=B
     set Build_Flags=%Build_Flags% /B
     shift
     goto OptLoop
@@ -139,8 +139,8 @@ echo.
 echo BIOS ROM input:  %BIOS_Name%
 echo.
 pushd %STITCH_PATH%
-   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %Stepping%
-   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %Stepping%
+   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
+   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
    @echo off
 popd
 if ErrorLevel 1 (
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index c21904f..69ed67a 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -60,6 +60,7 @@ exitCode=0
 Build_Flags=
 Stitch_Flags=
 Arch=IA32
+FabId=B
 
 ## Description of each Platform/Board_ID
 ##   APLK - Netbook/Desktop (PCCG)
@@ -107,6 +108,14 @@ for (( i=1; i<=$#; ))
       Arch=X64
       Build_Flags="$Build_Flags /x64"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      Build_Flags="$Build_Flags /B"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      Build_Flags="$Build_Flags /A"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
       Build_Flags="$Build_Flags /vp"
       shift
diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
index 326fade..c3bb2bd 100644
--- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
+++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
@@ -29,14 +29,14 @@ if "%~1"=="/?"      goto Usage
 if /i "%~1"=="Help" goto Usage
 
 set FspWrapper=FALSE
-set Stepping=B
+set FabId=B
 
 if /i "%~2"=="B" (
-    set Stepping=B
+    set FabId=B
 )
 
 if /i "%~2"=="A" (
-    set Stepping=A
+    set FabId=A
 )
 
 :OptLoop1
@@ -119,16 +119,16 @@ copy /y /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\IBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\OBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\NvStorage.Fv .\BIOS_COMPONENTS
-if %Stepping%==B (
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\B_Stepping\SpiChunk3.bin .
+if %FabId%==B (
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
   copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
   ) else (
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\A_Stepping\SpiChunk3.bin .
-  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
+  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
+  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
   )
 
 move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
-- 
2.7.0.windows.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
@ 2017-06-16  2:48 lushifex
  2017-06-16  2:50 ` Wei, David
  0 siblings, 1 reply; 12+ messages in thread
From: lushifex @ 2017-06-16  2:48 UTC (permalink / raw)
  To: david.wei; +Cc: edk2-devel

Change build script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 Platform/BroxtonPlatformPkg/BiosId.env    | 1 -
 Platform/BroxtonPlatformPkg/BuildBios.bat | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/BiosId.env b/Platform/BroxtonPlatformPkg/BiosId.env
index 18b4e01..1e28313 100644
--- a/Platform/BroxtonPlatformPkg/BiosId.env
+++ b/Platform/BroxtonPlatformPkg/BiosId.env
@@ -29,7 +29,6 @@
 
 BOARD_ID      = APLKRVP
 BOARD_REV     = 3
-OEM_ID     = X64
 BUILD_TYPE    = D
 VERSION_MAJOR = 0064
 VERSION_MINOR = 01
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 5e06a98..b59e8eb 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -218,8 +218,8 @@ if "%Arch%"=="IA32" (
 if "%Arch%"=="X64" (
     findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
 ) else if "%Arch%"=="IA32" (
-    findstr /b /v "BOARD_ID BUILD_TYPE OEM_ID" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
-    echo OEM_ID = I32 >> Conf\BiosId.env
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+    echo BOARD_EXT = I32 >> Conf\BiosId.env
 )
 
 if /i "%~2" == "RELEASE" (
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
  2017-06-16  2:48 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
@ 2017-06-16  2:50 ` Wei, David
  0 siblings, 0 replies; 12+ messages in thread
From: Wei, David @ 2017-06-16  2:50 UTC (permalink / raw)
  To: Lu, ShifeiX A; +Cc: edk2-devel@lists.01.org

Reviewed-by: zwei4 <david.wei@intel.com> 

Thanks,
David  Wei                                 

-----Original Message-----
From: Lu, ShifeiX A 
Sent: Friday, June 16, 2017 10:49 AM
To: Wei, David <david.wei@intel.com>
Cc: edk2-devel@lists.01.org
Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.

Change build script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 Platform/BroxtonPlatformPkg/BiosId.env    | 1 -
 Platform/BroxtonPlatformPkg/BuildBios.bat | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/BiosId.env b/Platform/BroxtonPlatformPkg/BiosId.env
index 18b4e01..1e28313 100644
--- a/Platform/BroxtonPlatformPkg/BiosId.env
+++ b/Platform/BroxtonPlatformPkg/BiosId.env
@@ -29,7 +29,6 @@
 
 BOARD_ID      = APLKRVP
 BOARD_REV     = 3
-OEM_ID     = X64
 BUILD_TYPE    = D
 VERSION_MAJOR = 0064
 VERSION_MINOR = 01
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 5e06a98..b59e8eb 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -218,8 +218,8 @@ if "%Arch%"=="IA32" (
 if "%Arch%"=="X64" (
     findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
 ) else if "%Arch%"=="IA32" (
-    findstr /b /v "BOARD_ID BUILD_TYPE OEM_ID" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
-    echo OEM_ID = I32 >> Conf\BiosId.env
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+    echo BOARD_EXT = I32 >> Conf\BiosId.env
 )
 
 if /i "%~2" == "RELEASE" (
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
@ 2017-07-11 22:20 lushifex
  0 siblings, 0 replies; 12+ messages in thread
From: lushifex @ 2017-07-11 22:20 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

Change GCC build script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 BuildBIOS.sh                             | 28 ++++++++++++++++++-
 Platform/BroxtonPlatformPkg/BuildIFWI.sh | 46 ++++++++++----------------------
 2 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index c241d87..552cf2d 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -10,6 +10,25 @@
 #
 
 ##**********************************************************************
+## Function define
+##**********************************************************************
+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
+  echo "       Build_Flags:                 /A     Set FabId to A (default:  FAB_B)"
+  echo "       Build_Flags:                 /B     Set FabId to B (default:  FAB_B)"
+  echo "       PlatformName [optional]:     Broxton  "                   
+  echo "       Target_Flag:                 Release, Debug       "
+  echo
+  echo "Press any key......"
+  read
+  exit 0
+}
+
+##**********************************************************************
 ## Initial Setup
 ##**********************************************************************
 
@@ -20,6 +39,13 @@ if [ "$1" == "/?" ]; then
   Usage
 fi
 
+if [ "$1" == "" ]; then
+  echo "Not Enough Arguments Provided"
+  echo "Please review the Help screen"
+  Usage
+fi
+
+
 ## Build Flags
 for (( i=1; i<=$#; ))
   do
@@ -56,5 +82,5 @@ export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WORKSPACE/P
 
 make -C BaseTools
 
-bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh $Build_Flags APLI $Target_Flag
+bash ./Platform/BroxtonPlatformPkg/BuildIFWI.sh $Build_Flags Broxton $Target_Flag
 
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index 69ed67a..a315e0b 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -13,41 +13,16 @@
 ##**********************************************************************
 ## Function define
 ##**********************************************************************
-function Usage() {
+function Usage () {
   echo
   echo "Script to build BIOS firmware and stitch the entire IFWI."
   echo
-  echo "Usage: BuildIFWI.bat [options] ^<PlatformType^> ^<BuildTarget^> [IFWI Suffix]"
+  echo "Usage: BuildIFWI.sh Build_Flags Platform_Type Build_Target"
   echo
-  echo "       /?    Display this help text                                                       "
-  echo "       /q    Quiet mode. Only display Fatal Errors (slightly faster)                      "
-  echo "       /l    Log a copy of the build output to EDK2.log                                   "
-  echo "       /c    CleanAll before building                                                     "
-  echo "       /w    Enabled WinDbg module for build                                              "
-  echo "       /sv   Build with SVBIOS flags enabled                                              "
-  echo "       /ppv  Build with PPV flags enabled                                                 "
-  echo "       /rvv  Build with RVV BXTM flags enabled                                            "
-  echo "       /rvvp Build with RVVP BXTP flags enabled                                           "
-  echo "       /x64  Set Arch to X64  (default: IA32)                                             "
-  echo "       /sata Enable SATA Build                                                            "
-  echo "       /pcie Enable PCIe Build                                                            "
-  echo "       /nG   Not update GOP driver per StitchConfig (override src version)                "
-  echo "       /uM   Update Microcode per StitchConfig  (override src version)                    "
-  echo
-  echo "      Set ONLY ONE of the following:                                                      "
-  echo "       /vp   Set special build flag for ALL Pre-Si                                        "
-  echo "       /csle Set special build flag for C-SLE                                             "
-  echo
-  echo "     Platform Types:   $eNB_RVP $Phblt_RVP $Phblt_Die1_RVP $Embd_RVP                      "
-  echo "                      APLK - Netbook/Desktop                                              "
-  echo "                      BXTM - Phablet build for BXT-A                                      "
-  echo "                      BXTM1 - Phablet build for BXT Die1(E0)                              "
-  echo "                      APLI - Embedded/IVI build (IOTG)                                     "
-  echo
-  echo "       Build Targets:    Release, Debug                                                   "
-  echo "       IFWI Suffix:      Suffix to append to end of IFWI filename (default: MM_DD_YYYY)   "
-  echo
-  echo "       See  Stitch/Stitch_Config.txt  for additional stitching settings.                  "
+  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  "                   
+  echo "       Build_Target:                Release, Debug       "
   echo
   echo "Press any key......"
   read
@@ -77,6 +52,12 @@ if [ "$1" == "/?" ]; then
   Usage
 fi
 
+if [ "$1" == "" ]; then
+  echo "Not Enough Arguments Provided"
+  echo "Please review the Help screen"
+  Usage
+fi
+
 ## Build Flags
 for (( i=1; i<=$#; ))
   do
@@ -153,7 +134,8 @@ for (( i=1; i<=$#; ))
 ## Require 2 input parameters
 if [ "$2" == "" ]; then
   echo "Not Enough Arguments Provided"
-  echo "Please review the Help screen "/?""
+  echo "Please review the Help screen"
+  Usage
 fi
 
 ## Assign required arguments
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
@ 2017-07-11 22:20 lushifex
  0 siblings, 0 replies; 12+ messages in thread
From: lushifex @ 2017-07-11 22:20 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

GCC build script clean up.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 Platform/BroxtonPlatformPkg/BuildBios.sh | 43 +--------------------
 Platform/BroxtonPlatformPkg/BuildIFWI.sh | 64 +-------------------------------
 2 files changed, 3 insertions(+), 104 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBios.sh
index 2195af6..40d873e 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBios.sh
@@ -94,40 +94,7 @@ EDK_SOURCE=$WORKSPACE
 ## Optional arguments
 for (( i=1; i<=$#; ))
   do
-    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/Q" ]; then
-      Build_Flags="$Build_Flags --quiet"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/L" ]; then
-      Build_Flags="$Build_Flags -j EDK2.log"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then
-      echo "Removing previous Build files..."
-      if [ -d "Build" ]; then
-        rm -r Build
-      fi
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/W" ]; then
-      SrcDebug=TRUE
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/SV" ]; then
-      SV_BIOS_ENABLE=TRUE
-      SV_String=_SV_
-      Arch=X64
-      echo "-- Forcing to 64-bit for SV build --"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/PPV" ]; then
-      PPV_BIOS_ENABLE=TRUE
-      SV_String=_PPV_
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/RVVP" ]; then
-      RVVP_BIOS_ENABLE=TRUE
-      SV_String=_RVVP_
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/RVV" ]; then
-      RVV_BIOS_ENABLE=TRUE
-      SV_String=_RVV_
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
       Arch=X64
       shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
@@ -136,12 +103,6 @@ for (( i=1; i<=$#; ))
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
       FabId=A
       shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
-      VP_BIOS_ENABLE=TRUE
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/CSLE" ]; then
-      CSLE_ENABLE=TRUE
-      shift
     else
       break
     fi
@@ -151,7 +112,7 @@ for (( i=1; i<=$#; ))
 if [ "$2" == "" ]; then
   echo 
   echo "Not Enough Arguments Provided"
-  echo "Please review the Help screen "/?""
+  echo "Please review the Help screen"
   ErrorExit
 fi
 
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index a315e0b..82d5f45 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -33,19 +33,9 @@ function Usage () {
 ## Assign initial values
 exitCode=0
 Build_Flags=
-Stitch_Flags=
 Arch=IA32
 FabId=B
 
-## Description of each Platform/Board_ID
-##   APLK - Netbook/Desktop (PCCG)
-##   BXTM - Phablet build (MCG)
-##   BXTM1 - Phablet build for BXT Die1(E0) (MCG)
-##   APLI - Embedded/IVI build (IOTG)
-eNB_RVP=APLK
-Phblt_RVP=BXTM
-Phblt_Die1_RVP=BXTM1
-Embd_RVP=APLI
 
 ## Parse Optional arguments
 if [ "$1" == "/?" ]; then
@@ -61,31 +51,7 @@ fi
 ## Build Flags
 for (( i=1; i<=$#; ))
   do
-    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/Q" ]; then
-      Build_Flags="$Build_Flags /q"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/L" ]; then
-      Build_Flags="$Build_Flags /l"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then
-      Build_Flags="$Build_Flags /c"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/W" ]; then
-      Build_Flags="$Build_Flags /w"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/SV" ]; then
-      Build_Flags="$Build_Flags /sv"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/PPV" ]; then
-      Build_Flags="$Build_Flags /ppv"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/RVVP" ]; then
-      Build_Flags="$Build_Flags /rvvp"
-      shift
-	elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/RVV" ]; then
-      Build_Flags="$Build_Flags /rvv"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
       Arch=X64
       Build_Flags="$Build_Flags /x64"
       shift
@@ -97,39 +63,11 @@ for (( i=1; i<=$#; ))
       FabId=A
       Build_Flags="$Build_Flags /A"
       shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/VP" ]; then
-      Build_Flags="$Build_Flags /vp"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/CSLE" ]; then
-      Build_Flags="$Build_Flags /csle"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/SATA" ]; then
-      Build_Flags="$Build_Flags /sata"
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/PCIE" ]; then
-      Build_Flags="$Build_Flags /pcie"
-      shift
     else
       break
     fi
   done
 
-## Stitch Flags
-for (( i=1; i<=$#; ))
-  do
-    if [ "$1" == "/nG" ]; then
-      Stitch_Flags="$Stitch_Flags /nG"
-      shift
-    elif [ "$1" == "/uM" ]; then
-      Stitch_Flags="$Stitch_Flags /uM"
-      shift
-    elif [ "$1" == "/nB" ]; then
-      Stitch_Flags="$Stitch_Flags /nB"
-      shift
-    else
-      break
-    fi
-  done
 
 ## Require 2 input parameters
 if [ "$2" == "" ]; then
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
@ 2017-09-14  5:59 lushifex
  2017-09-14  6:24 ` Wei, David
  0 siblings, 1 reply; 12+ messages in thread
From: lushifex @ 2017-09-14  5:59 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

Change build script to generate different BIOS ID to differentiate Minnow3 and Benson Glacier board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 BuildBIOS.bat                                      | 19 +++++-
 BuildBIOS.sh                                       |  8 ++-
 Platform/BroxtonPlatformPkg/BuildBios.bat          | 39 ++++++++++---
 Platform/BroxtonPlatformPkg/BuildBios.sh           | 67 +++++++++++++++-------
 Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 20 +++++--
 Platform/BroxtonPlatformPkg/BuildIFWI.sh           |  5 ++
 .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 40 +++++++++----
 7 files changed, 151 insertions(+), 47 deletions(-)

diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index 3bc68e5..4bb4b03 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -11,6 +11,7 @@ set BuildTarget=Debug
 set Compiler=/vs13
 set Arch=/x64
 set FabId=/B
+set BoardId=/MN
 
 :: Optional arguments
 :OptLoop
@@ -72,6 +73,18 @@ if /i "%~1"=="/B" (
     shift
     goto OptLoop
 )
+if /i "%~1"=="/MN" (
+    set BoardId=/MN
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/BG" (
+    set BoardId=/BG
+    echo.
+    shift
+    goto OptLoop
+)
 
 :: Required argument(s)
 :: Require 2 input parameters
@@ -83,8 +96,8 @@ set BuildTarget=%~2
 
 :OptLoopEnd
 echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
 
 goto Exit
 
@@ -99,6 +112,8 @@ echo        /x64   Set Arch to X64  (default: X64)
 echo        /IA32  Set Arch to IA32 (default: X64)
 echo        /A     Set FabId to A (default:  FAB_B)
 echo        /B     Set FabId to B (default:  FAB_B)
+echo        /MN    Minnow3 Board (default: MN)
+echo        /BG    Benson Glacier Board
 echo        PlatformName:  Broxton
 echo        BuildTargets:  Release, Debug
 
diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index 552cf2d..aea8daa 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -18,6 +18,8 @@ function Usage () {
   echo
   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"
   echo "       Build_Flags:                 /A     Set FabId to A (default:  FAB_B)"
   echo "       Build_Flags:                 /B     Set FabId to B (default:  FAB_B)"
   echo "       PlatformName [optional]:     Broxton  "                   
@@ -49,7 +51,11 @@ fi
 ## Build Flags
 for (( i=1; i<=$#; ))
   do
-    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+      BoardId=BG
+      Build_Flags="$Build_Flags /BG"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       Build_Flags="$Build_Flags /B"
       shift
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat
index 7aca176..3ac411e 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
@@ -25,6 +25,7 @@ set exitCode=0
 set Arch=X64
 set Compiler=VS2013
 set FabId=B
+set BoardId=MN
 if not defined BiosVersion set BiosVersion=DEV
 
 
@@ -165,6 +166,18 @@ if /i "%~1"=="/B" (
     shift
     goto OptLoop
 )
+if /i "%~1"=="/MN" (
+    set BoardId=MN
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/BG" (
+    set BoardId=BG
+    echo.
+    shift
+    goto OptLoop
+)
 
 :: Required argument(s)
 if "%~2"=="" (
@@ -178,7 +191,11 @@ echo. & echo -- Setting compiler to %Compiler% -- & echo.
 :: BOARD_ID needs to be exactly 7 characters (GenBiosId.exe limitation)
 echo Setting  %1  platform configuration and BIOS ID...
 if /i "%~1" == "%Minnow_RVP%" (
-    set BOARD_ID=MINNOWV
+  if %BoardId%==MN (
+    set BOARD_ID=MINNOW3
+  ) else if %BoardId%==BG (
+    set BOARD_ID=BENSONV
+  )
     set ENBDT_PF_BUILD=TRUE
     set PLATFORM_NAME=BroxtonPlatformPkg
     set PLATFORM_PACKAGE=%PLATFORM_PATH%
@@ -216,9 +233,9 @@ if "%Arch%"=="IA32" (
 ::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target values removed
 
 if "%Arch%"=="X64" (
-    findstr /b /v "BOARD_ID BUILD_TYPE VERSION_MINOR" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
 ) else if "%Arch%"=="IA32" (
-    findstr /b /v "BOARD_ID BUILD_TYPE VERSION_MINOR BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
     echo BOARD_EXT = I32 >> Conf\BiosId.env
 )
 
@@ -230,10 +247,16 @@ if /i "%~2" == "RELEASE" (
     echo BUILD_TYPE = D >> Conf\BiosId.env
 )
 
-if %FabId%==B (
-    echo VERSION_MINOR = 0B >> Conf\BiosId.env
-) else (
-    echo VERSION_MINOR = 0A >> Conf\BiosId.env
+if %BoardId%==BG (
+  echo BOARD_REV = A >> Conf\BiosId.env
+)
+
+if %BoardId%==MN (
+  if %FabId%==B (
+    echo BOARD_REV = B >> Conf\BiosId.env
+  ) else (
+    echo BOARD_REV = A >> Conf\BiosId.env
+  )
 )
 
 :: Set the Build_Type, Version_Major, and Version_Minor environment variables
@@ -405,7 +428,7 @@ if ErrorLevel 1 goto BldFail
 if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R
 
 echo Copy BIOS...
-set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
+set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
 copy /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM >nul
 copy /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map >nul
 
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBios.sh
index 3fa450b..91f84a1 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBios.sh
@@ -29,6 +29,7 @@ SV_String=_
 exitCode=0
 Arch=X64
 FabId=B
+BoardId=MN
 
 ## Initialize all the build flags to FALSE
 ## depending on the cmd line input, some will be set to TRUE prior to building
@@ -97,6 +98,9 @@ for (( i=1; i<=$#; ))
     if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
       Arch=X64
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+      BoardId=BG
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       shift
@@ -119,12 +123,16 @@ fi
 ## Remove the values for Platform_Type and Build_Target from BiosId.env and stage in Conf/
 cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env       $WORKSPACE/Conf/BiosId.env
 sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
+sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
 sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
-sed -i '/^VERSION_MINOR/d' $WORKSPACE/Conf/BiosId.env
-
 
-BOARD_ID=MNW3
-echo BOARD_ID = MINNOWV >> $WORKSPACE/Conf/BiosId.env
+if [ $BoardId == "MN" ]; then
+  BOARD_ID=MNW3
+  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
+else
+  BOARD_ID=BEN1
+  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
+fi
 ENBDT_PF_BUILD=TRUE
 PLATFORM_NAME=BroxtonPlatformPkg
 PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg  
@@ -164,14 +172,22 @@ else
   echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
 fi
 
-if [ $FabId == "B" ]; then
-  VERSION_MINOR=0B
-  echo VERSION_MINOR = 0B >> $WORKSPACE/Conf/BiosId.env
-else
-  VERSION_MINOR=0A
-  echo VERSION_MINOR = 0A >> $WORKSPACE/Conf/BiosId.env
+if [ $BoardId == "BG" ]; then
+  BOARD_REV=A
+  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
 fi
 
+if [ $BoardId == "MN" ]; then
+  if [ $FabId == "B" ]; then
+    BOARD_REV=B
+    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
+  else
+    BOARD_REV=A
+    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
+  fi
+fi
+
+
 ##**********************************************************************
 ## Additional EDK Build Setup/Configuration
 ##**********************************************************************
@@ -262,7 +278,7 @@ cp $BUILD_PATH/FV/SOC.fd $BUILD_PATH/FV/Bxt"$Arch".fd
 ##
 VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-4)
 VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-2)
-BIOS_Name="$BOARD_ID""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
+BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
 
 cp -f $BUILD_PATH/FV/FVOBB.Fv  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
@@ -270,16 +286,25 @@ cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Too
 cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
 
-if [ $FabId == "B" ]; then
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-else
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+if [ $BoardId == "BG" ]; then
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+fi
+
+if [ $BoardId == "MN" ]; then
+  if [ $FabId == "B" ]; then
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  else
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  fi
 fi
 
 #
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index 838f9b3..8694da5 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -7,6 +7,7 @@ set "Build_Flags= "
 set Arch=X64
 set SkipUsageFlag=FALSE
 set FabId=B
+set BoardId=MN
 set WORKSPACE=%CD%
 if %WORKSPACE:~-1%==\ (
   set WORKSPACE=%WORKSPACE:~0,-1%
@@ -90,7 +91,18 @@ if /i "%~1"=="/B" (
     shift
     goto OptLoop
 )
-
+if /i "%~1"=="/MN" (
+    set BoardId=MN
+    set Build_Flags=%Build_Flags% /MN
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/BG" (
+    set BoardId=BG
+    set Build_Flags=%Build_Flags% /BG
+    shift
+    goto OptLoop
+)
 
 :: Require 2 input parameters
 if "%~2"=="" (
@@ -130,7 +142,7 @@ del /f/q ver_strings >nul
 :: Translate Release Build Type
 if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R
 
-set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
+set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
 
 :: Start Integration process
 echo ================================================================================
@@ -139,8 +151,8 @@ echo.
 echo BIOS ROM input:  %BIOS_Name%
 echo.
 pushd %STITCH_PATH%
-   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
-   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
+   echo  - call IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId% %BoardId%
+   call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId% %BoardId%
    @echo off
 popd
 if ErrorLevel 1 (
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index 82d5f45..73766cc 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -35,6 +35,7 @@ exitCode=0
 Build_Flags=
 Arch=IA32
 FabId=B
+BoardId=MN
 
 
 ## Parse Optional arguments
@@ -55,6 +56,10 @@ for (( i=1; i<=$#; ))
       Arch=X64
       Build_Flags="$Build_Flags /x64"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+      BoardId=BG
+      Build_Flags="$Build_Flags /BG"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       Build_Flags="$Build_Flags /B"
diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
index c3bb2bd..679b0ee 100644
--- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
+++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
@@ -30,6 +30,7 @@ if /i "%~1"=="Help" goto Usage
 
 set FspWrapper=FALSE
 set FabId=B
+set BoardId=MN
 
 if /i "%~2"=="B" (
     set FabId=B
@@ -39,6 +40,14 @@ if /i "%~2"=="A" (
     set FabId=A
 )
 
+if /i "%~3"=="MN" (
+    set BoardId=MN
+)
+
+if /i "%~3"=="BG" (
+    set BoardId=BG
+)
+
 :OptLoop1
 
 if /i "%~1"=="/FspW" (
@@ -95,6 +104,8 @@ if not "!BIOS_Name!"=="!BIOS_Name:_R_=!" (
 
 if /i "!Platform_Type!"=="MINN" (
     set Platform_Type=MINN
+) else if /i "!Platform_Type!"=="BENS" (
+    set Platform_Type=BENS
 ) else (
     echo Error - Unsupported PlatformType: !Platform_Type!
     goto Usage
@@ -119,18 +130,25 @@ copy /y /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\IBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\OBB.Fv .\BIOS_COMPONENTS
 copy /y /b %BIOS_Names%\NvStorage.Fv .\BIOS_COMPONENTS
-if %FabId%==B (
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
-  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
-  ) else (
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
-  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
-  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
-  )
 
+if %BoardId%==BG (
+  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk1.bin .
+  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk2.bin .
+  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk3.bin .
+  copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+) else if %BoardId%==MN (
+         if %FabId%==B (
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
+           copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+         ) else (
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
+           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
+           copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+         )
+)
 move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
 
 if !ERRORLEVEL! NEQ 0 (
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
  2017-09-14  5:59 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script lushifex
@ 2017-09-14  6:24 ` Wei, David
  0 siblings, 0 replies; 12+ messages in thread
From: Wei, David @ 2017-09-14  6:24 UTC (permalink / raw)
  To: Lu, ShifeiX A, edk2-devel@lists.01.org
  Cc: Guo, Mang, Liu, XianhuiX, Wei, David

Reviewed-by: zwei4  <david.wei@intel.com>

Thanks,
David  Wei                                 

> -----Original Message-----
> From: Lu, ShifeiX A
> Sent: Thursday, September 14, 2017 1:59 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David <david.wei@intel.com>
> Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
> 
> Change build script to generate different BIOS ID to differentiate Minnow3
> and Benson Glacier board.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: lushifex <shifeix.a.lu@intel.com>
> ---
>  BuildBIOS.bat                                      | 19 +++++-
>  BuildBIOS.sh                                       |  8 ++-
>  Platform/BroxtonPlatformPkg/BuildBios.bat          | 39 ++++++++++---
>  Platform/BroxtonPlatformPkg/BuildBios.sh           | 67 +++++++++++++++-----
> --
>  Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 20 +++++--
>  Platform/BroxtonPlatformPkg/BuildIFWI.sh           |  5 ++
>  .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 40 +++++++++----
>  7 files changed, 151 insertions(+), 47 deletions(-)
> 
> diff --git a/BuildBIOS.bat b/BuildBIOS.bat
> index 3bc68e5..4bb4b03 100644
> --- a/BuildBIOS.bat
> +++ b/BuildBIOS.bat
> @@ -11,6 +11,7 @@ set BuildTarget=Debug
>  set Compiler=/vs13
>  set Arch=/x64
>  set FabId=/B
> +set BoardId=/MN
> 
>  :: Optional arguments
>  :OptLoop
> @@ -72,6 +73,18 @@ if /i "%~1"=="/B" (
>      shift
>      goto OptLoop
>  )
> +if /i "%~1"=="/MN" (
> +    set BoardId=/MN
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/BG" (
> +    set BoardId=/BG
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> 
>  :: Required argument(s)
>  :: Require 2 input parameters
> @@ -83,8 +96,8 @@ set BuildTarget=%~2
> 
>  :OptLoopEnd
>  echo ---- Call Build Script of Broxton ----
> -echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> -call
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> +echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> +call
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %Compiler% %Arch%
>  %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget%
> 
>  goto Exit
> 
> @@ -99,6 +112,8 @@ echo        /x64   Set Arch to X64  (default: X64)
>  echo        /IA32  Set Arch to IA32 (default: X64)
>  echo        /A     Set FabId to A (default:  FAB_B)
>  echo        /B     Set FabId to B (default:  FAB_B)
> +echo        /MN    Minnow3 Board (default: MN)
> +echo        /BG    Benson Glacier Board
>  echo        PlatformName:  Broxton
>  echo        BuildTargets:  Release, Debug
> 
> diff --git a/BuildBIOS.sh b/BuildBIOS.sh
> index 552cf2d..aea8daa 100755
> --- a/BuildBIOS.sh
> +++ b/BuildBIOS.sh
> @@ -18,6 +18,8 @@ function Usage () {
>    echo
>    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"
>    echo "       Build_Flags:                 /A     Set FabId to A (default:  FAB_B)"
>    echo "       Build_Flags:                 /B     Set FabId to B (default:  FAB_B)"
>    echo "       PlatformName [optional]:     Broxton  "
> @@ -49,7 +51,11 @@ fi
>  ## Build Flags
>  for (( i=1; i<=$#; ))
>    do
> -    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
> +    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> +      BoardId=BG
> +      Build_Flags="$Build_Flags /BG"
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        Build_Flags="$Build_Flags /B"
>        shift
> diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat
> b/Platform/BroxtonPlatformPkg/BuildBios.bat
> index 7aca176..3ac411e 100644
> --- a/Platform/BroxtonPlatformPkg/BuildBios.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildBios.bat
> @@ -25,6 +25,7 @@ set exitCode=0
>  set Arch=X64
>  set Compiler=VS2013
>  set FabId=B
> +set BoardId=MN
>  if not defined BiosVersion set BiosVersion=DEV
> 
> 
> @@ -165,6 +166,18 @@ if /i "%~1"=="/B" (
>      shift
>      goto OptLoop
>  )
> +if /i "%~1"=="/MN" (
> +    set BoardId=MN
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/BG" (
> +    set BoardId=BG
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> 
>  :: Required argument(s)
>  if "%~2"=="" (
> @@ -178,7 +191,11 @@ echo. & echo -- Setting compiler to %Compiler% -- &
> echo.
>  :: BOARD_ID needs to be exactly 7 characters (GenBiosId.exe limitation)
>  echo Setting  %1  platform configuration and BIOS ID...
>  if /i "%~1" == "%Minnow_RVP%" (
> -    set BOARD_ID=MINNOWV
> +  if %BoardId%==MN (
> +    set BOARD_ID=MINNOW3
> +  ) else if %BoardId%==BG (
> +    set BOARD_ID=BENSONV
> +  )
>      set ENBDT_PF_BUILD=TRUE
>      set PLATFORM_NAME=BroxtonPlatformPkg
>      set PLATFORM_PACKAGE=%PLATFORM_PATH%
> @@ -216,9 +233,9 @@ if "%Arch%"=="IA32" (
>  ::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target
> values removed
> 
>  if "%Arch%"=="X64" (
> -    findstr /b /v "BOARD_ID BUILD_TYPE
> VERSION_MINOR" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> +    findstr /b /v "BOARD_ID BUILD_TYPE
> BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
>  ) else if "%Arch%"=="IA32" (
> -    findstr /b /v "BOARD_ID BUILD_TYPE VERSION_MINOR
> BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> +    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV
> BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
>      echo BOARD_EXT = I32 >> Conf\BiosId.env
>  )
> 
> @@ -230,10 +247,16 @@ if /i "%~2" == "RELEASE" (
>      echo BUILD_TYPE = D >> Conf\BiosId.env
>  )
> 
> -if %FabId%==B (
> -    echo VERSION_MINOR = 0B >> Conf\BiosId.env
> -) else (
> -    echo VERSION_MINOR = 0A >> Conf\BiosId.env
> +if %BoardId%==BG (
> +  echo BOARD_REV = A >> Conf\BiosId.env
> +)
> +
> +if %BoardId%==MN (
> +  if %FabId%==B (
> +    echo BOARD_REV = B >> Conf\BiosId.env
> +  ) else (
> +    echo BOARD_REV = A >> Conf\BiosId.env
> +  )
>  )
> 
>  :: Set the Build_Type, Version_Major, and Version_Minor environment
> variables
> @@ -405,7 +428,7 @@ if ErrorLevel 1 goto BldFail
>  if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R
> 
>  echo Copy BIOS...
> -set
> BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%
> _%VERSION_MINOR%
> +set
> BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VE
> RSION_MAJOR%_%VERSION_MINOR%
>  copy
> /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM
>  >nul
>  copy
> /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map
> >nul
> 
> diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh
> b/Platform/BroxtonPlatformPkg/BuildBios.sh
> index 3fa450b..91f84a1 100644
> --- a/Platform/BroxtonPlatformPkg/BuildBios.sh
> +++ b/Platform/BroxtonPlatformPkg/BuildBios.sh
> @@ -29,6 +29,7 @@ SV_String=_
>  exitCode=0
>  Arch=X64
>  FabId=B
> +BoardId=MN
> 
>  ## Initialize all the build flags to FALSE
>  ## depending on the cmd line input, some will be set to TRUE prior to
> building
> @@ -97,6 +98,9 @@ for (( i=1; i<=$#; ))
>      if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
>        Arch=X64
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> +      BoardId=BG
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        shift
> @@ -119,12 +123,16 @@ fi
>  ## Remove the values for Platform_Type and Build_Target from BiosId.env
> and stage in Conf/
>  cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env
> $WORKSPACE/Conf/BiosId.env
>  sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
> +sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
>  sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
> -sed -i '/^VERSION_MINOR/d' $WORKSPACE/Conf/BiosId.env
> -
> 
> -BOARD_ID=MNW3
> -echo BOARD_ID = MINNOWV >> $WORKSPACE/Conf/BiosId.env
> +if [ $BoardId == "MN" ]; then
> +  BOARD_ID=MNW3
> +  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
> +else
> +  BOARD_ID=BEN1
> +  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
> +fi
>  ENBDT_PF_BUILD=TRUE
>  PLATFORM_NAME=BroxtonPlatformPkg
>  PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
> @@ -164,14 +172,22 @@ else
>    echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
>  fi
> 
> -if [ $FabId == "B" ]; then
> -  VERSION_MINOR=0B
> -  echo VERSION_MINOR = 0B >> $WORKSPACE/Conf/BiosId.env
> -else
> -  VERSION_MINOR=0A
> -  echo VERSION_MINOR = 0A >> $WORKSPACE/Conf/BiosId.env
> +if [ $BoardId == "BG" ]; then
> +  BOARD_REV=A
> +  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
>  fi
> 
> +if [ $BoardId == "MN" ]; then
> +  if [ $FabId == "B" ]; then
> +    BOARD_REV=B
> +    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
> +  else
> +    BOARD_REV=A
> +    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
> +  fi
> +fi
> +
> +
> 
> ##********************************************************
> **************
>  ## Additional EDK Build Setup/Configuration
> 
> ##********************************************************
> **************
> @@ -262,7 +278,7 @@ cp $BUILD_PATH/FV/SOC.fd
> $BUILD_PATH/FV/Bxt"$Arch".fd
>  ##
>  VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3
> | cut -c 1-4)
>  VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3
> | cut -c 1-2)
> -
> BIOS_Name="$BOARD_ID""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION
> _MAJOR"_"$VERSION_MINOR"
> +BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_T
> YPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
> 
>  cp -f $BUILD_PATH/FV/FVOBB.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
>  cp -f $BUILD_PATH/FV/FVOBBX.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> @@ -270,16 +286,25 @@ cp -f $BUILD_PATH/FV/FVIBBR.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Too
>  cp -f $BUILD_PATH/FV/FVIBBM.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
>  cp -f $BUILD_PATH/FV/FVIBBL.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> 
> -if [ $FabId == "B" ]; then
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -else
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +if [ $BoardId == "BG" ]; then
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +fi
> +
> +if [ $BoardId == "MN" ]; then
> +  if [ $FabId == "B" ]; then
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  else
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  fi
>  fi
> 
>  #
> diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> index 838f9b3..8694da5 100644
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> @@ -7,6 +7,7 @@ set "Build_Flags= "
>  set Arch=X64
>  set SkipUsageFlag=FALSE
>  set FabId=B
> +set BoardId=MN
>  set WORKSPACE=%CD%
>  if %WORKSPACE:~-1%==\ (
>    set WORKSPACE=%WORKSPACE:~0,-1%
> @@ -90,7 +91,18 @@ if /i "%~1"=="/B" (
>      shift
>      goto OptLoop
>  )
> -
> +if /i "%~1"=="/MN" (
> +    set BoardId=MN
> +    set Build_Flags=%Build_Flags% /MN
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/BG" (
> +    set BoardId=BG
> +    set Build_Flags=%Build_Flags% /BG
> +    shift
> +    goto OptLoop
> +)
> 
>  :: Require 2 input parameters
>  if "%~2"=="" (
> @@ -130,7 +142,7 @@ del /f/q ver_strings >nul
>  :: Translate Release Build Type
>  if "%BUILD_TYPE%"=="R" set BUILD_TYPE=R
> 
> -set
> BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%
> _%VERSION_MINOR%
> +set
> BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VE
> RSION_MAJOR%_%VERSION_MINOR%
> 
>  :: Start Integration process
>  echo
> ==========================================================
> ======================
> @@ -139,8 +151,8 @@ echo.
>  echo BIOS ROM input:  %BIOS_Name%
>  echo.
>  pushd %STITCH_PATH%
> -   echo  - call
> IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId%
> -
> call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name
> % %FabId%
> +   echo  - call
> IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name% %FabId% %BoardId%
> +
> call %STITCH_PATH%\IFWIStitch_Simple.bat %STITCH_PATH%\%BIOS_Name
> % %FabId% %BoardId%
>     @echo off
>  popd
>  if ErrorLevel 1 (
> diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> index 82d5f45..73766cc 100755
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> @@ -35,6 +35,7 @@ exitCode=0
>  Build_Flags=
>  Arch=IA32
>  FabId=B
> +BoardId=MN
> 
> 
>  ## Parse Optional arguments
> @@ -55,6 +56,10 @@ for (( i=1; i<=$#; ))
>        Arch=X64
>        Build_Flags="$Build_Flags /x64"
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> +      BoardId=BG
> +      Build_Flags="$Build_Flags /BG"
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        Build_Flags="$Build_Flags /B"
> diff --git
> a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> index c3bb2bd..679b0ee 100644
> ---
> a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> +++
> b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> @@ -30,6 +30,7 @@ if /i "%~1"=="Help" goto Usage
> 
>  set FspWrapper=FALSE
>  set FabId=B
> +set BoardId=MN
> 
>  if /i "%~2"=="B" (
>      set FabId=B
> @@ -39,6 +40,14 @@ if /i "%~2"=="A" (
>      set FabId=A
>  )
> 
> +if /i "%~3"=="MN" (
> +    set BoardId=MN
> +)
> +
> +if /i "%~3"=="BG" (
> +    set BoardId=BG
> +)
> +
>  :OptLoop1
> 
>  if /i "%~1"=="/FspW" (
> @@ -95,6 +104,8 @@ if not "!BIOS_Name!"=="!BIOS_Name:_R_=!" (
> 
>  if /i "!Platform_Type!"=="MINN" (
>      set Platform_Type=MINN
> +) else if /i "!Platform_Type!"=="BENS" (
> +    set Platform_Type=BENS
>  ) else (
>      echo Error - Unsupported PlatformType: !Platform_Type!
>      goto Usage
> @@ -119,18 +130,25 @@ copy /y
> /b %BIOS_Names%\IBBL.Fv .\BIOS_COMPONENTS
>  copy /y /b %BIOS_Names%\IBB.Fv .\BIOS_COMPONENTS
>  copy /y /b %BIOS_Names%\OBB.Fv .\BIOS_COMPONENTS
>  copy /y /b %BIOS_Names%\NvStorage.Fv .\BIOS_COMPONENTS
> -if %FabId%==B (
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
> -  copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> -  ) else (
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
> -  copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
> -  copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> -  )
> 
> +if %BoardId%==BG (
> +  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk1.bin .
> +  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk2.bin .
> +  copy /y /b ..\..\Binaries\IFWI\BensonGlacier\FAB_A\SpiChunk3.bin .
> +  copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> +) else if %BoardId%==MN (
> +         if %FabId%==B (
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk1.bin .
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk2.bin .
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_B\SpiChunk3.bin .
> +           copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> +         ) else (
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk1.bin .
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk2.bin .
> +           copy /y /b ..\..\Binaries\IFWI\MinnowBoard3\FAB_A\SpiChunk3.bin .
> +           copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> +         )
> +)
>  move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
> 
>  if !ERRORLEVEL! NEQ 0 (
> --
> 2.7.0.windows.1
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
@ 2017-10-30  1:58 lushifex
  2017-10-30  2:15 ` Wei, David
  0 siblings, 1 reply; 12+ messages in thread
From: lushifex @ 2017-10-30  1:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

Enhance build script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jarlstrom, Laurie <laurie.jarlstrom@intel.com>
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 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
 
 set exitCode=0
-set WORKSPACE=%CD%
-set CORE_PATH=%CD%
 set BuildFlags=
-set PlatformName=
-set BuildTarget=Debug
-set Compiler=/vs13
-set Arch=/x64
-set FabId=/B
-set BoardId=/MN
-set buildthread=
+
+set thisscript=%0
 
 :: Optional arguments
 :OptLoop
@@ -20,82 +14,15 @@ set buildthread=
 if /i "%~1"=="" goto Usage
 if /i "%~1"=="/?" goto Usage
 
-if /i "%~1"=="/IA32" (
-    set Arch=/IA32
-    shift
-    goto OptLoop
-)
-
-if /i "%~1"=="/x64" (
-    set Arch=/x64
-    shift
-    goto OptLoop
-)
-
-if /i "%~1"=="/vs08" (
-    set Compiler=/vs08
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs10" (
-    set Compiler=/vs10
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs12" (
-    set Compiler=/vs12
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs13" (
-    set Compiler=/vs13
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs15" (
-    set Compiler=/vs15
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/A" (
-    set FabId=/A
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/B" (
-    set FabId=/B
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/MN" (
-    set BoardId=/MN
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/BG" (
-    set BoardId=/BG
-    echo.
-    shift
-    goto OptLoop
-)
-
-if /i "%~1"=="/m" (
-    set buildthread=/m
-    echo.
+set BuildOption=%~1
+if "!BuildOption:~0,1!"=="/" (
+    set BuildFlags=%BuildFlags% %BuildOption%
     shift
     goto OptLoop
 )
 
 :: Required argument(s)
-:: Require 2 input parameters
+:: Require 2 input parameters , first parameter without a "/" is Platform Name
 if "%~2"=="" goto Usage
 
 :: Assign required arguments
@@ -104,17 +31,26 @@ set BuildTarget=%~2
 
 :OptLoopEnd
 echo ---- Call Build Script of Broxton ----
-echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
-call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% 
+
+if not exist Platform\%PlatformName%PlatformPkg\BuildIFWI.bat (
+  echo Platform %PlatformName%PlatformPkg does not exist
+  echo. & echo Error - Unsupported Platform name: %1 
+  echo.
+  goto Usage
+)
+
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %BuildFlags%  /fspw MINN %BuildTarget% 
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %BuildFlags%  /fspw MINN %BuildTarget% 
 
 goto Exit
 
 :Usage
-echo Usage: BuildBIOS.bat [options] ^<PlatformName^> ^<BuildTarget^>
+echo Usage: %thisscript% [options] ^<PlatformName^> ^<BuildTarget^>
 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
 
 echo Examples:
-echo    BuildBIOS.bat /vs13 /B /x64 Broxton Debug
+echo    %thisscript% /vs13 /B /x64 Broxton Debug
 
 set exitCode=1
 
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=1; i<=$#; ))
   do
-    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+      BoardId=MN
+      Build_Flags="$Build_Flags /MN"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
       BoardId=BG
       Build_Flags="$Build_Flags /BG"
       shift
@@ -68,14 +72,22 @@ for (( i=1; i<=$#; ))
     fi
   done
 
-Target_Flag=Release
+if [ "$1" == "Broxton" ]; then
+       shift
+ else
+   echo "No parameter for board : assume Broxton"  
+fi
+
+Target_Flag=Debug
+
 if [ "$1" == "Debug" ]; then
   Target_Flag=Debug
-  shift
-fi
-if [ "$1" == "Release" ]; then
+elif [ "$1" == "Release" ]; then
   Target_Flag=Release
-  shift
+else
+  echo "Error - Invalid Target"
+  echo "  Please review the Help screen"
+  Usage
 fi
 
 echo $Build_Flags
@@ -84,7 +96,7 @@ echo $Target_Flag
 export WORKSPACE=`pwd`
 export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WORKSPACE/Platform:$WORKSPACE/Platform/BroxtonPlatformPkg:$WORKSPACE/Silicon/BroxtonSoC:$WORKSPACE/Platform/BroxtonPlatformPkg/Common
 
-. edksetup.sh
+. edksetup.sh BaseTools
 
 make -C BaseTools
 
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/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=%CD%
-if %WORKSPACE:~-1%==\ (
-  set WORKSPACE=%WORKSPACE:~0,-1%
-)
-set CORE_PATH=%WORKSPACE%\Core
-set PLATFORM_PATH=Platform\BroxtonPlatformPkg
-set SILICON_PATH=Silicon\BroxtonSoC
-set AslPath=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe
-set PACKAGES_PATH=%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%\Platform;%WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON_PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common ;
-set EDK_TOOLS_BIN=%WORKSPACE%\BaseTools\Bin\Win32
-set /a build_threads=1
-set "Nasm_Flags=-D ARCH_IA32 -D DEBUG_PORT80"
-set "Build_Flags= "
-set exitCode=0
-set Arch=X64
-set Compiler=VS2013
-set FabId=B
-set BoardId=MN
-if not defined BiosVersion set BiosVersion=DEV
-
-
-:: 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\FrameworkDatabase.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\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt
-
-:: Setup EDK environment. Edksetup puts new copies of target.txt, tools_def.txt, build_rule.txt in WorkSpace\Conf
-:: Also run edksetup as soon as possible to avoid it from changing environment variables we're overriding
-set "VCINSTALLDIR="
-set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
-call edksetup.bat
-@echo off
-
-set Minnow_RVP=MINN
-
-:: Initialize all the build flags to FALSE
-:: Then based on the cmd line input, some will be set to TRUE prior to building.
-:: Note: These variable names match the actual Build Macro names in DSC for clarity.
-set ENBDT_PF_BUILD=FALSE
-set SrcDebug=FALSE
-set APLK_SETUP_ENABLE_BUILD=FALSE
-set FSP_BUILD=FALSE
-set FSP_WRAPPER=FALSE
-
-:: Set Defaults of platform specific environment variables.
-set EFI_SOURCE=%CD%
-set EDK_SOURCE=%CD%
-set PLATFORM_NAME=BxtPlatformPkg
-set PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
-set PLATFORM_RC_PACKAGE=Silicon\BroxtonSoC\BroxtonSiPkg
-set COMMON_PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
-set FSP_BIN_PKG_NAME=BroxtonFspBinPkg
-set STITCH_PATH=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch
-
-PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\GenBiosId;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
-PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
-
-::**********************************************************************
-:: Parse command line arguments
-::**********************************************************************
-
-:: Optional arguments
-:OptLoop
-if /i "%~1"=="" goto Usage
-if /i "%~1"=="/?" goto Usage
-
-if /i "%~1"=="/l" (
-    set Build_Flags=%Build_Flags% -j EDK2.log
-    shift
-    goto OptLoop
-)
-if /i "%~1" == "/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"=="/ia32" (
-    set Arch=IA32
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/x64" (
-    set Arch=X64
-    shift
-    goto OptLoop
-)
-
-if /i "%~1"=="/vs08" (
-    set Compiler=VS2008
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs10" (
-    set Compiler=VS2010
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs12" (
-    set Compiler=VS2012
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs13" (
-    set Compiler=VS2013
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/vs15" (
-    set Compiler=VS2015
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/FspW" (
-    set FSP_WRAPPER=TRUE
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/A" (
-    set FabId=A
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/B" (
-    set FabId=B
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/MN" (
-    set BoardId=MN
-    echo.
-    shift
-    goto OptLoop
-)
-if /i "%~1"=="/BG" (
-    set BoardId=BG
-    echo.
-    shift
-    goto OptLoop
-)
-
-if /i "%~1"=="/m" (
-    if defined NUMBER_OF_PROCESSORS (
-        set /a build_threads=%NUMBER_OF_PROCESSORS%
-    )
-    shift
-    goto OptLoop
-)
-
-:: Required argument(s)
-if "%~2"=="" (
-   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" == "%Minnow_RVP%" (
-  if %BoardId%==MN (
-    set BOARD_ID=MINNOW3
-  ) else if %BoardId%==BG (
-    set BOARD_ID=BENSONV
-  )
-    set ENBDT_PF_BUILD=TRUE
-    set PLATFORM_NAME=BroxtonPlatformPkg
-    set PLATFORM_PACKAGE=%PLATFORM_PATH%
-    set APLK_SETUP_ENABLE_BUILD=TRUE
-) else (
-    echo. & echo Error - Unsupported PlatformType: %1
-    echo Please review the Help screen "/?" & echo.
-    goto ExitFail
-)
-set Platform_Type=%~1
-
-::
-:: Tack on BIOS Version
-::
-
-::**********************************************************************
-:: Additional EDK Build Setup/Configuration
-::**********************************************************************
-
-::Setup DefineAtBuildMacros config file
-set Build_Macros=.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc
-copy /y nul %Build_Macros% >nul
-
-::output platform specific build macros to DefineAtBuildMacros.dsc
-echo DEFINE ENBDT_PF_BUILD          = %ENBDT_PF_BUILD%          >> %Build_Macros%
-
-echo DEFINE APLK_SETUP_ENABLE_BUILD = %APLK_SETUP_ENABLE_BUILD% >> %Build_Macros%
-
-if "%Arch%"=="IA32" (
-    echo DEFINE X64_CONFIG              = FALSE                     >> %Build_Macros%
-) else if "%Arch%"=="X64" (
-    echo DEFINE X64_CONFIG              = TRUE                      >> %Build_Macros%
-)
-
-::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target values removed
-
-if "%Arch%"=="X64" (
-    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
-) else if "%Arch%"=="IA32" (
-    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
-    echo BOARD_EXT = I32 >> Conf\BiosId.env
-)
-
-if /i "%~2" == "RELEASE" (
-    set target=RELEASE
-    echo BUILD_TYPE = R >> Conf\BiosId.env
-) else (
-    set target=DEBUG
-    echo BUILD_TYPE = D >> Conf\BiosId.env
-)
-
-if %BoardId%==BG (
-  echo BOARD_REV = A >> Conf\BiosId.env
-)
-
-if %BoardId%==MN (
-  if %FabId%==B (
-    echo BOARD_REV = B >> Conf\BiosId.env
-  ) else (
-    echo BOARD_REV = A >> Conf\BiosId.env
-  )
-)
-
-:: Set the Build_Type, Version_Major, and Version_Minor environment variables
-find /v "#" Conf\BiosId.env > ver_strings
-for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
-del /f/q ver_strings >nul
-:: Do this after parsing "ver_strings"
-echo BOARD_ID = %BOARD_ID% >> Conf\BiosId.env
-
-echo.
-echo Setting the Build environment for Visual Studio...
-if "%Compiler%"=="VS2008" (
-  if defined VS90COMNTOOLS (
-     call "%VS90COMNTOOLS%\vsvars32.bat" >nul
-     if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" (
-      set TOOL_CHAIN_TAG=VS2008
-     ) else  set TOOL_CHAIN_TAG=VS2008x86
-  ) else (
-    echo  --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not defined ^^!
-    goto BldFail
-  )
-) else if "%Compiler%"=="VS2010" (
-  if defined VS100COMNTOOLS (
-     call "%VS100COMNTOOLS%\vsvars32.bat" >nul
-     if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\" (
-        set TOOL_CHAIN_TAG=VS2010
-     ) else  set TOOL_CHAIN_TAG=VS2010x86
-  ) else (
-     echo  --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not defined ^^!
-     goto BldFail
-  )
-) else if "%Compiler%"=="VS2012" (
-  if defined VS110COMNTOOLS (
-     call "%VS110COMNTOOLS%\vsvars32.bat" >nul
-     if /I "%VS110COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\" (
-        set TOOL_CHAIN_TAG=VS2012
-     ) else  set TOOL_CHAIN_TAG=VS2012x86
-  ) else (
-     echo  --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not defined ^^!
-     goto BldFail
-  )
-) else if "%Compiler%"=="VS2013" (
-  if defined VS120COMNTOOLS (
-     call "%VS120COMNTOOLS%\vsvars32.bat" >nul
-     if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\" (
-        set TOOL_CHAIN_TAG=VS2013
-     ) else  set TOOL_CHAIN_TAG=VS2013x86
-  ) else (
-     echo  --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not defined ^^!
-     echo           See help ^(/?^) for how specify a different VS version.
-     goto BldFail
-  )
-) else if "%Compiler%"=="VS2015" (
-  if defined VS140COMNTOOLS (
-     call "%VS140COMNTOOLS%\vsvars32.bat" >nul
-     if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 14.0\Common7\Tools\" (
-        set TOOL_CHAIN_TAG=VS2015
-     ) else  set TOOL_CHAIN_TAG=VS2015x86
-
-  ) else (
-     echo  --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not defined ^^!
-     echo           See help ^(/?^) for how specify a different VS version.
-     goto BldFail
-  )
-)
-
-::**********************************************************************
-:: Build BIOS
-::**********************************************************************
-
-echo Setup build directory for GenBiosId...
-set BUILD_PATH=Build\%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%"=="X64" (
-   if not exist %BUILD_PATH%\X64  mkdir %BUILD_PATH%\X64
-   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob Conf\BiosId.bat
-) else if "%Arch%"=="IA32" (
-   if not exist %BUILD_PATH%\IA32  mkdir %BUILD_PATH%\IA32
-   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Conf\BiosId.bat
-)
-
-if ErrorLevel 1 goto BldFail
-
-echo Building ResetVector...
-
-set ResetVectorPath=%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=%WORKSPACE%
-set WORKSPACE=%CD%
-if "%Arch%"=="X64" (
-set ActivePlatform=%PLATFORM_PACKAGE%\PlatformPkgX64.dsc
-) else if "%Arch%"=="IA32" (
-set ActivePlatform=%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_CONCURRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp
-
-if "%Arch%"=="IA32" (
-    echo TARGET_ARCH = IA32                                  >> Conf\target.txt.tmp
-) else if "%Arch%"=="X64" (
-    echo TARGET_ARCH = IA32 X64                              >> Conf\target.txt.tmp
-)
-echo TARGET          = %TARGET%                              >> Conf\target.txt.tmp
-echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                      >> Conf\target.txt.tmp
-echo ACTIVE_PLATFORM = %ActivePlatform%                      >> Conf\target.txt.tmp
-echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads%          >> Conf\target.txt.tmp
-
-move /Y Conf\target.txt.tmp Conf\target.txt >nul
-echo *_VS2008x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
-echo *_VS2010x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
-echo *_VS2012x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
-echo *_VS2013x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
-echo *_VS2015x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
-
-echo.
-echo Invoking normal EDK2 build...
-build %Build_Flags%
-if ErrorLevel 1 goto BldFail
-
-set WORKSPACE=%SaveWorkSpace%
-
-::**********************************************************************
-:: Post Build processing and cleanup
-::**********************************************************************
-echo Create FlashMap.h...
-
-set PLAT_INIT_PRE_MEM=PlatformPreMemPei
-
-set AutoGenPath=%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\PlatformSettings\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_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_ENABLED)
-:: 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\HiiDefaultData.txt -o %BUILD_PATH%\FV\Bxt%Arch%.fd  -g B73FE497-B92E-416e-8326-45AD0D270091 -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%"=="R" set BUILD_TYPE=R
-
-echo Copy BIOS...
-set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
-copy /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM >nul
-copy /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map >nul
-
-set Storage_Folder=%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%" == "TRUE" (
-::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
-    pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin
-    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 ApolloLakeFsp.fd -o .\ -n FSP.Fv
-    popd
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
-    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\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
-)
-
-::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_PcdFlashBaseAddress
-::        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
-::===========================================================================================
-  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase "%STITCH_PATH%\FlashMap.h"
-  call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress   BaseAddress   "%STITCH_PATH%\FlashMap.h"
-  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize "%STITCH_PATH%\FlashMap.h"
-:: Find image offset as opposed to memory offset
-  PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd
-  set /p VpdOffset=<temp.pcd
-  del /f /q temp.pcd
-:: Force the variables we care about into DEC string format
-  set VpdSize=%NvStorageSize%
-  call :ForceToDec VpdOffset
-  call :ForceToDec VpdSize
-:: Dump what we found
-  echo - NvStorageBase = %NvStorageBase%
-  echo - BaseAddress   = %BaseAddress%
-  echo - NvStorageSize = %NvStorageSize%
-  echo - VpdOffset     = %VpdOffset%
-  echo - VpdSize       = %VpdSize%
-
-:: Create NvStorage.fv
-  echo Create NvStorage.fv...
-  pushd %STITCH_PATH%
-    REM This -s offset must equal the decimal value of  FLASH_REGION_VPD_OFFSET  in the Platform.fdf
-    Split.exe -f %STITCH_PATH%\%BIOS_Name%.ROM -s %VpdOffset% -o temp1.bin -t temp2.bin
-    REM This -s offset must equal the decimal value of
-    REM  FLASH_REGION_VPD_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE
-    Split.exe -f temp2.bin -s %VpdSize% -o %Storage_Folder%\NvStorage.Fv -t temp3.bin
-    del /F/Q temp1.bin temp2.bin temp3.bin
-  popd
-
-echo.
-echo Build location:     %BUILD_PATH%
-echo BIOS ROM Created:   %BIOS_Name%
-echo.
-echo --------------- The EDKII BIOS build has successfully completed. ---------------
-echo.
-goto Exit
-
-::
-:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2) as a HEX string
-::
-:: USAGE: call :FindPcdInFile PCD Variable File
-:FindPcdInFile
-  call :GetPcd "%~1" "%~2" "%~3"
-  call :ForceToHex "%~2"
-goto :EOF
-
-::
-:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2)
-::
-:: USAGE: call :GetPcd PCD Variable File
-:GetPcd
-  set _TargetFile=%~3
-  if not exist "%_TargetFile%" (
-    echo ERROR: Couldn't find %_TargetFile%^!
-    set ExitCode=1
-  ) else (
-    for /f "tokens=3" %%a in ('findstr /C:"%~1" "%_TargetFile%"') do (
-      set _TestValue=%%~a
-      set _PcdValue=!_TestValue:~0,-1!
-    )
-    set %~2=!_PcdValue!
-	echo %2 %_PcdValue%
-  )
-  set _TargetFile=
-  set _TestValue=
-  set _PcdValue=
-goto :EOF
-
-::
-:: Force value of %1 into hex format 0x1234
-::
-:: USAGE: call :ForceToHex Variable
-:ForceToHex
-  call set _Temp=%%%~1%%
-  if "%_Temp:~0,2%" == "0x" goto :ForceToHexExit
-  PowerShell ('0x' + [convert]::tostring($env:_Temp, 16).ToUpper()) > temp.pcd
-  set /p %~1=<temp.pcd
-  del /f /q temp.pcd
-:ForceToHexExit
-  set _Temp=
-goto :EOF
-
-::
-:: Force value of %1 into decimal format
-::
-:: USAGE: call :ForceToDec Variable
-:ForceToDec
-  call set _Temp=%%%~1%%
-  if not "%_Temp:~0,2%" == "0x" goto :ForceToDecExit
-  PowerShell ([convert]::toInt64((Get-Item env:_Temp).value, 16)) > temp.pcd
-  set /p %~1=<temp.pcd
-  del /f /q temp.pcd
-:ForceToDecExit
-  set _Temp=
-goto :EOF
-
-:Usage
-echo.
-echo ***************************************************************************
-echo Build BIOS Rom for BXT platforms.
-echo.
-echo Usage: BuildBios.bat [options] ^<PlatformType^> ^<BuildTarget^>
-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=1
-goto Exit
-
-:BldFail
-set exitCode=1
-echo  -- Error:  EDKII BIOS Build has failed!
-echo See EDK2.log for more details
-
-:Exit
-echo %date%  %time%
-(
-  EndLocal
-  set BiosVersion=%BiosVersion%
-  exit /b %ExitCode%
-)
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/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.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# 
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-##**********************************************************************
-## Function define
-##**********************************************************************
-function ErrorExit() {
-  echo
-  echo "Press any key......"
-  read
-  exit 0
-}
-
-echo -e $(date)
-##**********************************************************************
-## Initial Setup
-##**********************************************************************
-
-Build_Flags=
-SV_String=_
-exitCode=0
-Arch=X64
-FabId=B
-BoardId=MN
-
-## Initialize all the build flags to FALSE
-## depending on the cmd line input, some will be set to TRUE prior to building
-ENBDT_PF_BUILD=FALSE
-TABLET_PF_BUILD=FALSE
-BYTI_PF_BUILD=FALSE
-CSLE_ENABLE=FALSE
-VP_BIOS_ENABLE=FALSE
-SV_BIOS_ENABLE=FALSE
-PPV_BIOS_ENABLE=FALSE
-RVVP_BIOS_ENABLE=FALSE
-RVV_BIOS_ENABLE=FALSE
-SrcDebug=FALSE
-
-## 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_rule.txt
-
-
-
-
-TOOL_CHAIN_TAG=GCC5
-
-## Define platform specific environment variables.
-PLATFORM_NAME=BroxtonPlatformPkg
-PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
-EFI_SOURCE=$WORKSPACE
-EDK_SOURCE=$WORKSPACE
-
-##**********************************************************************
-## Parse command line arguments
-##**********************************************************************
-
-## Optional arguments
-for (( i=1; i<=$#; ))
-  do
-    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
-      Arch=X64
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
-      BoardId=BG
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
-      FabId=B
-      shift
-    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
-      FabId=A
-      shift
-    else
-      break
-    fi
-  done
-
-## Required argument(s)
-if [ "$2" == "" ]; then
-  echo 
-  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 and stage in Conf/
-cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env       $WORKSPACE/Conf/BiosId.env
-sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
-sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
-sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
-
-if [ $BoardId == "MN" ]; then
-  BOARD_ID=MNW3
-  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
-else
-  BOARD_ID=BEN1
-  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
-fi
-ENBDT_PF_BUILD=TRUE
-PLATFORM_NAME=BroxtonPlatformPkg
-PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg  
-Platform_Type=$1
-
-## Create new DefineAtBuildMacros.dsc file
-Build_Macros=$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      = $ENBDT_PF_BUILD   >> $Build_Macros
-echo DEFINE TABLET_PF_BUILD     = $TABLET_PF_BUILD  >> $Build_Macros
-echo DEFINE BYTI_PF_BUILD       = $BYTI_PF_BUILD    >> $Build_Macros
-echo DEFINE CSLE_ENABLE         = $CSLE_ENABLE      >> $Build_Macros
-echo DEFINE VP_BIOS_ENABLE      = $VP_BIOS_ENABLE   >> $Build_Macros
-echo DEFINE SV_BIOS_ENABLE      = $SV_BIOS_ENABLE   >> $Build_Macros
-echo DEFINE PPV_BIOS_ENABLE     = $PPV_BIOS_ENABLE  >> $Build_Macros
-echo DEFINE RVVP_BIOS_ENABLE    = $RVVP_BIOS_ENABLE >> $Build_Macros
-echo DEFINE RVV_BIOS_ENABLE     = $RVV_BIOS_ENABLE  >> $Build_Macros
-
-if [ $Arch == "IA32" ]; then
-  echo DEFINE X64_CONFIG = FALSE      >> $Build_Macros
-else
-  echo DEFINE X64_CONFIG = TRUE       >> $Build_Macros
-fi
-
-if [ "$(echo $2 | tr 'a-z' 'A-Z')" == "RELEASE" ]; then
-  TARGET=RELEASE
-  BUILD_TYPE=R
-  echo BUILD_TYPE = R >> $WORKSPACE/Conf/BiosId.env
-else
-  TARGET=DEBUG
-  BUILD_TYPE=D
-  echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
-fi
-
-if [ $BoardId == "BG" ]; then
-  BOARD_REV=A
-  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
-fi
-
-if [ $BoardId == "MN" ]; then
-  if [ $FabId == "B" ]; then
-    BOARD_REV=B
-    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
-  else
-    BOARD_REV=A
-    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
-  fi
-fi
-
-
-##**********************************************************************
-## Additional EDK Build Setup/Configuration
-##**********************************************************************
-echo "Ensuring correct build directory is present for GenBiosId..."
-ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc
-#TOOL_CHAIN_TAG=GCC47
-MAX_CONCURRENT_THREAD_NUMBER=1
-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 = $ACTIVE_PLATFORM                           >> Conf/target.txt
-echo TARGET          = $TARGET                                    >> Conf/target.txt
-echo TOOL_CHAIN_TAG  = $TOOL_CHAIN_TAG                            >> Conf/target.txt
-echo MAX_CONCURRENT_THREAD_NUMBER = $MAX_CONCURRENT_THREAD_NUMBER >> Conf/target.txt
-if [ $Arch == "IA32" ]; then
-  echo TARGET_ARCH   = IA32                                       >> Conf/target.txt
-else
-  echo TARGET_ARCH   = IA32 X64                                   >> Conf/target.txt
-fi
-
-###
-### Update ASL path for GCC47 & 46
-###
-
-## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule
-  echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG     = --add-gnu-debuglink=\$\(DEBUG_DIR\)/\$\(MODULE_NAME\).debug >> $WORKSPACE/Conf/tools_def.txt
-### 
-
-##**********************************************************************
-## Build BIOS
-##**********************************************************************
-echo "Creating BiosId..."
-BUILD_PATH=Build/$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/BiosId.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 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
-pushd  $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin
-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 ApolloLakeFsp.fd -o ./ -n FSP.Fv
-popd
-cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/FSP_T.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/FSP_M.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/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_ENABLED)
-# 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.
-./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i $BUILD_PATH/FV/Temp.fd 0006 005C 0078 0030 0031 0030 0031 > $BUILD_PATH/FV/HiiDefaultData.txt
-
-## copy the Setup variable to the SetupDefault variable and save changes to 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 B73FE497-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 environment variables
-##find /v "#" Conf\BiosId.env > ver_strings
-##for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
-##del /f/q ver_strings >nul
-##
-VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-4)
-VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-2)
-BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
-
-cp -f $BUILD_PATH/FV/FVOBB.Fv  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-
-if [ $BoardId == "BG" ]; then
-  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-fi
-
-if [ $BoardId == "MN" ]; then
-  if [ $FabId == "B" ]; then
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-  else
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
-  fi
-fi
-
-#
-# 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 SpiChunk3.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/BroxtonPlatformPkg/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=%CD%
+if %WORKSPACE:~-1%==\ (
+  set WORKSPACE=%WORKSPACE:~0,-1%
+)
+set CORE_PATH=%WORKSPACE%\Core
+set PLATFORM_PATH=Platform\BroxtonPlatformPkg
+set SILICON_PATH=Silicon\BroxtonSoC
+set AslPath=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe
+set PACKAGES_PATH=%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%\Platform;%WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON_PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common ;
+set EDK_TOOLS_BIN=%WORKSPACE%\BaseTools\Bin\Win32
+set /a build_threads=1
+set "Nasm_Flags=-D ARCH_IA32 -D DEBUG_PORT80"
+set "Build_Flags= "
+set exitCode=0
+set Arch=X64
+set Compiler=VS2013
+set FabId=B
+set BoardId=MN
+if not defined BiosVersion set BiosVersion=DEV
+
+
+:: 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\FrameworkDatabase.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_def.txt, build_rule.txt in WorkSpace\Conf
+:: Also run edksetup as soon as possible to avoid it from changing environment variables we're overriding
+set "VCINSTALLDIR="
+set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
+call edksetup.bat
+@echo off
+
+set Minnow_RVP=MINN
+
+:: Initialize all the build flags to FALSE
+:: Then based on the cmd line input, some will be set to TRUE prior to building.
+:: Note: These variable names match the actual Build Macro names in DSC for clarity.
+set ENBDT_PF_BUILD=FALSE
+set SrcDebug=FALSE
+set APLK_SETUP_ENABLE_BUILD=FALSE
+set FSP_BUILD=FALSE
+set FSP_WRAPPER=FALSE
+
+:: Set Defaults of platform specific environment variables.
+set EFI_SOURCE=%CD%
+set EDK_SOURCE=%CD%
+set PLATFORM_NAME=BxtPlatformPkg
+set PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
+set PLATFORM_RC_PACKAGE=Silicon\BroxtonSoC\BroxtonSiPkg
+set COMMON_PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
+set FSP_BIN_PKG_NAME=BroxtonFspBinPkg
+set STITCH_PATH=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch
+
+PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\GenBiosId;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
+PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
+
+::**********************************************************************
+:: Parse command line arguments
+::**********************************************************************
+
+:: Optional arguments
+:OptLoop
+if /i "%~1"=="" goto Usage
+if /i "%~1"=="/?" goto Usage
+
+if /i "%~1"=="/l" (
+    set Build_Flags=%Build_Flags% -j EDK2.log
+    shift
+    goto OptLoop
+)
+if /i "%~1" == "/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"=="/ia32" (
+    set Arch=IA32
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/x64" (
+    set Arch=X64
+    shift
+    goto OptLoop
+)
+
+if /i "%~1"=="/vs08" (
+    set Compiler=VS2008
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/vs10" (
+    set Compiler=VS2010
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/vs12" (
+    set Compiler=VS2012
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/vs13" (
+    set Compiler=VS2013
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/vs15" (
+    set Compiler=VS2015
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/FspW" (
+    set FSP_WRAPPER=TRUE
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/A" (
+    set FabId=A
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/B" (
+    set FabId=B
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/MN" (
+    set BoardId=MN
+    echo.
+    shift
+    goto OptLoop
+)
+if /i "%~1"=="/BG" (
+    set BoardId=BG
+    echo.
+    shift
+    goto OptLoop
+)
+
+if /i "%~1"=="/m" (
+    if defined NUMBER_OF_PROCESSORS (
+        set /a build_threads=%NUMBER_OF_PROCESSORS%
+    )
+    shift
+    goto OptLoop
+)
+
+:: Required argument(s)
+if "%~2"=="" (
+   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" == "%Minnow_RVP%" (
+  if %BoardId%==MN (
+    set BOARD_ID=MINNOW3
+  ) else if %BoardId%==BG (
+    set BOARD_ID=BENSONV
+  )
+    set ENBDT_PF_BUILD=TRUE
+    set PLATFORM_NAME=BroxtonPlatformPkg
+    set PLATFORM_PACKAGE=%PLATFORM_PATH%
+    set APLK_SETUP_ENABLE_BUILD=TRUE
+) else (
+    echo. & echo Error - Unsupported PlatformType: %1
+    echo Please review the Help screen "/?" & echo.
+    goto ExitFail
+)
+set Platform_Type=%~1
+
+::
+:: Tack on BIOS Version
+::
+
+::**********************************************************************
+:: Additional EDK Build Setup/Configuration
+::**********************************************************************
+
+::Setup DefineAtBuildMacros config file
+set Build_Macros=.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc
+copy /y nul %Build_Macros% >nul
+
+::output platform specific build macros to DefineAtBuildMacros.dsc
+echo DEFINE ENBDT_PF_BUILD          = %ENBDT_PF_BUILD%          >> %Build_Macros%
+
+echo DEFINE APLK_SETUP_ENABLE_BUILD = %APLK_SETUP_ENABLE_BUILD% >> %Build_Macros%
+
+if "%Arch%"=="IA32" (
+    echo DEFINE X64_CONFIG              = FALSE                     >> %Build_Macros%
+) else if "%Arch%"=="X64" (
+    echo DEFINE X64_CONFIG              = TRUE                      >> %Build_Macros%
+)
+
+::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target values removed
+
+if "%Arch%"=="X64" (
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+) else if "%Arch%"=="IA32" (
+    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
+    echo BOARD_EXT = I32 >> Conf\BiosId.env
+)
+
+if /i "%~2" == "RELEASE" (
+    set target=RELEASE
+    echo BUILD_TYPE = R >> Conf\BiosId.env
+) else (
+    set target=DEBUG
+    echo BUILD_TYPE = D >> Conf\BiosId.env
+)
+
+if %BoardId%==BG (
+  echo BOARD_REV = A >> Conf\BiosId.env
+)
+
+if %BoardId%==MN (
+  if %FabId%==B (
+    echo BOARD_REV = B >> Conf\BiosId.env
+  ) else (
+    echo BOARD_REV = A >> Conf\BiosId.env
+  )
+)
+
+:: Set the Build_Type, Version_Major, and Version_Minor environment variables
+find /v "#" Conf\BiosId.env > ver_strings
+for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
+del /f/q ver_strings >nul
+:: Do this after parsing "ver_strings"
+echo BOARD_ID = %BOARD_ID% >> Conf\BiosId.env
+
+echo.
+echo Setting the Build environment for Visual Studio...
+if "%Compiler%"=="VS2008" (
+  if defined VS90COMNTOOLS (
+     call "%VS90COMNTOOLS%\vsvars32.bat" >nul
+     if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" (
+      set TOOL_CHAIN_TAG=VS2008
+     ) else  set TOOL_CHAIN_TAG=VS2008x86
+  ) else (
+    echo  --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not defined ^^!
+    goto BldFail
+  )
+) else if "%Compiler%"=="VS2010" (
+  if defined VS100COMNTOOLS (
+     call "%VS100COMNTOOLS%\vsvars32.bat" >nul
+     if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\" (
+        set TOOL_CHAIN_TAG=VS2010
+     ) else  set TOOL_CHAIN_TAG=VS2010x86
+  ) else (
+     echo  --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not defined ^^!
+     goto BldFail
+  )
+) else if "%Compiler%"=="VS2012" (
+  if defined VS110COMNTOOLS (
+     call "%VS110COMNTOOLS%\vsvars32.bat" >nul
+     if /I "%VS110COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\" (
+        set TOOL_CHAIN_TAG=VS2012
+     ) else  set TOOL_CHAIN_TAG=VS2012x86
+  ) else (
+     echo  --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not defined ^^!
+     goto BldFail
+  )
+) else if "%Compiler%"=="VS2013" (
+  if defined VS120COMNTOOLS (
+     call "%VS120COMNTOOLS%\vsvars32.bat" >nul
+     if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\" (
+        set TOOL_CHAIN_TAG=VS2013
+     ) else  set TOOL_CHAIN_TAG=VS2013x86
+  ) else (
+     echo  --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not defined ^^!
+     echo           See help ^(/?^) for how specify a different VS version.
+     goto BldFail
+  )
+) else if "%Compiler%"=="VS2015" (
+  if defined VS140COMNTOOLS (
+     call "%VS140COMNTOOLS%\vsvars32.bat" >nul
+     if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 14.0\Common7\Tools\" (
+        set TOOL_CHAIN_TAG=VS2015
+     ) else  set TOOL_CHAIN_TAG=VS2015x86
+
+  ) else (
+     echo  --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not defined ^^!
+     echo           See help ^(/?^) for how specify a different VS version.
+     goto BldFail
+  )
+)
+
+::**********************************************************************
+:: Build BIOS
+::**********************************************************************
+
+echo Setup build directory for GenBiosId...
+set BUILD_PATH=Build\%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%"=="X64" (
+   if not exist %BUILD_PATH%\X64  mkdir %BUILD_PATH%\X64
+   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob Conf\BiosId.bat
+) else if "%Arch%"=="IA32" (
+   if not exist %BUILD_PATH%\IA32  mkdir %BUILD_PATH%\IA32
+   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob Conf\BiosId.bat
+)
+
+if ErrorLevel 1 goto BldFail
+
+echo Building ResetVector...
+
+set ResetVectorPath=%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=%WORKSPACE%
+set WORKSPACE=%CD%
+if "%Arch%"=="X64" (
+set ActivePlatform=%PLATFORM_PACKAGE%\PlatformPkgX64.dsc
+) else if "%Arch%"=="IA32" (
+set ActivePlatform=%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_CONCURRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp
+
+if "%Arch%"=="IA32" (
+    echo TARGET_ARCH = IA32                                  >> Conf\target.txt.tmp
+) else if "%Arch%"=="X64" (
+    echo TARGET_ARCH = IA32 X64                              >> Conf\target.txt.tmp
+)
+echo TARGET          = %TARGET%                              >> Conf\target.txt.tmp
+echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                      >> Conf\target.txt.tmp
+echo ACTIVE_PLATFORM = %ActivePlatform%                      >> Conf\target.txt.tmp
+echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads%          >> Conf\target.txt.tmp
+
+move /Y Conf\target.txt.tmp Conf\target.txt >nul
+echo *_VS2008x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
+echo *_VS2010x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
+echo *_VS2012x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
+echo *_VS2013x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
+echo *_VS2015x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
+
+echo.
+echo Invoking normal EDK2 build...
+build %Build_Flags%
+if ErrorLevel 1 goto BldFail
+
+set WORKSPACE=%SaveWorkSpace%
+
+::**********************************************************************
+:: Post Build processing and cleanup
+::**********************************************************************
+echo Create FlashMap.h...
+
+set PLAT_INIT_PRE_MEM=PlatformPreMemPei
+
+set AutoGenPath=%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\PlatformSettings\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_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_ENABLED)
+:: 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\HiiDefaultData.txt -o %BUILD_PATH%\FV\Bxt%Arch%.fd  -g B73FE497-B92E-416e-8326-45AD0D270091 -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%"=="R" set BUILD_TYPE=R
+
+echo Copy BIOS...
+set BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%
+copy /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM >nul
+copy /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map >nul
+
+set Storage_Folder=%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%" == "TRUE" (
+::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
+    pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin
+    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 ApolloLakeFsp.fd -o .\ -n FSP.Fv
+    popd
+    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
+    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBinPkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
+    copy /y/b %WORKSPACE%\Silicon\BroxtonSoC\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
+)
+
+::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_PcdFlashBaseAddress
+::        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
+::===========================================================================================
+  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase "%STITCH_PATH%\FlashMap.h"
+  call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress   BaseAddress   "%STITCH_PATH%\FlashMap.h"
+  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize "%STITCH_PATH%\FlashMap.h"
+:: Find image offset as opposed to memory offset
+  PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd
+  set /p VpdOffset=<temp.pcd
+  del /f /q temp.pcd
+:: Force the variables we care about into DEC string format
+  set VpdSize=%NvStorageSize%
+  call :ForceToDec VpdOffset
+  call :ForceToDec VpdSize
+:: Dump what we found
+  echo - NvStorageBase = %NvStorageBase%
+  echo - BaseAddress   = %BaseAddress%
+  echo - NvStorageSize = %NvStorageSize%
+  echo - VpdOffset     = %VpdOffset%
+  echo - VpdSize       = %VpdSize%
+
+:: Create NvStorage.fv
+  echo Create NvStorage.fv...
+  pushd %STITCH_PATH%
+    REM This -s offset must equal the decimal value of  FLASH_REGION_VPD_OFFSET  in the Platform.fdf
+    Split.exe -f %STITCH_PATH%\%BIOS_Name%.ROM -s %VpdOffset% -o temp1.bin -t temp2.bin
+    REM This -s offset must equal the decimal value of
+    REM  FLASH_REGION_VPD_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE + FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE
+    Split.exe -f temp2.bin -s %VpdSize% -o %Storage_Folder%\NvStorage.Fv -t temp3.bin
+    del /F/Q temp1.bin temp2.bin temp3.bin
+  popd
+
+echo.
+echo Build location:     %BUILD_PATH%
+echo BIOS ROM Created:   %BIOS_Name%
+echo.
+echo --------------- The EDKII BIOS build has successfully completed. ---------------
+echo.
+goto Exit
+
+::
+:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2) as a HEX string
+::
+:: USAGE: call :FindPcdInFile PCD Variable File
+:FindPcdInFile
+  call :GetPcd "%~1" "%~2" "%~3"
+  call :ForceToHex "%~2"
+goto :EOF
+
+::
+:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2)
+::
+:: USAGE: call :GetPcd PCD Variable File
+:GetPcd
+  set _TargetFile=%~3
+  if not exist "%_TargetFile%" (
+    echo ERROR: Couldn't find %_TargetFile%^!
+    set ExitCode=1
+  ) else (
+    for /f "tokens=3" %%a in ('findstr /C:"%~1" "%_TargetFile%"') do (
+      set _TestValue=%%~a
+      set _PcdValue=!_TestValue:~0,-1!
+    )
+    set %~2=!_PcdValue!
+	echo %2 %_PcdValue%
+  )
+  set _TargetFile=
+  set _TestValue=
+  set _PcdValue=
+goto :EOF
+
+::
+:: Force value of %1 into hex format 0x1234
+::
+:: USAGE: call :ForceToHex Variable
+:ForceToHex
+  call set _Temp=%%%~1%%
+  if "%_Temp:~0,2%" == "0x" goto :ForceToHexExit
+  PowerShell ('0x' + [convert]::tostring($env:_Temp, 16).ToUpper()) > temp.pcd
+  set /p %~1=<temp.pcd
+  del /f /q temp.pcd
+:ForceToHexExit
+  set _Temp=
+goto :EOF
+
+::
+:: Force value of %1 into decimal format
+::
+:: USAGE: call :ForceToDec Variable
+:ForceToDec
+  call set _Temp=%%%~1%%
+  if not "%_Temp:~0,2%" == "0x" goto :ForceToDecExit
+  PowerShell ([convert]::toInt64((Get-Item env:_Temp).value, 16)) > temp.pcd
+  set /p %~1=<temp.pcd
+  del /f /q temp.pcd
+:ForceToDecExit
+  set _Temp=
+goto :EOF
+
+:Usage
+echo.
+echo ***************************************************************************
+echo Build Edk II BIOS Rom for BXT platforms.
+echo.
+echo Usage: %0 [options] ^<PlatformType^> ^<BuildTarget^>
+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=1
+goto Exit
+
+:BldFail
+set exitCode=1
+echo  -- Error:  EDKII BIOS Build has failed!
+echo See EDK2.log for more details
+
+:Exit
+echo %date%  %time%
+(
+  EndLocal
+  set BiosVersion=%BiosVersion%
+  exit /b %ExitCode%
+)
diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh b/Platform/BroxtonPlatformPkg/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.<BR>
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution.  The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+# 
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+##**********************************************************************
+## Function define
+##**********************************************************************
+function ErrorExit() {
+  echo
+  echo "Press any key......"
+  read
+  exit 0
+}
+
+echo -e $(date)
+##**********************************************************************
+## Initial Setup
+##**********************************************************************
+
+Build_Flags=
+SV_String=_
+exitCode=0
+Arch=X64
+FabId=B
+BoardId=MN
+
+## Initialize all the build flags to FALSE
+## depending on the cmd line input, some will be set to TRUE prior to building
+ENBDT_PF_BUILD=FALSE
+TABLET_PF_BUILD=FALSE
+BYTI_PF_BUILD=FALSE
+CSLE_ENABLE=FALSE
+VP_BIOS_ENABLE=FALSE
+SV_BIOS_ENABLE=FALSE
+PPV_BIOS_ENABLE=FALSE
+RVVP_BIOS_ENABLE=FALSE
+RVV_BIOS_ENABLE=FALSE
+SrcDebug=FALSE
+
+## 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_rule.txt
+
+
+
+
+TOOL_CHAIN_TAG=GCC5
+
+## Define platform specific environment variables.
+PLATFORM_NAME=BroxtonPlatformPkg
+PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
+EFI_SOURCE=$WORKSPACE
+EDK_SOURCE=$WORKSPACE
+
+##**********************************************************************
+## Parse command line arguments
+##**********************************************************************
+
+## Optional arguments
+for (( i=1; i<=$#; ))
+  do
+    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
+      Arch=X64
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+      BoardId=MN
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+      BoardId=BG
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
+      FabId=B
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
+      FabId=A
+      shift
+    else
+      break
+    fi
+  done
+
+## Required argument(s)
+if [ "$2" == "" ]; then
+  echo 
+  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 and stage in Conf/
+cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env       $WORKSPACE/Conf/BiosId.env
+sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
+sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
+sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
+
+if [ $BoardId == "MN" ]; then
+  BOARD_ID=MNW3
+  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
+else
+  BOARD_ID=BEN1
+  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
+fi
+ENBDT_PF_BUILD=TRUE
+PLATFORM_NAME=BroxtonPlatformPkg
+PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg  
+Platform_Type=$1
+
+## Create new DefineAtBuildMacros.dsc file
+Build_Macros=$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      = $ENBDT_PF_BUILD   >> $Build_Macros
+echo DEFINE TABLET_PF_BUILD     = $TABLET_PF_BUILD  >> $Build_Macros
+echo DEFINE BYTI_PF_BUILD       = $BYTI_PF_BUILD    >> $Build_Macros
+echo DEFINE CSLE_ENABLE         = $CSLE_ENABLE      >> $Build_Macros
+echo DEFINE VP_BIOS_ENABLE      = $VP_BIOS_ENABLE   >> $Build_Macros
+echo DEFINE SV_BIOS_ENABLE      = $SV_BIOS_ENABLE   >> $Build_Macros
+echo DEFINE PPV_BIOS_ENABLE     = $PPV_BIOS_ENABLE  >> $Build_Macros
+echo DEFINE RVVP_BIOS_ENABLE    = $RVVP_BIOS_ENABLE >> $Build_Macros
+echo DEFINE RVV_BIOS_ENABLE     = $RVV_BIOS_ENABLE  >> $Build_Macros
+
+if [ $Arch == "IA32" ]; then
+  echo DEFINE X64_CONFIG = FALSE      >> $Build_Macros
+else
+  echo DEFINE X64_CONFIG = TRUE       >> $Build_Macros
+fi
+
+if [ "$(echo $2 | tr 'a-z' 'A-Z')" == "RELEASE" ]; then
+  TARGET=RELEASE
+  BUILD_TYPE=R
+  echo BUILD_TYPE = R >> $WORKSPACE/Conf/BiosId.env
+else
+  TARGET=DEBUG
+  BUILD_TYPE=D
+  echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
+fi
+
+if [ $BoardId == "BG" ]; then
+  BOARD_REV=A
+  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
+fi
+
+if [ $BoardId == "MN" ]; then
+  if [ $FabId == "B" ]; then
+    BOARD_REV=B
+    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
+  else
+    BOARD_REV=A
+    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
+  fi
+fi
+
+
+##**********************************************************************
+## Additional EDK Build Setup/Configuration
+##**********************************************************************
+echo "Ensuring correct build directory is present for GenBiosId..."
+ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc
+#TOOL_CHAIN_TAG=GCC47
+MAX_CONCURRENT_THREAD_NUMBER=1
+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 = $ACTIVE_PLATFORM                           >> Conf/target.txt
+echo TARGET          = $TARGET                                    >> Conf/target.txt
+echo TOOL_CHAIN_TAG  = $TOOL_CHAIN_TAG                            >> Conf/target.txt
+echo MAX_CONCURRENT_THREAD_NUMBER = $MAX_CONCURRENT_THREAD_NUMBER >> Conf/target.txt
+if [ $Arch == "IA32" ]; then
+  echo TARGET_ARCH   = IA32                                       >> Conf/target.txt
+else
+  echo TARGET_ARCH   = IA32 X64                                   >> Conf/target.txt
+fi
+
+###
+### Update ASL path for GCC47 & 46
+###
+
+## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule
+  echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG     = --add-gnu-debuglink=\$\(DEBUG_DIR\)/\$\(MODULE_NAME\).debug >> $WORKSPACE/Conf/tools_def.txt
+### 
+
+##**********************************************************************
+## Build BIOS
+##**********************************************************************
+echo "Creating BiosId..."
+BUILD_PATH=Build/$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/BiosId.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 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase = $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) + $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
+pushd  $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin
+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 ApolloLakeFsp.fd -o ./ -n FSP.Fv
+popd
+cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/FSP_T.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/FSP_M.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/FspBin/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_ENABLED)
+# 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.
+./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i $BUILD_PATH/FV/Temp.fd 0006 005C 0078 0030 0031 0030 0031 > $BUILD_PATH/FV/HiiDefaultData.txt
+
+## copy the Setup variable to the SetupDefault variable and save changes to 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 B73FE497-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 environment variables
+##find /v "#" Conf\BiosId.env > ver_strings
+##for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
+##del /f/q ver_strings >nul
+##
+VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-4)
+VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f 3 | cut -c 1-2)
+BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TYPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
+
+cp -f $BUILD_PATH/FV/FVOBB.Fv  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $BUILD_PATH/FV/FVOBBX.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $BUILD_PATH/FV/FVIBBR.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $BUILD_PATH/FV/FVIBBM.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+cp -f $BUILD_PATH/FV/FVIBBL.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+
+if [ $BoardId == "BG" ]; then
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/BensonGlacier/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+fi
+
+if [ $BoardId == "MN" ]; then
+  if [ $FabId == "B" ]; then
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_B/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  else
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/MinnowBoard3/FAB_A/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  fi
+fi
+
+#
+# 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 SpiChunk3.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/BroxtonPlatformPkg/BuildIFWI.bat
index 5042580..04d338d 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -2,6 +2,7 @@
 SetLocal EnableDelayedExpansion EnableExtensions
 
 :: Assign initial values
+set thisscript=%0
 set exitCode=0
 set "Build_Flags= "
 set Arch=X64
@@ -116,7 +117,7 @@ if /i "%~1"=="/m" (
 :: Require 2 input parameters
 if "%~2"=="" (
    echo. & echo -- ERROR: Not Enough Arguments Provided
-   echo -- Please review the Help screen "/?" -- & echo.
+   echo -- Please review the Help screen %thisscript% "/?" -- & echo.
    goto exit
 )
 
@@ -129,8 +130,8 @@ echo ===========================================================================
 echo Build_IFWI:  Calling BIOS build Script...
 echo.
 
-echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_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_Flags% %Platform_Type% %Build_Target%
 if ErrorLevel 1 (
     echo echo  -- Error Building BIOS  & echo.
     set exitCode=1
@@ -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 ======================================================================
 
 
@@ -180,11 +181,12 @@ goto Exit
 if /i "%SkipUsageFlag%" == "TRUE" goto Exit
 echo Script to build BIOS firmware and stitch the entire IFWI.
 echo.
-echo Usage: BuildIFWI.bat [options] ^<PlatformType^> ^<BuildTarget^>
+echo Usage: %thisscript% [options] ^<PlatformType^> ^<BuildTarget^>
 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/BroxtonPlatformPkg/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  "                   
-  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 "                   
+  echo "       Build_Target:                Release, Debug "
   echo
   echo "Press any key......"
   read
@@ -56,6 +58,10 @@ for (( i=1; i<=$#; ))
       Arch=X64
       Build_Flags="$Build_Flags /x64"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+      BoardId=MN
+      Build_Flags="$Build_Flags /MN"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
       BoardId=BG
       Build_Flags="$Build_Flags /BG"
@@ -94,7 +100,7 @@ fi
 ## Build BIOS
 echo "======================================================================"
 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_Type $Build_Target
 
 echo
 echo Finished Building Process.
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
  2017-10-30  1:58 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
@ 2017-10-30  2:15 ` Wei, David
  0 siblings, 0 replies; 12+ messages in thread
From: Wei, David @ 2017-10-30  2:15 UTC (permalink / raw)
  To: Lu, ShifeiX A, edk2-devel@lists.01.org; +Cc: Jarlstrom, Laurie

Reviewed-by: zwei4  <david.wei@intel.com>

Thanks,
David  Wei

Intel SSG/STO/UEFI BIOS                                 

> -----Original Message-----
> From: Lu, ShifeiX A
> Sent: Monday, October 30, 2017 9:59 AM
> To: edk2-devel@lists.01.org
> Cc: Wei, David <david.wei@intel.com>
> Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script.
> 
> Enhance build script.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jarlstrom, Laurie <laurie.jarlstrom@intel.com>
> Signed-off-by: lushifex <shifeix.a.lu@intel.com>
> ---
>  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
> 
>  set exitCode=0
> -set WORKSPACE=%CD%
> -set CORE_PATH=%CD%
>  set BuildFlags=
> -set PlatformName=
> -set BuildTarget=Debug
> -set Compiler=/vs13
> -set Arch=/x64
> -set FabId=/B
> -set BoardId=/MN
> -set buildthread=
> +
> +set thisscript=%0
> 
>  :: Optional arguments
>  :OptLoop
> @@ -20,82 +14,15 @@ set buildthread=
>  if /i "%~1"=="" goto Usage
>  if /i "%~1"=="/?" goto Usage
> 
> -if /i "%~1"=="/IA32" (
> -    set Arch=/IA32
> -    shift
> -    goto OptLoop
> -)
> -
> -if /i "%~1"=="/x64" (
> -    set Arch=/x64
> -    shift
> -    goto OptLoop
> -)
> -
> -if /i "%~1"=="/vs08" (
> -    set Compiler=/vs08
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs10" (
> -    set Compiler=/vs10
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs12" (
> -    set Compiler=/vs12
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs13" (
> -    set Compiler=/vs13
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs15" (
> -    set Compiler=/vs15
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/A" (
> -    set FabId=/A
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/B" (
> -    set FabId=/B
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/MN" (
> -    set BoardId=/MN
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/BG" (
> -    set BoardId=/BG
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -
> -if /i "%~1"=="/m" (
> -    set buildthread=/m
> -    echo.
> +set BuildOption=%~1
> +if "!BuildOption:~0,1!"=="/" (
> +    set BuildFlags=%BuildFlags% %BuildOption%
>      shift
>      goto OptLoop
>  )
> 
>  :: Required argument(s)
> -:: Require 2 input parameters
> +:: Require 2 input parameters , first parameter without a "/" is Platform
> Name
>  if "%~2"=="" goto Usage
> 
>  :: Assign required arguments
> @@ -104,17 +31,26 @@ set BuildTarget=%~2
> 
>  :OptLoopEnd
>  echo ---- Call Build Script of Broxton ----
> -echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Co
> mpiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags%
> MINN %BuildTarget%
> -call
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Co
> mpiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags%
> MINN %BuildTarget%
> +
> +if not exist Platform\%PlatformName%PlatformPkg\BuildIFWI.bat (
> +  echo Platform %PlatformName%PlatformPkg does not exist
> +  echo. & echo Error - Unsupported Platform name: %1
> +  echo.
> +  goto Usage
> +)
> +
> +echo calling :
> Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %BuildFlags%  /fspw
> MINN %BuildTarget%
> +call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat  %BuildFlags%
> /fspw MINN %BuildTarget%
> 
>  goto Exit
> 
>  :Usage
> -echo Usage: BuildBIOS.bat [options] ^<PlatformName^> ^<BuildTarget^>
> +echo Usage: %thisscript% [options] ^<PlatformName^> ^<BuildTarget^>
>  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
> 
>  echo Examples:
> -echo    BuildBIOS.bat /vs13 /B /x64 Broxton Debug
> +echo    %thisscript% /vs13 /B /x64 Broxton Debug
> 
>  set exitCode=1
> 
> 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=1; i<=$#; ))
>    do
> -    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> +    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
> +      BoardId=MN
> +      Build_Flags="$Build_Flags /MN"
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
>        BoardId=BG
>        Build_Flags="$Build_Flags /BG"
>        shift
> @@ -68,14 +72,22 @@ for (( i=1; i<=$#; ))
>      fi
>    done
> 
> -Target_Flag=Release
> +if [ "$1" == "Broxton" ]; then
> +       shift
> + else
> +   echo "No parameter for board : assume Broxton"
> +fi
> +
> +Target_Flag=Debug
> +
>  if [ "$1" == "Debug" ]; then
>    Target_Flag=Debug
> -  shift
> -fi
> -if [ "$1" == "Release" ]; then
> +elif [ "$1" == "Release" ]; then
>    Target_Flag=Release
> -  shift
> +else
> +  echo "Error - Invalid Target"
> +  echo "  Please review the Help screen"
> +  Usage
>  fi
> 
>  echo $Build_Flags
> @@ -84,7 +96,7 @@ echo $Target_Flag
>  export WORKSPACE=`pwd`
>  export
> PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:
> $WORKSPACE/Platform:$WORKSPACE/Platform/BroxtonPlatformPkg:$WOR
> KSPACE/Silicon/BroxtonSoC:$WORKSPACE/Platform/BroxtonPlatformPkg/Co
> mmon
> 
> -. edksetup.sh
> +. edksetup.sh BaseTools
> 
>  make -C BaseTools
> 
> diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat
> b/Platform/BroxtonPlatformPkg/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=%CD%
> -if %WORKSPACE:~-1%==\ (
> -  set WORKSPACE=%WORKSPACE:~0,-1%
> -)
> -set CORE_PATH=%WORKSPACE%\Core
> -set PLATFORM_PATH=Platform\BroxtonPlatformPkg
> -set SILICON_PATH=Silicon\BroxtonSoC
> -set
> AslPath=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe
> -set
> PACKAGES_PATH=%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%
> \Platform;%WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON
> _PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common ;
> -set EDK_TOOLS_BIN=%WORKSPACE%\BaseTools\Bin\Win32
> -set /a build_threads=1
> -set "Nasm_Flags=-D ARCH_IA32 -D DEBUG_PORT80"
> -set "Build_Flags= "
> -set exitCode=0
> -set Arch=X64
> -set Compiler=VS2013
> -set FabId=B
> -set BoardId=MN
> -if not defined BiosVersion set BiosVersion=DEV
> -
> -
> -:: 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\FrameworkDatabase.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\Bas
> eTools\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt
> -
> -:: Setup EDK environment. Edksetup puts new copies of target.txt,
> tools_def.txt, build_rule.txt in WorkSpace\Conf
> -:: Also run edksetup as soon as possible to avoid it from changing
> environment variables we're overriding
> -set "VCINSTALLDIR="
> -set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
> -call edksetup.bat
> -@echo off
> -
> -set Minnow_RVP=MINN
> -
> -:: Initialize all the build flags to FALSE
> -:: Then based on the cmd line input, some will be set to TRUE prior to
> building.
> -:: Note: These variable names match the actual Build Macro names in DSC
> for clarity.
> -set ENBDT_PF_BUILD=FALSE
> -set SrcDebug=FALSE
> -set APLK_SETUP_ENABLE_BUILD=FALSE
> -set FSP_BUILD=FALSE
> -set FSP_WRAPPER=FALSE
> -
> -:: Set Defaults of platform specific environment variables.
> -set EFI_SOURCE=%CD%
> -set EDK_SOURCE=%CD%
> -set PLATFORM_NAME=BxtPlatformPkg
> -set PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
> -set PLATFORM_RC_PACKAGE=Silicon\BroxtonSoC\BroxtonSiPkg
> -set
> COMMON_PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
> -set FSP_BIN_PKG_NAME=BroxtonFspBinPkg
> -set
> STITCH_PATH=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch
> -
> -
> PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Gen
> BiosId;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
> -
> PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FCE;
> %WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
> -
> -
> ::*********************************************************
> *************
> -:: Parse command line arguments
> -
> ::*********************************************************
> *************
> -
> -:: Optional arguments
> -:OptLoop
> -if /i "%~1"=="" goto Usage
> -if /i "%~1"=="/?" goto Usage
> -
> -if /i "%~1"=="/l" (
> -    set Build_Flags=%Build_Flags% -j EDK2.log
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1" == "/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"=="/ia32" (
> -    set Arch=IA32
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/x64" (
> -    set Arch=X64
> -    shift
> -    goto OptLoop
> -)
> -
> -if /i "%~1"=="/vs08" (
> -    set Compiler=VS2008
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs10" (
> -    set Compiler=VS2010
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs12" (
> -    set Compiler=VS2012
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs13" (
> -    set Compiler=VS2013
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/vs15" (
> -    set Compiler=VS2015
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/FspW" (
> -    set FSP_WRAPPER=TRUE
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/A" (
> -    set FabId=A
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/B" (
> -    set FabId=B
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/MN" (
> -    set BoardId=MN
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -if /i "%~1"=="/BG" (
> -    set BoardId=BG
> -    echo.
> -    shift
> -    goto OptLoop
> -)
> -
> -if /i "%~1"=="/m" (
> -    if defined NUMBER_OF_PROCESSORS (
> -        set /a build_threads=%NUMBER_OF_PROCESSORS%
> -    )
> -    shift
> -    goto OptLoop
> -)
> -
> -:: Required argument(s)
> -if "%~2"=="" (
> -   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" == "%Minnow_RVP%" (
> -  if %BoardId%==MN (
> -    set BOARD_ID=MINNOW3
> -  ) else if %BoardId%==BG (
> -    set BOARD_ID=BENSONV
> -  )
> -    set ENBDT_PF_BUILD=TRUE
> -    set PLATFORM_NAME=BroxtonPlatformPkg
> -    set PLATFORM_PACKAGE=%PLATFORM_PATH%
> -    set APLK_SETUP_ENABLE_BUILD=TRUE
> -) else (
> -    echo. & echo Error - Unsupported PlatformType: %1
> -    echo Please review the Help screen "/?" & echo.
> -    goto ExitFail
> -)
> -set Platform_Type=%~1
> -
> -::
> -:: Tack on BIOS Version
> -::
> -
> -
> ::*********************************************************
> *************
> -:: Additional EDK Build Setup/Configuration
> -
> ::*********************************************************
> *************
> -
> -::Setup DefineAtBuildMacros config file
> -set Build_Macros=.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc
> -copy /y nul %Build_Macros% >nul
> -
> -::output platform specific build macros to DefineAtBuildMacros.dsc
> -echo DEFINE ENBDT_PF_BUILD
> = %ENBDT_PF_BUILD%          >> %Build_Macros%
> -
> -echo DEFINE APLK_SETUP_ENABLE_BUILD
> = %APLK_SETUP_ENABLE_BUILD% >> %Build_Macros%
> -
> -if "%Arch%"=="IA32" (
> -    echo DEFINE X64_CONFIG              = FALSE                     >> %Build_Macros%
> -) else if "%Arch%"=="X64" (
> -    echo DEFINE X64_CONFIG              = TRUE                      >> %Build_Macros%
> -)
> -
> -::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target
> values removed
> -
> -if "%Arch%"=="X64" (
> -    findstr /b /v "BOARD_ID BUILD_TYPE
> BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> -) else if "%Arch%"=="IA32" (
> -    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV
> BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> -    echo BOARD_EXT = I32 >> Conf\BiosId.env
> -)
> -
> -if /i "%~2" == "RELEASE" (
> -    set target=RELEASE
> -    echo BUILD_TYPE = R >> Conf\BiosId.env
> -) else (
> -    set target=DEBUG
> -    echo BUILD_TYPE = D >> Conf\BiosId.env
> -)
> -
> -if %BoardId%==BG (
> -  echo BOARD_REV = A >> Conf\BiosId.env
> -)
> -
> -if %BoardId%==MN (
> -  if %FabId%==B (
> -    echo BOARD_REV = B >> Conf\BiosId.env
> -  ) else (
> -    echo BOARD_REV = A >> Conf\BiosId.env
> -  )
> -)
> -
> -:: Set the Build_Type, Version_Major, and Version_Minor environment
> variables
> -find /v "#" Conf\BiosId.env > ver_strings
> -for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
> -del /f/q ver_strings >nul
> -:: Do this after parsing "ver_strings"
> -echo BOARD_ID = %BOARD_ID% >> Conf\BiosId.env
> -
> -echo.
> -echo Setting the Build environment for Visual Studio...
> -if "%Compiler%"=="VS2008" (
> -  if defined VS90COMNTOOLS (
> -     call "%VS90COMNTOOLS%\vsvars32.bat" >nul
> -     if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 9.0\Common7\Tools\" (
> -      set TOOL_CHAIN_TAG=VS2008
> -     ) else  set TOOL_CHAIN_TAG=VS2008x86
> -  ) else (
> -    echo  --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not
> defined ^^!
> -    goto BldFail
> -  )
> -) else if "%Compiler%"=="VS2010" (
> -  if defined VS100COMNTOOLS (
> -     call "%VS100COMNTOOLS%\vsvars32.bat" >nul
> -     if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 10.0\Common7\Tools\" (
> -        set TOOL_CHAIN_TAG=VS2010
> -     ) else  set TOOL_CHAIN_TAG=VS2010x86
> -  ) else (
> -     echo  --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not
> defined ^^!
> -     goto BldFail
> -  )
> -) else if "%Compiler%"=="VS2012" (
> -  if defined VS110COMNTOOLS (
> -     call "%VS110COMNTOOLS%\vsvars32.bat" >nul
> -     if /I "%VS110COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 11.0\Common7\Tools\" (
> -        set TOOL_CHAIN_TAG=VS2012
> -     ) else  set TOOL_CHAIN_TAG=VS2012x86
> -  ) else (
> -     echo  --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not
> defined ^^!
> -     goto BldFail
> -  )
> -) else if "%Compiler%"=="VS2013" (
> -  if defined VS120COMNTOOLS (
> -     call "%VS120COMNTOOLS%\vsvars32.bat" >nul
> -     if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 12.0\Common7\Tools\" (
> -        set TOOL_CHAIN_TAG=VS2013
> -     ) else  set TOOL_CHAIN_TAG=VS2013x86
> -  ) else (
> -     echo  --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not
> defined ^^!
> -     echo           See help ^(/?^) for how specify a different VS version.
> -     goto BldFail
> -  )
> -) else if "%Compiler%"=="VS2015" (
> -  if defined VS140COMNTOOLS (
> -     call "%VS140COMNTOOLS%\vsvars32.bat" >nul
> -     if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 14.0\Common7\Tools\" (
> -        set TOOL_CHAIN_TAG=VS2015
> -     ) else  set TOOL_CHAIN_TAG=VS2015x86
> -
> -  ) else (
> -     echo  --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not
> defined ^^!
> -     echo           See help ^(/?^) for how specify a different VS version.
> -     goto BldFail
> -  )
> -)
> -
> -
> ::*********************************************************
> *************
> -:: Build BIOS
> -
> ::*********************************************************
> *************
> -
> -echo Setup build directory for GenBiosId...
> -set
> BUILD_PATH=Build\%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%"=="X64" (
> -   if not exist %BUILD_PATH%\X64  mkdir %BUILD_PATH%\X64
> -   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob
> Conf\BiosId.bat
> -) else if "%Arch%"=="IA32" (
> -   if not exist %BUILD_PATH%\IA32  mkdir %BUILD_PATH%\IA32
> -   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob
> Conf\BiosId.bat
> -)
> -
> -if ErrorLevel 1 goto BldFail
> -
> -echo Building ResetVector...
> -
> -set
> ResetVectorPath=%WORKSPACE%\%PLATFORM_RC_PACKAGE%\Cpu\Reset
> Vector
> -
> -pushd %ResetVectorPath%\Vtf0
> -  nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw
> ResetVectorCode.asm
> -
> python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawS
> ection.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\FixupForRawS
> ection.py Bin\ResetVector.ia32.port80.raw
> -popd
> -
> -:: SaveWorkSpace w/a is needed when using subst for Workspace builds (eg.
> R:/)
> -set SaveWorkSpace=%WORKSPACE%
> -set WORKSPACE=%CD%
> -if "%Arch%"=="X64" (
> -set ActivePlatform=%PLATFORM_PACKAGE%\PlatformPkgX64.dsc
> -) else if "%Arch%"=="IA32" (
> -set ActivePlatform=%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_CONCURRENT_THREAD_NUMBER" Conf\target.txt >
> Conf\target.txt.tmp
> -
> -if "%Arch%"=="IA32" (
> -    echo TARGET_ARCH = IA32                                  >> Conf\target.txt.tmp
> -) else if "%Arch%"=="X64" (
> -    echo TARGET_ARCH = IA32 X64                              >> Conf\target.txt.tmp
> -)
> -echo TARGET          = %TARGET%                              >> Conf\target.txt.tmp
> -echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                      >>
> Conf\target.txt.tmp
> -echo ACTIVE_PLATFORM = %ActivePlatform%                      >>
> Conf\target.txt.tmp
> -echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads%          >>
> Conf\target.txt.tmp
> -
> -move /Y Conf\target.txt.tmp Conf\target.txt >nul
> -echo *_VS2008x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> -echo *_VS2010x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> -echo *_VS2012x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> -echo *_VS2013x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> -echo *_VS2015x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> -
> -echo.
> -echo Invoking normal EDK2 build...
> -build %Build_Flags%
> -if ErrorLevel 1 goto BldFail
> -
> -set WORKSPACE=%SaveWorkSpace%
> -
> -
> ::*********************************************************
> *************
> -:: Post Build processing and cleanup
> -
> ::*********************************************************
> *************
> -echo Create FlashMap.h...
> -
> -set PLAT_INIT_PRE_MEM=PlatformPreMemPei
> -
> -set
> AutoGenPath=%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\Platfor
> mSettings\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_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_ENABLED)
> -:: 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\PlatformSetupDx
> e\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\HiiDefaultData.txt -
> o %BUILD_PATH%\FV\Bxt%Arch%.fd  -g B73FE497-B92E-416e-8326-
> 45AD0D270091 -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%"=="R" set BUILD_TYPE=R
> -
> -echo Copy BIOS...
> -set
> BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VE
> RSION_MAJOR%_%VERSION_MINOR%
> -copy
> /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM
>  >nul
> -copy
> /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map
> >nul
> -
> -set Storage_Folder=%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%" == "TRUE" (
> -::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =
> $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) +
> $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
> -
> pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi
> nPkg\FspBin
> -    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
> ApolloLakeFsp.fd -o .\ -n FSP.Fv
> -    popd
> -    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
> -    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
> -    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\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_PcdFlashBaseAddress
> -::        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
> -
> ::=========================================================
> ==================================
> -  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase
> "%STITCH_PATH%\FlashMap.h"
> -  call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress   BaseAddress
> "%STITCH_PATH%\FlashMap.h"
> -  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize
> "%STITCH_PATH%\FlashMap.h"
> -:: Find image offset as opposed to memory offset
> -  PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd
> -  set /p VpdOffset=<temp.pcd
> -  del /f /q temp.pcd
> -:: Force the variables we care about into DEC string format
> -  set VpdSize=%NvStorageSize%
> -  call :ForceToDec VpdOffset
> -  call :ForceToDec VpdSize
> -:: Dump what we found
> -  echo - NvStorageBase = %NvStorageBase%
> -  echo - BaseAddress   = %BaseAddress%
> -  echo - NvStorageSize = %NvStorageSize%
> -  echo - VpdOffset     = %VpdOffset%
> -  echo - VpdSize       = %VpdSize%
> -
> -:: Create NvStorage.fv
> -  echo Create NvStorage.fv...
> -  pushd %STITCH_PATH%
> -    REM This -s offset must equal the decimal value of
> FLASH_REGION_VPD_OFFSET  in the Platform.fdf
> -    Split.exe -f %STITCH_PATH%\%BIOS_Name%.ROM -s %VpdOffset% -o
> temp1.bin -t temp2.bin
> -    REM This -s offset must equal the decimal value of
> -    REM  FLASH_REGION_VPD_SIZE +
> FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE +
> FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE
> -    Split.exe -f temp2.bin -s %VpdSize% -o %Storage_Folder%\NvStorage.Fv -
> t temp3.bin
> -    del /F/Q temp1.bin temp2.bin temp3.bin
> -  popd
> -
> -echo.
> -echo Build location:     %BUILD_PATH%
> -echo BIOS ROM Created:   %BIOS_Name%
> -echo.
> -echo --------------- The EDKII BIOS build has successfully completed. -----------
> ----
> -echo.
> -goto Exit
> -
> -::
> -:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2) as a
> HEX string
> -::
> -:: USAGE: call :FindPcdInFile PCD Variable File
> -:FindPcdInFile
> -  call :GetPcd "%~1" "%~2" "%~3"
> -  call :ForceToHex "%~2"
> -goto :EOF
> -
> -::
> -:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2)
> -::
> -:: USAGE: call :GetPcd PCD Variable File
> -:GetPcd
> -  set _TargetFile=%~3
> -  if not exist "%_TargetFile%" (
> -    echo ERROR: Couldn't find %_TargetFile%^!
> -    set ExitCode=1
> -  ) else (
> -    for /f "tokens=3" %%a in ('findstr /C:"%~1" "%_TargetFile%"') do (
> -      set _TestValue=%%~a
> -      set _PcdValue=!_TestValue:~0,-1!
> -    )
> -    set %~2=!_PcdValue!
> -	echo %2 %_PcdValue%
> -  )
> -  set _TargetFile=
> -  set _TestValue=
> -  set _PcdValue=
> -goto :EOF
> -
> -::
> -:: Force value of %1 into hex format 0x1234
> -::
> -:: USAGE: call :ForceToHex Variable
> -:ForceToHex
> -  call set _Temp=%%%~1%%
> -  if "%_Temp:~0,2%" == "0x" goto :ForceToHexExit
> -  PowerShell ('0x' + [convert]::tostring($env:_Temp, 16).ToUpper()) >
> temp.pcd
> -  set /p %~1=<temp.pcd
> -  del /f /q temp.pcd
> -:ForceToHexExit
> -  set _Temp=
> -goto :EOF
> -
> -::
> -:: Force value of %1 into decimal format
> -::
> -:: USAGE: call :ForceToDec Variable
> -:ForceToDec
> -  call set _Temp=%%%~1%%
> -  if not "%_Temp:~0,2%" == "0x" goto :ForceToDecExit
> -  PowerShell ([convert]::toInt64((Get-Item env:_Temp).value, 16)) >
> temp.pcd
> -  set /p %~1=<temp.pcd
> -  del /f /q temp.pcd
> -:ForceToDecExit
> -  set _Temp=
> -goto :EOF
> -
> -:Usage
> -echo.
> -echo
> **********************************************************
> *****************
> -echo Build BIOS Rom for BXT platforms.
> -echo.
> -echo Usage: BuildBios.bat [options] ^<PlatformType^> ^<BuildTarget^>
> -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=1
> -goto Exit
> -
> -:BldFail
> -set exitCode=1
> -echo  -- Error:  EDKII BIOS Build has failed!
> -echo See EDK2.log for more details
> -
> -:Exit
> -echo %date%  %time%
> -(
> -  EndLocal
> -  set BiosVersion=%BiosVersion%
> -  exit /b %ExitCode%
> -)
> diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh
> b/Platform/BroxtonPlatformPkg/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.<BR>
> -# This program and the accompanying materials
> -# are licensed and made available under the terms and conditions of the
> BSD License
> -# which accompanies this distribution.  The full text of the license may be
> found at
> -# http://opensource.org/licenses/bsd-license.php
> -#
> -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> -#
> -
> -
> ##********************************************************
> **************
> -## Function define
> -
> ##********************************************************
> **************
> -function ErrorExit() {
> -  echo
> -  echo "Press any key......"
> -  read
> -  exit 0
> -}
> -
> -echo -e $(date)
> -
> ##********************************************************
> **************
> -## Initial Setup
> -
> ##********************************************************
> **************
> -
> -Build_Flags=
> -SV_String=_
> -exitCode=0
> -Arch=X64
> -FabId=B
> -BoardId=MN
> -
> -## Initialize all the build flags to FALSE
> -## depending on the cmd line input, some will be set to TRUE prior to
> building
> -ENBDT_PF_BUILD=FALSE
> -TABLET_PF_BUILD=FALSE
> -BYTI_PF_BUILD=FALSE
> -CSLE_ENABLE=FALSE
> -VP_BIOS_ENABLE=FALSE
> -SV_BIOS_ENABLE=FALSE
> -PPV_BIOS_ENABLE=FALSE
> -RVVP_BIOS_ENABLE=FALSE
> -RVV_BIOS_ENABLE=FALSE
> -SrcDebug=FALSE
> -
> -## 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_rule.txt
> -
> -
> -
> -
> -TOOL_CHAIN_TAG=GCC5
> -
> -## Define platform specific environment variables.
> -PLATFORM_NAME=BroxtonPlatformPkg
> -PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
> -EFI_SOURCE=$WORKSPACE
> -EDK_SOURCE=$WORKSPACE
> -
> -
> ##********************************************************
> **************
> -## Parse command line arguments
> -
> ##********************************************************
> **************
> -
> -## Optional arguments
> -for (( i=1; i<=$#; ))
> -  do
> -    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
> -      Arch=X64
> -      shift
> -    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> -      BoardId=BG
> -      shift
> -    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
> -      FabId=B
> -      shift
> -    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
> -      FabId=A
> -      shift
> -    else
> -      break
> -    fi
> -  done
> -
> -## Required argument(s)
> -if [ "$2" == "" ]; then
> -  echo
> -  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
> and stage in Conf/
> -cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env
> $WORKSPACE/Conf/BiosId.env
> -sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
> -sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
> -sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
> -
> -if [ $BoardId == "MN" ]; then
> -  BOARD_ID=MNW3
> -  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
> -else
> -  BOARD_ID=BEN1
> -  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
> -fi
> -ENBDT_PF_BUILD=TRUE
> -PLATFORM_NAME=BroxtonPlatformPkg
> -PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
> -Platform_Type=$1
> -
> -## Create new DefineAtBuildMacros.dsc file
> -
> Build_Macros=$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      = $ENBDT_PF_BUILD   >> $Build_Macros
> -echo DEFINE TABLET_PF_BUILD     = $TABLET_PF_BUILD  >> $Build_Macros
> -echo DEFINE BYTI_PF_BUILD       = $BYTI_PF_BUILD    >> $Build_Macros
> -echo DEFINE CSLE_ENABLE         = $CSLE_ENABLE      >> $Build_Macros
> -echo DEFINE VP_BIOS_ENABLE      = $VP_BIOS_ENABLE   >> $Build_Macros
> -echo DEFINE SV_BIOS_ENABLE      = $SV_BIOS_ENABLE   >> $Build_Macros
> -echo DEFINE PPV_BIOS_ENABLE     = $PPV_BIOS_ENABLE  >> $Build_Macros
> -echo DEFINE RVVP_BIOS_ENABLE    = $RVVP_BIOS_ENABLE >>
> $Build_Macros
> -echo DEFINE RVV_BIOS_ENABLE     = $RVV_BIOS_ENABLE  >> $Build_Macros
> -
> -if [ $Arch == "IA32" ]; then
> -  echo DEFINE X64_CONFIG = FALSE      >> $Build_Macros
> -else
> -  echo DEFINE X64_CONFIG = TRUE       >> $Build_Macros
> -fi
> -
> -if [ "$(echo $2 | tr 'a-z' 'A-Z')" == "RELEASE" ]; then
> -  TARGET=RELEASE
> -  BUILD_TYPE=R
> -  echo BUILD_TYPE = R >> $WORKSPACE/Conf/BiosId.env
> -else
> -  TARGET=DEBUG
> -  BUILD_TYPE=D
> -  echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
> -fi
> -
> -if [ $BoardId == "BG" ]; then
> -  BOARD_REV=A
> -  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
> -fi
> -
> -if [ $BoardId == "MN" ]; then
> -  if [ $FabId == "B" ]; then
> -    BOARD_REV=B
> -    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
> -  else
> -    BOARD_REV=A
> -    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
> -  fi
> -fi
> -
> -
> -
> ##********************************************************
> **************
> -## Additional EDK Build Setup/Configuration
> -
> ##********************************************************
> **************
> -echo "Ensuring correct build directory is present for GenBiosId..."
> -ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc
> -#TOOL_CHAIN_TAG=GCC47
> -MAX_CONCURRENT_THREAD_NUMBER=1
> -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 = $ACTIVE_PLATFORM                           >>
> Conf/target.txt
> -echo TARGET          = $TARGET                                    >> Conf/target.txt
> -echo TOOL_CHAIN_TAG  = $TOOL_CHAIN_TAG                            >>
> Conf/target.txt
> -echo MAX_CONCURRENT_THREAD_NUMBER =
> $MAX_CONCURRENT_THREAD_NUMBER >> Conf/target.txt
> -if [ $Arch == "IA32" ]; then
> -  echo TARGET_ARCH   = IA32                                       >> Conf/target.txt
> -else
> -  echo TARGET_ARCH   = IA32 X64                                   >> Conf/target.txt
> -fi
> -
> -###
> -### Update ASL path for GCC47 & 46
> -###
> -
> -## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule
> -  echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG     = --add-gnu-
> debuglink=\$\(DEBUG_DIR\)/\$\(MODULE_NAME\).debug >>
> $WORKSPACE/Conf/tools_def.txt
> -###
> -
> -
> ##********************************************************
> **************
> -## Build BIOS
> -
> ##********************************************************
> **************
> -echo "Creating BiosId..."
> -BUILD_PATH=Build/$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/BiosId.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 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =
> $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) +
> $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_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
> ApolloLakeFsp.fd -o ./ -n FSP.Fv
> -popd
> -cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/FSP_T.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/FSP_M.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/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_ENABLED)
> -# 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/PlatformSetupDx
> e/VfrStrings.uni.
> -./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i
> $BUILD_PATH/FV/Temp.fd 0006 005C 0078 0030 0031 0030 0031 >
> $BUILD_PATH/FV/HiiDefaultData.txt
> -
> -## copy the Setup variable to the SetupDefault variable and save changes to
> 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 B73FE497-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
> environment variables
> -##find /v "#" Conf\BiosId.env > ver_strings
> -##for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
> -##del /f/q ver_strings >nul
> -##
> -VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f
> 3 | cut -c 1-4)
> -VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f
> 3 | cut -c 1-2)
> -
> BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_TY
> PE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
> -
> -cp -f $BUILD_PATH/FV/FVOBB.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f $BUILD_PATH/FV/FVOBBX.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f $BUILD_PATH/FV/FVIBBR.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f $BUILD_PATH/FV/FVIBBM.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -cp -f $BUILD_PATH/FV/FVIBBL.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -
> -if [ $BoardId == "BG" ]; then
> -  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -fi
> -
> -if [ $BoardId == "MN" ]; then
> -  if [ $FabId == "B" ]; then
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -  else
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> -    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/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
> SpiChunk3.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/BroxtonPlatformPkg/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=%CD%
> +if %WORKSPACE:~-1%==\ (
> +  set WORKSPACE=%WORKSPACE:~0,-1%
> +)
> +set CORE_PATH=%WORKSPACE%\Core
> +set PLATFORM_PATH=Platform\BroxtonPlatformPkg
> +set SILICON_PATH=Silicon\BroxtonSoC
> +set
> AslPath=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Iasl\iasl.exe
> +set
> PACKAGES_PATH=%CORE_PATH%;%WORKSPACE%\Silicon\;%WORKSPACE%
> \Platform;%WORKSPACE%\%PLATFORM_PATH%;%WORKSPACE%\%SILICON
> _PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common ;
> +set EDK_TOOLS_BIN=%WORKSPACE%\BaseTools\Bin\Win32
> +set /a build_threads=1
> +set "Nasm_Flags=-D ARCH_IA32 -D DEBUG_PORT80"
> +set "Build_Flags= "
> +set exitCode=0
> +set Arch=X64
> +set Compiler=VS2013
> +set FabId=B
> +set BoardId=MN
> +if not defined BiosVersion set BiosVersion=DEV
> +
> +
> +:: 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\FrameworkDatabase.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_def.txt, build_rule.txt in WorkSpace\Conf
> +:: Also run edksetup as soon as possible to avoid it from changing
> environment variables we're overriding
> +set "VCINSTALLDIR="
> +set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
> +call edksetup.bat
> +@echo off
> +
> +set Minnow_RVP=MINN
> +
> +:: Initialize all the build flags to FALSE
> +:: Then based on the cmd line input, some will be set to TRUE prior to
> building.
> +:: Note: These variable names match the actual Build Macro names in DSC
> for clarity.
> +set ENBDT_PF_BUILD=FALSE
> +set SrcDebug=FALSE
> +set APLK_SETUP_ENABLE_BUILD=FALSE
> +set FSP_BUILD=FALSE
> +set FSP_WRAPPER=FALSE
> +
> +:: Set Defaults of platform specific environment variables.
> +set EFI_SOURCE=%CD%
> +set EDK_SOURCE=%CD%
> +set PLATFORM_NAME=BxtPlatformPkg
> +set PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
> +set PLATFORM_RC_PACKAGE=Silicon\BroxtonSoC\BroxtonSiPkg
> +set
> COMMON_PLATFORM_PACKAGE=%PLATFORM_PATH%\BxtPlatformPkg
> +set FSP_BIN_PKG_NAME=BroxtonFspBinPkg
> +set
> STITCH_PATH=%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch
> +
> +PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Ge
> nBiosId;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
> +PATH=%PATH%;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\FC
> E;%WORKSPACE%\%PLATFORM_PATH%\Common\Tools\nasm\Win32
> +
> +::********************************************************
> **************
> +:: Parse command line arguments
> +::********************************************************
> **************
> +
> +:: Optional arguments
> +:OptLoop
> +if /i "%~1"=="" goto Usage
> +if /i "%~1"=="/?" goto Usage
> +
> +if /i "%~1"=="/l" (
> +    set Build_Flags=%Build_Flags% -j EDK2.log
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1" == "/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"=="/ia32" (
> +    set Arch=IA32
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/x64" (
> +    set Arch=X64
> +    shift
> +    goto OptLoop
> +)
> +
> +if /i "%~1"=="/vs08" (
> +    set Compiler=VS2008
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/vs10" (
> +    set Compiler=VS2010
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/vs12" (
> +    set Compiler=VS2012
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/vs13" (
> +    set Compiler=VS2013
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/vs15" (
> +    set Compiler=VS2015
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/FspW" (
> +    set FSP_WRAPPER=TRUE
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/A" (
> +    set FabId=A
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/B" (
> +    set FabId=B
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/MN" (
> +    set BoardId=MN
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +if /i "%~1"=="/BG" (
> +    set BoardId=BG
> +    echo.
> +    shift
> +    goto OptLoop
> +)
> +
> +if /i "%~1"=="/m" (
> +    if defined NUMBER_OF_PROCESSORS (
> +        set /a build_threads=%NUMBER_OF_PROCESSORS%
> +    )
> +    shift
> +    goto OptLoop
> +)
> +
> +:: Required argument(s)
> +if "%~2"=="" (
> +   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" == "%Minnow_RVP%" (
> +  if %BoardId%==MN (
> +    set BOARD_ID=MINNOW3
> +  ) else if %BoardId%==BG (
> +    set BOARD_ID=BENSONV
> +  )
> +    set ENBDT_PF_BUILD=TRUE
> +    set PLATFORM_NAME=BroxtonPlatformPkg
> +    set PLATFORM_PACKAGE=%PLATFORM_PATH%
> +    set APLK_SETUP_ENABLE_BUILD=TRUE
> +) else (
> +    echo. & echo Error - Unsupported PlatformType: %1
> +    echo Please review the Help screen "/?" & echo.
> +    goto ExitFail
> +)
> +set Platform_Type=%~1
> +
> +::
> +:: Tack on BIOS Version
> +::
> +
> +::********************************************************
> **************
> +:: Additional EDK Build Setup/Configuration
> +::********************************************************
> **************
> +
> +::Setup DefineAtBuildMacros config file
> +set Build_Macros=.\%PLATFORM_PACKAGE%\DefineAtBuildMacros.dsc
> +copy /y nul %Build_Macros% >nul
> +
> +::output platform specific build macros to DefineAtBuildMacros.dsc
> +echo DEFINE ENBDT_PF_BUILD
> = %ENBDT_PF_BUILD%          >> %Build_Macros%
> +
> +echo DEFINE APLK_SETUP_ENABLE_BUILD
> = %APLK_SETUP_ENABLE_BUILD% >> %Build_Macros%
> +
> +if "%Arch%"=="IA32" (
> +    echo DEFINE X64_CONFIG              = FALSE                     >> %Build_Macros%
> +) else if "%Arch%"=="X64" (
> +    echo DEFINE X64_CONFIG              = TRUE                      >> %Build_Macros%
> +)
> +
> +::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target
> values removed
> +
> +if "%Arch%"=="X64" (
> +    findstr /b /v "BOARD_ID BUILD_TYPE
> BOARD_REV" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> +) else if "%Arch%"=="IA32" (
> +    findstr /b /v "BOARD_ID BUILD_TYPE BOARD_REV
> BOARD_EXT" %PLATFORM_PACKAGE%\BiosId.env > Conf\BiosId.env
> +    echo BOARD_EXT = I32 >> Conf\BiosId.env
> +)
> +
> +if /i "%~2" == "RELEASE" (
> +    set target=RELEASE
> +    echo BUILD_TYPE = R >> Conf\BiosId.env
> +) else (
> +    set target=DEBUG
> +    echo BUILD_TYPE = D >> Conf\BiosId.env
> +)
> +
> +if %BoardId%==BG (
> +  echo BOARD_REV = A >> Conf\BiosId.env
> +)
> +
> +if %BoardId%==MN (
> +  if %FabId%==B (
> +    echo BOARD_REV = B >> Conf\BiosId.env
> +  ) else (
> +    echo BOARD_REV = A >> Conf\BiosId.env
> +  )
> +)
> +
> +:: Set the Build_Type, Version_Major, and Version_Minor environment
> variables
> +find /v "#" Conf\BiosId.env > ver_strings
> +for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
> +del /f/q ver_strings >nul
> +:: Do this after parsing "ver_strings"
> +echo BOARD_ID = %BOARD_ID% >> Conf\BiosId.env
> +
> +echo.
> +echo Setting the Build environment for Visual Studio...
> +if "%Compiler%"=="VS2008" (
> +  if defined VS90COMNTOOLS (
> +     call "%VS90COMNTOOLS%\vsvars32.bat" >nul
> +     if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio
> 9.0\Common7\Tools\" (
> +      set TOOL_CHAIN_TAG=VS2008
> +     ) else  set TOOL_CHAIN_TAG=VS2008x86
> +  ) else (
> +    echo  --ERROR: VS2008 not installed correctly. VS90COMNTOOLS not
> defined ^^!
> +    goto BldFail
> +  )
> +) else if "%Compiler%"=="VS2010" (
> +  if defined VS100COMNTOOLS (
> +     call "%VS100COMNTOOLS%\vsvars32.bat" >nul
> +     if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual
> Studio 10.0\Common7\Tools\" (
> +        set TOOL_CHAIN_TAG=VS2010
> +     ) else  set TOOL_CHAIN_TAG=VS2010x86
> +  ) else (
> +     echo  --ERROR: VS2010 not installed correctly. VS100COMNTOOLS not
> defined ^^!
> +     goto BldFail
> +  )
> +) else if "%Compiler%"=="VS2012" (
> +  if defined VS110COMNTOOLS (
> +     call "%VS110COMNTOOLS%\vsvars32.bat" >nul
> +     if /I "%VS110COMNTOOLS%" == "C:\Program Files\Microsoft Visual
> Studio 11.0\Common7\Tools\" (
> +        set TOOL_CHAIN_TAG=VS2012
> +     ) else  set TOOL_CHAIN_TAG=VS2012x86
> +  ) else (
> +     echo  --ERROR: VS2012 not installed correctly. VS110COMNTOOLS not
> defined ^^!
> +     goto BldFail
> +  )
> +) else if "%Compiler%"=="VS2013" (
> +  if defined VS120COMNTOOLS (
> +     call "%VS120COMNTOOLS%\vsvars32.bat" >nul
> +     if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual
> Studio 12.0\Common7\Tools\" (
> +        set TOOL_CHAIN_TAG=VS2013
> +     ) else  set TOOL_CHAIN_TAG=VS2013x86
> +  ) else (
> +     echo  --ERROR: VS2013 not installed correctly. VS120COMNTOOLS not
> defined ^^!
> +     echo           See help ^(/?^) for how specify a different VS version.
> +     goto BldFail
> +  )
> +) else if "%Compiler%"=="VS2015" (
> +  if defined VS140COMNTOOLS (
> +     call "%VS140COMNTOOLS%\vsvars32.bat" >nul
> +     if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual
> Studio 14.0\Common7\Tools\" (
> +        set TOOL_CHAIN_TAG=VS2015
> +     ) else  set TOOL_CHAIN_TAG=VS2015x86
> +
> +  ) else (
> +     echo  --ERROR: VS2015 not installed correctly. VS140COMNTOOLS not
> defined ^^!
> +     echo           See help ^(/?^) for how specify a different VS version.
> +     goto BldFail
> +  )
> +)
> +
> +::********************************************************
> **************
> +:: Build BIOS
> +::********************************************************
> **************
> +
> +echo Setup build directory for GenBiosId...
> +set
> BUILD_PATH=Build\%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%"=="X64" (
> +   if not exist %BUILD_PATH%\X64  mkdir %BUILD_PATH%\X64
> +   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob
> Conf\BiosId.bat
> +) else if "%Arch%"=="IA32" (
> +   if not exist %BUILD_PATH%\IA32  mkdir %BUILD_PATH%\IA32
> +   GenBiosId.exe -i Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob
> Conf\BiosId.bat
> +)
> +
> +if ErrorLevel 1 goto BldFail
> +
> +echo Building ResetVector...
> +
> +set
> ResetVectorPath=%WORKSPACE%\%PLATFORM_RC_PACKAGE%\Cpu\Reset
> Vector
> +
> +pushd %ResetVectorPath%\Vtf0
> +  nasm.exe %Nasm_Flags% -o Bin\ResetVector.ia32.port80.raw
> ResetVectorCode.asm
> +
> python %CORE_PATH%\UefiCpuPkg\ResetVector\Vtf0\Tools\FixupForRawS
> ection.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\FixupForRawS
> ection.py Bin\ResetVector.ia32.port80.raw
> +popd
> +
> +:: SaveWorkSpace w/a is needed when using subst for Workspace builds (eg.
> R:/)
> +set SaveWorkSpace=%WORKSPACE%
> +set WORKSPACE=%CD%
> +if "%Arch%"=="X64" (
> +set ActivePlatform=%PLATFORM_PACKAGE%\PlatformPkgX64.dsc
> +) else if "%Arch%"=="IA32" (
> +set ActivePlatform=%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_CONCURRENT_THREAD_NUMBER" Conf\target.txt >
> Conf\target.txt.tmp
> +
> +if "%Arch%"=="IA32" (
> +    echo TARGET_ARCH = IA32                                  >> Conf\target.txt.tmp
> +) else if "%Arch%"=="X64" (
> +    echo TARGET_ARCH = IA32 X64                              >> Conf\target.txt.tmp
> +)
> +echo TARGET          = %TARGET%                              >> Conf\target.txt.tmp
> +echo TOOL_CHAIN_TAG  = %TOOL_CHAIN_TAG%                      >>
> Conf\target.txt.tmp
> +echo ACTIVE_PLATFORM = %ActivePlatform%                      >>
> Conf\target.txt.tmp
> +echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads%          >>
> Conf\target.txt.tmp
> +
> +move /Y Conf\target.txt.tmp Conf\target.txt >nul
> +echo *_VS2008x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> +echo *_VS2010x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> +echo *_VS2012x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> +echo *_VS2013x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> +echo *_VS2015x86_*_ASL_PATH = %AslPath% >> Conf\tools_def.txt
> +
> +echo.
> +echo Invoking normal EDK2 build...
> +build %Build_Flags%
> +if ErrorLevel 1 goto BldFail
> +
> +set WORKSPACE=%SaveWorkSpace%
> +
> +::********************************************************
> **************
> +:: Post Build processing and cleanup
> +::********************************************************
> **************
> +echo Create FlashMap.h...
> +
> +set PLAT_INIT_PRE_MEM=PlatformPreMemPei
> +
> +set
> AutoGenPath=%BUILD_PATH%\IA32\BroxtonPlatformPkg\Common\Platfor
> mSettings\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_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_ENABLED)
> +:: 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\PlatformSetupDx
> e\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\HiiDefaultData.txt -
> o %BUILD_PATH%\FV\Bxt%Arch%.fd  -g B73FE497-B92E-416e-8326-
> 45AD0D270091 -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%"=="R" set BUILD_TYPE=R
> +
> +echo Copy BIOS...
> +set
> BIOS_Name=%BOARD_ID%%BOARD_REV%_%Arch%_%BUILD_TYPE%_%VE
> RSION_MAJOR%_%VERSION_MINOR%
> +copy
> /y/b %BUILD_PATH%\FV\Soc.fd          %STITCH_PATH%\%BIOS_Name%.ROM
>  >nul
> +copy
> /y   %STITCH_PATH%\FlashMap.h        %STITCH_PATH%\%BIOS_Name%.map
> >nul
> +
> +set Storage_Folder=%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%" == "TRUE" (
> +::  0xFEF7A000 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =
> $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) +
> $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_DATA_SIZE) + $(BLD_IBBM_SIZE)
> +
> pushd  %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBi
> nPkg\FspBin
> +    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
> ApolloLakeFsp.fd -o .\ -n FSP.Fv
> +    popd
> +    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\FspBin\FSP_T.Fv %Storage_Folder%\FSP_T.Fv
> +    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\FspBin\FSP_M.Fv %Storage_Folder%\FSP_M.Fv
> +    copy
> /y/b %WORKSPACE%\Silicon\BroxtonSoC\BroxtonFspPkg\ApolloLakeFspBin
> Pkg\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_PcdFlashBaseAddress
> +::        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
> +::========================================================
> ===================================
> +  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageBase NvStorageBase
> "%STITCH_PATH%\FlashMap.h"
> +  call :FindPcdInFile _PCD_VALUE_PcdFlashBaseAddress   BaseAddress
> "%STITCH_PATH%\FlashMap.h"
> +  call :FindPcdInFile _PCD_VALUE_PcdFlashNvStorageSize NvStorageSize
> "%STITCH_PATH%\FlashMap.h"
> +:: Find image offset as opposed to memory offset
> +  PowerShell ($env:NvStorageBase - $env:BaseAddress) > temp.pcd
> +  set /p VpdOffset=<temp.pcd
> +  del /f /q temp.pcd
> +:: Force the variables we care about into DEC string format
> +  set VpdSize=%NvStorageSize%
> +  call :ForceToDec VpdOffset
> +  call :ForceToDec VpdSize
> +:: Dump what we found
> +  echo - NvStorageBase = %NvStorageBase%
> +  echo - BaseAddress   = %BaseAddress%
> +  echo - NvStorageSize = %NvStorageSize%
> +  echo - VpdOffset     = %VpdOffset%
> +  echo - VpdSize       = %VpdSize%
> +
> +:: Create NvStorage.fv
> +  echo Create NvStorage.fv...
> +  pushd %STITCH_PATH%
> +    REM This -s offset must equal the decimal value of
> FLASH_REGION_VPD_OFFSET  in the Platform.fdf
> +    Split.exe -f %STITCH_PATH%\%BIOS_Name%.ROM -s %VpdOffset% -o
> temp1.bin -t temp2.bin
> +    REM This -s offset must equal the decimal value of
> +    REM  FLASH_REGION_VPD_SIZE +
> FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_SIZE +
> FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_SIZE
> +    Split.exe -f temp2.bin -s %VpdSize% -o %Storage_Folder%\NvStorage.Fv
> -t temp3.bin
> +    del /F/Q temp1.bin temp2.bin temp3.bin
> +  popd
> +
> +echo.
> +echo Build location:     %BUILD_PATH%
> +echo BIOS ROM Created:   %BIOS_Name%
> +echo.
> +echo --------------- The EDKII BIOS build has successfully completed. ----------
> -----
> +echo.
> +goto Exit
> +
> +::
> +:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2) as a
> HEX string
> +::
> +:: USAGE: call :FindPcdInFile PCD Variable File
> +:FindPcdInFile
> +  call :GetPcd "%~1" "%~2" "%~3"
> +  call :ForceToHex "%~2"
> +goto :EOF
> +
> +::
> +:: Find PCD value (%~1) in a file (%~3) and return it in a variable (%~2)
> +::
> +:: USAGE: call :GetPcd PCD Variable File
> +:GetPcd
> +  set _TargetFile=%~3
> +  if not exist "%_TargetFile%" (
> +    echo ERROR: Couldn't find %_TargetFile%^!
> +    set ExitCode=1
> +  ) else (
> +    for /f "tokens=3" %%a in ('findstr /C:"%~1" "%_TargetFile%"') do (
> +      set _TestValue=%%~a
> +      set _PcdValue=!_TestValue:~0,-1!
> +    )
> +    set %~2=!_PcdValue!
> +	echo %2 %_PcdValue%
> +  )
> +  set _TargetFile=
> +  set _TestValue=
> +  set _PcdValue=
> +goto :EOF
> +
> +::
> +:: Force value of %1 into hex format 0x1234
> +::
> +:: USAGE: call :ForceToHex Variable
> +:ForceToHex
> +  call set _Temp=%%%~1%%
> +  if "%_Temp:~0,2%" == "0x" goto :ForceToHexExit
> +  PowerShell ('0x' + [convert]::tostring($env:_Temp, 16).ToUpper()) >
> temp.pcd
> +  set /p %~1=<temp.pcd
> +  del /f /q temp.pcd
> +:ForceToHexExit
> +  set _Temp=
> +goto :EOF
> +
> +::
> +:: Force value of %1 into decimal format
> +::
> +:: USAGE: call :ForceToDec Variable
> +:ForceToDec
> +  call set _Temp=%%%~1%%
> +  if not "%_Temp:~0,2%" == "0x" goto :ForceToDecExit
> +  PowerShell ([convert]::toInt64((Get-Item env:_Temp).value, 16)) >
> temp.pcd
> +  set /p %~1=<temp.pcd
> +  del /f /q temp.pcd
> +:ForceToDecExit
> +  set _Temp=
> +goto :EOF
> +
> +:Usage
> +echo.
> +echo
> **********************************************************
> *****************
> +echo Build Edk II BIOS Rom for BXT platforms.
> +echo.
> +echo Usage: %0 [options] ^<PlatformType^> ^<BuildTarget^>
> +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=1
> +goto Exit
> +
> +:BldFail
> +set exitCode=1
> +echo  -- Error:  EDKII BIOS Build has failed!
> +echo See EDK2.log for more details
> +
> +:Exit
> +echo %date%  %time%
> +(
> +  EndLocal
> +  set BiosVersion=%BiosVersion%
> +  exit /b %ExitCode%
> +)
> diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
> b/Platform/BroxtonPlatformPkg/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.<BR>
> +# This program and the accompanying materials
> +# are licensed and made available under the terms and conditions of the
> BSD License
> +# which accompanies this distribution.  The full text of the license may be
> found at
> +# http://opensource.org/licenses/bsd-license.php
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +#
> +
> +##*******************************************************
> ***************
> +## Function define
> +##*******************************************************
> ***************
> +function ErrorExit() {
> +  echo
> +  echo "Press any key......"
> +  read
> +  exit 0
> +}
> +
> +echo -e $(date)
> +##*******************************************************
> ***************
> +## Initial Setup
> +##*******************************************************
> ***************
> +
> +Build_Flags=
> +SV_String=_
> +exitCode=0
> +Arch=X64
> +FabId=B
> +BoardId=MN
> +
> +## Initialize all the build flags to FALSE
> +## depending on the cmd line input, some will be set to TRUE prior to
> building
> +ENBDT_PF_BUILD=FALSE
> +TABLET_PF_BUILD=FALSE
> +BYTI_PF_BUILD=FALSE
> +CSLE_ENABLE=FALSE
> +VP_BIOS_ENABLE=FALSE
> +SV_BIOS_ENABLE=FALSE
> +PPV_BIOS_ENABLE=FALSE
> +RVVP_BIOS_ENABLE=FALSE
> +RVV_BIOS_ENABLE=FALSE
> +SrcDebug=FALSE
> +
> +## 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_rule.txt
> +
> +
> +
> +
> +TOOL_CHAIN_TAG=GCC5
> +
> +## Define platform specific environment variables.
> +PLATFORM_NAME=BroxtonPlatformPkg
> +PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
> +EFI_SOURCE=$WORKSPACE
> +EDK_SOURCE=$WORKSPACE
> +
> +##*******************************************************
> ***************
> +## Parse command line arguments
> +##*******************************************************
> ***************
> +
> +## Optional arguments
> +for (( i=1; i<=$#; ))
> +  do
> +    if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
> +      Arch=X64
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
> +      BoardId=MN
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
> +      BoardId=BG
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
> +      FabId=B
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/A" ]; then
> +      FabId=A
> +      shift
> +    else
> +      break
> +    fi
> +  done
> +
> +## Required argument(s)
> +if [ "$2" == "" ]; then
> +  echo
> +  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
> and stage in Conf/
> +cp $WORKSPACE/$PLATFORM_PACKAGE/BiosId.env
> $WORKSPACE/Conf/BiosId.env
> +sed -i '/^BOARD_ID/d' $WORKSPACE/Conf/BiosId.env
> +sed -i '/^BOARD_REV/d' $WORKSPACE/Conf/BiosId.env
> +sed -i '/^BUILD_TYPE/d' $WORKSPACE/Conf/BiosId.env
> +
> +if [ $BoardId == "MN" ]; then
> +  BOARD_ID=MNW3
> +  echo BOARD_ID = MINNOW3 >> $WORKSPACE/Conf/BiosId.env
> +else
> +  BOARD_ID=BEN1
> +  echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
> +fi
> +ENBDT_PF_BUILD=TRUE
> +PLATFORM_NAME=BroxtonPlatformPkg
> +PLATFORM_PACKAGE=Platform/BroxtonPlatformPkg
> +Platform_Type=$1
> +
> +## Create new DefineAtBuildMacros.dsc file
> +Build_Macros=$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      = $ENBDT_PF_BUILD   >> $Build_Macros
> +echo DEFINE TABLET_PF_BUILD     = $TABLET_PF_BUILD  >> $Build_Macros
> +echo DEFINE BYTI_PF_BUILD       = $BYTI_PF_BUILD    >> $Build_Macros
> +echo DEFINE CSLE_ENABLE         = $CSLE_ENABLE      >> $Build_Macros
> +echo DEFINE VP_BIOS_ENABLE      = $VP_BIOS_ENABLE   >> $Build_Macros
> +echo DEFINE SV_BIOS_ENABLE      = $SV_BIOS_ENABLE   >> $Build_Macros
> +echo DEFINE PPV_BIOS_ENABLE     = $PPV_BIOS_ENABLE  >> $Build_Macros
> +echo DEFINE RVVP_BIOS_ENABLE    = $RVVP_BIOS_ENABLE >>
> $Build_Macros
> +echo DEFINE RVV_BIOS_ENABLE     = $RVV_BIOS_ENABLE  >>
> $Build_Macros
> +
> +if [ $Arch == "IA32" ]; then
> +  echo DEFINE X64_CONFIG = FALSE      >> $Build_Macros
> +else
> +  echo DEFINE X64_CONFIG = TRUE       >> $Build_Macros
> +fi
> +
> +if [ "$(echo $2 | tr 'a-z' 'A-Z')" == "RELEASE" ]; then
> +  TARGET=RELEASE
> +  BUILD_TYPE=R
> +  echo BUILD_TYPE = R >> $WORKSPACE/Conf/BiosId.env
> +else
> +  TARGET=DEBUG
> +  BUILD_TYPE=D
> +  echo BUILD_TYPE = D >> $WORKSPACE/Conf/BiosId.env
> +fi
> +
> +if [ $BoardId == "BG" ]; then
> +  BOARD_REV=A
> +  echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
> +fi
> +
> +if [ $BoardId == "MN" ]; then
> +  if [ $FabId == "B" ]; then
> +    BOARD_REV=B
> +    echo BOARD_REV = B >> $WORKSPACE/Conf/BiosId.env
> +  else
> +    BOARD_REV=A
> +    echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env
> +  fi
> +fi
> +
> +
> +##*******************************************************
> ***************
> +## Additional EDK Build Setup/Configuration
> +##*******************************************************
> ***************
> +echo "Ensuring correct build directory is present for GenBiosId..."
> +ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgX64Gcc.dsc
> +#TOOL_CHAIN_TAG=GCC47
> +MAX_CONCURRENT_THREAD_NUMBER=1
> +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 = $ACTIVE_PLATFORM                           >>
> Conf/target.txt
> +echo TARGET          = $TARGET                                    >> Conf/target.txt
> +echo TOOL_CHAIN_TAG  = $TOOL_CHAIN_TAG                            >>
> Conf/target.txt
> +echo MAX_CONCURRENT_THREAD_NUMBER =
> $MAX_CONCURRENT_THREAD_NUMBER >> Conf/target.txt
> +if [ $Arch == "IA32" ]; then
> +  echo TARGET_ARCH   = IA32                                       >> Conf/target.txt
> +else
> +  echo TARGET_ARCH   = IA32 X64                                   >> Conf/target.txt
> +fi
> +
> +###
> +### Update ASL path for GCC47 & 46
> +###
> +
> +## Fix error due to '\' in OBJCOPY_ADDDEBUGFLAG GCC Common rule
> +  echo DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG     = --add-gnu-
> debuglink=\$\(DEBUG_DIR\)/\$\(MODULE_NAME\).debug >>
> $WORKSPACE/Conf/tools_def.txt
> +###
> +
> +##*******************************************************
> ***************
> +## Build BIOS
> +##*******************************************************
> ***************
> +echo "Creating BiosId..."
> +BUILD_PATH=Build/$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/BiosId.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 = gIntelFsp2WrapperTokenSpaceGuid.PcdFlashFvFspBase =
> $(CAR_BASE_ADDRESS) + $(BLD_RAM_DATA_SIZE) +
> $(FSP_RAM_DATA_SIZE) + $(FSP_EMP_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
> ApolloLakeFsp.fd -o ./ -n FSP.Fv
> +popd
> +cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/FSP_T.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/FSP_M.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f
> $WORKSPACE/Silicon/BroxtonSoC/BroxtonFspPkg/ApolloLakeFspBinPkg/Fsp
> Bin/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_ENABLED)
> +# 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/PlatformSetupDx
> e/VfrStrings.uni.
> +./$PLATFORM_PACKAGE/Common/Tools/FCE/FCE read -i
> $BUILD_PATH/FV/Temp.fd 0006 005C 0078 0030 0031 0030 0031 >
> $BUILD_PATH/FV/HiiDefaultData.txt
> +
> +## copy the Setup variable to the SetupDefault variable and save changes
> to 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 B73FE497-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
> environment variables
> +##find /v "#" Conf\BiosId.env > ver_strings
> +##for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
> +##del /f/q ver_strings >nul
> +##
> +VERSION_MAJOR=$(grep '^VERSION_MAJOR' Conf/BiosId.env | cut -d ' ' -f
> 3 | cut -c 1-4)
> +VERSION_MINOR=$(grep '^VERSION_MINOR' Conf/BiosId.env | cut -d ' ' -f
> 3 | cut -c 1-2)
> +BIOS_Name="$BOARD_ID""$BOARD_REV""$SV_String""$Arch"_"$BUILD_T
> YPE"_"$VERSION_MAJOR"_"$VERSION_MINOR"
> +
> +cp -f $BUILD_PATH/FV/FVOBB.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f $BUILD_PATH/FV/FVOBBX.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f $BUILD_PATH/FV/FVIBBR.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f $BUILD_PATH/FV/FVIBBM.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +cp -f $BUILD_PATH/FV/FVIBBL.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +
> +if [ $BoardId == "BG" ]; then
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Benso
> nGlacier/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +fi
> +
> +if [ $BoardId == "MN" ]; then
> +  if [ $FabId == "B" ]; then
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_B/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  else
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/Minno
> wBoard3/FAB_A/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/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
> SpiChunk3.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/BroxtonPlatformPkg/BuildIFWI.bat
> index 5042580..04d338d 100644
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> @@ -2,6 +2,7 @@
>  SetLocal EnableDelayedExpansion EnableExtensions
> 
>  :: Assign initial values
> +set thisscript=%0
>  set exitCode=0
>  set "Build_Flags= "
>  set Arch=X64
> @@ -116,7 +117,7 @@ if /i "%~1"=="/m" (
>  :: Require 2 input parameters
>  if "%~2"=="" (
>     echo. & echo -- ERROR: Not Enough Arguments Provided
> -   echo -- Please review the Help screen "/?" -- & echo.
> +   echo -- Please review the Help screen %thisscript% "/?" -- & echo.
>     goto exit
>  )
> 
> @@ -129,8 +130,8 @@ echo
> ==========================================================
> =================
>  echo Build_IFWI:  Calling BIOS build Script...
>  echo.
> 
> -echo - call
> BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Targe
> t%
> -
> call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Bu
> ild_Flags% %Platform_Type% %Build_Target%
> +echo - call
> BuildBxtBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Ta
> rget%
> +call %WORKSPACE%\%PLATFORM_PATH%\BuildBxtBios.bat %buildthread%
>  %Build_Flags% %Platform_Type% %Build_Target%
>  if ErrorLevel 1 (
>      echo echo  -- Error Building BIOS  & echo.
>      set exitCode=1
> @@ -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
> ==========================================================
> ============
> 
> 
> @@ -180,11 +181,12 @@ goto Exit
>  if /i "%SkipUsageFlag%" == "TRUE" goto Exit
>  echo Script to build BIOS firmware and stitch the entire IFWI.
>  echo.
> -echo Usage: BuildIFWI.bat [options] ^<PlatformType^> ^<BuildTarget^>
> +echo Usage: %thisscript% [options] ^<PlatformType^> ^<BuildTarget^>
>  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/BroxtonPlatformPkg/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  "
> -  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 "
> +  echo "       Build_Target:                Release, Debug "
>    echo
>    echo "Press any key......"
>    read
> @@ -56,6 +58,10 @@ for (( i=1; i<=$#; ))
>        Arch=X64
>        Build_Flags="$Build_Flags /x64"
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
> +      BoardId=MN
> +      Build_Flags="$Build_Flags /MN"
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
>        BoardId=BG
>        Build_Flags="$Build_Flags /BG"
> @@ -94,7 +100,7 @@ fi
>  ## Build BIOS
>  echo
> "==========================================================
> ============"
>  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_Type $Build_Target
> 
>  echo
>  echo Finished Building Process.
> --
> 2.7.0.windows.1
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
@ 2017-12-19 16:40 lushifex
  2017-12-20  6:04 ` Wei, David
  0 siblings, 1 reply; 12+ messages in thread
From: lushifex @ 2017-12-19 16:40 UTC (permalink / raw)
  To: edk2-devel; +Cc: david.wei

Add build script for E0 stepping LeafHill FAB D CRB board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
---
 BuildBIOS.bat                                      |  4 ++-
 BuildBIOS.sh                                       | 12 ++++++++-
 Platform/BroxtonPlatformPkg/BuildBxtBios.bat       | 20 +++++++++++++++
 Platform/BroxtonPlatformPkg/BuildBxtBios.sh        | 29 +++++++++++++++++++++-
 Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 13 ++++++++++
 Platform/BroxtonPlatformPkg/BuildIFWI.sh           | 10 ++++++++
 .../SmBiosMiscDxe/MiscSystemManufacturerFunction.c |  7 ++++++
 .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 11 ++++++++
 .../BroxtonSiPkg/Include/Library/SteppingLib.h     |  3 ++-
 .../BroxtonSiPkg/Library/SteppingLib/SteppingLib.c |  6 ++++-
 10 files changed, 110 insertions(+), 5 deletions(-)

diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index 051c0a9..96c34f9 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -54,11 +54,13 @@ 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)
-echo        /A     Set FabId to A (default:  FAB_B)
+echo        /A     Set FabId to A
 echo        /B     Set FabId to B (default:  FAB_B)
+echo        /D     Set FabId to D
 echo        /MN    MinnowBoard 3(default: MN)
 echo        /MX    MinnowBoard 3 Module
 echo        /BG    Benson Glacier Board
+echo        /LH    LeafHill CRB Board
 echo        PlatformName:  Broxton
 echo        BuildTargets:  Release, Debug
 
diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index b8d21d7..91d6bd6 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -21,8 +21,10 @@ function Usage () {
   echo "       Build_Flags:                 /MN    MinnowBoard3 (default: MN)"
   echo "       Build_Flags:                 /BG    Benson Glacier Board"
   echo "       Build_Flags:                 /MX    MinnowBoard3 Module"
-  echo "       Build_Flags:                 /A     Set FabId to A (default:  FAB_B)"
+  echo "       Build_Flags:                 /LH    LeafHill CRB Board"
+  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 "       PlatformName [optional]:     Broxton  "                   
   echo "       Target_Flag:                 Release, Debug       "
   echo
@@ -64,6 +66,14 @@ for (( i=1; i<=$#; ))
       BoardId=MX
       Build_Flags="$Build_Flags /MX"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
+      BoardId=LH
+      Build_Flags="$Build_Flags /LH"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
+      FabId=D
+      Build_Flags="$Build_Flags /D"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       Build_Flags="$Build_Flags /B"
diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
index 994bb3a..5aa545e 100644
--- a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
@@ -165,6 +165,12 @@ if /i "%~1"=="/B" (
     shift
     goto OptLoop
 )
+if /i "%~1"=="/D" (
+    set FabId=D
+    echo.
+    shift
+    goto OptLoop
+)
 if /i "%~1"=="/MN" (
     set BoardId=MN
     echo.
@@ -183,6 +189,12 @@ if /i "%~1"=="/MX" (
     shift
     goto OptLoop
 )
+if /i "%~1"=="/LH" (
+    set BoardId=LH
+    echo.
+    shift
+    goto OptLoop
+)
 if /i "%~1"=="/m" (
     if defined NUMBER_OF_PROCESSORS (
         set /a build_threads=%NUMBER_OF_PROCESSORS%
@@ -209,6 +221,8 @@ if /i "%~1" == "%Minnow_RVP%" (
     set BOARD_ID=BENSONV
   ) else if %BoardId%==MX (
     set BOARD_ID=M3MODUL
+  ) else if %BoardId%==LH (
+    set BOARD_ID=LEAFHIL
   )
     set ENBDT_PF_BUILD=TRUE
     set PLATFORM_NAME=BroxtonPlatformPkg
@@ -285,6 +299,12 @@ if %BoardId%==MX (
   )
 )
 
+if %BoardId%==LH (
+  if %FabId%==D (
+    echo BOARD_REV = D >> Conf\BiosId.env
+  )
+)
+
 :: Set the Build_Type, Version_Major, and Version_Minor environment variables
 find /v "#" Conf\BiosId.env > ver_strings
 for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
index ef261e6..74aa782 100755
--- a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
@@ -107,6 +107,12 @@ for (( i=1; i<=$#; ))
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MX" ]; then
       BoardId=MX
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
+      BoardId=LH
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
+      FabId=D
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       shift
@@ -138,9 +144,14 @@ if [ $BoardId == "MN" ]; then
 elif [ $BoardId == "MX" ]; then
   BOARD_ID=M3MO
   echo BOARD_ID = M3MODUL >> $WORKSPACE/Conf/BiosId.env
-else
+elif [ $BoardId == "BG" ]; then
   BOARD_ID=BEN1
   echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
+elif [ $BoardId == "LH" ]; then
+  BOARD_ID=LEAF
+  echo BOARD_ID = LEAFHIL >> $WORKSPACE/Conf/BiosId.env
+else
+  break
 fi
 
 ENBDT_PF_BUILD=TRUE
@@ -212,6 +223,13 @@ if [ $BoardId == "MX" ]; then
   fi
 fi
 
+if [ $BoardId == "LH" ]; then
+  if [ $FabId == "D" ]; then
+    BOARD_REV=D
+    echo BOARD_REV = D >> $WORKSPACE/Conf/BiosId.env
+  fi
+fi
+
 ##**********************************************************************
 ## Additional EDK Build Setup/Configuration
 ##**********************************************************************
@@ -353,6 +371,15 @@ if [ $BoardId == "MX" ]; then
   fi
 fi
 
+if [ $BoardId == "LH" ]; then
+  if [ $FabId == "D" ]; then
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHill/FAB_D/SpiChunk1.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHill/FAB_D/SpiChunk2.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHill/FAB_D/SpiChunk3.bin  $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+    cp -f $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHill/FAB_D/GCC/NvStorage.Fv $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
+  fi
+fi
+
 #
 # Assmeble components
 #
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index 556bd4a..2742103 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -93,6 +93,12 @@ if /i "%~1"=="/B" (
     shift
     goto OptLoop
 )
+if /i "%~1"=="/D" (
+    set FabId=D
+    set Build_Flags=%Build_Flags% /D
+    shift
+    goto OptLoop
+)
 if /i "%~1"=="/MN" (
     set BoardId=MN
     set Build_Flags=%Build_Flags% /MN
@@ -113,6 +119,13 @@ if /i "%~1"=="/MX" (
     goto OptLoop
 )
 
+if /i "%~1"=="/LH" (
+    set BoardId=LH
+    set Build_Flags=%Build_Flags% /LH
+    shift
+    goto OptLoop
+)
+
 if /i "%~1"=="/m" (
     set buildthread=/m
     echo.
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index 33dd249..6138fb4 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -22,8 +22,10 @@ function Usage () {
   echo "       Build_Flags:                 /MN    Minnowboard 3 (default) "
   echo "       Build_Flags:                 /BG    Benson Glacier Board "
   echo "       Build_Flags:                 /MX    Minnowboard 3 Next "
+  echo "       Build_Flags:                 /LH    LeafHill CRB Board "
   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 "       Platform_Type [optional]:    Broxton "                   
   echo "       Build_Target:                Release, Debug "
   echo
@@ -71,6 +73,14 @@ for (( i=1; i<=$#; ))
       BoardId=MX
       Build_Flags="$Build_Flags /MX"
       shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
+      BoardId=LH
+      Build_Flags="$Build_Flags /LH"
+      shift
+    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
+      FabId=D
+      Build_Flags="$Build_Flags /D"
+      shift
     elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
       FabId=B
       Build_Flags="$Build_Flags /B"
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
index bcb0c51..1878ce5 100644
--- a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
+++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
@@ -144,6 +144,13 @@ AddSmbiosManuCallback (
       HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
       DEBUG ((EFI_D_ERROR, "C0 Stepping Detected\n"));
       break;
+    case BxtPE0:
+      UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"E0 PLATFORM");
+      HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+      UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"E0");
+      HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+      DEBUG ((EFI_D_ERROR, "E0 Stepping Detected\n"));
+      break;
     default:
       DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n"));
       break;
diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
index 01e56c5..4c1fcb1 100644
--- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
+++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat
@@ -52,6 +52,10 @@ if /i "%~3"=="MX" (
     set BoardId=MX
 )
 
+if /i "%~3"=="LH" (
+    set BoardId=LH
+)
+
 :OptLoop1
 
 if /i "%~1"=="/FspW" (
@@ -112,6 +116,8 @@ if /i "!Platform_Type!"=="MINN" (
     set Platform_Type=BENS
 ) else if /i "!Platform_Type!"=="M3MO" (
     set Platform_Type=M3MO
+) else if /i "!Platform_Type!"=="LEAF" (
+    set Platform_Type=LEAF
 ) else (
     echo Error - Unsupported PlatformType: !Platform_Type!
     goto Usage
@@ -165,6 +171,11 @@ if %BoardId%==BG (
            copy /y /b ..\..\Binaries\IFWI\MinnowBoard3Next\FAB_A\SpiChunk2.bin .
            copy /y /b ..\..\Binaries\IFWI\MinnowBoard3Next\FAB_A\SpiChunk3.bin .
            copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
+) else if %BoardId%==LH (
+           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk1.bin .
+           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk2.bin .
+           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk3.bin .
+           copy /y /b SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.Fv+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\NvStorage.Fv+SpiChunk3.bin spi_out.bin
 )
 move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
 
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h b/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
index c14911b..f27da46 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
@@ -1,7 +1,7 @@
 /** @file
   Get Soc ID library implementation.
 
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -42,6 +42,7 @@ typedef enum {
   BxtPB0         = 0x50,
   BxtPB1,
   BxtPB2,
+  BxtPE0         = 0x60,
   BxtSteppingMax = 0xFF
 } BXT_STEPPING;
 
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
index d4930d1..64ea576 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
@@ -1,7 +1,7 @@
 /** @file
   This file contains routines that get Soc Stepping.
 
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -110,6 +110,10 @@ BxtStepping (
         DEBUG ((DEBUG_INFO, "BXTP-B2 detected!\n"));
         return BxtPB2;
         break;
+      case V_SA_MC_RID_C:
+        DEBUG ((DEBUG_INFO, "BXTP-E0 detected!\n"));
+        return BxtPE0;
+        break;
       default:
         DEBUG ((DEBUG_ERROR, "Unsupported BXT-P stepping.\n"));
         return BxtSteppingMax;
-- 
2.7.0.windows.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
  2017-12-19 16:40 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script lushifex
@ 2017-12-20  6:04 ` Wei, David
  0 siblings, 0 replies; 12+ messages in thread
From: Wei, David @ 2017-12-20  6:04 UTC (permalink / raw)
  To: Lu, ShifeiX A, edk2-devel@lists.01.org

Reviewed-by: zwei4  <david.wei@intel.com> 

Thanks,
David  Wei

Intel SSG/STO/UEFI BIOS                                 

> -----Original Message-----
> From: Lu, ShifeiX A
> Sent: Wednesday, December 20, 2017 2:02 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David <david.wei@intel.com>
> Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script.
> 
> Add build script for E0 stepping LeafHill FAB D CRB board.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: lushifex <shifeix.a.lu@intel.com>
> ---
>  BuildBIOS.bat                                      |  4 ++-
>  BuildBIOS.sh                                       | 12 ++++++++-
>  Platform/BroxtonPlatformPkg/BuildBxtBios.bat       | 20 +++++++++++++++
>  Platform/BroxtonPlatformPkg/BuildBxtBios.sh        | 29
> +++++++++++++++++++++-
>  Platform/BroxtonPlatformPkg/BuildIFWI.bat          | 13 ++++++++++
>  Platform/BroxtonPlatformPkg/BuildIFWI.sh           | 10 ++++++++
>  .../SmBiosMiscDxe/MiscSystemManufacturerFunction.c |  7 ++++++
>  .../Common/Tools/Stitch/IFWIStitch_Simple.bat      | 11 ++++++++
>  .../BroxtonSiPkg/Include/Library/SteppingLib.h     |  3 ++-
>  .../BroxtonSiPkg/Library/SteppingLib/SteppingLib.c |  6 ++++-
>  10 files changed, 110 insertions(+), 5 deletions(-)
> 
> diff --git a/BuildBIOS.bat b/BuildBIOS.bat
> index 051c0a9..96c34f9 100644
> --- a/BuildBIOS.bat
> +++ b/BuildBIOS.bat
> @@ -54,11 +54,13 @@ 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)
> -echo        /A     Set FabId to A (default:  FAB_B)
> +echo        /A     Set FabId to A
>  echo        /B     Set FabId to B (default:  FAB_B)
> +echo        /D     Set FabId to D
>  echo        /MN    MinnowBoard 3(default: MN)
>  echo        /MX    MinnowBoard 3 Module
>  echo        /BG    Benson Glacier Board
> +echo        /LH    LeafHill CRB Board
>  echo        PlatformName:  Broxton
>  echo        BuildTargets:  Release, Debug
> 
> diff --git a/BuildBIOS.sh b/BuildBIOS.sh
> index b8d21d7..91d6bd6 100755
> --- a/BuildBIOS.sh
> +++ b/BuildBIOS.sh
> @@ -21,8 +21,10 @@ function Usage () {
>    echo "       Build_Flags:                 /MN    MinnowBoard3 (default: MN)"
>    echo "       Build_Flags:                 /BG    Benson Glacier Board"
>    echo "       Build_Flags:                 /MX    MinnowBoard3 Module"
> -  echo "       Build_Flags:                 /A     Set FabId to A (default:  FAB_B)"
> +  echo "       Build_Flags:                 /LH    LeafHill CRB Board"
> +  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 "       PlatformName [optional]:     Broxton  "
>    echo "       Target_Flag:                 Release, Debug       "
>    echo
> @@ -64,6 +66,14 @@ for (( i=1; i<=$#; ))
>        BoardId=MX
>        Build_Flags="$Build_Flags /MX"
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
> +      BoardId=LH
> +      Build_Flags="$Build_Flags /LH"
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
> +      FabId=D
> +      Build_Flags="$Build_Flags /D"
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        Build_Flags="$Build_Flags /B"
> diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
> b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
> index 994bb3a..5aa545e 100644
> --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
> @@ -165,6 +165,12 @@ if /i "%~1"=="/B" (
>      shift
>      goto OptLoop
>  )
> +if /i "%~1"=="/D" (
> +    set FabId=D
> +    echo.
> +    shift
> +    goto OptLoop
> +)
>  if /i "%~1"=="/MN" (
>      set BoardId=MN
>      echo.
> @@ -183,6 +189,12 @@ if /i "%~1"=="/MX" (
>      shift
>      goto OptLoop
>  )
> +if /i "%~1"=="/LH" (
> +    set BoardId=LH
> +    echo.
> +    shift
> +    goto OptLoop
> +)
>  if /i "%~1"=="/m" (
>      if defined NUMBER_OF_PROCESSORS (
>          set /a build_threads=%NUMBER_OF_PROCESSORS%
> @@ -209,6 +221,8 @@ if /i "%~1" == "%Minnow_RVP%" (
>      set BOARD_ID=BENSONV
>    ) else if %BoardId%==MX (
>      set BOARD_ID=M3MODUL
> +  ) else if %BoardId%==LH (
> +    set BOARD_ID=LEAFHIL
>    )
>      set ENBDT_PF_BUILD=TRUE
>      set PLATFORM_NAME=BroxtonPlatformPkg
> @@ -285,6 +299,12 @@ if %BoardId%==MX (
>    )
>  )
> 
> +if %BoardId%==LH (
> +  if %FabId%==D (
> +    echo BOARD_REV = D >> Conf\BiosId.env
> +  )
> +)
> +
>  :: Set the Build_Type, Version_Major, and Version_Minor environment
> variables
>  find /v "#" Conf\BiosId.env > ver_strings
>  for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
> diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
> b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
> index ef261e6..74aa782 100755
> --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
> +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
> @@ -107,6 +107,12 @@ for (( i=1; i<=$#; ))
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MX" ]; then
>        BoardId=MX
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
> +      BoardId=LH
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
> +      FabId=D
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        shift
> @@ -138,9 +144,14 @@ if [ $BoardId == "MN" ]; then
>  elif [ $BoardId == "MX" ]; then
>    BOARD_ID=M3MO
>    echo BOARD_ID = M3MODUL >> $WORKSPACE/Conf/BiosId.env
> -else
> +elif [ $BoardId == "BG" ]; then
>    BOARD_ID=BEN1
>    echo BOARD_ID = BENSONV >> $WORKSPACE/Conf/BiosId.env
> +elif [ $BoardId == "LH" ]; then
> +  BOARD_ID=LEAF
> +  echo BOARD_ID = LEAFHIL >> $WORKSPACE/Conf/BiosId.env
> +else
> +  break
>  fi
> 
>  ENBDT_PF_BUILD=TRUE
> @@ -212,6 +223,13 @@ if [ $BoardId == "MX" ]; then
>    fi
>  fi
> 
> +if [ $BoardId == "LH" ]; then
> +  if [ $FabId == "D" ]; then
> +    BOARD_REV=D
> +    echo BOARD_REV = D >> $WORKSPACE/Conf/BiosId.env
> +  fi
> +fi
> +
> 
> ##********************************************************
> **************
>  ## Additional EDK Build Setup/Configuration
> 
> ##********************************************************
> **************
> @@ -353,6 +371,15 @@ if [ $BoardId == "MX" ]; then
>    fi
>  fi
> 
> +if [ $BoardId == "LH" ]; then
> +  if [ $FabId == "D" ]; then
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHi
> ll/FAB_D/SpiChunk1.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHi
> ll/FAB_D/SpiChunk2.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHi
> ll/FAB_D/SpiChunk3.bin
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +    cp -f
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Binaries/IFWI/LeafHi
> ll/FAB_D/GCC/NvStorage.Fv
> $WORKSPACE/Platform/BroxtonPlatformPkg/Common/Tools/Stitch
> +  fi
> +fi
> +
>  #
>  # Assmeble components
>  #
> diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> index 556bd4a..2742103 100644
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
> @@ -93,6 +93,12 @@ if /i "%~1"=="/B" (
>      shift
>      goto OptLoop
>  )
> +if /i "%~1"=="/D" (
> +    set FabId=D
> +    set Build_Flags=%Build_Flags% /D
> +    shift
> +    goto OptLoop
> +)
>  if /i "%~1"=="/MN" (
>      set BoardId=MN
>      set Build_Flags=%Build_Flags% /MN
> @@ -113,6 +119,13 @@ if /i "%~1"=="/MX" (
>      goto OptLoop
>  )
> 
> +if /i "%~1"=="/LH" (
> +    set BoardId=LH
> +    set Build_Flags=%Build_Flags% /LH
> +    shift
> +    goto OptLoop
> +)
> +
>  if /i "%~1"=="/m" (
>      set buildthread=/m
>      echo.
> diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> index 33dd249..6138fb4 100755
> --- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
> @@ -22,8 +22,10 @@ function Usage () {
>    echo "       Build_Flags:                 /MN    Minnowboard 3 (default) "
>    echo "       Build_Flags:                 /BG    Benson Glacier Board "
>    echo "       Build_Flags:                 /MX    Minnowboard 3 Next "
> +  echo "       Build_Flags:                 /LH    LeafHill CRB Board "
>    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 "       Platform_Type [optional]:    Broxton "
>    echo "       Build_Target:                Release, Debug "
>    echo
> @@ -71,6 +73,14 @@ for (( i=1; i<=$#; ))
>        BoardId=MX
>        Build_Flags="$Build_Flags /MX"
>        shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/LH" ]; then
> +      BoardId=LH
> +      Build_Flags="$Build_Flags /LH"
> +      shift
> +    elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/D" ]; then
> +      FabId=D
> +      Build_Flags="$Build_Flags /D"
> +      shift
>      elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/B" ]; then
>        FabId=B
>        Build_Flags="$Build_Flags /B"
> diff --git
> a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe
> /MiscSystemManufacturerFunction.c
> b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDx
> e/MiscSystemManufacturerFunction.c
> index bcb0c51..1878ce5 100644
> ---
> a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe
> /MiscSystemManufacturerFunction.c
> +++
> b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDx
> e/MiscSystemManufacturerFunction.c
> @@ -144,6 +144,13 @@ AddSmbiosManuCallback (
>        HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION),
> Buffer, NULL);
>        DEBUG ((EFI_D_ERROR, "C0 Stepping Detected\n"));
>        break;
> +    case BxtPE0:
> +      UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer,
> L"E0 PLATFORM");
> +      HiiSetString (mHiiHandle, STRING_TOKEN
> (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
> +      UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"E0");
> +      HiiSetString (mHiiHandle, STRING_TOKEN
> (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
> +      DEBUG ((EFI_D_ERROR, "E0 Stepping Detected\n"));
> +      break;
>      default:
>        DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n"));
>        break;
> diff --git
> a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> index 01e56c5..4c1fcb1 100644
> ---
> a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> +++
> b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.b
> at
> @@ -52,6 +52,10 @@ if /i "%~3"=="MX" (
>      set BoardId=MX
>  )
> 
> +if /i "%~3"=="LH" (
> +    set BoardId=LH
> +)
> +
>  :OptLoop1
> 
>  if /i "%~1"=="/FspW" (
> @@ -112,6 +116,8 @@ if /i "!Platform_Type!"=="MINN" (
>      set Platform_Type=BENS
>  ) else if /i "!Platform_Type!"=="M3MO" (
>      set Platform_Type=M3MO
> +) else if /i "!Platform_Type!"=="LEAF" (
> +    set Platform_Type=LEAF
>  ) else (
>      echo Error - Unsupported PlatformType: !Platform_Type!
>      goto Usage
> @@ -165,6 +171,11 @@ if %BoardId%==BG (
>             copy /y
> /b ..\..\Binaries\IFWI\MinnowBoard3Next\FAB_A\SpiChunk2.bin .
>             copy /y
> /b ..\..\Binaries\IFWI\MinnowBoard3Next\FAB_A\SpiChunk3.bin .
>             copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
> +) else if %BoardId%==LH (
> +           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk1.bin .
> +           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk2.bin .
> +           copy /y /b ..\..\Binaries\IFWI\LeafHill\FAB_D\SpiChunk3.bin .
> +           copy /y /b
> SpiChunk1.bin+.\BIOS_COMPONENTS\IBBL.Fv+.\BIOS_COMPONENTS\IBB.F
> v+SpiChunk2.bin+.\BIOS_COMPONENTS\OBB.Fv+.\BIOS_COMPONENTS\Nv
> Storage.Fv+SpiChunk3.bin spi_out.bin
>  )
>  move /y spi_out.bin %BIOS_ID%.bin  >> Stitching.log
> 
> diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
> b/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
> index c14911b..f27da46 100644
> --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
> +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Include/Library/SteppingLib.h
> @@ -1,7 +1,7 @@
>  /** @file
>    Get Soc ID library implementation.
> 
> -  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> 
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
> @@ -42,6 +42,7 @@ typedef enum {
>    BxtPB0         = 0x50,
>    BxtPB1,
>    BxtPB2,
> +  BxtPE0         = 0x60,
>    BxtSteppingMax = 0xFF
>  } BXT_STEPPING;
> 
> diff --git
> a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
> b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
> index d4930d1..64ea576 100644
> --- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
> +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/SteppingLib/SteppingLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>    This file contains routines that get Soc Stepping.
> 
> -  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> 
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
> @@ -110,6 +110,10 @@ BxtStepping (
>          DEBUG ((DEBUG_INFO, "BXTP-B2 detected!\n"));
>          return BxtPB2;
>          break;
> +      case V_SA_MC_RID_C:
> +        DEBUG ((DEBUG_INFO, "BXTP-E0 detected!\n"));
> +        return BxtPE0;
> +        break;
>        default:
>          DEBUG ((DEBUG_ERROR, "Unsupported BXT-P stepping.\n"));
>          return BxtSteppingMax;
> --
> 2.7.0.windows.1
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-12-20  5:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-16  2:48 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
2017-06-16  2:50 ` Wei, David
  -- strict thread matches above, loose matches on Subject: below --
2017-12-19 16:40 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script lushifex
2017-12-20  6:04 ` Wei, David
2017-10-30  1:58 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
2017-10-30  2:15 ` Wei, David
2017-09-14  5:59 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build Script lushifex
2017-09-14  6:24 ` Wei, David
2017-07-11 22:20 lushifex
2017-07-11 22:20 lushifex
2017-06-08  7:58 [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Build script lushifex
2017-06-08  8:01 ` Wei, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox