From nobody Sun May 5 20:12:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522215220475506.6612787126643; Tue, 27 Mar 2018 22:33:40 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 230962252CBB2; Tue, 27 Mar 2018 22:26:59 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 72BCF2095745D for ; Tue, 27 Mar 2018 22:26:57 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 22:33:33 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.73.52]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 22:33:33 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,369,1517904000"; d="scan'208";a="215356016" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 22:33:26 -0700 Message-Id: <20180328053330.13272-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180328053330.13272-1-michael.d.kinney@intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 1/5] Vlv2TbltDevicePkg: Fix build scripts X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Jiewen Yao , David Wei MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Michael D Kinney https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Update build scripts to work with edk2 and Vlv2Binaries in PACKAGES_PATH. Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: Guo Mang Reviewed-by: David Wei --- Vlv2TbltDevicePkg/.gitignore | 3 + Vlv2TbltDevicePkg/Build_IFWI.bat | 8 +-- Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat | 2 +- Vlv2TbltDevicePkg/bld_vlv.bat | 117 +++++++++++++++++-----------= ---- 4 files changed, 72 insertions(+), 58 deletions(-) create mode 100644 Vlv2TbltDevicePkg/.gitignore diff --git a/Vlv2TbltDevicePkg/.gitignore b/Vlv2TbltDevicePkg/.gitignore new file mode 100644 index 0000000000..b4699122b8 --- /dev/null +++ b/Vlv2TbltDevicePkg/.gitignore @@ -0,0 +1,3 @@ +AutoPlatformCFG.txt +Stitch/Stitching.log +Stitch/MNW*.bin diff --git a/Vlv2TbltDevicePkg/Build_IFWI.bat b/Vlv2TbltDevicePkg/Build_IFW= I.bat index ac22a76b73..c8e3ec3d76 100644 --- a/Vlv2TbltDevicePkg/Build_IFWI.bat +++ b/Vlv2TbltDevicePkg/Build_IFWI.bat @@ -1,7 +1,7 @@ @REM @file @REM Windows batch file to build BIOS ROM @REM -@REM Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
@REM This program and the accompanying materials @REM are licensed and made available under the terms and conditions of the= BSD License @REM which accompanies this distribution. The full text of the license ma= y be found at @@ -131,11 +131,11 @@ if %ERRORLEVEL% NEQ 0 ( echo. echo Finished Building BIOS. @REM Set BIOS_ID environment variable here. -call Conf\BiosId.bat +call %WORKSPACE%\Conf\BiosId.bat echo BIOS_ID=3D%BIOS_ID% =20 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environm= ent variables -find /v "#" Conf\BiosId.env > ver_strings +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j del /f/q ver_strings >nul set BIOS_Name=3D%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MI= NOR%.ROM @@ -149,7 +149,7 @@ if "%Platform_Type%" =3D=3D "BYTC" ( pushd %PLATFORM_PACKAGE%\Stitch ) :: IFWIStitch.bat [/nG] [/nM] [/nB] [/B BIOS.rom] [/C StitchConfig] [/S= IFWISuffix] - call IFWIStitch.bat %Stitch_Flags% /B ..\..\%BIOS_Name% %IFWI_Suffix% + call IFWIStitch.bat %Stitch_Flags% /B %WORKSPACE%\%BIOS_Name% %IFWI_Suf= fix% =20 @echo off popd diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat b/Vlv2TbltDevicePkg/St= itch/IFWIStitch.bat index f3a9cf3d74..5f19983c91 100644 --- a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat +++ b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat @@ -191,7 +191,7 @@ for %%i in (%BIOS_Names%) do ( echo Generating IFWI... %BIOS_ID%.bin echo. =20 - copy /b/y !IFWI_HEADER_FILE! + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERS= ION!\VLV_SEC_REGION.bin + ..\..\Vlv2MiscBinariesPkg\SEC\!SEC_VERSION!\Vacan= t.bin + !BIOS_Rom! %BIOS_ID%.bin + copy /b/y !IFWI_HEADER_FILE! + %WORKSPACE%\Vlv2Binaries\Vlv2MiscBinari= esPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin + %WORKSPACE%\Vlv2Binaries\Vlv2M= iscBinariesPkg\SEC\!SEC_VERSION!\Vacant.bin + !BIOS_Rom! %BIOS_ID%.bin echo. echo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D ) diff --git a/Vlv2TbltDevicePkg/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat index a1d8c5b525..27bc4e7c41 100644 --- a/Vlv2TbltDevicePkg/bld_vlv.bat +++ b/Vlv2TbltDevicePkg/bld_vlv.bat @@ -20,8 +20,8 @@ echo. ::********************************************************************** :: Initial Setup ::********************************************************************** -set WORKSPACE=3D%CD% -if %WORKSPACE:~-1%=3D=3D\ set WORKSPACE=3D%WORKSPACE:~0,-1% +REM set WORKSPACE=3D%CD% +REM if %WORKSPACE:~-1%=3D=3D\ set WORKSPACE=3D%WORKSPACE:~0,-1% set /a build_threads=3D1 set "Build_Flags=3D " set exitCode=3D0 @@ -36,7 +36,7 @@ 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.t= xt if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\Framew= orkDatabase.db -if exist conf\.cache rmdir /q/s conf\.cache +if exist %WORKSPACE%\Conf\.cache rmdir /q/s %WORKSPACE%\Conf\.cache =20 :: Setup EDK environment. Edksetup puts new copies of target.txt, tools_de= f.txt, build_rule.txt in WorkSpace\Conf :: Also run edksetup as soon as possible to avoid it from changing environ= ment variables we're overriding @@ -48,7 +48,7 @@ set PLATFORM_PACKAGE=3DVlv2TbltDevicePkg set config_file=3D.\%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc set auto_config_inc=3D.\%PLATFORM_PACKAGE%\AutoPlatformCFG.txt =20 -set EDK_SOURCE=3D%WORKSPACE%\EdkCompatibilityPkg +REM set EDK_SOURCE=3D%WORKSPACE%\EdkCompatibilityPkg =20 ::create new AutoPlatformCFG.txt file copy /y nul %auto_config_inc% >nul @@ -109,17 +109,17 @@ if "%~1"=3D=3D"" goto Usage =20 ::Remove the values for Platform_Type and Build_Target from BiosIdX.env an= d stage in Conf\ if "%Arch%"=3D=3D"IA32" ( - findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env > = Conf\BiosId.env + findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env > = %WORKSPACE%\Conf\BiosId.env echo DEFINE X64_CONFIG =3D FALSE >> %auto_config_inc% ) else if "%Arch%"=3D=3D"X64" ( - findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.env= > Conf\BiosId.env + findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.env= > %WORKSPACE%\Conf\BiosId.env echo DEFINE X64_CONFIG =3D TRUE >> %auto_config_inc% ) =20 :: -- Build flags settings for each Platform -- echo Setting %1 platform configuration and BIOS ID... if /i "%~1" =3D=3D "MNW2" ( - echo BOARD_ID =3D MNW2MAX >> %Conf\BiosId.env + echo BOARD_ID =3D MNW2MAX >> %WORKSPACE%\Conf\BiosId.env echo DEFINE ENBDT_PF_BUILD =3D TRUE >> %auto_config_inc% =20 ) else ( @@ -130,37 +130,23 @@ set Platform_Type=3D%~1 =20 if /i "%~2" =3D=3D "RELEASE" ( set target=3DRELEASE - echo BUILD_TYPE =3D R >> Conf\BiosId.env + echo BUILD_TYPE =3D R >> %WORKSPACE%\Conf\BiosId.env ) else ( set target=3DDEBUG - echo BUILD_TYPE =3D D >> Conf\BiosId.env + echo BUILD_TYPE =3D D >> %WORKSPACE%\Conf\BiosId.env ) =20 ::********************************************************************** -:: Additional EDK Build Setup/Configuration -::********************************************************************** -echo. +:: Additional EDK Build Setup/Configuration +::********************************************************************** +echo. echo Setting the Build environment for VS2008/VS2010/VS2012/VS2013... -if defined VS90COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" - if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 9.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2008 - ) else ( - set TOOL_CHAIN_TAG=3DVS2008x86 - ) - ) else if defined VS100COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat" - if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 10.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2010 +if defined VS140COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS140COMNTOOLS%\vsvars32.bat" + if /I "%VS140COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 14.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2015 ) else ( - set TOOL_CHAIN_TAG=3DVS2010x86 - ) -) else if defined VS110COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat" - if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 11.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=3DVS2012 - ) else ( - set TOOL_CHAIN_TAG=3DVS2012x86 + set TOOL_CHAIN_TAG=3DVS2015x86 ) ) else if defined VS120COMNTOOLS ( if not defined VSINSTALLDIR call "%VS120COMNTOOLS%\vsvars32.bat" @@ -169,35 +155,56 @@ if defined VS90COMNTOOLS ( ) else ( set TOOL_CHAIN_TAG=3DVS2013x86 ) -) else ( - echo --ERROR: VS2008/VS2010/VS2012/VS2013 not installed correctly. VS90= COMNTOOLS/VS100COMNTOOLS/VS110COMNTOOLS/VS120COMNTOOLS not defined ^^! +) else if defined VS110COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat" + if /I "%VS110COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 11.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2012 + ) else ( + set TOOL_CHAIN_TAG=3DVS2012x86 + ) +) else if defined VS100COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat" + if /I "%VS100COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studi= o 10.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2010 + ) else ( + set TOOL_CHAIN_TAG=3DVS2010x86 + ) +) else if defined VS90COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" + if /I "%VS90COMNTOOLS%" =3D=3D "C:\Program Files\Microsoft Visual Studio= 9.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=3DVS2008 + ) else ( + set TOOL_CHAIN_TAG=3DVS2008x86 + ) +) else ( + echo --ERROR: VS2008/VS2010/VS2012/VS2013/VS2015 not installed correctl= y. VS90COMNTOOLS/VS100COMNTOOLS/VS110COMNTOOLS/VS120COMNTOOLS/VS140COMMONTO= OLS not defined ^^! echo. goto :BldFail -) +) =20 echo Ensuring correct build directory is present for GenBiosId... -set BUILD_PATH=3DBuild\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% +set BUILD_PATH=3D%WORKSPACE%\Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN= _TAG% =20 echo Modifing Conf files for this build... :: Remove lines with these tags from target.txt -findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_P= LATFORM MAX_CONCURRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp +findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_P= LATFORM MAX_CONCURRENT_THREAD_NUMBER" %WORKSPACE%\Conf\target.txt > %WORKS= PACE%\Conf\target.txt.tmp =20 -echo TARGET =3D %TARGET% >> Conf= \target.txt.tmp +echo TARGET =3D %TARGET% >> %WOR= KSPACE%\Conf\target.txt.tmp if "%Arch%"=3D=3D"IA32" ( - echo TARGET_ARCH =3D IA32 >> Conf= \target.txt.tmp + echo TARGET_ARCH =3D IA32 >> %WOR= KSPACE%\Conf\target.txt.tmp ) else if "%Arch%"=3D=3D"X64" ( - echo TARGET_ARCH =3D IA32 X64 >> Conf= \target.txt.tmp + echo TARGET_ARCH =3D IA32 X64 >> %WOR= KSPACE%\Conf\target.txt.tmp ) -echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% = >> Conf\target.txt.tmp -echo BUILD_RULE_CONF =3D Conf/build_rule.txt = >> Conf\target.txt.tmp +echo TOOL_CHAIN_TAG =3D %TOOL_CHAIN_TAG% = >> %WORKSPACE%\Conf\target.txt.tmp +echo BUILD_RULE_CONF =3D Conf/build_rule.txt = >> %WORKSPACE%\Conf\target.txt.tmp if %Source% =3D=3D 0 ( - echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc = >> Conf\target.txt.tmp + echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc = >> %WORKSPACE%\Conf\target.txt.tmp ) else ( - echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc = >> Conf\target.txt.tmp + echo ACTIVE_PLATFORM =3D %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc = >> %WORKSPACE%\Conf\target.txt.tmp ) -echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% = >> Conf\target.txt.tmp +echo MAX_CONCURRENT_THREAD_NUMBER =3D %build_threads% = >> %WORKSPACE%\Conf\target.txt.tmp =20 -move /Y Conf\target.txt.tmp Conf\target.txt >nul +move /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt >nul =20 ::********************************************************************** :: Build BIOS @@ -205,11 +212,11 @@ move /Y Conf\target.txt.tmp Conf\target.txt >nul =20 echo Creating BiosId... pushd %PLATFORM_PACKAGE% -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 not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32 + GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId= .bin -ob %WORKSPACE%\Conf\BiosId.bat if "%Arch%"=3D=3D"X64" ( - if not exist ..\%BUILD_PATH%\X64 mkdir ..\%BUILD_PATH%\X64 - GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\X64\BiosId.bin -= ob ..\Conf\BiosId.bat + if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64 + GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId= .bin -ob %WORKSPACE%\Conf\BiosId.bat ) popd =20 @@ -230,10 +237,10 @@ echo Running fce... =20 pushd %PLATFORM_PACKAGE% :: Extract Hii data from build and store in HiiDefaultData.txt -fce read -i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.= txt +fce read -i %BUILD_PATH%\FV\Vlv.fd > %BUILD_PATH%\FV\HiiDefaultData.txt =20 :: save changes to VlvXXX.fd -fce update -i ..\%BUILD_PATH%\FV\Vlv.fd -s ..\%BUILD_PATH%\FV\HiiDefaultDa= ta.txt -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd +fce update -i %BUILD_PATH%\FV\Vlv.fd -s %BUILD_PATH%\FV\HiiDefaultData.txt= -o %BUILD_PATH%\FV\Vlv%Arch%.fd =20 popd =20 @@ -241,7 +248,7 @@ if %ERRORLEVEL% NEQ 0 goto BldFail ::echo FD successfully updated with default Hii values. =20 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environm= ent variables -find /v "#" Conf\BiosId.env > ver_strings +find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings for /f "tokens=3D1,3" %%i in (ver_strings) do set %%i=3D%%j del /f/q ver_strings >nul =20 @@ -257,7 +264,11 @@ echo -------------------- The EDKII BIOS build has suc= cessfully completed. ----- echo. =20 @REM build capsule here -if "%openssl_path%" =3D=3D "" goto Exit +if "%openssl_path%" =3D=3D "" ( + echo -- Error: OPENSSL_PATH not set. Capule and Recovery images not = generated. + set exitCode=3D1 + goto Exit +) echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc =20 --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 20:12:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522215226986576.8450182381081; Tue, 27 Mar 2018 22:33:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 03B14225E4010; Tue, 27 Mar 2018 22:27:00 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 A51DF21F85E76 for ; Tue, 27 Mar 2018 22:26:57 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 22:33:34 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.73.52]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 22:33:33 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,369,1517904000"; d="scan'208";a="215356020" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 22:33:27 -0700 Message-Id: <20180328053330.13272-3-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180328053330.13272-1-michael.d.kinney@intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 2/5] Vlv2TbltDevicePkg: Fix VS2015 build breaks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Jiewen Yao , David Wei MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Fix minor code issues that break VS2015 builds. Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: David Wei --- Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c | 1 - Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c | 6 ------ Vlv2TbltDevicePkg/VlvPlatformInitDxe/VlvPlatformInit.c | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Vlv2Tb= ltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c index b0e29f02d0..f608651cd4 100644 --- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c +++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c @@ -1185,7 +1185,6 @@ UpdatePlatformInformation ( EFI_STATUS Status; UINT8 CpuFlavor=3D0; EFI_PEI_HOB_POINTERS GuidHob; - EFI_PLATFORM_INFO_HOB *mPlatformInfo=3DNULL; UINTN NumHandles; EFI_HANDLE *HandleBuffer; UINTN Index; diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c b= /Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c index b18a6aaa3b..4a83aedc97 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c @@ -28,12 +28,6 @@ Abstract: #include #include =20 - -extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL1; -extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL2; -extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL3; - - UINT32 ConvertBase2ToRaw ( IN EFI_EXP_BASE2_DATA *Data) diff --git a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/VlvPlatformInit.c b/Vlv2T= bltDevicePkg/VlvPlatformInitDxe/VlvPlatformInit.c index 5e8d95ae9f..f8274e9df0 100644 --- a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/VlvPlatformInit.c +++ b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/VlvPlatformInit.c @@ -147,7 +147,7 @@ PostPmInitCallBack ( EFI_STATUS IgdPmHook ( IN EFI_HANDLE ImageHandle, - IN DXE_VLV_PLATFORM_POLICY_PROTOCOL *DxePlatformSaPolicy + IN DXE_VLV_PLATFORM_POLICY_PROTOCOL *DxePlatformSaPolicyParam ) { =20 --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 20:12:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522215253028345.9492552762065; Tue, 27 Mar 2018 22:34:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9564F22551B85; Tue, 27 Mar 2018 22:26:59 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 A6048221C194A for ; Tue, 27 Mar 2018 22:26:57 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 22:33:35 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.73.52]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 22:33:34 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,369,1517904000"; d="scan'208";a="215356025" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 22:33:28 -0700 Message-Id: <20180328053330.13272-4-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180328053330.13272-1-michael.d.kinney@intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 3/5] Vlv2TbltDevicePkg: Fix build issues in DSC/FDF X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Jiewen Yao , David Wei MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Fix a the following issues in DSC/FDF files * Remove references to drivers that are not present * Enable the Tianocore boot logo and BGRT table * Enable full UEFI shell * Enable more debug messages in DXE phase Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: David Wei --- Vlv2TbltDevicePkg/PlatformPkg.fdf | 15 ++++++++++++--- Vlv2TbltDevicePkg/PlatformPkgGcc.fdf | 17 +++++++++++++---- Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 12 ++++++++---- Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 12 ++++++++---- Vlv2TbltDevicePkg/PlatformPkgX64.dsc | 14 +++++++++----- 5 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf b/Vlv2TbltDevicePkg/Platform= Pkg.fdf index 846db044b4..85309650db 100644 --- a/Vlv2TbltDevicePkg/PlatformPkg.fdf +++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf @@ -319,7 +319,7 @@ [FV.FVRECOVERY2] INF EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThun= k/AcpiVariableHobOnSmramReserveHobThunk.inf !endif =20 -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/IA32/PiSmmCommunicationPei.inf +# INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTUR= E)$(TARGET)/IA32/PiSmmCommunicationPei.inf !if $(TPM_ENABLED) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/TcgPei/TcgPei.inf @@ -473,6 +473,7 @@ [FV.FVMAIN] INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MpCpu.inf INF $(PLATFORM_PACKAGE)/Metronome/Metronome.inf INF IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf +INF USE=3DX64 MdeModulePkg/Logo/Logo.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf @@ -612,6 +613,8 @@ [FV.FVMAIN] =20 INF $(PLATFORM_PACKAGE)/AcpiPlatform/AcpiPlatform.inf =20 +INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsR= esourceTableDxe.inf + # # PCI # @@ -635,8 +638,8 @@ [FV.FVMAIN] # # SDIO # -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MmcHost.inf -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MmcMediaDevice.inf +#INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE= )$(TARGET)/$(DXE_ARCHITECTURE)/MmcHost.inf +#INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE= )$(TARGET)/$(DXE_ARCHITECTURE)/MmcMediaDevice.inf # # IDE/SCSI/AHCI # @@ -1091,6 +1094,12 @@ [Rule.Common.USER_DEFINED] RAW BIN |.bin } =20 +[Rule.Common.USER_DEFINED.BINARY] + FILE FREEFORM =3D $(NAMED_GUID) { + UI STRING=3D"$(MODULE_NAME)" Optional + RAW BIN |.bin + } + [Rule.Common.USER_DEFINED.ACPITABLE] FILE FREEFORM =3D $(NAMED_GUID) { RAW ACPI Optional |.acpi diff --git a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf b/Vlv2TbltDevicePkg/Platf= ormPkgGcc.fdf index 479c4c7264..51a620ea15 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf +++ b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf @@ -276,7 +276,7 @@ [FV.FVRECOVERY2] INF EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThun= k/AcpiVariableHobOnSmramReserveHobThunk.inf !endif =20 -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/IA32/PiSmmCommunicationPei.inf +# INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTUR= E)$(TARGET)/IA32/PiSmmCommunicationPei.inf !if $(TPM_ENABLED) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/TcgPei/TcgPei.inf @@ -430,6 +430,7 @@ [FV.FVMAIN] INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MpCpu.inf INF $(PLATFORM_PACKAGE)/Metronome/Metronome.inf INF IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf +INF USE=3DX64 MdeModulePkg/Logo/Logo.inf INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf @@ -569,6 +570,8 @@ [FV.FVMAIN] =20 INF $(PLATFORM_PACKAGE)/AcpiPlatform/AcpiPlatform.inf =20 +INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsR= esourceTableDxe.inf + # # PCI # @@ -592,8 +595,8 @@ [FV.FVMAIN] # # SDIO # -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MmcHost.inf -INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)= $(TARGET)/$(DXE_ARCHITECTURE)/MmcMediaDevice.inf +#INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE= )$(TARGET)/$(DXE_ARCHITECTURE)/MmcHost.inf +#INF RuleOverride =3D BINARY $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE= )$(TARGET)/$(DXE_ARCHITECTURE)/MmcMediaDevice.inf # # IDE/SCSI/AHCI # @@ -670,7 +673,7 @@ [FV.FVMAIN] # FILE APPLICATION =3D PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShel= lFile) { # SECTION PE32 =3D EdkShellBinPkg/FullShell/$(EDK_DXE_ARCHITECTURE)/She= ll_Full.efi - SECTION PE32 =3D EdkShellBinPkg/MinimumShell/$(EDK_DXE_ARCHITECTURE)/Sh= ell.efi + SECTION PE32 =3D ShellBinPkg/UefiShell/$(EDK_DXE_ARCHITECTURE)/Shell.e= fi } =20 # @@ -1052,6 +1055,12 @@ [Rule.Common.USER_DEFINED] RAW BIN |.bin } =20 +[Rule.Common.USER_DEFINED.BINARY] + FILE FREEFORM =3D $(NAMED_GUID) { + UI STRING=3D"$(MODULE_NAME)" Optional + RAW BIN |.bin + } + [Rule.Common.USER_DEFINED.ACPITABLE] FILE FREEFORM =3D $(NAMED_GUID) { RAW ACPI Optional |.acpi diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/Pl= atformPkgGccX64.dsc index dc2c5b63e9..f918e44851 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc @@ -303,6 +303,8 @@ [LibraryClasses.common] FspHobProcessLib|Vlv2TbltDevicePkg/FspSupport/Library/PeiFspHobProcessLi= bVlv2/FspHobProcessLibVlv2.inf !endif =20 + BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf + [LibraryClasses.IA32.SEC] !if $(PERFORMANCE_ENABLE) =3D=3D TRUE PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf @@ -375,7 +377,7 @@ [LibraryClasses.X64] HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRou= terDxe.inf =20 [LibraryClasses.X64.DXE_DRIVER] - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize= dDisplayLib.inf @@ -1035,7 +1037,7 @@ [Components.IA32] UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/MpS3.inf EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/= AcpiVariableHobOnSmramReserveHobThunk.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommun= icationPei.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommu= nicationPei.inf =20 !if $(RECOVERY_ENABLE) # @@ -1409,6 +1411,8 @@ [Components.X64] =20 $(PLATFORM_PACKAGE)/AcpiPlatform/AcpiPlatform.inf =20 + MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf + # # PCI # @@ -1430,8 +1434,8 @@ [Components.X64] # # SDIO # - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcHost.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcMediaDevice.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcHost.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcMediaDevice.inf !if $(ACPI50_ENABLE) =3D=3D TRUE MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerf= ormanceDxe.inf { diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Vlv2TbltDevicePkg/Plat= formPkgIA32.dsc index 35a51944f3..0a95d95557 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc @@ -303,6 +303,8 @@ [LibraryClasses.common] FspHobProcessLib|Vlv2TbltDevicePkg/FspSupport/Library/PeiFspHobProcessLi= bVlv2/FspHobProcessLibVlv2.inf !endif =20 + BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf + [LibraryClasses.IA32.SEC] !if $(PERFORMANCE_ENABLE) =3D=3D TRUE PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf @@ -375,7 +377,7 @@ [LibraryClasses.IA32] HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRou= terDxe.inf =20 [LibraryClasses.IA32.DXE_DRIVER] - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize= dDisplayLib.inf @@ -1035,7 +1037,7 @@ [Components.IA32] UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/MpS3.inf EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/= AcpiVariableHobOnSmramReserveHobThunk.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommun= icationPei.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommu= nicationPei.inf =20 !if $(RECOVERY_ENABLE) # @@ -1397,6 +1399,8 @@ [Components.IA32] =20 $(PLATFORM_PACKAGE)/AcpiPlatform/AcpiPlatform.inf =20 + MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf + # # PCI # @@ -1418,8 +1422,8 @@ [Components.IA32] # # SDIO # - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcHost.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcMediaDevice.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcHost.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcMediaDevice.inf !if $(ACPI50_ENABLE) =3D=3D TRUE MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerf= ormanceDxe.inf { diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc b/Vlv2TbltDevicePkg/Platf= ormPkgX64.dsc index 5fab75c31e..fb2743c727 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc @@ -303,6 +303,8 @@ [LibraryClasses.common] FspHobProcessLib|Vlv2TbltDevicePkg/FspSupport/Library/PeiFspHobProcessLi= bVlv2/FspHobProcessLibVlv2.inf !endif =20 + BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf + [LibraryClasses.IA32.SEC] !if $(PERFORMANCE_ENABLE) =3D=3D TRUE PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf @@ -375,7 +377,7 @@ [LibraryClasses.X64] HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRou= terDxe.inf =20 [LibraryClasses.X64.DXE_DRIVER] - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize= dDisplayLib.inf @@ -698,7 +700,7 @@ [PcdsFixedAtBuild.common] gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|2 !endif =20 -[PcdsFixedAtBuild.IA32.PEIM, PcdsFixedAtBuild.IA32.PEI_CORE, PcdsFixedAtBu= ild.IA32.SEC] +[PcdsFixedAtBuild.IA32] !if $(TARGET) =3D=3D RELEASE gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0 gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x3 @@ -1035,7 +1037,7 @@ [Components.IA32] UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/MpS3.inf EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/= AcpiVariableHobOnSmramReserveHobThunk.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommun= icationPei.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/PiSmmCommu= nicationPei.inf =20 !if $(RECOVERY_ENABLE) # @@ -1409,6 +1411,8 @@ [Components.X64] =20 $(PLATFORM_PACKAGE)/AcpiPlatform/AcpiPlatform.inf =20 + MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf + # # PCI # @@ -1430,8 +1434,8 @@ [Components.X64] # # SDIO # - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcHost.inf - $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTU= RE)/MmcMediaDevice.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcHost.inf +# $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECT= URE)/MmcMediaDevice.inf !if $(ACPI50_ENABLE) =3D=3D TRUE MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerf= ormanceDxe.inf { --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 20:12:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522215233747717.9328928958779; Tue, 27 Mar 2018 22:33:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D2919225E4035; Tue, 27 Mar 2018 22:27:03 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 D4AB0224AE8D3 for ; Tue, 27 Mar 2018 22:26:57 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 22:33:35 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.73.52]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 22:33:34 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,369,1517904000"; d="scan'208";a="215356029" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 22:33:29 -0700 Message-Id: <20180328053330.13272-5-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180328053330.13272-1-michael.d.kinney@intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 4/5] Vlv2TbltDevicePkg: Display logo on BOOT_ON_FLASH_UPDATE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Jiewen Yao , David Wei MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Update PlatformBdsLib to show boot logo when the boot mode is BOOT_ON_FLASH_UPDATE. Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: David Wei --- Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2T= bltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c index e42e82b678..c25e1d301a 100644 --- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c +++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
= =20 This program and the accompanying materials are licensed and made availa= ble under the terms and conditions of the BSD License that accompanies this distri= bution. =20 @@ -1871,6 +1871,7 @@ PlatformBdsPolicyBehavior ( // PlatformBdsConnectConsole (gPlatformConsole); PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest); + EnableQuietBoot (PcdGetPtr(PcdLogoFile)); =20 DEBUG((DEBUG_INFO, "ProcessCapsules Before EndOfDxe......\n")); ProcessCapsules (); @@ -2642,6 +2643,8 @@ PlatformBdsEnterFrontPageWithHotKey ( { EFI_STATUS Status; =20 + EFI_STATUS LogoStatus; + EFI_BOOT_LOGO_PROTOCOL *BootLogo; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut; UINTN BootTextColumn; @@ -2721,6 +2724,14 @@ PlatformBdsEnterFrontPageWithHotKey ( gST->ConOut->EnableCursor (gST->ConOut, TRUE); gST->ConOut->ClearScreen (gST->ConOut); =20 + // + // Boot Logo is corrupted, report it using Boot Logo protocol. + // + LogoStatus =3D gBS->LocateProtocol (&gEfiBootLogoProtocolGuid, NULL, (= VOID **) &BootLogo); + if (!EFI_ERROR (LogoStatus) && (BootLogo !=3D NULL)) { + BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0); + } + if (EFI_ERROR (Status)) { // // Timeout or user press enter to continue @@ -2728,6 +2739,7 @@ PlatformBdsEnterFrontPageWithHotKey ( goto Exit; } } + // // Install BM HiiPackages.=20 // Keep BootMaint HiiPackage, so that it can be covered by global settin= g.=20 --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 20:12:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1522215230411716.2834510496393; Tue, 27 Mar 2018 22:33:50 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 60201225E403A; Tue, 27 Mar 2018 22:27:03 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 D95112252CBB2 for ; Tue, 27 Mar 2018 22:26:57 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 22:33:35 -0700 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.254.73.52]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 22:33:35 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,369,1517904000"; d="scan'208";a="215356034" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 27 Mar 2018 22:33:30 -0700 Message-Id: <20180328053330.13272-6-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20180328053330.13272-1-michael.d.kinney@intel.com> References: <20180328053330.13272-1-michael.d.kinney@intel.com> Subject: [edk2] [Patch 5/5] Vlv2TbltDevicePkg: Sync FLASH libraries from UDK2017 branch X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Jiewen Yao , David Wei MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D911 Update Minnow Max FLASH libraries to match libraries in the UDK2017 development branch in edk2-platforms. https://github.com/tianocore/edk2-platforms/tree/devel-MinnowBoardMax-UDK20= 17 Cc: David Wei Cc: Mang Guo Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: Guo Mang Reviewed-by: David Wei --- .../PlatformFlashAccessLib.c | 491 +++++++++++++++++= +++- .../PlatformFlashAccessLib.inf | 19 +- .../Library/FlashDeviceLib/FlashDeviceLib.c | 158 ++++++- .../Library/FlashDeviceLib/FlashDeviceLib.inf | 6 +- .../Library/FlashDeviceLib/SpiChipDefinitions.h | 1 + 5 files changed, 639 insertions(+), 36 deletions(-) diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessL= ib/PlatformFlashAccessLib.c b/Vlv2TbltDevicePkg/Feature/Capsule/Library/Pla= tformFlashAccessLib/PlatformFlashAccessLib.c index f3cb31daaa..9162e025ed 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/Plat= formFlashAccessLib.c +++ b/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/Plat= formFlashAccessLib.c @@ -1,7 +1,7 @@ /** @file Platform Flash Access library. =20 - Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -11,6 +11,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 **/ +#include =20 #include =20 @@ -19,14 +20,366 @@ #include #include #include -#include +//#include #include +#include +#include +#include "PchAccess.h" +#include +#include +#include +#include =20 -#define SECTOR_SIZE_64KB 0x10000 // Common 64kBytes sector size -#define ALINGED_SIZE SECTOR_SIZE_64KB +//#define SECTOR_SIZE_64KB 0x10000 // Common 64kBytes sector size +//#define ALINGED_SIZE SECTOR_SIZE_64KB + +#define BLOCK_SIZE 0x1000 +#define ALINGED_SIZE BLOCK_SIZE + +#define R_PCH_LPC_BIOS_CNTL 0xDC +#define B_PCH_LPC_BIOS_CNTL_SMM_BWP 0x20 ///< SMM= BIOS write protect disable + +// +// Prefix Opcode Index on the host SPI controller +// +typedef enum { + SPI_WREN, // Prefix Opcode 0: Write Enable + SPI_EWSR, // Prefix Opcode 1: Enable Write Status Register +} PREFIX_OPCODE_INDEX; +// +// Opcode Menu Index on the host SPI controller +// +typedef enum { + SPI_READ_ID, // Opcode 0: READ ID, Read cycle with address + SPI_READ, // Opcode 1: READ, Read cycle with address + SPI_RDSR, // Opcode 2: Read Status Register, No address + SPI_WRDI_SFDP, // Opcode 3: Write Disable or Discovery Parameters, = No address + SPI_SERASE, // Opcode 4: Sector Erase (4KB), Write cycle with ad= dress + SPI_BERASE, // Opcode 5: Block Erase (32KB), Write cycle with ad= dress + SPI_PROG, // Opcode 6: Byte Program, Write cycle with address + SPI_WRSR, // Opcode 7: Write Status Register, No address +} SPI_OPCODE_INDEX; =20 STATIC EFI_PHYSICAL_ADDRESS mInternalFdAddress; =20 +EFI_SPI_PROTOCOL *mSpiProtocol; + +/** + Read NumBytes bytes of data from the address specified by + PAddress into Buffer. + + @param[in] Address The starting physical address of the read. + @param[in,out] NumBytes On input, the number of bytes to read. On = output, the number + of bytes actually read. + @param[out] Buffer The destination data buffer for the read. + + @retval EFI_SUCCESS Opertion is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + +**/ +EFI_STATUS +EFIAPI +SpiFlashRead ( + IN UINTN Address, + IN OUT UINT32 *NumBytes, + OUT UINT8 *Buffer + ) +{ + EFI_STATUS Status =3D EFI_SUCCESS; + UINTN Offset =3D 0; + + ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); + + + //if (Address >=3D (UINTN)PcdGet32 (PcdGbeRomBase) && Address < (UINTN)P= cdGet32 (PcdPDRRomBase)) { + Offset =3D Address - (UINTN)PcdGet32 (PcdFlashChipBase); + + Status =3D mSpiProtocol->Execute ( + mSpiProtocol, + 1, //SPI_READ, + 0, //SPI_WREN, + TRUE, + TRUE, + FALSE, + Offset, + BLOCK_SIZE, + Buffer, + EnumSpiRegionAll + ); + return Status; +} + +/** + Write NumBytes bytes of data from Buffer to the address specified by + PAddresss. + + @param[in] Address The starting physical address of the wri= te. + @param[in,out] NumBytes On input, the number of bytes to write. = On output, + the actual number of bytes written. + @param[in] Buffer The source data buffer for the write. + + @retval EFI_SUCCESS Opertion is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + +**/ +EFI_STATUS +EFIAPI +SpiFlashWrite ( + IN UINTN Address, + IN OUT UINT32 *NumBytes, + IN UINT8 *Buffer + ) +{ + EFI_STATUS Status; + UINTN Offset; + UINT32 Length; + UINT32 RemainingBytes; + + ASSERT ((NumBytes !=3D NULL) && (Buffer !=3D NULL)); + ASSERT (Address >=3D (UINTN)PcdGet32 (PcdFlashChipBase)); + + Offset =3D Address - (UINTN)PcdGet32 (PcdFlashChipBase); + + ASSERT ((*NumBytes + Offset) <=3D (UINTN)PcdGet32 (PcdFlashChipSize)); + + Status =3D EFI_SUCCESS; + RemainingBytes =3D *NumBytes; + + while (RemainingBytes > 0) { + if (RemainingBytes > SIZE_4KB) { + Length =3D SIZE_4KB; + } else { + Length =3D RemainingBytes; + } + Status =3D mSpiProtocol->Execute ( + mSpiProtocol, + SPI_PROG, + SPI_WREN, + TRUE, + TRUE, + TRUE, + (UINT32) Offset, + Length, + Buffer, + EnumSpiRegionAll + ); + if (EFI_ERROR (Status)) { + break; + } + RemainingBytes -=3D Length; + Offset +=3D Length; + Buffer +=3D Length; + } + + // + // Actual number of bytes written + // + *NumBytes -=3D RemainingBytes; + + return Status; +} + + +EFI_STATUS +InternalReadBlock ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + OUT VOID *ReadBuffer + ) +{ + EFI_STATUS Status; + UINT32 BlockSize; + + BlockSize =3D BLOCK_SIZE; + + Status =3D SpiFlashRead ((UINTN) BaseAddress, &BlockSize, ReadBuffer); + + return Status; +} + +/** + Erase the block starting at Address. + + @param[in] Address The starting physical address of the block t= o be erased. + This library assume that caller garantee tha= t the PAddress + is at the starting address of this block. + @param[in] NumBytes On input, the number of bytes of the logical= block to be erased. + On output, the actual number of bytes erased. + + @retval EFI_SUCCESS. Opertion is successful. + @retval EFI_DEVICE_ERROR If there is any device errors. + +**/ +EFI_STATUS +EFIAPI +SpiFlashBlockErase ( + IN UINTN Address, + IN UINTN *NumBytes + ) +{ + EFI_STATUS Status; + UINTN Offset; + UINTN RemainingBytes; + + ASSERT (NumBytes !=3D NULL); + ASSERT (Address >=3D (UINTN)PcdGet32 (PcdFlashChipBase)); + + Offset =3D Address - (UINTN)PcdGet32 (PcdFlashChipBase); + + ASSERT ((*NumBytes % SIZE_4KB) =3D=3D 0); + ASSERT ((*NumBytes + Offset) <=3D (UINTN)PcdGet32 (PcdFlashChipSize)); + + Status =3D EFI_SUCCESS; + RemainingBytes =3D *NumBytes; + + // + // To adjust the Offset with Bios/Gbe + // +// if (Address >=3D (UINTN)PcdGet32 (PcdFlashChipBase)) { +// Offset =3D Address - (UINTN)PcdGet32 (PcdFlashChipBase); + + while (RemainingBytes > 0) { + Status =3D mSpiProtocol->Execute ( + mSpiProtocol, + SPI_SERASE, + SPI_WREN, + FALSE, + TRUE, + FALSE, + (UINT32) Offset, + 0, + NULL, + EnumSpiRegionAll + ); + if (EFI_ERROR (Status)) { + break; + } + RemainingBytes -=3D SIZE_4KB; + Offset +=3D SIZE_4KB; + } +// } + + // + // Actual number of bytes erased + // + *NumBytes -=3D RemainingBytes; + + return Status; +} + +/** + +Routine Description: + + Erase the whole block. + +Arguments: + + BaseAddress - Base address of the block to be erased. + +Returns: + + EFI_SUCCESS - The command completed successfully. + Other - Device error or wirte-locked, operation failed. + +**/ +EFI_STATUS +InternalEraseBlock ( + IN EFI_PHYSICAL_ADDRESS BaseAddress + ) +{ + EFI_STATUS Status; + UINTN NumBytes; + + NumBytes =3D BLOCK_SIZE; + + Status =3D SpiFlashBlockErase ((UINTN) BaseAddress, &NumBytes); + + return Status; +} + +EFI_STATUS +InternalCompareBlock ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT8 *Buffer + ) +{ + EFI_STATUS Status; + VOID *CompareBuffer; + UINT32 NumBytes; + INTN CompareResult; + + NumBytes =3D BLOCK_SIZE; + CompareBuffer =3D AllocatePool (NumBytes); + if (CompareBuffer =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto Done; + } + + Status =3D SpiFlashRead ((UINTN) BaseAddress, &NumBytes, CompareBuffer); + if (EFI_ERROR (Status)) { + goto Done; + } + CompareResult =3D CompareMem (CompareBuffer, Buffer, BLOCK_SIZE); + if (CompareResult !=3D 0) { + Status =3D EFI_VOLUME_CORRUPTED; + } + +Done: + if (CompareBuffer !=3D NULL) { + FreePool (CompareBuffer); + } + + return Status; +} + +/** + +Routine Description: + + Write a block of data. + +Arguments: + + BaseAddress - Base address of the block. + Buffer - Data buffer. + BufferSize - Size of the buffer. + +Returns: + + EFI_SUCCESS - The command completed successfully. + EFI_INVALID_PARAMETER - Invalid parameter, can not proceed. + Other - Device error or wirte-locked, operation failed. + +**/ +EFI_STATUS +InternalWriteBlock ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT8 *Buffer, + IN UINT32 BufferSize + ) +{ + EFI_STATUS Status; + + Status =3D SpiFlashWrite ((UINTN) BaseAddress, &BufferSize, Buffer); + + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "\nFlash write error.")); + return Status; + } + + WriteBackInvalidateDataCacheRange ((VOID *) (UINTN) BaseAddress, BLOCK_S= IZE); + + Status =3D InternalCompareBlock (BaseAddress, Buffer); + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "\nError when writing to BaseAddress %x with diffe= rent at offset %x.", BaseAddress, Status)); + } else { + DEBUG((DEBUG_INFO, "\nVerified data written to Block at %x is correct.= ", BaseAddress)); + } + + return Status; + +} + /** Perform flash write opreation. =20 @@ -51,36 +404,122 @@ PerformFlashWrite ( IN UINTN Length ) { - EFI_STATUS Status; + EFI_STATUS Status =3D EFI_SUCCESS; + UINTN Index; + EFI_PHYSICAL_ADDRESS Address; + UINTN CountOfBlocks; + EFI_TPL OldTpl; + BOOLEAN FlashError; + UINT8 *Buf; + UINTN LpcBaseAddress; + UINT8 Data8Or; + UINT8 Data8And; + UINT8 BiosCntl; =20 - DEBUG((DEBUG_INFO, "PerformFlashWrite - 0x%x(%x) - 0x%x\n", (UINTN)Flash= Address, (UINTN)FlashAddressType, Length)); + Index =3D 0; + Address =3D 0; + CountOfBlocks =3D 0; + FlashError =3D FALSE; + Buf =3D Buffer; + + DEBUG((DEBUG_INFO | DEBUG_ERROR, "PerformFlashWrite - 0x%x(%x) - 0x%x\n"= , (UINTN)FlashAddress, (UINTN)FlashAddressType, Length)); if (FlashAddressType =3D=3D FlashAddressTypeRelativeAddress) { FlashAddress =3D FlashAddress + mInternalFdAddress; } =20 - DEBUG((DEBUG_INFO, " - 0x%x(%x) - 0x%x\n", (UINTN)Flash= Address, (UINTN)FlashAddressType, Length)); - LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, FALSE); + CountOfBlocks =3D (UINTN) (Length / BLOCK_SIZE); + Address =3D FlashAddress; =20 + LpcBaseAddress =3D MmPciAddress (0, + DEFAULT_PCI_BUS_NUMBER_PCH, + PCI_DEVICE_NUMBER_PCH_LPC, + PCI_FUNCTION_NUMBER_PCH_LPC, + 0 + ); + BiosCntl =3D MmioRead8 (LpcBaseAddress + R_PCH_LPC_BIOS_CNTL); + if ((BiosCntl & B_PCH_LPC_BIOS_CNTL_SMM_BWP) =3D=3D B_PCH_LPC_BIOS_CNTL_= SMM_BWP) { + /// + /// Clear SMM_BWP bit (D31:F0:RegDCh[5]) + /// + Data8And =3D (UINT8) ~B_PCH_LPC_BIOS_CNTL_SMM_BWP; + Data8Or =3D 0x00; + + MmioAndThenOr8 ( + LpcBaseAddress + R_PCH_LPC_BIOS_CNTL, + Data8And, + Data8Or + ); + DEBUG((DEBUG_INFO, "PerformFlashWrite Clear SMM_BWP bit\n")); + } + + // + // Raise TPL to TPL_NOTIFY to block any event handler, + // while still allowing RaiseTPL(TPL_NOTIFY) within + // output driver during Print() // - // Erase & Write - // - Status =3D LibFvbFlashDeviceBlockErase((UINTN)FlashAddress, Length); - ASSERT_EFI_ERROR(Status); + OldTpl =3D gBS->RaiseTPL (TPL_NOTIFY); + for (Index =3D 0; Index < CountOfBlocks; Index++) { + // + // Handle block based on address and contents. + // + if (!EFI_ERROR (InternalCompareBlock (Address, Buf))) { + DEBUG((DEBUG_INFO, "Skipping block at 0x%lx (already programmed)\n= ", Address)); + } else { + // + // Display a dot for each block being updated. + // + Print (L"."); + + // + // Make updating process uninterruptable, + // so that the flash memory area is not accessed by other entities + // which may interfere with the updating process + // + Status =3D InternalEraseBlock (Address); if (EFI_ERROR(Status)) { - LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE); - DEBUG((DEBUG_ERROR, "Flash Erase error\n")); - return Status; + gBS->RestoreTPL (OldTpl); + FlashError =3D TRUE; + goto Done; } - - Status =3D LibFvbFlashDeviceWrite((UINTN)FlashAddress, &Length, Buffer); - ASSERT_EFI_ERROR(Status); + Status =3D InternalWriteBlock ( + Address, + Buf, + (UINT32)(Length > BLOCK_SIZE ? BLOCK_SIZE : Length) + ); if (EFI_ERROR(Status)) { - LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE); - DEBUG((DEBUG_ERROR, "Flash write error\n")); - return Status; + gBS->RestoreTPL (OldTpl); + FlashError =3D TRUE; + goto Done; + } } =20 - LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE); + // + // Move to next block to update. + // + Address +=3D BLOCK_SIZE; + Buf +=3D BLOCK_SIZE; + if (Length > BLOCK_SIZE) { + Length -=3D BLOCK_SIZE; + } else { + Length =3D 0; + } + } + gBS->RestoreTPL (OldTpl); + + Done: + if ((BiosCntl & B_PCH_LPC_BIOS_CNTL_SMM_BWP) =3D=3D B_PCH_LPC_BIOS_CNTL_= SMM_BWP) { + // + // Restore original control setting + // + MmioWrite8 (LpcBaseAddress + R_PCH_LPC_BIOS_CNTL, BiosCntl); + } + + // + // Print flash update failure message if error detected. + // + if (FlashError) { + Print (L"No %r\n", Status); + } =20 return EFI_SUCCESS; } @@ -183,8 +622,16 @@ PerformFlashAccessLibConstructor ( VOID ) { + EFI_STATUS Status; mInternalFdAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32(PcdFlashAre= aBaseAddress); DEBUG((DEBUG_INFO, "PcdFlashAreaBaseAddress - 0x%x\n", mInternalFdAddres= s)); =20 + Status =3D gBS->LocateProtocol ( + &gEfiSpiProtocolGuid, + NULL, + (VOID **) &mSpiProtocol + ); + ASSERT_EFI_ERROR(Status); + return EFI_SUCCESS; } diff --git a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessL= ib/PlatformFlashAccessLib.inf b/Vlv2TbltDevicePkg/Feature/Capsule/Library/P= latformFlashAccessLib/PlatformFlashAccessLib.inf index 17ab38e27f..fbbdb91b64 100644 --- a/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/Plat= formFlashAccessLib.inf +++ b/Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/Plat= formFlashAccessLib.inf @@ -1,7 +1,7 @@ ## @file # Platform Flash Access library. # -# Copyright (c) 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License # which accompanies this distribution. The full text of the license may = be found at @@ -36,13 +36,26 @@ [Packages] MdeModulePkg/MdeModulePkg.dec SignedCapsulePkg/SignedCapsulePkg.dec Vlv2TbltDevicePkg/PlatformPkg.dec + Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec =20 [LibraryClasses] BaseMemoryLib + IoLib PcdLib DebugLib - FlashDeviceLib +# FlashDeviceLib MemoryAllocationLib + CacheMaintenanceLib + +[Guids] + gEdkiiSystemFmpCapsuleConfigFileGuid ## SOMETIMES_CONSUMES ## G= UID + +[Protocols] + gEfiSpiProtocolGuid ## CONSUMES =20 [Pcd] - gPlatformModuleTokenSpaceGuid.PcdFlashAreaBaseAddress + gPlatformModuleTokenSpaceGuid.PcdFlashAreaBaseAddress ## SOMETIMES_CONS= UMES + gPlatformModuleTokenSpaceGuid.PcdFlashChipBase ## SOMETIMES_CONS= UMES + gPlatformModuleTokenSpaceGuid.PcdFlashChipSize ## SOMETIMES_CONS= UMES + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## SOMETIMES_CONS= UMES + diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c b/Vl= v2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c index 8e6e5b4728..392ad1c14b 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c @@ -19,13 +19,14 @@ #include #include #include +#include +#include #include +#include +#include #include -#include +#include "SpiChipDefinitions.h" =20 -#define FLASH_SIZE 0x400000 - -#define FLASH_DEVICE_BASE_ADDRESS (0xFFFFFFFF-FLASH_SIZE+1) UINTN FlashDeviceBase =3D FLASH_DEVICE_BASE_ADDRESS; =20 EFI_SPI_PROTOCOL *mSpiProtocol =3D NULL; @@ -77,11 +78,11 @@ SpiFlashBlockErase ( UINT32 SpiAddress; =20 SpiAddress =3D (UINT32)(UINTN)(BaseAddress) - (UINT32)FlashDeviceBase; - SectorSize =3D SECTOR_SIZE_64KB; + SectorSize =3D SECTOR_SIZE_4KB; while ( (NumBytes > 0) && (NumBytes <=3D MAX_FWH_SIZE) ) { Status =3D mSpiProtocol->Execute ( mSpiProtocol, - SPI_BERASE, + SPI_SERASE, SPI_WREN, FALSE, TRUE, @@ -319,3 +320,148 @@ LibFvbFlashDeviceBlockLock ( return Status; } =20 +VOID +EFIAPI +LibFvbFlashDeviceVirtualAddressChangeNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + gRT->ConvertPointer (0, (VOID **) &mSpiProtocol); + gRT->ConvertPointer (0, (VOID **) &FlashDeviceBase); +} + + +/** + The library constructuor. + + The function does the necessary initialization work for this library + instance. Please put all initialization works in it. + + @param[in] ImageHandle The firmware allocated handle for the UEFI= image. + @param[in] SystemTable A pointer to the EFI system table. + + @retval EFI_SUCCESS The function always return EFI_SUCCESS for= now. + It will ASSERT on error for debug version. + @retval EFI_ERROR Please reference LocateProtocol for error = code details. + +**/ +EFI_STATUS +EFIAPI +LibFvbFlashDeviceSupportInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_EVENT Event; + UINT8 SfId[3]; + UINT8 FlashIndex; + UINT8 SpiReadError; + UINT8 SpiNotMatchError; + EFI_SMM_BASE2_PROTOCOL *SmmBase; + BOOLEAN InSmm; + + SpiReadError =3D 0x00; + SpiNotMatchError =3D 0x00; + + InSmm =3D FALSE; + Status =3D gBS->LocateProtocol ( + &gEfiSmmBase2ProtocolGuid, + NULL, + (void **)&SmmBase + ); + if (!EFI_ERROR(Status)) { + Status =3D SmmBase->InSmm(SmmBase, &InSmm); + if (EFI_ERROR(Status)) { + InSmm =3D FALSE; + } + } + + if (!InSmm) { + Status =3D gBS->LocateProtocol ( + &gEfiSpiProtocolGuid, + NULL, + (VOID **)&mSpiProtocol + ); + ASSERT_EFI_ERROR (Status); + + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + LibFvbFlashDeviceVirtualAddressChangeNotifyEvent, + NULL, + &gEfiEventVirtualAddressChangeGuid, + &Event + ); + ASSERT_EFI_ERROR (Status); + } else { + Status =3D gBS->LocateProtocol ( + &gEfiSmmSpiProtocolGuid, + NULL, + (VOID **)&mSpiProtocol + ); + ASSERT_EFI_ERROR (Status); + } + + + for (FlashIndex =3D EnumSpiFlashW25Q64; FlashIndex < EnumSpiFlashMax; Fl= ashIndex++) { + Status =3D mSpiProtocol->Init (mSpiProtocol, &(mInitTable[FlashIndex])= ); + if (!EFI_ERROR (Status)) { + // + // Read Vendor/Device IDs to check if the driver supports the Serial= Flash device. + // + Status =3D mSpiProtocol->Execute ( + mSpiProtocol, + SPI_READ_ID, + SPI_WREN, + TRUE, + FALSE, + FALSE, + 0, + 3, + SfId, + EnumSpiRegionAll + ); + if (!EFI_ERROR (Status)) { + if ((SfId[0] =3D=3D mInitTable[FlashIndex].VendorId) && + (SfId[1] =3D=3D mInitTable[FlashIndex].DeviceId0) && + (SfId[2] =3D=3D mInitTable[FlashIndex].DeviceId1)) { + // + // Found a matching SPI device, FlashIndex now contains flash = device. + // + DEBUG ((DEBUG_ERROR, "OK - Found SPI Flash Type in SPI Flash D= river, Device Type ID 0 =3D 0x%02x!\n", mInitTable[FlashIndex].DeviceId0)); + DEBUG ((DEBUG_ERROR, "Device Type ID 1 =3D 0x%02x!\n", mInitTa= ble[FlashIndex].DeviceId1)); + + if (mInitTable[FlashIndex].BiosStartOffset =3D=3D (UINTN) (-1)= ) { + DEBUG ((DEBUG_ERROR, "ERROR - The size of BIOS image is bigg= er than SPI Flash device!\n")); + CpuDeadLoop (); + } + break; + } else { + SpiNotMatchError++; + } + } else { + SpiReadError++; + } + } + } + + DEBUG ((DEBUG_ERROR, "SPI flash chip VID =3D 0x%X, DID0 =3D 0x%X, DID1 = =3D 0x%X\n", SfId[0], SfId[1], SfId[2])); + + if (FlashIndex < EnumSpiFlashMax) { + return EFI_SUCCESS; + } else { + if (SpiReadError !=3D 0) { + DEBUG ((DEBUG_ERROR, "ERROR - SPI Read ID execution failed! Error Co= unt =3D %d\n", SpiReadError)); + } + else { + if (SpiNotMatchError !=3D 0) { + DEBUG ((DEBUG_ERROR, "ERROR - No supported SPI flash chip found! E= rror Count =3D %d\n", SpiNotMatchError)); + DEBUG ((DEBUG_ERROR, "SPI flash chip VID =3D 0x%X, DID0 =3D 0x%X, = DID1 =3D 0x%X\n", SfId[0], SfId[1], SfId[2])); + } + } + return EFI_UNSUPPORTED; + } +} + diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf b/= Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf index 955b2479f6..3331432b68 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf @@ -16,7 +16,7 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D FlashDeviceLibRuntimeSmm + BASE_NAME =3D FlashDeviceLib FILE_GUID =3D E38A1C3C-928C-4bf7-B6C1-7F0EF163FAA5 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 @@ -32,7 +32,6 @@ [Defines] =20 [Sources] FlashDeviceLib.c - FlashDeviceLibDxeRuntimeSmm.c =20 =20 [Packages] @@ -44,9 +43,6 @@ [Packages] [LibraryClasses] DebugLib =20 -[Guids] - gEfiEventVirtualAddressChangeGuid - [Protocols] gEfiSpiProtocolGuid gEfiSmmSpiProtocolGuid diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h = b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h index fdf742c1ba..954aadc174 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h @@ -17,6 +17,7 @@ #include =20 #define FLASH_SIZE 0x400000 +#define FLASH_DEVICE_BASE_ADDRESS (0xFFFFFFFF-FLASH_SIZE+1) =20 // // Serial Flash device initialization data table provided to the --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel