From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A7C0F1A1E8B for ; Wed, 21 Sep 2016 00:10:28 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP; 21 Sep 2016 00:10:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,372,1470726000"; d="scan'208";a="12036279" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 21 Sep 2016 00:10:28 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Sep 2016 00:10:27 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Sep 2016 00:10:27 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.118]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Wed, 21 Sep 2016 15:10:23 +0800 From: "Wei, David" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Zeng, Star" , "Kinney, Michael D" , "Gao, Liming" , "Zhang, Chao B" Thread-Topic: [PATCH 41/45] Vlv2TbltDevicePkg/FlashDeviceLib: Add DXE flash device lib. Thread-Index: AQHSE9QhXqXlFOFG8kKI2n6qeY881KCDhqtA Date: Wed, 21 Sep 2016 07:10:22 +0000 Message-ID: <89954A0B46707A448411A627AD4EEE34663799C5@SHSMSX101.ccr.corp.intel.com> References: <1474440326-9292-1-git-send-email-jiewen.yao@intel.com> <1474440326-9292-42-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1474440326-9292-42-git-send-email-jiewen.yao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjU4MWFhNGUtYTc0YS00ZGIwLTk5NzAtMGE5NDFlNzhlZWZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImZIeGlvMUhyR0l4UkZ6b1wvbHhKUHFBMlF5YmY4TEkwTHc5MWdLNlFGckhrPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 41/45] Vlv2TbltDevicePkg/FlashDeviceLib: Add DXE flash device lib. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2016 07:10:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: David Wei Thanks, David Wei =20 -----Original Message----- From: Yao, Jiewen=20 Sent: Wednesday, September 21, 2016 2:45 PM To: edk2-devel@lists.01.org Cc: Wei, David ; Tian, Feng ; Zen= g, Star ; Kinney, Michael D ; Gao, Liming ; Zhang, Chao B Subject: [PATCH 41/45] Vlv2TbltDevicePkg/FlashDeviceLib: Add DXE flash devi= ce lib. Previous FlashDeviceLib only supports DxeRuntime and Smm. It cannot be linked with SystemBiosUpdateDxe driver. So we separate DxeRuntime related code into a standalone file, and create FlashDeviceLibDxe.inf. Cc: David Wei Cc: Feng Tian Cc: Star Zeng Cc: Michael D Kinney Cc: Liming Gao Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c | 1= 56 +--------------- Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf | = 8 +- Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.c | = 62 +++++++ Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.inf | = 49 +++++ Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxeRuntimeSmm.c | 1= 88 ++++++++++++++++++++ Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h | = 5 +- 6 files changed, 312 insertions(+), 156 deletions(-) diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c b/Vl= v2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c index afb12c9..d964aa5 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2004 - 2016, 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 @@ -19,14 +19,13 @@ #include #include #include -#include -#include #include -#include -#include #include -#include "SpiChipDefinitions.h" +#include =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; @@ -320,148 +319,3 @@ 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 ((EFI_D_ERROR, "OK - Found SPI Flash Type in SPI Flash D= river, Device Type ID 0 =3D 0x%02x!\n", mInitTable[FlashIndex].DeviceId0)); - DEBUG ((EFI_D_ERROR, "Device Type ID 1 =3D 0x%02x!\n", mInitTa= ble[FlashIndex].DeviceId1)); - - if (mInitTable[FlashIndex].BiosStartOffset =3D=3D (UINTN) (-1)= ) { - DEBUG ((EFI_D_ERROR, "ERROR - The size of BIOS image is bigg= er than SPI Flash device!\n")); - CpuDeadLoop (); - } - break; - } else { - SpiNotMatchError++; - } - } else { - SpiReadError++; - } - } - } - - DEBUG ((EFI_D_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 ((EFI_D_ERROR, "ERROR - SPI Read ID execution failed! Error Co= unt =3D %d\n", SpiReadError)); - } =20 - else { - if (SpiNotMatchError !=3D 0) { - DEBUG ((EFI_D_ERROR, "ERROR - No supported SPI flash chip found! E= rror Count =3D %d\n", SpiNotMatchError)); - DEBUG ((EFI_D_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 423490e..cddbe60 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLib.inf @@ -1,6 +1,6 @@ # # -# Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved +# Copyright (c) 1999 - 2016, 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 @@ -16,7 +16,7 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D FlashDeviceLib + BASE_NAME =3D FlashDeviceLibRuntimeSmm FILE_GUID =3D E38A1C3C-928C-4bf7-B6C1-7F0EF163FAA5 MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 @@ -32,6 +32,7 @@ =20 [Sources] FlashDeviceLib.c + FlashDeviceLibDxeRuntimeSmm.c =20 =20 [Packages] @@ -43,6 +44,9 @@ [LibraryClasses] DebugLib =20 +[Guids] + gEfiEventVirtualAddressChangeGuid + [Protocols] gEfiSpiProtocolGuid gEfiSmmSpiProtocolGuid diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.c b= /Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.c new file mode 100644 index 0000000..bff9823 --- /dev/null +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.c @@ -0,0 +1,62 @@ +/** @file + + Copyright (c) 2004 - 2016, 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 + The full text of the license may be found at = =20 + http://opensource.org/licenses/bsd-license.php. = =20 + = =20 + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 + = =20 + + +**/ + +#include + +#include +#include +#include +#include +#include +#include "SpiChipDefinitions.h" + +extern UINTN FlashDeviceBase; + +extern EFI_SPI_PROTOCOL *mSpiProtocol; + +/** + 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; + Status =3D gBS->LocateProtocol ( + &gEfiSpiProtocolGuid, + NULL, + (VOID **)&mSpiProtocol + ); + ASSERT_EFI_ERROR (Status); + // There is no need to call Init, because Runtime or SMM FVB already doe= s that. + DEBUG((EFI_D_ERROR, "LibFvbFlashDeviceSupportInit - no init\n")); + return EFI_SUCCESS; +} + diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.inf= b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.inf new file mode 100644 index 0000000..cb2ada6 --- /dev/null +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.inf @@ -0,0 +1,49 @@ +# +# +# Copyright (c) 1999 - 2016, 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 +# The full text of the license may be found at = =20 +# http://opensource.org/licenses/bsd-license.php. = =20 +# = =20 +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 +# = =20 +# +# + + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D FlashDeviceLibDxe + FILE_GUID =3D F0D7222F-FD43-4A5D-B8BF-A259C87AE3B2 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D FlashDeviceLib | DXE_DRIVER + CONSTRUCTOR =3D LibFvbFlashDeviceSupportInit + + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + FlashDeviceLib.c + FlashDeviceLibDxe.c + + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Vlv2TbltDevicePkg/PlatformPkg.dec + Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec + +[LibraryClasses] + DebugLib + +[Protocols] + gEfiSpiProtocolGuid + diff --git a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxeRunt= imeSmm.c b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxeRuntim= eSmm.c new file mode 100644 index 0000000..4e9fc46 --- /dev/null +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxeRuntimeSmm.= c @@ -0,0 +1,188 @@ +/** @file + + Copyright (c) 2004 - 2016, 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 + + The full text of the license may be found at = =20 + + http://opensource.org/licenses/bsd-license.php. = =20 + + = =20 + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 + + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. =20 + + = =20 + + + +**/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SpiChipDefinitions.h" + +extern UINTN FlashDeviceBase; + +extern EFI_SPI_PROTOCOL *mSpiProtocol; + +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 ((EFI_D_ERROR, "OK - Found SPI Flash Type in SPI Flash D= river, Device Type ID 0 =3D 0x%02x!\n", mInitTable[FlashIndex].DeviceId0)); + DEBUG ((EFI_D_ERROR, "Device Type ID 1 =3D 0x%02x!\n", mInitTa= ble[FlashIndex].DeviceId1)); + + if (mInitTable[FlashIndex].BiosStartOffset =3D=3D (UINTN) (-1)= ) { + DEBUG ((EFI_D_ERROR, "ERROR - The size of BIOS image is bigg= er than SPI Flash device!\n")); + CpuDeadLoop (); + } + break; + } else { + SpiNotMatchError++; + } + } else { + SpiReadError++; + } + } + } + + DEBUG ((EFI_D_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 ((EFI_D_ERROR, "ERROR - SPI Read ID execution failed! Error Co= unt =3D %d\n", SpiReadError)); + } + else { + if (SpiNotMatchError !=3D 0) { + DEBUG ((EFI_D_ERROR, "ERROR - No supported SPI flash chip found! E= rror Count =3D %d\n", SpiNotMatchError)); + DEBUG ((EFI_D_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/SpiChipDefinitions.h = b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h index 15bd1e0..fbde4e6 100644 --- a/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h +++ b/Vlv2TbltDevicePkg/Library/FlashDeviceLib/SpiChipDefinitions.h @@ -1,6 +1,6 @@ /*++ =20 - Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2004 - 2016, 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 @@ -16,8 +16,7 @@ =20 #include =20 -#define FLASH_SIZE 0x300000 -#define FLASH_DEVICE_BASE_ADDRESS (0xFFFFFFFF-FLASH_SIZE+1) +#define FLASH_SIZE 0x400000 =20 // // Serial Flash device initialization data table provided to the --=20 2.7.4.windows.1