From nobody Thu Dec 18 20:00:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+77136+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77136+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1624656184; cv=none; d=zohomail.com; s=zohoarc; b=YyurbW2GgxilfIKUuXXjWvLJDLPhHghpB5gAePmaEV7LWf3liuz5JFDTPBMB3lv44DxOkgtS07ubvuafwuv+EkjEnCB1m9EnpynC+PMXm7AOE52aSXboRtd/G1xa7f6hqtzg1kmZzugLzXRfx+K/nk82XxDbYCaJbsAOF0Wpcxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624656184; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ItnfdzH/ZVEMHcIsZDpSK1ebQtdTKeoT9lWbvl0Pp6M=; b=LkvGyYdPBKcXxIYLWtDMSRoIEROmg4nF/zHsQAI8cRYR7D2q1VXF4K8RNx8OyCeg9YlfsuSQw8g4YdZJPxZSqfNJtQ/3loCvDBBDsLdlXDdy7gFer5l2erw+QryExUJ4Hiu+2lbkWo0ON98WKPAdHp65oFnJRjuIVcuT6G+2bpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77136+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1624656184626256.7737873531547; Fri, 25 Jun 2021 14:23:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id L9H4YY1788612xQP1F4AjWBT; Fri, 25 Jun 2021 14:23:04 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.407.1624656178790579149 for ; Fri, 25 Jun 2021 14:22:58 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 8896E20B83DE; Fri, 25 Jun 2021 14:22:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8896E20B83DE From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Rangasai V Chaganty , Nate DeSimone Subject: [edk2-devel] [edk2-platforms][PATCH v4 39/41] KabylakeSiliconPkg: Identify flash regions by GUID Date: Fri, 25 Jun 2021 17:21:18 -0400 Message-Id: <20210625212120.235-40-mikuback@linux.microsoft.com> In-Reply-To: <20210625212120.235-1-mikuback@linux.microsoft.com> References: <20210625212120.235-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com X-Gm-Message-State: bCyB74sCMtmOT6n4HCT0IBx0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1624656184; bh=KQMWOEFz01dk3BL/M4nobnK6BK7GJ6ZM29Tna/hSD/w=; h=Cc:Date:From:Reply-To:Subject:To; b=KEHKvUyEkhsTMbwFzACL9oGiuxRzduqaTolWblrGczfU0TPdIuq3XCaRdcJVMgkXCE6 4AeNG1WzsaioHMFOsg6+ETeiC9XHJiNu0jI/9cONi0B7ACC5819ak5mJmMgMDGq2dOzjv +HYIqaadKK+JzQN75cBNR1UWjLxHiXIabNY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 Updates the code to identify flash regions by GUID and internally map the GUID entries to values specific to KabylakeSiliconPkg. Cc: Chasel Chiu Cc: Rangasai V Chaganty Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Chasel Chiu --- Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfiguration.c = | 106 ++++++++++++++- Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonLib/Sp= iCommon.c | 140 ++++++++++++++++---- Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf = | 9 ++ Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Library/PchSpiCommonLi= b.h | 20 +-- Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonLib/Ba= sePchSpiCommonLib.inf | 11 ++ 5 files changed, 247 insertions(+), 39 deletions(-) diff --git a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfi= guration.c b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfi= guration.c index a3c9bbebeaa9..ccf63b216f70 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfiguratio= n.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfiguratio= n.c @@ -2,11 +2,14 @@ This file contains the tests for the SecureMemoryMapConfiguration bit =20 Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include "HstiSiliconDxe.h" +#include =20 typedef struct { UINT64 Base; @@ -100,6 +103,90 @@ MEMORY_RANGE mNonLockableMemoryRange[NonLockableMemor= yRangeMax] =3D { // 14. SPI_BAR0 (BDF 0:31:5 + 0x10) }; =20 +typedef enum { + FlashRegionDescriptor, + FlashRegionBios, + FlashRegionMe, + FlashRegionGbe, + FlashRegionPlatformData, + FlashRegionDer, + FlashRegionAll, + FlashRegionMax +} FLASH_REGION_TYPE; + +typedef struct { + EFI_GUID *Guid; + FLASH_REGION_TYPE Type; +} FLASH_REGION_MAPPING; + +FLASH_REGION_MAPPING mFlashRegionTypes[] =3D { + { + &gFlashRegionDescriptorGuid, + FlashRegionDescriptor + }, + { + &gFlashRegionBiosGuid, + FlashRegionBios + }, + { + &gFlashRegionMeGuid, + FlashRegionMe + }, + { + &gFlashRegionGbeGuid, + FlashRegionGbe + }, + { + &gFlashRegionPlatformDataGuid, + FlashRegionPlatformData + }, + { + &gFlashRegionDerGuid, + FlashRegionDer + }, + { + &gFlashRegionAllGuid, + FlashRegionAll + }, + { + &gFlashRegionMaxGuid, + FlashRegionMax + } +}; + +/** + Returns the type of a flash region given its GUID. + + @param[in] FlashRegionGuid Pointer to the flash region GUID. + @param[out] FlashRegionType Pointer to a buffer that will be set to = the flash region type value. + + @retval EFI_SUCCESS The flash region type was found fo= r the given flash region GUID. + @retval EFI_INVALID_PARAMETER A pointer argument passed to the f= unction is NULL. + @retval EFI_NOT_FOUND The flash region type was not foun= d for the given flash region GUID. + +**/ +EFI_STATUS +GetFlashRegionType ( + IN EFI_GUID *FlashRegionGuid, + OUT FLASH_REGION_TYPE *FlashRegionType + ) +{ + UINTN Index; + + if (FlashRegionGuid =3D=3D NULL || FlashRegionType =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + for (Index =3D 0; Index < ARRAY_SIZE (mFlashRegionTypes); Index++) { + if (CompareGuid (mFlashRegionTypes[Index].Guid, FlashRegionGuid)) { + *FlashRegionType =3D mFlashRegionTypes[Index].Type; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + /** Check for overlaps in single range array =20 @@ -224,7 +311,7 @@ AcquireSpiBar0 ( { UINT32 SpiBar0; UINTN PchSpiBase; - =20 + // // Init PCH spi reserved MMIO address. // @@ -270,7 +357,7 @@ ReleaseSpiBar0 ( Get the SPI region base and size, based on the enum type =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for for the base a= ddress which is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for the base addre= ss which corresponds to the type in the descriptor. @param[out] BaseAddress The Flash Linear Address for the Region = 'n' Base @param[out] RegionSize The size for the Region 'n' =20 @@ -281,13 +368,20 @@ ReleaseSpiBar0 ( EFI_STATUS EFIAPI GetRegionAddress ( - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, OUT UINT32 *BaseAddress, OUT UINT32 *RegionSize ) { - UINTN PchSpiBar0; - UINT32 ReadValue; + EFI_STATUS Status; + FLASH_REGION_TYPE FlashRegionType; + UINTN PchSpiBar0; + UINT32 ReadValue; + + Status =3D GetFlashRegionType (FlashRegionGuid, &FlashRegionType); + if (EFI_ERROR (Status)) { + return EFI_INVALID_PARAMETER; + } =20 if (FlashRegionType >=3D FlashRegionMax) { return EFI_INVALID_PARAMETER; @@ -484,7 +578,7 @@ CheckSecureMemoryMapConfiguration ( // // Locate BIOS region size to update High bios base address // - GetRegionAddress (FlashRegionBios, &BaseAddress, &RegionSize); + GetRegionAddress (&gFlashRegionBiosGuid, &BaseAddress, &RegionSize); DEBUG ((DEBUG_INFO, "Bios Region Size %x:\n", RegionSize)); mLockableMemoryRange[LockableMemoryRangeHighBios].Base =3D SIZE_4GB -= RegionSize; mLockableMemoryRange[LockableMemoryRangeLowDram].End =3D (MmioRead32 = (MmPciBase (0,SA_MC_DEV,SA_MC_FUN) + R_SA_TOLUD) & B_SA_TOLUD_TOLUD_MASK) -= 1; diff --git a/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpi= CommonLib/SpiCommon.c b/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate= /BasePchSpiCommonLib/SpiCommon.c index 58757a8cba39..d2eb8324bf58 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonL= ib/SpiCommon.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonL= ib/SpiCommon.c @@ -2,10 +2,13 @@ PCH SPI Common Driver implements the SPI Host Controller Compatibility I= nterface. =20 Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
+ SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ #include +#include #include #include #include @@ -16,6 +19,90 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include =20 +typedef enum { + FlashRegionDescriptor, + FlashRegionBios, + FlashRegionMe, + FlashRegionGbe, + FlashRegionPlatformData, + FlashRegionDer, + FlashRegionAll, + FlashRegionMax +} FLASH_REGION_TYPE; + +typedef struct { + EFI_GUID *Guid; + FLASH_REGION_TYPE Type; +} FLASH_REGION_MAPPING; + +FLASH_REGION_MAPPING mFlashRegionTypes[] =3D { + { + &gFlashRegionDescriptorGuid, + FlashRegionDescriptor + }, + { + &gFlashRegionBiosGuid, + FlashRegionBios + }, + { + &gFlashRegionMeGuid, + FlashRegionMe + }, + { + &gFlashRegionGbeGuid, + FlashRegionGbe + }, + { + &gFlashRegionPlatformDataGuid, + FlashRegionPlatformData + }, + { + &gFlashRegionDerGuid, + FlashRegionDer + }, + { + &gFlashRegionAllGuid, + FlashRegionAll + }, + { + &gFlashRegionMaxGuid, + FlashRegionMax + } +}; + +/** + Returns the type of a flash region given its GUID. + + @param[in] FlashRegionGuid Pointer to the flash region GUID. + @param[out] FlashRegionType Pointer to a buffer that will be set to = the flash region type value. + + @retval EFI_SUCCESS The flash region type was found fo= r the given flash region GUID. + @retval EFI_INVALID_PARAMETER A pointer argument passed to the f= unction is NULL. + @retval EFI_NOT_FOUND The flash region type was not foun= d for the given flash region GUID. + +**/ +EFI_STATUS +GetFlashRegionType ( + IN EFI_GUID *FlashRegionGuid, + OUT FLASH_REGION_TYPE *FlashRegionType + ) +{ + UINTN Index; + + if (FlashRegionGuid =3D=3D NULL || FlashRegionType =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + for (Index =3D 0; Index < ARRAY_SIZE (mFlashRegionTypes); Index++) { + if (CompareGuid (mFlashRegionTypes[Index].Guid, FlashRegionGuid)) { + *FlashRegionType =3D mFlashRegionTypes[Index].Type; + return EFI_SUCCESS; + } + } + + return EFI_NOT_FOUND; +} + /** Initialize an SPI protocol instance. =20 @@ -249,7 +336,7 @@ PchPmTimerStallRuntimeSafe ( Read data from the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @param[out] Buffer The Pointer to caller-allocated buffer c= ontaining the dada received. @@ -263,7 +350,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashRead ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount, OUT UINT8 *Buffer @@ -276,7 +363,7 @@ SpiProtocolFlashRead ( // Status =3D SendSpiCmd ( This, - FlashRegionType, + FlashRegionGuid, FlashCycleRead, Address, ByteCount, @@ -289,7 +376,7 @@ SpiProtocolFlashRead ( Write data to the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @param[in] Buffer Pointer to caller-allocated buffer conta= ining the data sent during the SPI cycle. @@ -302,7 +389,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashWrite ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount, IN UINT8 *Buffer @@ -315,7 +402,7 @@ SpiProtocolFlashWrite ( // Status =3D SendSpiCmd ( This, - FlashRegionType, + FlashRegionGuid, FlashCycleWrite, Address, ByteCount, @@ -328,7 +415,7 @@ SpiProtocolFlashWrite ( Erase some area on the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. =20 @@ -340,7 +427,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashErase ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount ) @@ -352,7 +439,7 @@ SpiProtocolFlashErase ( // Status =3D SendSpiCmd ( This, - FlashRegionType, + FlashRegionGuid, FlashCycleErase, Address, ByteCount, @@ -407,7 +494,7 @@ SpiProtocolFlashReadSfdp ( // Status =3D SendSpiCmd ( This, - FlashRegionAll, + &gFlashRegionAllGuid, FlashCycleReadSfdp, FlashAddress, ByteCount, @@ -460,7 +547,7 @@ SpiProtocolFlashReadJedecId ( // Status =3D SendSpiCmd ( This, - FlashRegionAll, + &gFlashRegionAllGuid, FlashCycleReadJedecId, Address, ByteCount, @@ -495,7 +582,7 @@ SpiProtocolFlashWriteStatus ( // Status =3D SendSpiCmd ( This, - FlashRegionAll, + &gFlashRegionAllGuid, FlashCycleWriteStatus, 0, ByteCount, @@ -530,7 +617,7 @@ SpiProtocolFlashReadStatus ( // Status =3D SendSpiCmd ( This, - FlashRegionAll, + &gFlashRegionAllGuid, FlashCycleReadStatus, 0, ByteCount, @@ -543,7 +630,7 @@ SpiProtocolFlashReadStatus ( Get the SPI region base and size, based on the enum type =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for for the base a= ddress which is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for the base addre= ss which corresponds to the type in the descriptor. @param[out] BaseAddress The Flash Linear Address for the Region = 'n' Base @param[out] RegionSize The size for the Region 'n' =20 @@ -555,17 +642,24 @@ EFI_STATUS EFIAPI SpiProtocolGetRegionAddress ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, OUT UINT32 *BaseAddress, OUT UINT32 *RegionSize ) { - SPI_INSTANCE *SpiInstance; - UINTN PchSpiBar0; - UINT32 ReadValue; + EFI_STATUS Status; + FLASH_REGION_TYPE FlashRegionType; + SPI_INSTANCE *SpiInstance; + UINTN PchSpiBar0; + UINT32 ReadValue; =20 SpiInstance =3D SPI_INSTANCE_FROM_SPIPROTOCOL (This); =20 + Status =3D GetFlashRegionType (FlashRegionGuid, &FlashRegionType); + if (EFI_ERROR (Status)) { + return EFI_INVALID_PARAMETER; + } + if (FlashRegionType >=3D FlashRegionMax) { return EFI_INVALID_PARAMETER; } @@ -646,7 +740,7 @@ SpiProtocolReadPchSoftStrap ( // Status =3D SendSpiCmd ( This, - FlashRegionDescriptor, + &gFlashRegionDescriptorGuid, FlashCycleRead, StrapFlashAddr, ByteCount, @@ -704,7 +798,7 @@ SpiProtocolReadCpuSoftStrap ( // Status =3D SendSpiCmd ( This, - FlashRegionDescriptor, + &gFlashRegionDescriptorGuid, FlashCycleRead, StrapFlashAddr, ByteCount, @@ -717,7 +811,7 @@ SpiProtocolReadCpuSoftStrap ( This function sends the programmed SPI command to the slave device. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] SpiRegionType The SPI Region type for flash cycle whic= h is listed in the Descriptor + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] FlashCycleType The Flash SPI cycle type list in HSFC (H= ardware Sequencing Flash Control Register) register @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @@ -731,7 +825,7 @@ SpiProtocolReadCpuSoftStrap ( EFI_STATUS SendSpiCmd ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN FLASH_CYCLE_TYPE FlashCycleType, IN UINT32 Address, IN UINT32 ByteCount, @@ -795,7 +889,7 @@ SendSpiCmd ( goto SendSpiCmdEnd; } =20 - Status =3D SpiProtocolGetRegionAddress (This, FlashRegionType, &Hardware= SpiAddr, &FlashRegionSize); + Status =3D SpiProtocolGetRegionAddress (This, FlashRegionGuid, &Hardware= SpiAddr, &FlashRegionSize); if (EFI_ERROR (Status)) { goto SendSpiCmdEnd; } diff --git a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf b= /Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf index bd12fa691d40..09826cdfdf39 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf @@ -2,6 +2,7 @@ # Component description file for Hsti Silicon Driver # # Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -86,6 +87,14 @@ [LibraryClasses] [Guids] gEfiEndOfDxeEventGroupGuid gSiMemoryPlatformDataGuid ## CONSUMES + gFlashRegionDescriptorGuid + gFlashRegionBiosGuid + gFlashRegionMeGuid + gFlashRegionGbeGuid + gFlashRegionPlatformDataGuid + gFlashRegionDerGuid + gFlashRegionAllGuid + gFlashRegionMaxGuid =20 [Protocols] gEfiDxeSmmReadyToLockProtocolGuid ## CONSUMES diff --git a/Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Library/Pc= hSpiCommonLib.h b/Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Libra= ry/PchSpiCommonLib.h index d408289ea253..fd991de96016 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Library/PchSpiCom= monLib.h +++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Library/PchSpiCom= monLib.h @@ -134,7 +134,7 @@ ReleaseSpiBar0 ( Read data from the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @param[out] Buffer The Pointer to caller-allocated buffer c= ontaining the dada received. @@ -148,7 +148,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashRead ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount, OUT UINT8 *Buffer @@ -158,7 +158,7 @@ SpiProtocolFlashRead ( Write data to the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @param[in] Buffer Pointer to caller-allocated buffer conta= ining the data sent during the SPI cycle. @@ -171,7 +171,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashWrite ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount, IN UINT8 *Buffer @@ -181,7 +181,7 @@ SpiProtocolFlashWrite ( Erase some area on the flash part. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. =20 @@ -193,7 +193,7 @@ EFI_STATUS EFIAPI SpiProtocolFlashErase ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN UINT32 Address, IN UINT32 ByteCount ); @@ -286,7 +286,7 @@ SpiProtocolFlashReadStatus ( Get the SPI region base and size, based on the enum type =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] FlashRegionType The Flash Region type for for the base a= ddress which is listed in the Descriptor. + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[out] BaseAddress The Flash Linear Address for the Region = 'n' Base @param[out] RegionSize The size for the Region 'n' =20 @@ -298,7 +298,7 @@ EFI_STATUS EFIAPI SpiProtocolGetRegionAddress ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, OUT UINT32 *BaseAddress, OUT UINT32 *RegionSize ); @@ -353,7 +353,7 @@ SpiProtocolReadCpuSoftStrap ( This function sends the programmed SPI command to the slave device. =20 @param[in] This Pointer to the PCH_SPI_PROTOCOL instance. - @param[in] SpiRegionType The SPI Region type for flash cycle whic= h is listed in the Descriptor + @param[in] FlashRegionGuid The Flash Region GUID for flash cycle wh= ich corresponds to the type in the descriptor. @param[in] FlashCycleType The Flash SPI cycle type list in HSFC (H= ardware Sequencing Flash Control Register) register @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. @@ -367,7 +367,7 @@ SpiProtocolReadCpuSoftStrap ( EFI_STATUS SendSpiCmd ( IN PCH_SPI_PROTOCOL *This, - IN FLASH_REGION_TYPE FlashRegionType, + IN EFI_GUID *FlashRegionGuid, IN FLASH_CYCLE_TYPE FlashCycleType, IN UINT32 Address, IN UINT32 ByteCount, diff --git a/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpi= CommonLib/BasePchSpiCommonLib.inf b/Silicon/Intel/KabylakeSiliconPkg/Pch/Li= braryPrivate/BasePchSpiCommonLib/BasePchSpiCommonLib.inf index 51e2d25a7f8b..67176c879de5 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonL= ib/BasePchSpiCommonLib.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonL= ib/BasePchSpiCommonLib.inf @@ -2,6 +2,7 @@ # Component description file for the PchSpiCommonLib # # Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -28,3 +29,13 @@ [LibraryClasses] IoLib DebugLib PchCycleDecodingLib + +[Guids] + gFlashRegionDescriptorGuid + gFlashRegionBiosGuid + gFlashRegionMeGuid + gFlashRegionGbeGuid + gFlashRegionPlatformDataGuid + gFlashRegionDerGuid + gFlashRegionAllGuid + gFlashRegionMaxGuid --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77136): https://edk2.groups.io/g/devel/message/77136 Mute This Topic: https://groups.io/mt/83794828/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-