From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=david.wei@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7F7EA210EE4DF for ; Mon, 13 Aug 2018 23:18:05 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2018 23:18:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,237,1531810800"; d="scan'208";a="254629481" Received: from zwei4-mobl1.ccr.corp.intel.com ([10.239.193.212]) by fmsmga006.fm.intel.com with ESMTP; 13 Aug 2018 23:18:03 -0700 From: zwei4 To: edk2-devel@lists.01.org Cc: David Wei , Mike Wu , Mang Guo Date: Tue, 14 Aug 2018 14:17:51 +0800 Message-Id: <20180814061751.2412-1-david.wei@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] UP2 Board Enabling. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Aug 2018 06:18:05 -0000 Add platform specific code and build script for AAEON UP2 board. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: David Wei CC: Mike Wu CC: Mang Guo --- BuildBIOS.bat | 4 +++- BuildBIOS.sh | 3 +++ Platform/BroxtonPlatformPkg/BuildBxtBios.bat | 18 ++++++++++++++++++ Platform/BroxtonPlatformPkg/BuildBxtBios.sh | 21 +++++++++++++++++++++ Platform/BroxtonPlatformPkg/BuildIFWI.bat | 7 +++++++ .../Common/Include/Guid/PlatformInfo.h | 1 + .../Common/Include/Guid/PlatformInfo_Aplk.h | 1 + .../PlatformSetupDxe/PlatformSetupDxe.c | 9 --------- .../Common/Tools/Stitch/IFWIStitch_Simple.bat | 9 +++++++++ Platform/BroxtonPlatformPkg/DefineAtBuildMacros.dsc | 1 + .../PlatformDsc/Components.IA32.dsc | 15 ++++++++++----- .../BroxtonPlatformPkg/PlatformDsc/Components.dsc | 1 + .../PlatformDsc/PcdsFixedAtBuild.dsc | 7 ++++++- Platform/BroxtonPlatformPkg/PlatformPkg.dec | 1 + Platform/BroxtonPlatformPkg/PlatformPkg.fdf | 6 ++++++ 15 files changed, 88 insertions(+), 16 deletions(-) diff --git a/BuildBIOS.bat b/BuildBIOS.bat index b04150c2e0..22c8792edb 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -52,6 +52,7 @@ 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 /vs15 Set Compiler to vs2015 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 @@ -62,12 +63,13 @@ echo /MX MinnowBoard 3 Module echo /BG Benson Glacier Board echo /AG Aurora Glacier Board echo /LH LeafHill CRB Board +echo /UP AAEON UP2 Board echo /L Flash region access permission for host CPU echo PlatformName: Broxton echo BuildTargets: Release, Debug echo Examples: -echo %thisscript% /vs13 /B /x64 Broxton Debug +echo %thisscript% /vs13 /LH /B /x64 Broxton Debug set exitCode=1 diff --git a/BuildBIOS.sh b/BuildBIOS.sh index a99f77e978..9c482697b1 100755 --- a/BuildBIOS.sh +++ b/BuildBIOS.sh @@ -22,6 +22,7 @@ function Usage () { echo " Build_Flags: /BG Benson Glacier Board" echo " Build_Flags: /MX MinnowBoard3 Module" echo " Build_Flags: /LH LeafHill CRB Board" + echo " Build_Flags: /UP AAEON UP2 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 " @@ -29,6 +30,8 @@ function Usage () { echo " PlatformName [optional]: Broxton " echo " Target_Flag: Release, Debug " echo + echo "Example: BuildBios.sh /LH /D Broxton Release" + echo echo "Press any key......" read exit 0 diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat index bd3a7b6498..3e31d52e25 100644 --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.bat +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat @@ -61,6 +61,7 @@ set SrcDebug=FALSE set APLK_SETUP_ENABLE_BUILD=FALSE set FSP_BUILD=FALSE set FSP_WRAPPER=FALSE +set UP2_BOARD=FALSE :: Set Defaults of platform specific environment variables. set EFI_SOURCE=%CD% @@ -199,6 +200,12 @@ if /i "%~1"=="/LH" ( shift goto OptLoop ) +if /i "%~1"=="/UP" ( + set BoardId=UP + echo. + shift + goto OptLoop +) if /i "%~1"=="/m" ( if defined NUMBER_OF_PROCESSORS ( set /a build_threads=%NUMBER_OF_PROCESSORS% @@ -229,6 +236,9 @@ if /i "%~1" == "%Minnow_RVP%" ( set BOARD_ID=M3MODUL ) else if %BoardId%==LH ( set BOARD_ID=LEAFHIL + ) else if %BoardId%==UP ( + set BOARD_ID=UPBOARD + set UP2_BOARD=TRUE ) set ENBDT_PF_BUILD=TRUE set PLATFORM_NAME=BroxtonPlatformPkg @@ -264,6 +274,8 @@ if "%Arch%"=="IA32" ( echo DEFINE X64_CONFIG = TRUE >> %Build_Macros% ) +echo DEFINE UP2_BOARD = %UP2_BOARD% >> %Build_Macros% + ::Stage of copy of BiosId.env in Conf/ with Platform_Type and Build_Target values removed if "%Arch%"=="X64" ( @@ -315,6 +327,12 @@ if %BoardId%==LH ( ) ) +if %BoardId%==UP ( + if %FabId%==A ( + 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 diff --git a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh index 80ed924a2c..95665c7f95 100755 --- a/Platform/BroxtonPlatformPkg/BuildBxtBios.sh +++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh @@ -44,6 +44,7 @@ PPV_BIOS_ENABLE=FALSE RVVP_BIOS_ENABLE=FALSE RVV_BIOS_ENABLE=FALSE SrcDebug=FALSE +UP2_BOARD=FALSE ## Clean up previous build files. if [ -e $(pwd)/EDK2.log ]; then @@ -161,6 +162,11 @@ elif [ $BoardId == "BG" ]; then elif [ $BoardId == "LH" ]; then BOARD_ID=LEAF echo BOARD_ID = LEAFHIL >> $WORKSPACE/Conf/BiosId.env +else +elif [ $BoardId == "UP" ]; then + BOARD_ID=UPBO + echo BOARD_ID = UP2BORD >> $WORKSPACE/Conf/BiosId.env + UP2_BOARD=TRUE else break fi @@ -187,6 +193,7 @@ 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 +echo DEFINE UP2_BOARD = $UP2_BOARD >> $Build_Macros if [ $Arch == "IA32" ]; then echo DEFINE X64_CONFIG = FALSE >> $Build_Macros @@ -241,6 +248,12 @@ if [ $BoardId == "LH" ]; then fi fi +if [ $BoardId == "UP" ]; then + if [ $FabId == "A" ]; then + BOARD_REV=A + echo BOARD_REV = A >> $WORKSPACE/Conf/BiosId.env + fi +fi ##********************************************************************** ## Additional EDK Build Setup/Configuration ##********************************************************************** @@ -416,6 +429,14 @@ if [ $BoardId == "LH" ]; then fi fi +if [ $BoardId == "UP" ]; then + if [ $FabId == "A" ]; then + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/FAB_A/SpiChunk1.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/FAB_A/SpiChunk2.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/FAB_A/SpiChunk3.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + cp -f $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Board/LeafHill/IFWI/FAB_A/SpiChunk1SpiAccessControl.bin $PLATFORM_PATH/Platform/BroxtonPlatformPkg/Common/Tools/Stitch + fi +fi # # Assmeble components # diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat index 35f4c8d6bd..396e8c4968 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -132,6 +132,13 @@ if /i "%~1"=="/LH" ( goto OptLoop ) +if /i "%~1"=="/UP" ( + set BoardId=UP + set Build_Flags=%Build_Flags% /UP + shift + goto OptLoop +) + if /i "%~1"=="/m" ( set buildthread=/m echo. diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h index bebbda4349..ee60046488 100644 --- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h +++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo.h @@ -173,6 +173,7 @@ typedef enum { typedef enum { + BOARD_ID_UP2 = 0x01, // UP2 BOARD_ID_MINNOW_NEXT = 0x03, // Minnow Board Next BOARD_ID_LFH_CRB = 0x07, // Leaf Hill BOARD_ID_MINNOW = 0x0F, // Minnow Board diff --git a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h index e721cda959..c9f0a7576e 100644 --- a/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h +++ b/Platform/BroxtonPlatformPkg/Common/Include/Guid/PlatformInfo_Aplk.h @@ -158,6 +158,7 @@ typedef struct { // typedef enum { + BOARD_ID_UP2 = 0x01, // UP2 BOARD_ID_MINNOW_NEXT = 0x03, // Minnow Board Next BOARD_ID_LFH_CRB = 0x07, // Leaf Hill BOARD_ID_MINNOW = 0x0F, // Minnow Board diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c index 21fd328fd4..bbb31b10da 100644 --- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c +++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformSetupDxe/PlatformSetupDxe.c @@ -141,15 +141,6 @@ LoadPlatformDefaultValues ( IN EFI_CALLBACK_INFO *Private ) { - switch (Private->FakeNvData.BoardId) { - case BOARD_ID_LFH_CRB: - case BOARD_ID_MINNOW: - case BOARD_ID_BENSON: - - break; - default: - break; - } Private->FakeNvData.PlatformSettingEn = 1; } diff --git a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat index b8abaf38bf..125c8c2d53 100644 --- a/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat +++ b/Platform/BroxtonPlatformPkg/Common/Tools/Stitch/IFWIStitch_Simple.bat @@ -60,6 +60,10 @@ if /i "%~3"=="LH" ( set BoardId=LH ) +if /i "%~3"=="UP" ( + set BoardId=UP +) + if /i "%~4"=="L" ( set SpiAccessControl=1 ) @@ -190,6 +194,11 @@ if %BoardId%==BG ( ) else ( copy /y /b SpiChunk1SpiAccessControl.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%==UP ( + copy /y /b ..\..\..\Board\UP2\IFWI\FAB_A\SpiChunk1.bin . + copy /y /b ..\..\..\Board\UP2\IFWI\FAB_A\SpiChunk2.bin . + copy /y /b ..\..\..\Board\UP2\IFWI\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 diff --git a/Platform/BroxtonPlatformPkg/DefineAtBuildMacros.dsc b/Platform/BroxtonPlatformPkg/DefineAtBuildMacros.dsc index 0e29ef3be4..d181c499f4 100644 --- a/Platform/BroxtonPlatformPkg/DefineAtBuildMacros.dsc +++ b/Platform/BroxtonPlatformPkg/DefineAtBuildMacros.dsc @@ -1,3 +1,4 @@ DEFINE ENBDT_PF_BUILD = TRUE DEFINE APLK_SETUP_ENABLE_BUILD = TRUE DEFINE X64_CONFIG = TRUE +DEFINE UP2_BOARD = FALSE diff --git a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.IA32.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.IA32.dsc index 1aec4a9244..abd89bf374 100644 --- a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.IA32.dsc +++ b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.IA32.dsc @@ -78,11 +78,15 @@ $(PLATFORM_PACKAGE_COMMON)/PlatformSettings/PlatformPreMemPei/PlatformPreMemPei.inf { - NULL|$(PLATFORM_NAME)/Board/MinnowBoard3/BoardInitPreMem/BoardInitPreMem.inf - NULL|$(PLATFORM_NAME)/Board/LeafHill/BoardInitPreMem/BoardInitPreMem.inf - NULL|$(PLATFORM_NAME)/Board/BensonGlacier/BoardInitPreMem/BoardInitPreMem.inf - NULL|$(PLATFORM_NAME)/Board/AuroraGlacier/BoardInitPreMem/BoardInitPreMem.inf - NULL|$(PLATFORM_NAME)/Board/MinnowBoard3Next/BoardInitPreMem/BoardInitPreMem.inf + !if $(UP2_BOARD) == TRUE + NULL|$(PLATFORM_NAME)/Board/UP2/BoardInitPreMem/BoardInitPreMem.inf + !else + NULL|$(PLATFORM_NAME)/Board/MinnowBoard3/BoardInitPreMem/BoardInitPreMem.inf + NULL|$(PLATFORM_NAME)/Board/LeafHill/BoardInitPreMem/BoardInitPreMem.inf + NULL|$(PLATFORM_NAME)/Board/BensonGlacier/BoardInitPreMem/BoardInitPreMem.inf + NULL|$(PLATFORM_NAME)/Board/AuroraGlacier/BoardInitPreMem/BoardInitPreMem.inf + NULL|$(PLATFORM_NAME)/Board/MinnowBoard3Next/BoardInitPreMem/BoardInitPreMem.inf + !endif BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf CpuPolicyLib|$(PLATFORM_SI_PACKAGE)/Cpu/Library/PeiCpuPolicyLibPreMem/PeiCpuPolicyLibPreMem.inf @@ -115,6 +119,7 @@ $(PLATFORM_PACKAGE_COMMON)/PlatformSettings/PlatformPostMemPei/PlatformPostMemPei.inf { + NULL|$(PLATFORM_NAME)/Board/UP2/BoardInitPostMem/BoardInitPostMem.inf NULL|$(PLATFORM_NAME)/Board/MinnowBoard3/BoardInitPostMem/BoardInitPostMem.inf NULL|$(PLATFORM_NAME)/Board/LeafHill/BoardInitPostMem/BoardInitPostMem.inf NULL|$(PLATFORM_NAME)/Board/BensonGlacier/BoardInitPostMem/BoardInitPostMem.inf diff --git a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc index 8f5d833668..f49d4cc796 100644 --- a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc +++ b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc @@ -194,6 +194,7 @@ NULL|$(PLATFORM_NAME)/Board/BensonGlacier/BoardInitDxe/BoardInitDxe.inf NULL|$(PLATFORM_NAME)/Board/AuroraGlacier/BoardInitDxe/BoardInitDxe.inf NULL|$(PLATFORM_NAME)/Board/MinnowBoard3Next/BoardInitDxe/BoardInitDxe.inf + NULL|$(PLATFORM_NAME)/Board/UP2/BoardInitDxe/BoardInitDxe.inf } !if $(DATAHUB_ENABLE) == TRUE diff --git a/Platform/BroxtonPlatformPkg/PlatformDsc/PcdsFixedAtBuild.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/PcdsFixedAtBuild.dsc index 6c26acaf5b..8aca7358c3 100644 --- a/Platform/BroxtonPlatformPkg/PlatformDsc/PcdsFixedAtBuild.dsc +++ b/Platform/BroxtonPlatformPkg/PlatformDsc/PcdsFixedAtBuild.dsc @@ -85,4 +85,9 @@ !endif gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x3000 - + + !if $(UP2_BOARD) == TRUE + gPlatformModuleTokenSpaceGuid.PcdSerialIoUartNumber|0 + !else + gPlatformModuleTokenSpaceGuid.PcdSerialIoUartNumber|2 + !endif \ No newline at end of file diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.dec b/Platform/BroxtonPlatformPkg/PlatformPkg.dec index 683d92f4ac..2438906355 100644 --- a/Platform/BroxtonPlatformPkg/PlatformPkg.dec +++ b/Platform/BroxtonPlatformPkg/PlatformPkg.dec @@ -63,6 +63,7 @@ gPeiBensonGlacierVbtGuid = { 0xbfde308e, 0x2d5a, 0x4ca7, { 0xaa, 0x76, 0x19, 0x93, 0x8a, 0xaa, 0xe4, 0xda } } gPeiMinnow3NextVbtGuid = { 0x1f9cbb42, 0x107e, 0x46a4, { 0xa2, 0xcb, 0x92, 0xf5, 0x86, 0xf9, 0xfb, 0x31 } } gPeiAuroraGlacierVbtGuid = { 0xaa80b0b1, 0xba1e, 0x4d4f, { 0x83, 0xe0, 0xcc, 0xf4, 0x7a, 0xaa, 0x3c, 0xd8 } } + gPeiUp2VbtGuid = { 0x16667736, 0xb2fe, 0x49b3, { 0xa0, 0xeb, 0xd6, 0xb9, 0xd7, 0xf9, 0x65, 0x7b } } gPeiLogoGuid = { 0x7BB28B99, 0x61BB, 0x11d5, { 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } } gPlatformEmmcHs400TuningInfoGuid = { 0xb0ae3e81, 0xc6b0, 0x4d35, { 0xad, 0x51, 0x91, 0x17, 0xe0, 0x65, 0x1e, 0xa3 } } gEfiTraceHubDebugLibIa32Guid = { 0x23a3e7ba, 0x75d1, 0x4cb9, { 0x9c, 0x8f, 0x56, 0xfa, 0x4e, 0x48, 0xd9, 0x9e } } diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf index 4ad90dc3c8..055193d1e6 100644 --- a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf +++ b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf @@ -277,6 +277,12 @@ SECTION RAW = $(PLATFORM_NAME)/Board/AuroraGlacier/Vbt/VbtBxtMipi.bin SECTION UI = "IntelGopVbt1" } + + # VBT For Up2 (File Guid is gPeiUp2VbtGuid) + FILE FREEFORM = 16667736-B2FE-49b3-A0EB-D6B9D7F9657B { + SECTION RAW = $(PLATFORM_NAME)/Board/UP2/Vbt/Vbt.bin + SECTION UI = "IntelGopVbt1" + } !endif INF $(PLATFORM_SI_PACKAGE)/Cpu/SmmAccess/Pei/SmmAccess.inf -- 2.14.1.windows.1