Re: [edk2] [PATCH] Vlv2TbltDevicePkg: Remove PACKAGES_PATH from batch file

2019-04-01 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Monday, April 01, 2019 5:07 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [PATCH] Vlv2TbltDevicePkg: Remove PACKAGES_PATH from batch
> file
> 
> PACKAGES_PATH is supposed to set manually by users. Remove the
> assignment statement from batch file in this commit.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> ---
>  Vlv2TbltDevicePkg/bld_vlv.bat | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Vlv2TbltDevicePkg/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat
> index cd3ce41342..20dcba4e8c 100644
> --- a/Vlv2TbltDevicePkg/bld_vlv.bat
> +++ b/Vlv2TbltDevicePkg/bld_vlv.bat
> @@ -30,7 +30,6 @@ set Arch=X64
>  set Source=0
>  set CORE_PATH=%WORKSPACE%\edk2
>  set PLATFORM_PATH=%WORKSPACE%\edk2
> -set PACKAGES_PATH=%WORKSPACE%\edk2-non-
> osi\Silicon\Intel;%WORKSPACE%\edk2
>  cd ./edk2
> 
>  :: Clean up previous build files.
> --
> 2.19.1.windows.1

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


Re: [edk2] [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Vlv2TbltDevicePkg: Fix issue with SOURCE_DEBUG_ENABLE

2019-03-29 Thread Qian, Yi
Reviewed by Qian Yi

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Friday, March 29, 2019 3:13 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017]
> Vlv2TbltDevicePkg: Fix issue with SOURCE_DEBUG_ENABLE
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1671
> 
> Build fails when SOURCE_DEBUG_ENABLE is set to TRUE. This is due to
> limited size of FV MAIN region. To work around the issue, we increase size
> for the region by another 320KB provided that MINNOW2_FSP_BUILD is set
> to FALSE.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> ---
>  Vlv2TbltDevicePkg/PlatformPkg.fdf | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf
> b/Vlv2TbltDevicePkg/PlatformPkg.fdf
> index 4c19f156ea..84e3014178 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
> +++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
> @@ -47,8 +47,13 @@ DEFINE FLASH_REGION_AZALIABIN_BASE
> = 0xFFD08000
> 
>  !endif
> 
> +!if $(MINNOW2_FSP_BUILD) == TRUE
>  DEFINE FLASH_REGION_FVMAIN_OFFSET = 0x0011
>  DEFINE FLASH_REGION_FVMAIN_SIZE   = 0x0021
> +!else
> +DEFINE FLASH_REGION_FVMAIN_OFFSET = 0x000C
> +DEFINE FLASH_REGION_FVMAIN_SIZE   = 0x0026
> +!endif
> 
>  DEFINE FLASH_REGION_FV_RECOVERY2_OFFSET   = 0x0032
>  DEFINE FLASH_REGION_FV_RECOVERY2_SIZE = 0x0007
> --
> 2.19.1.windows.1

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


