From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web12.39492.1656686434858470845 for ; Fri, 01 Jul 2022 07:40:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=EwL8jMN8; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.195.228.134]) by linux.microsoft.com (Postfix) with ESMTPSA id A52DE20D4DF4; Fri, 1 Jul 2022 07:40:33 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A52DE20D4DF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1656686434; bh=omAnlvISLW7eCBcV8TpxtbHzGzXaF9UnlZSjAxyeSQY=; h=From:To:Cc:Subject:Date:From; b=EwL8jMN87ozM5gsERpTYRlJK5Vs4CSJUo4+kqhJ1hTEV+k4NjM81TWU4ZSQdkoVVf W21DRniQ55xQi5yzAwvNMJpK1a9LkzTrtGkNuPe4qafVDqYRT1wFcnjsikay6nWvDb Td19GUKWjLnzY0z5xFE4l5mDlJLIP5MChnmR/xU8= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Rangasai V Chaganty , Ray Ni , Isaac Oram , Nate DeSimone Subject: [edk2-platforms][PATCH v2 1/1] IntelSiliconPkg/SpiFvbService: Add support for VariableFlashInfoLib Date: Fri, 1 Jul 2022 10:39:43 -0400 Message-Id: <20220701143943.423-1-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3478 Adds support for getting the variable flash information from VariableFlashInfoLib. This library abstracts the source of flash information so platforms could expect the information to come from a different source in the library implementation than the PCDs previously used as the information source in this module. In particular, the library allows Standalone MM platforms to dynamically pass the information behind the library API. Cc: Rangasai V Chaganty Cc: Ray Ni Cc: Isaac Oram Cc: Nate DeSimone Signed-off-by: Michael Kubacki --- Notes: V2 changes: =20 1. Updated the buffer that is returned from GetFvbInfo() to be allocated from pool. 2. Updated calls to that function in FvbInitialize() to free the new buffer after usage. 3. Updated the multiplication operation to determine the FV length to use safe multiplication in GenerateNvStorageFvbMediaInfo(). Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c = | 128 +++++++++++++------- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceC= ommon.c | 93 ++++++++++++-- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceM= m.c | 49 ++++++-- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceC= ommon.h | 18 ++- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceS= mm.inf | 6 +- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceS= tandaloneMm.inf | 6 +- Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc = | 7 ++ 7 files changed, 243 insertions(+), 64 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Fv= bInfo.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbIn= fo.c index 7f2678fa9e5a..634a44218c7a 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c @@ -3,6 +3,7 @@ These data is intent to decouple FVB driver with FV header. =20 Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -11,51 +12,92 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #define FIRMWARE_BLOCK_SIZE 0x10000 #define FVB_MEDIA_BLOCK_SIZE FIRMWARE_BLOCK_SIZE - -#define NV_STORAGE_BASE_ADDRESS FixedPcdGet32(PcdFlashNvStorageVaria= bleBase) -#define SYSTEM_NV_BLOCK_NUM ((FixedPcdGet32(PcdFlashNvStorageVar= iableSize)+ FixedPcdGet32(PcdFlashNvStorageFtwWorkingSize) + FixedPcdGet3= 2(PcdFlashNvStorageFtwSpareSize))/ FVB_MEDIA_BLOCK_SIZE) - typedef struct { EFI_PHYSICAL_ADDRESS BaseAddress; EFI_FIRMWARE_VOLUME_HEADER FvbInfo; EFI_FV_BLOCK_MAP_ENTRY End[1]; } EFI_FVB2_MEDIA_INFO; =20 -// -// This data structure contains a template of all correct FV headers, wh= ich is used to restore -// Fv header if it's corrupted. -// -EFI_FVB2_MEDIA_INFO mPlatformFvbMediaInfo[] =3D { - // - // Systen NvStorage FVB - // - { - NV_STORAGE_BASE_ADDRESS, - { - {0,}, //ZeroVector[16] - EFI_SYSTEM_NV_DATA_FV_GUID, - FVB_MEDIA_BLOCK_SIZE * SYSTEM_NV_BLOCK_NUM, - EFI_FVH_SIGNATURE, - 0x0004feff, // check MdePkg/Include/Pi/PiFirmwareVolume.h for deta= ils on EFI_FVB_ATTRIBUTES_2 - sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENT= RY), - 0, //CheckSum which will be calucated dynamically. - 0, //ExtHeaderOffset - {0,}, //Reserved[1] - 2, //Revision - { - { - SYSTEM_NV_BLOCK_NUM, - FVB_MEDIA_BLOCK_SIZE, - } - } - }, - { - { - 0, - 0 - } - } +/** + Returns FVB media information for NV variable storage. + + @return FvbMediaInfo A pointer to an instance of FVB me= dia info produced by this function. + The buffer is allocated internally= to this function and it is the caller's + responsibility to free the memory + +**/ +typedef +EFI_STATUS +(*FVB_MEDIA_INFO_GENERATOR)( + OUT EFI_FVB2_MEDIA_INFO *FvbMediaInfo + ); + +/** + Returns FVB media information for NV variable storage. + + @param[out] FvbMediaInfo A pointer to an instance of FVB me= dia info produced by this function. + + @retval EFI_SUCCESS A structure was successfully writt= en to the FvbMediaInfo buffer. + @retval EFI_INVALID_PARAMETER The FvbMediaInfo parameter is NULL= . + @retval EFI_UNSUPPORTED An error occurred retrieving varia= ble FV information. + @retval EFI_BAD_BUFFER_SIZE An overflow or underflow of the FV= buffer occurred with the information found. + +**/ +EFI_STATUS +GenerateNvStorageFvbMediaInfo ( + OUT EFI_FVB2_MEDIA_INFO *FvbMediaInfo + ) +{ + EFI_STATUS Status; + UINT32 NvBlockNum; + UINT32 TotalNvVariableStorageSize; + EFI_PHYSICAL_ADDRESS NvStorageBaseAddress; + EFI_FIRMWARE_VOLUME_HEADER FvbInfo =3D { + {0,}, = //ZeroVector[16] + EFI_SYSTEM_NV_DATA_FV_GUID, = //FileSystemGuid + 0, = //FvLength + EFI_FVH_SIGNATURE, = //Signature + 0x0004feff, = //Attributes + sizeof (EFI_FIRMWARE_VOLUME_HE= ADER) + //HeaderLength + sizeof (EFI_FV_BLOCK_MAP_ENT= RY), + 0, = //Checksum + 0, = //ExtHeaderOffset + {0,}, = //Reserved[1] + 2, = //Revision + { = //BlockMap[1] + {0,0} + } + }; + + if (FvbMediaInfo =3D=3D NULL) { + return EFI_INVALID_PARAMETER; } + + ZeroMem (FvbMediaInfo, sizeof (*FvbMediaInfo)); + + GetVariableFvInfo (&NvStorageBaseAddress, &TotalNvVariableStorageSize)= ; + if ((NvStorageBaseAddress =3D=3D 0) || (TotalNvVariableStorageSize =3D= =3D 0)) { + return EFI_UNSUPPORTED; + } + + NvBlockNum =3D TotalNvVariableStorageSize / FVB_MEDIA_BLOCK_SIZE; + + Status =3D SafeUint64Mult ((UINT64)NvBlockNum, FVB_MEDIA_BLOCK_SIZE, &= FvbInfo.FvLength); + if (EFI_ERROR (Status)) { + return EFI_BAD_BUFFER_SIZE; + } + + FvbInfo.BlockMap[0].NumBlocks =3D NvBlockNum; + FvbInfo.BlockMap[0].Length =3D FVB_MEDIA_BLOCK_SIZE; + + FvbMediaInfo->BaseAddress =3D NvStorageBaseAddress; + CopyMem (&FvbMediaInfo->FvbInfo, &FvbInfo, sizeof (FvbInfo)); + + return EFI_SUCCESS; +} + +FVB_MEDIA_INFO_GENERATOR mFvbMediaInfoGenerators[] =3D { + GenerateNvStorageFvbMediaInfo }; =20 EFI_STATUS @@ -64,12 +106,16 @@ GetFvbInfo ( OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo ) { + EFI_STATUS Status; + EFI_FVB2_MEDIA_INFO FvbMediaInfo; UINTN Index; EFI_FIRMWARE_VOLUME_HEADER *FvHeader; =20 - for (Index =3D 0; Index < sizeof (mPlatformFvbMediaInfo) / sizeof (EFI= _FVB2_MEDIA_INFO); Index++) { - if (mPlatformFvbMediaInfo[Index].BaseAddress =3D=3D FvBaseAddress) { - FvHeader =3D &mPlatformFvbMediaInfo[Index].FvbInfo; + for (Index =3D 0; Index < ARRAY_SIZE (mFvbMediaInfoGenerators); Index+= +) { + Status =3D mFvbMediaInfoGenerators[Index](&FvbMediaInfo); + ASSERT_EFI_ERROR (Status); + if (!EFI_ERROR (Status) && (FvbMediaInfo.BaseAddress =3D=3D FvBaseAd= dress)) { + FvHeader =3D AllocateCopyPool (sizeof (EFI_FIRMWARE_VOLUME_HEADER)= , &FvbMediaInfo.FvbInfo); =20 // // Update the checksum value of FV header. diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Sp= iFvbServiceCommon.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbS= ervice/SpiFvbServiceCommon.c index dab818e98087..942abf95a64f 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceCommon.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceCommon.c @@ -3,6 +3,7 @@ which are compliant with the Intel(R) Serial Flash Interface Compatibi= lity Specification. =20 Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -25,12 +26,6 @@ FV_INFO mPlatformFvBaseAddress[] =3D { {0, 0} }; =20 -FV_INFO mPlatformDefaultBaseAddress[] =3D { - {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase), FixedPcdGet3= 2(PcdFlashNvStorageVariableSize)}, - {0, 0}, // {FixedPcdGet32(PcdFlashMicrocodeFvBase), FixedPcdGet32(PcdF= lashMicrocodeFvSize)}, - {0, 0} -}; - FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate =3D { { { @@ -530,6 +525,85 @@ FvbSetVolumeAttributes ( return EFI_SUCCESS; } =20 +/** + Get the total size of the firmware volume on flash used for variable s= tore operations. + + @param[out] BaseAddress Base address of the variable store fir= mware volume. + @param[out] Length Length in bytes of the firmware volume= used for variable store operations. + +**/ +VOID +GetVariableFvInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT32 *Length + ) +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS NvBaseAddress; + EFI_PHYSICAL_ADDRESS NvVariableBaseAddress; + UINT64 Length64; + UINT32 NvStoreLength; + UINT32 FtwSpareLength; + UINT32 FtwWorkingLength; + UINT32 TotalLength; + + TotalLength =3D 0; + Status =3D EFI_SUCCESS; + + if ((BaseAddress =3D=3D NULL) || (Length =3D=3D NULL)) { + ASSERT ((BaseAddress !=3D NULL) && (Length !=3D NULL)); + return; + } + *BaseAddress =3D 0; + *Length =3D 0; + + Status =3D GetVariableFlashNvStorageInfo (&NvBaseAddress, &Length64); + if (!EFI_ERROR (Status)) { + NvVariableBaseAddress =3D NvBaseAddress; + // Stay within the current UINT32 size assumptions in the variable s= tack. + Status =3D SafeUint64ToUint32 (Length64, &NvStoreLength); + } + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return; + } + + Status =3D GetVariableFlashFtwSpareInfo (&NvBaseAddress, &Length64); + if (!EFI_ERROR (Status)) { + // Stay within the current UINT32 size assumptions in the variable s= tack. + Status =3D SafeUint64ToUint32 (Length64, &FtwSpareLength); + } + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return; + } + + Status =3D GetVariableFlashFtwWorkingInfo (&NvBaseAddress, &Length64); + if (!EFI_ERROR (Status)) { + // Stay within the current UINT32 size assumptions in the variable s= tack. + Status =3D SafeUint64ToUint32 (Length64, &FtwWorkingLength); + } + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return; + } + + Status =3D SafeUint32Add (NvStoreLength, FtwSpareLength, &TotalLength)= ; + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return; + } + + Status =3D SafeUint32Add (TotalLength, FtwWorkingLength, &TotalLength)= ; + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return; + } + + *BaseAddress =3D NvVariableBaseAddress; + *Length =3D TotalLength; +} + /** Check the integrity of firmware volume header =20 @@ -545,7 +619,12 @@ IsFvHeaderValid ( IN CONST EFI_FIRMWARE_VOLUME_HEADER *FvHeader ) { - if (FvBase =3D=3D PcdGet32(PcdFlashNvStorageVariableBase)) { + EFI_PHYSICAL_ADDRESS NvStorageFvBaseAddress; + UINT32 NvStorageSize; + + GetVariableFvInfo (&NvStorageFvBaseAddress, &NvStorageSize); + + if (FvBase =3D=3D NvStorageFvBaseAddress) { if (CompareMem (&FvHeader->FileSystemGuid, &gEfiSystemNvDataFvGuid, = sizeof(EFI_GUID)) !=3D 0 ) { return FALSE; } diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Sp= iFvbServiceMm.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbServi= ce/SpiFvbServiceMm.c index 42a0828c6fae..6b4bcdcfe3c4 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceMm.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceMm.c @@ -113,15 +113,31 @@ FvbInitialize ( UINT32 MaxLbaSize; UINT32 BytesWritten; UINTN BytesErased; + UINT64 NvStorageFvSize; + + Status =3D GetVariableFlashNvStorageInfo (&BaseAddress, &NvStorageFvSi= ze); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + DEBUG ((DEBUG_ERROR, "[%a] - An error ocurred getting variable info = - %r.\n", __FUNCTION__, Status)); + return; + } + + // Stay within the current UINT32 size assumptions in the variable sta= ck. + Status =3D SafeUint64ToUint32 (BaseAddress, &mPlatformFvBaseAddress[0]= .FvBase); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage base address no= t supported.\n", __FUNCTION__)); + return; + } + Status =3D SafeUint64ToUint32 (NvStorageFvSize, &mPlatformFvBaseAddres= s[0].FvSize); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage size not suppor= ted.\n", __FUNCTION__)); + return; + } =20 - mPlatformFvBaseAddress[0].FvBase =3D PcdGet32(PcdFlashNvStorageVariabl= eBase); - mPlatformFvBaseAddress[0].FvSize =3D PcdGet32(PcdFlashNvStorageVariabl= eSize); mPlatformFvBaseAddress[1].FvBase =3D PcdGet32(PcdFlashMicrocodeFvBase)= ; mPlatformFvBaseAddress[1].FvSize =3D PcdGet32(PcdFlashMicrocodeFvSize)= ; - mPlatformDefaultBaseAddress[0].FvBase =3D PcdGet32(PcdFlashNvStorageVa= riableBase); - mPlatformDefaultBaseAddress[0].FvSize =3D PcdGet32(PcdFlashNvStorageVa= riableSize); - mPlatformDefaultBaseAddress[1].FvBase =3D PcdGet32(PcdFlashMicrocodeFv= Base); - mPlatformDefaultBaseAddress[1].FvSize =3D PcdGet32(PcdFlashMicrocodeFv= Size); =20 // // We will only continue with FVB installation if the @@ -143,7 +159,8 @@ FvbInitialize ( BytesWritten =3D 0; BytesErased =3D 0; DEBUG ((DEBUG_ERROR, "ERROR - The FV in 0x%x is invalid!\n", FvH= eader)); - Status =3D GetFvbInfo (BaseAddress, &FvHeader); + FvHeader =3D NULL; + Status =3D GetFvbInfo (BaseAddress, &FvHeader); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - Can't recovery FV header at 0x%x.= GetFvbInfo Status %r\n", BaseAddress, Status)); continue; @@ -156,27 +173,42 @@ FvbInitialize ( Status =3D SpiFlashBlockErase( (UINTN) BaseAddress, &BytesErased= ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashBlockErase Error %r\n", = Status)); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } continue; } if (BytesErased !=3D FvHeader->BlockMap->Length) { DEBUG ((DEBUG_WARN, "ERROR - BytesErased !=3D FvHeader->BlockM= ap->Length\n")); DEBUG ((DEBUG_INFO, " BytesErased =3D 0x%X\n Length =3D 0x%X\n= ", BytesErased, FvHeader->BlockMap->Length)); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } continue; } BytesWritten =3D FvHeader->HeaderLength; Status =3D SpiFlashWrite ((UINTN)BaseAddress, &BytesWritten, (UI= NT8*)FvHeader); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashWrite Error %r\n", Statu= s)); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } continue; } if (BytesWritten !=3D FvHeader->HeaderLength) { DEBUG ((DEBUG_WARN, "ERROR - BytesWritten !=3D HeaderLength\n"= )); DEBUG ((DEBUG_INFO, " BytesWritten =3D 0x%X\n HeaderLength =3D= 0x%X\n", BytesWritten, FvHeader->HeaderLength)); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } continue; } Status =3D SpiFlashLock (); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashLock Error %r\n", Status= )); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } continue; } DEBUG ((DEBUG_INFO, "FV Header @ 0x%X restored with static data\= n", BaseAddress)); @@ -184,6 +216,9 @@ FvbInitialize ( // Clear cache for this range. // WriteBackInvalidateDataCacheRange ( (VOID *) (UINTN) BaseAddress= , FvHeader->BlockMap->Length); + if (FvHeader !=3D NULL) { + FreePool (FvHeader); + } } } =20 diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Sp= iFvbServiceCommon.h b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbS= ervice/SpiFvbServiceCommon.h index e9d69e985814..7b0908b03fdc 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceCommon.h +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceCommon.h @@ -2,6 +2,7 @@ Common source definitions used in serial flash drivers =20 Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -12,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include =20 @@ -24,6 +26,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include +#include =20 #include =20 @@ -148,11 +152,23 @@ GetFvbInfo ( OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo ); =20 +/** + Get the total size of the firmware volume on flash used for variable s= tore operations. + + @param[out] BaseAddress Base address of the variable store fir= mware volume. + @param[out] Length Length in bytes of the firmware volume= used for variable store operations. + +**/ +VOID +GetVariableFvInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT32 *Length + ); + extern FVB_GLOBAL mFvbModuleGlobal; extern FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate; extern FV_PIWG_DEVICE_PATH mFvPIWGDevicePathTemplate; extern EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL mFvbProtocolTemplate; extern FV_INFO mPlatformFvBaseAddress[]; -extern FV_INFO mPlatformDefaultBaseAddress[]; =20 #endif diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Sp= iFvbServiceSmm.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbSe= rvice/SpiFvbServiceSmm.inf index bf1306f00201..0cfa3f909bdf 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceSmm.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceSmm.inf @@ -32,8 +32,10 @@ [LibraryClasses] BaseLib UefiBootServicesTableLib UefiDriverEntryPoint + SafeIntLib SpiFlashCommonLib MmServicesTableLib + VariableFlashInfoLib =20 [Packages] MdePkg/MdePkg.dec @@ -41,10 +43,6 @@ [Packages] IntelSiliconPkg/IntelSiliconPkg.dec =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CONS= UMES gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONS= UMES gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONS= UMES =20 diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/Sp= iFvbServiceStandaloneMm.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Flash= /SpiFvbService/SpiFvbServiceStandaloneMm.inf index b66233968247..152cf0036fdb 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceStandaloneMm.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSer= viceStandaloneMm.inf @@ -31,8 +31,10 @@ [LibraryClasses] MemoryAllocationLib PcdLib MmServicesTableLib + SafeIntLib SpiFlashCommonLib StandaloneMmDriverEntryPoint + VariableFlashInfoLib =20 [Packages] MdePkg/MdePkg.dec @@ -40,10 +42,6 @@ [Packages] IntelSiliconPkg/IntelSiliconPkg.dec =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CONS= UMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CONS= UMES gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONS= UMES gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONS= UMES =20 diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/= Intel/IntelSiliconPkg/IntelSiliconPkg.dsc index 1e826a080f28..170eb480ada1 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc @@ -40,9 +40,11 @@ [LibraryClasses] PeiGetVtdPmrAlignmentLib|IntelSiliconPkg/Library/PeiGetVtdPmrAlignment= Lib/PeiGetVtdPmrAlignmentLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasur= ementLibNull.inf MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf + SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf SpiFlashCommonLib|IntelSiliconPkg/Library/SpiFlashCommonLibNull/SpiFla= shCommonLibNull.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiB= ootServicesTableLib.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEnt= ryPoint.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas= eVariableFlashInfoLib.inf =20 [LibraryClasses.common.PEIM] PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf @@ -63,11 +65,16 @@ [LibraryClasses.common.DXE_DRIVER] MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryA= llocationLib.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAll= ocationLib.inf MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLi= b.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTabl= eLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib= /UefiRuntimeServicesTableLib.inf =20 [LibraryClasses.common.MM_STANDALONE] + HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.i= nf MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocati= onLib/StandaloneMmMemoryAllocationLib.inf MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Standal= oneMmServicesTableLib.inf StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoi= nt/StandaloneMmDriverEntryPoint.inf --=20 2.28.0.windows.1