Re: [edk2] [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Vlv2TbltDevicePkg: Change BIOS version.

2019-03-28 Thread Qian, Yi
Reviewed by Qian Yi

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Thursday, March 28, 2019 8:42 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017]
> Vlv2TbltDevicePkg: Change BIOS version.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> ---
>  Vlv2TbltDevicePkg/BiosId.env | 2 +-
>  Vlv2TbltDevicePkg/BiosIdD.env| 2 +-
>  Vlv2TbltDevicePkg/BiosIdR.env| 2 +-
>  Vlv2TbltDevicePkg/BiosIdx64D.env | 2 +-  Vlv2TbltDevicePkg/BiosIdx64R.env
> | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/BiosId.env b/Vlv2TbltDevicePkg/BiosId.env
> index dfdcb34f41..41206302a1 100644
> --- a/Vlv2TbltDevicePkg/BiosId.env
> +++ b/Vlv2TbltDevicePkg/BiosId.env
> @@ -24,6 +24,6 @@
>  BOARD_ID  = MNW2MAX
>  BOARD_REV = 1
>  BUILD_TYPE= D
> -VERSION_MAJOR = 0100
> +VERSION_MAJOR = 0101
>  VERSION_MINOR = 01
>  BOARD_EXT = X64
> diff --git a/Vlv2TbltDevicePkg/BiosIdD.env b/Vlv2TbltDevicePkg/BiosIdD.env
> index e3bd0053b6..d09438b656 100644
> --- a/Vlv2TbltDevicePkg/BiosIdD.env
> +++ b/Vlv2TbltDevicePkg/BiosIdD.env
> @@ -35,5 +35,5 @@ OEM_ID= I32
>  BUILD_TYPE= D
> 
>  BOARD_ID = BLAKCRB
> -VERSION_MAJOR = 0100
> +VERSION_MAJOR = 0101
>  VERSION_MINOR = 01
> diff --git a/Vlv2TbltDevicePkg/BiosIdR.env b/Vlv2TbltDevicePkg/BiosIdR.env
> index 4629c44d14..635f2cb662 100644
> --- a/Vlv2TbltDevicePkg/BiosIdR.env
> +++ b/Vlv2TbltDevicePkg/BiosIdR.env
> @@ -35,5 +35,5 @@ OEM_ID= I32
>  BUILD_TYPE= R
> 
>  BOARD_ID = BLAKCRB
> -VERSION_MAJOR = 0100
> +VERSION_MAJOR = 0101
>  VERSION_MINOR = 01
> diff --git a/Vlv2TbltDevicePkg/BiosIdx64D.env
> b/Vlv2TbltDevicePkg/BiosIdx64D.env
> index 902820b6c3..1c16b2de6c 100644
> --- a/Vlv2TbltDevicePkg/BiosIdx64D.env
> +++ b/Vlv2TbltDevicePkg/BiosIdx64D.env
> @@ -25,6 +25,6 @@ BOARD_REV = 1
>  OEM_ID= X64
>  BUILD_TYPE= D
> 
> -VERSION_MAJOR = 0100
> +VERSION_MAJOR = 0101
>  VERSION_MINOR = 01
>  BOARD_ID = BBAYCRB
> diff --git a/Vlv2TbltDevicePkg/BiosIdx64R.env
> b/Vlv2TbltDevicePkg/BiosIdx64R.env
> index 7d06cf5bae..69d74c30c7 100644
> --- a/Vlv2TbltDevicePkg/BiosIdx64R.env
> +++ b/Vlv2TbltDevicePkg/BiosIdx64R.env
> @@ -25,6 +25,6 @@ BOARD_REV = 1
>  OEM_ID= X64
>  BUILD_TYPE= R
> 
> -VERSION_MAJOR = 0100
> +VERSION_MAJOR = 0101
>  VERSION_MINOR = 01
>  BOARD_ID = BBAYCRB
> --
> 2.19.1.windows.1

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


Re: [edk2] [Patch V2 3/3] Vlv2TbltDevicePkg: Fix 32bit BIOS build failure issue

2019-03-19 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Tuesday, March 19, 2019 4:36 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [Patch V2 3/3] Vlv2TbltDevicePkg: Fix 32bit BIOS build failure issue
> 
> In V2: Added new option "USE=IA32" when ARCH is IA32
> 
> Added conditional choice for Logo.inf in PlatformPkg.fdf, based on the build
> ARCH information. And Changed the location of binary object files to align
> with previous releases (%WORKSPACE%\silicon).
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> ---
>  Vlv2TbltDevicePkg/PlatformPkg.fdf   | 4 
>  Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat | 2 +-
>  Vlv2TbltDevicePkg/bld_vlv.bat   | 4 ++--
>  3 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf
> b/Vlv2TbltDevicePkg/PlatformPkg.fdf
> index 5d947db7bd..ccdc76c106 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
> +++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
> @@ -467,7 +467,11 @@ INF
> MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>  INF RuleOverride = BINARY
> $(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_
> ARCHITECTURE)/MpCpu.inf
>  INF $(PLATFORM_PACKAGE)/Metronome/Metronome.inf
>  INF IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
> +!if $(ARCH) == IA32
> +INF USE=IA32 MdeModulePkg/Logo/Logo.inf !else
>  INF USE=X64 MdeModulePkg/Logo/Logo.inf
> +!endif
>  INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
>  INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
>  INF
> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.in
> f
> diff --git a/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat
> b/Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat
> index 934fef081c..4bd91ef74d 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.
> 
> -copy /b/y !IFWI_HEADER_FILE! + ..\..\..\edk2-non-
> osi\Silicon\Intel\Vlv2SocBinPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin
> + ..\..\..\edk2-non-
> osi\Silicon\Intel\Vlv2SocBinPkg\SEC\!SEC_VERSION!\Vacant.bin
> + !BIOS_Rom! %BIOS_ID%.bin
> +copy /b/y !IFWI_HEADER_FILE! +
> + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SEC_VERSION!\VLV_SEC_REGION.bin +
> + ..\..\..\silicon\Vlv2SocBinPkg\SEC\!SEC_VERSION!\Vacant.bin +
> + !BIOS_Rom! %BIOS_ID%.bin
>  echo.
>  echo
> ==
> =
>  )
> diff --git a/Vlv2TbltDevicePkg/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat
> index cd3ce41342..749bc2dcae 100644
> --- a/Vlv2TbltDevicePkg/bld_vlv.bat
> +++ b/Vlv2TbltDevicePkg/bld_vlv.bat
> @@ -30,7 +30,7 @@ set Arch=X64
>  set Source=0
>  set CORE_PATH=%WORKSPACE%\edk2
>  set PLATFORM_PATH=%WORKSPACE%\edk2
> -set PACKAGES_PATH=%WORKSPACE%\edk2-non-
> osi\Silicon\Intel;%WORKSPACE%\edk2
> +set PACKAGES_PATH=%WORKSPACE%\silicon;%WORKSPACE%\edk2
>  cd ./edk2
> 
>  :: Clean up previous build files.
> @@ -124,7 +124,7 @@ if "%Arch%"=="IA32" (
>  :: -- Build flags settings for each Platform --  echo Setting  %1  platform
> configuration and BIOS ID...
>  if /i "%~1" == "MNW2" (
> -echo BOARD_ID = MNW2MAX >> %Conf\BiosId.env
> +echo BOARD_ID = MNW2MAX >> Conf\BiosId.env
>  echo DEFINE ENBDT_PF_BUILD = TRUE   >> %auto_config_inc%
> 
>  ) else (
> --
> 2.19.1.windows.1

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


Re: [edk2] [PATCH] Vlv2TbltDevicePkg: Resolved chipsec complains

2019-03-19 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Tuesday, March 19, 2019 4:56 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [PATCH] Vlv2TbltDevicePkg: Resolved chipsec complains
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1335
> 
> Set bit in SPI individual lock register to lock down BMWAG, BMRAG, PR0, PR1,
> PR2, PR3, SCF, PREOP, OPTYPE and OPMENU.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> ---
>  .../SouthCluster/Include/PchRegs/PchRegsSpi.h |  9 ++
>  Vlv2TbltDevicePkg/PlatformDxe/Platform.c  | 31 +++
>  2 files changed, 40 insertions(+)
> 
> diff --git
> a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchRegs/Pc
> hRegsSpi.h
> b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchRegs/P
> chRegsSpi.h
> index 7062a09b1b..4696ecc486 100644
> ---
> a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchRegs/Pc
> hRegsSpi.h
> +++
> b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchRegs/P
> +++ chRegsSpi.h
> @@ -90,7 +90,16 @@ Copyright (c) 2011  - 2015, Intel Corporation. All rights
> reserved
>  #define R_PCH_SPI_OPMENU10x9C  // Opcode Menu
> Configuration 1 (32bits)
> 
>  #define R_PCH_SPI_IND_LOCK   0xA4  // Indvidual Lock
> +#define B_PCH_SPI_IND_LOCK_BMWAG BIT0  // BMWAG LockDown
> +#define B_PCH_SPI_IND_LOCK_BMRAG BIT1  // BMRAG LockDown
>  #define B_PCH_SPI_IND_LOCK_PR0   BIT2  // PR0 LockDown
> +#define B_PCH_SPI_IND_LOCK_PR1   BIT3  // PR1 LockDown
> +#define B_PCH_SPI_IND_LOCK_PR2   BIT4  // PR2 LockDown
> +#define B_PCH_SPI_IND_LOCK_PR3   BIT5  // PR3 LockDown
> +#define B_PCH_SPI_IND_LOCK_SCF   BIT6  // SCF LockDown
> +#define B_PCH_SPI_IND_LOCK_PREOP BIT7  // PREP LockDown
> +#define B_PCH_SPI_IND_LOCK_OPTYPEBIT8  // OPTYPE LockDown
> +#define B_PCH_SPI_IND_LOCK_OPMENUBIT9  // OPMENU
> LockDown
> 
> 
>  #define R_PCH_SPI_FDOC   0xB0  // Flash Descriptor 
> Observability
> Control Register (32 bits)
> diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> index 02538fd6f0..ec1a1141e6 100644
> --- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> +++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> @@ -541,6 +541,37 @@ SpiBiosProtectionFunction(
>DEBUG((EFI_D_INFO, "R_PCH_SPI_PR1 \n"));
>DEBUG((EFI_D_INFO, "MmioRead32 (0x%x, 0x%x) = 0x%x \n", (UINTN)
> SpiBase, (UINT8) R_PCH_SPI_PR1, (UINT32) Data32));
> 
> +  //
> +  // Check and set individual lock
> +  //
> +  MmioOr16 ((UINTN) (SpiBase + R_PCH_SPI_IND_LOCK),
> +B_PCH_SPI_IND_LOCK_BMWAG |
> +B_PCH_SPI_IND_LOCK_BMRAG |
> +B_PCH_SPI_IND_LOCK_PR0 |
> +B_PCH_SPI_IND_LOCK_PR1 |
> +B_PCH_SPI_IND_LOCK_PR2 |
> +B_PCH_SPI_IND_LOCK_PR3 |
> +B_PCH_SPI_IND_LOCK_SCF |
> +B_PCH_SPI_IND_LOCK_PREOP |
> +B_PCH_SPI_IND_LOCK_OPTYPE |
> +B_PCH_SPI_IND_LOCK_OPMENU);
> +  Data16 = MmioRead16 (SpiBase + R_PCH_SPI_IND_LOCK);
> + S3BootScriptSaveMemWrite (
> +S3BootScriptWidthUint16,
> +(UINTN)(SpiBase + R_PCH_SPI_IND_LOCK),
> +1,
> +
> +  );
> +  DEBUG((EFI_D_INFO, "R_PCH_SPI_IND_LOCK \n"));  DEBUG((EFI_D_INFO,
> + "MmioRead16 (0x%x, 0x%x) = 0x%x \n", (UINTN) SpiBase, (UINT8)
> + R_PCH_SPI_IND_LOCK, (UINT16) Data16));
> +
> +  //
> +  // Verify if it's really locked.
> +  //
> +  if ((MmioRead16 (SpiBase + R_PCH_SPI_IND_LOCK) &
> B_PCH_SPI_IND_LOCK_PR0) == 0) {
> +DEBUG((EFI_D_ERROR, "Failed to lock down individual lock.\n"));  }
> +
>//
>//Lock down PRx
>//
> --
> 2.19.1.windows.1

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


Re: [edk2] [Patch V2 2/3] Vlv2TbltDevicePkg: Fix build failure issue after ECP cleanup

2019-03-19 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Tuesday, March 19, 2019 4:36 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi 
> Subject: [Patch V2 2/3] Vlv2TbltDevicePkg: Fix build failure issue after ECP
> cleanup
> 
> In V2: no new changes
> 
> Moved stuff in the three old packages IA32FamilyCpuPkg, Vlv2BinaryPkg and
> Vlv2MiscBinariesPkg into a new package Vlv2SocBinPkg. Updated the build
> scripts
> and added build instructions in Readme.md.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: David Wei 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> ---
>  Vlv2TbltDevicePkg/Application/FirmwareUpdate/FirmwareUpdate.inf | 177
> ++
> ++--
> ---
>  Vlv2TbltDevicePkg/Build_IFWI.bat|  35 
> -
> --
>  Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.inf | 166
> ++
> +--
> -
>  Vlv2TbltDevicePkg/MonoStatusCode/MonoStatusCode.inf | 156
> ++
> --
> 
>  Vlv2TbltDevicePkg/PlatformCpuInfoDxe/PlatformCpuInfoDxe.inf | 122
> ++
> +++-
>  Vlv2TbltDevicePkg/PlatformInitPei/PlatformInitPei.inf   | 246
> ++
> ++
> +++--
> -
>  Vlv2TbltDevicePkg/PlatformPei/PlatformPei.inf   | 270
> ++
> ++
> +++---
> 
>  Vlv2TbltDevicePkg/PlatformPkg.fdf   |   8 
> 
>  Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   |   4 ++--
>  Vlv2TbltDevicePkg/PlatformPkgX64.dsc|   4 ++--
>  Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.inf   |   2 +-
>  Vlv2TbltDevicePkg/Readme.md |  75
> ++
> +
>  Vlv2TbltDevicePkg/Stitch/IFWIStitch.bat |   4 ++--
>  Vlv2TbltDevicePkg/bld_vlv.bat   | 110
> +--
> ---
>  14 files changed, 727 insertions(+), 652 deletions(-)
> 
> diff --git
> a/Vlv2TbltDevicePkg/Application/FirmwareUpdate/FirmwareUpdate.inf
> b/Vlv2TbltDevicePkg/Application/FirmwareUpdate/FirmwareUpdate.inf
> index 4e2ec32ac6..8ca7a663cd 100644
> --- a/Vlv2TbltDevicePkg/Application/FirmwareUpdate/FirmwareUpdate.inf
> +++ b/Vlv2TbltDevicePkg/Application/FirmwareUpdate/FirmwareUpdate.inf
> @@ -1,90 +1,89 @@
> -## @file
> -# Implements a Tunnel Mountain specific flash update program.  This will
> allow
> -# users to update all regions of the flash as needed in a given update.
> -#
> -# Copyright (c) 2006  - 2014, Intel Corporation. All rights reserved.
> -#
> 
> -# This program and the accompanying materials are licensed and made
> available under
> 
> -# the terms and conditions of the BSD License that 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.
> 
> -#
> 
> -#
> -#
> -##
> -
> -[Defines]
> -  INF_VERSION= 0x00010005
> -  BASE_NAME  = FirmwareUpdate
> -  FILE_GUID  = AEFAF26C-FB6D-4fef-AF7A-9D78FF201FCA
> -  MODULE_TYPE= UEFI_APPLICATION
> -  VERSION_STRING = 1.0
> -  ENTRY_POINT= ShellCEntryLib
> -
> -#
> -# The fo

Re: [edk2] [Patch V2 1/3] Vlv2TbltDevicePkg: ECP Cleanup.

2019-03-19 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Tuesday, March 19, 2019 4:33 PM
> To: edk2-devel@lists.01.org
> Cc: Qian, Yi ; Wei, David 
> Subject: [Patch V2 1/3] Vlv2TbltDevicePkg: ECP Cleanup.
> 
> In V2: no new changes
> 
> Remove modules of EdkCompatibilityPkg from DSC/FDF of Vlv2TbltDevicePkg
> to make this platform ECP free.
> 
> Test: Boot to 64-bit Windows 10.
> 
> Cc: Zailiang Sun 
> Cc: Yi Qian 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: David Wei 
> ---
>  Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c   |  8 
>  Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.inf |  4 ++--
>  Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c |  8 
>  Vlv2TbltDevicePkg/PciPlatform/PciPlatform.inf   |  4 ++--
>  Vlv2TbltDevicePkg/PlatformPei/BootMode.c| 56 
> ++--
> 
>  Vlv2TbltDevicePkg/PlatformPei/PlatformPei.inf   |  4 +---
>  Vlv2TbltDevicePkg/PlatformPkg.fdf   | 11 +--
>  Vlv2TbltDevicePkg/PlatformPkgGcc.fdf| 10 --
>  Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 87 
> ---
> 
>  Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 91 
> +++
> 
>  Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 87 
> -
> --
>  Vlv2TbltDevicePkg/PlatformSmm/PlatformSmm.inf   |  6 +++---
>  Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c  | 10 +-
>  Vlv2TbltDevicePkg/VlvPlatformInitDxe/VlvPlatformInitDxe.inf |  6 +++---
>  14 files changed, 30 insertions(+), 362 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> index 4a913eb723..d575533319 100644
> --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2004  - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2004  - 2018, Intel Corporation. All rights
> + reserved.
> 
> 
>This program and the accompanying materials are licensed and made
> available under @@ -35,7 +35,7 @@ Abstract:
> 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include "AcpiPlatform.h"
>  #include "AcpiPlatformHooks.h"
>  #include "AcpiPlatformHooksLib.h"
> @@ -785,7 +785,7 @@ AcpiPlatformEntryPoint (
>EFI_STATUSStatus;
>EFI_STATUSAcpiStatus;
>EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport;
> -  EFI_FIRMWARE_VOLUME_PROTOCOL  *FwVol;
> +  EFI_FIRMWARE_VOLUME2_PROTOCOL  *FwVol;
>INTN  Instance;
>EFI_ACPI_COMMON_HEADER*CurrentTable;
>UINTN TableHandle;
> @@ -856,7 +856,7 @@ AcpiPlatformEntryPoint (
>//
>// Locate the firmware volume protocol.
>//
> -  Status = LocateSupportProtocol (,
> (VOID **) , 1);
> +  Status = LocateSupportProtocol (,
> + (VOID **) , 1);
>ASSERT_EFI_ERROR (Status);
> 
>//
> diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.inf
> b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.inf
> index 24fa913b33..74a531369d 100644
> --- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.inf
> +++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.inf
> @@ -1,6 +1,6 @@
>  #
>  #
> -# Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
> +# Copyright (c)  1999  - 2018, Intel Corporation. All rights reserved
>  #
> 
>  # This program and the accompanying materials are licensed and made
> available under
> 
>  # the terms and conditions of the BSD License that accompanies this
> distribution.
> 
> @@ -77,7 +77,7 @@
>gEfiMpServiceProtocolGuid
>gEfiGlobalNvsAreaProtocolGuid
>gEfiTcgProtocolGuid
> -  gEfiFirmwareVolumeProtocolGuid
> +  gEfiFirmwareVolume2ProtocolGuid
>gIgdOpRegionProtocolGuid
> 
>  [Pcd]
> diff --git a/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> b/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> index 08f5df2a25..27ae9de7a0 100644
> --- a/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> +++ b/Vlv2TbltDevicePkg/PciPlatform/PciPlatform.c
> @@ -36,7 +36,7 @@ Abstract:
>  #include 
>  #include 
>  #include 
> -#includ

Re: [edk2] [PATCH] Vlv2TbltDevicePkg: SPI lock

2019-03-19 Thread Qian, Yi
Reviewed by Qian, Yi 

Thanks
Qian Yi

> -Original Message-
> From: Sun, Zailiang
> Sent: Monday, March 18, 2019 9:42 PM
> To: edk2-devel@lists.01.org
> Cc: Wei, David ; Qian, Yi ; Kinney,
> Michael D 
> Subject: [PATCH] Vlv2TbltDevicePkg: SPI lock
> 
> https://vthsd.intel.com/hsd/tiano/tracker/default.aspx?tracker_id=221549
> 
> Set protection bit such as BCR, PR0, PR1 and HSFS bits in SPI registers.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zailiang Sun 
> Cc: David Wei 
> Cc: Yi Qian 
> Cc: Michael Kinney 
> ---
>  Vlv2TbltDevicePkg/PlatformDxe/Platform.c  | 74 +--
>  Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf |  8 ++
>  2 files changed, 75 insertions(+), 7 deletions(-)
> 
> diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> index ad18da5c61..02538fd6f0 100644
> --- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> +++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
> @@ -51,7 +51,8 @@ Abstract:
>  #include 
>  #include 
>  #include 
> -
> +#include 
> +#include 
> 
>  //
>  // VLV2 GPIO GROUP OFFSET
> @@ -441,6 +442,21 @@ SpiBiosProtectionFunction(
>UINTN BiosFlaLower1;
>UINTN BiosFlaLimit1;
> 
> +  EFI_SMM_BASE2_PROTOCOL*SmmBase2;
> +  EFI_STATUSStatus;
> +  UINT32Data32;
> +  UINT16Data16;
> +
> +  //
> +  // This feature requires smm stack. check whether smm stack is ready.
> + if not, just return  //  Status = gBS->LocateProtocol
> + (, NULL, (VOID**) );  if
> (EFI_ERROR
> + (Status)) {
> +DEBUG((EFI_D_INFO, "smm stack is not ready\n"));
> +return;
> +  } else {
> +DEBUG((EFI_D_INFO, "smm stack is ready\n"));  }
> 
>BiosFlaLower0 = PcdGet32(PcdFlashMicroCodeAddress)-
> PcdGet32(PcdBiosImageBase);
>BiosFlaLimit0 = PcdGet32(PcdFlashMicroCodeSize)-1;
> @@ -461,6 +477,7 @@ SpiBiosProtectionFunction(
> );
>SpiBase  = MmioRead32(mPciD31F0RegBase + R_PCH_LPC_SPI_BASE) &
> B_PCH_LPC_SPI_BASE_BAR;
> 
> +  DEBUG((EFI_D_INFO, "SpiBase = 0x%x\n", (UINTN)SpiBase));
>//
>//Set SMM_BWP, WPD and LE bit
>//
> @@ -468,6 +485,16 @@ SpiBiosProtectionFunction(
>MmioAnd32 ((UINTN) (SpiBase + R_PCH_SPI_BCR),
> (UINT8)(~B_PCH_SPI_BCR_BIOSWE));
>MmioOr32 ((UINTN) (SpiBase + R_PCH_SPI_BCR), (UINT8)
> B_PCH_SPI_BCR_BLE);
> 
> +  Data32 = MmioRead32 (SpiBase + R_PCH_SPI_BCR);
> + S3BootScriptSaveMemWrite (
> +  S3BootScriptWidthUint32,
> +  (UINTN)(SpiBase + R_PCH_SPI_BCR),
> +  1,
> +  
> +  );
> +  DEBUG((EFI_D_INFO, "R_PCH_SPI_BCR \n"));  DEBUG((EFI_D_INFO,
> + "MmioRead32 (0x%x, 0x%x) = 0x%x \n", (UINTN) SpiBase, (UINT8)
> + R_PCH_SPI_BCR, (UINT32) Data32));
> +
>//
>//First check if FLOCKDN or PR0FLOCKDN is set. No action if either of them
> set already.
>//
> @@ -487,6 +514,16 @@ SpiBiosProtectionFunction(
>  B_PCH_SPI_PR0_RPE|B_PCH_SPI_PR0_WPE|\
> 
> (B_PCH_SPI_PR0_PRB_MASK&(BiosFlaLower0>>12))|(B_PCH_SPI_PR0_PRL
> _MASK&(BiosFlaLimit0>>12)<<16));
> 
> +  Data32 = MmioRead32 (SpiBase + R_PCH_SPI_PR0);
> +  S3BootScriptSaveMemWrite (
> +S3BootScriptWidthUint32,
> +(UINTN)(SpiBase + R_PCH_SPI_PR0),
> +1,
> +
> +  );
> +  DEBUG((EFI_D_INFO, "R_PCH_SPI_PR0 \n"));  DEBUG((EFI_D_INFO,
> + "MmioRead32 (0x%x, 0x%x) = 0x%x \n", (UINTN) SpiBase, (UINT8)
> + R_PCH_SPI_PR0, (UINT32) Data32));
> +
>//
>//Set PR1
>//
> @@ -494,12 +531,31 @@ SpiBiosProtectionFunction(
>MmioOr32((UINTN)(SpiBase + R_PCH_SPI_PR1),
>  B_PCH_SPI_PR1_RPE|B_PCH_SPI_PR1_WPE|\
> 
> (B_PCH_SPI_PR1_PRB_MASK&(BiosFlaLower1>>12))|(B_PCH_SPI_PR1_PRL
> _MASK&(BiosFlaLimit1>>12)<<16));
> +  Data32 = MmioRead32 (SpiBase + R_PCH_SPI_PR1);
> +  S3BootScriptSaveMemWrite (
> +S3BootScriptWidthUint32,
> +(UINTN)(SpiBase + R_PCH_SPI_PR1),
> +1,
> +
> +  );
> +  DEBUG((EFI_D_INFO, "R_PCH_SPI_PR1 \n"));  DEBUG((EFI_D_INFO,
> + "MmioRead32 (0x%x, 0x%x) = 0x%x \n", (UINTN) SpiBase, (UINT8)
> + R_PCH_SPI_PR1, (UINT32) Data32));
> 
>//
>//Lock down PRx
>//
>MmioOr16 ((UINTN) (SpiBase + R_PCH_SPI_HSFS), (UINT16)
> (B_PCH_SPI_HSFS_FLOCKDN));
> 
> +  Data16 = MmioRead16 (SpiBase + R_PCH_SPI_HSFS);
> + S3BootScriptSaveMemWrite (
> +S3BootScriptWidthUint16,
> +(UINTN)(SpiBase

Re: [edk2] [PATCH v2 04/17] Vlv2TbltDevicePkg: add MmServicesTableLib resolution

2019-01-16 Thread Qian, Yi
Reviewed-by: Qian Yi 

Thanks
Qian Yi

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Thursday, January 17, 2019 1:45 AM
> To: Gao, Liming ; Qian, Yi 
> Cc: edk2-devel@lists.01.org; Sun, Zailiang ; Laszlo
> Ersek ; Leif Lindholm ;
> Kinney, Michael D ; Wang, Jian J
> ; Wu, Hao A ; Jagadeesh Ujja
> ; Achin Gupta ;
> Thomas Panakamattam Abraham ; Sami
> Mujawar ; Zeng, Star 
> Subject: Re: [PATCH v2 04/17] Vlv2TbltDevicePkg: add MmServicesTableLib
> resolution
> 
> (add Yi as well)
> 
> On Wed, 16 Jan 2019 at 16:14, Gao, Liming  wrote:
> >
> > Zailiang:
> >   Could you help review this change?
> >
> > > -Original Message-
> > > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> > > Sent: Monday, January 14, 2019 9:28 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Ard Biesheuvel ; Laszlo Ersek
> > > ; Leif Lindholm ;
> > > Kinney, Michael D ; Gao, Liming
> > > ; Wang, Jian J ; Wu,
> > > Hao A ; Jagadeesh Ujja
> ;
> > > Achin Gupta ; Thomas Panakamattam Abraham
> > > ; Sami Mujawar
> ; Zeng,
> > > Star 
> > > Subject: [PATCH v2 04/17] Vlv2TbltDevicePkg: add MmServicesTableLib
> > > resolution
> > >
> > > The SMM based FTW and variable drivers are going to depend on
> > > MmServicesTableLib after a subsequent patch, so add a resolution for
> > > it to various Vlv2TbltDevicePkg .dsc files.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Ard Biesheuvel 
> > > ---
> > >  Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 1 +
> > >  Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 1 +
> > >  Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 1 +
> > >  3 files changed, 3 insertions(+)
> > >
> > > diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > > b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > > index d43611550285..eb7c205a10a6 100644
> > > --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > > +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> > > @@ -406,6 +406,7 @@ [LibraryClasses.X64.DXE_CORE]  !endif
> > >
> > >  [LibraryClasses.X64.DXE_SMM_DRIVER]
> > > +
> > > +
> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTab
> > > + leLib.inf
> > >
> SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesT
> ableLib.inf
> > >
> ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/S
> mmReportStatusCodeLib.inf
> > >
> > >
> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe
> moryA
> > > llocationLib.inf diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > > b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > > index a33816c4d18b..b2f0d73f6d05 100644
> > > --- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > > +++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
> > > @@ -406,6 +406,7 @@ [LibraryClasses.IA32.DXE_CORE]  !endif
> > >
> > >  [LibraryClasses.IA32.DXE_SMM_DRIVER]
> > > +
> > > +
> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTab
> > > + leLib.inf
> > >
> SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesT
> ableLib.inf
> > >
> ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/S
> mmReportStatusCodeLib.inf
> > >
> > >
> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe
> moryA
> > > llocationLib.inf diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > > b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > > index 1da1442c64c6..aa62c07f177b 100644
> > > --- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > > +++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
> > > @@ -408,6 +408,7 @@ [LibraryClasses.X64.DXE_CORE]  !endif
> > >
> > >  [LibraryClasses.X64.DXE_SMM_DRIVER]
> > > +
> > > +
> MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTab
> > > + leLib.inf
> > >
> SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesT
> ableLib.inf
> > >
> ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/S
> mmReportStatusCodeLib.inf
> > >
> > >
> MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe
> moryA
> > > llocationLib.inf
> > > --
> > > 2.20.1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel