From nobody Mon Feb 9 13:04:16 2026 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+82164+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+82164+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1634333148; cv=none; d=zohomail.com; s=zohoarc; b=AAd66sWMO3zetVQrCgrE8Cmap8sfUuNS6AF8QHMm6xpkgP4rTr7CncmF3ZOQp80OUG06cYOf5mx042D1bvymNXcobVg/dF+UEWvndnwD/g5gNw4x1kgj8C72hoKHlXlKB9wXM+jpah50TQy0J4PvfMbGg/q253mU20wdvMelQZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634333148; 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=DHCko7eg0iyMU0IOHY0aI4PxC0eS8BHStW+iJc3Cr1U=; b=Cw0Bn1aDrsEPaqfNkHGzGr/1s2PRmdz7+rBALj502JIn53zb/8iLy6+F96WkleYfDrhEjFIfu7XLl50h50HMI8hCDsQ4piCZowbZNUEsjGIZ285VniCqcAVxKKv05fIp3kRY3Llm56aTn9Tm3ad5hCivHWHRt3iBYZJkZkwih3E= 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+82164+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 1634333148914975.7429308024177; Fri, 15 Oct 2021 14:25:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id E97tYY1788612xaTgazy7dng; Fri, 15 Oct 2021 14:25:48 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.3341.1634333146761283299 for ; Fri, 15 Oct 2021 14:25:47 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10138"; a="314187536" X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="314187536" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 14:25:47 -0700 X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="492709807" X-Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 14:25:44 -0700 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel][edk2-platforms][PATCH V1 09/11] MinPlatformPkg/SpifvbService: Publish FV based on board request Date: Fri, 15 Oct 2021 14:25:32 -0700 Message-Id: In-Reply-To: References: 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,isaac.w.oram@intel.com X-Gm-Message-State: KBPFTjebEmr9Lwr0Q5XZ40yfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634333148; bh=I4Wqym8ELzcJM5vMl8A228v7F8/fZF7Inw2u/e8pOdc=; h=Cc:Date:From:Reply-To:Subject:To; b=W65za2+jnZvT29rSG/AmVcQicsVoeKjEOvSgtMCRPD8AB+WC8lxIZ6USVt7wjOulTL3 FMoakt96JAMz973E3Mb98Uw+c+91HTgbT7BVF6k5mqfZa6soKKXBtIssAsyNVl9agC2m4 mMlJScAqvhOQ+DnDWr1mpoLNDJODG49cBpU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634333150587100034 Content-Type: text/plain; charset="utf-8" Change MM reporting to use ReportFvLib API ReportMmFv (); This removed the hardcoded table of FV to publish. Also removed the unused "default" table. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Isaac Oram --- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c = | 16 -------- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.h = | 7 ---- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c = | 41 ++++++++++++-------- Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf = | 1 + Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneM= m.inf | 1 + 5 files changed, 27 insertions(+), 39 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServic= eCommon.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbService= Common.c index 113c749d04..b8a255dbf4 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon= .c +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon= .c @@ -15,22 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // FVB_GLOBAL mFvbModuleGlobal; =20 -// -// This platform driver knows there are multiple FVs on FD. -// Now we only provide FVs on Variable region and MicorCode region for per= formance issue. -// -FV_INFO mPlatformFvBaseAddress[] =3D { - {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase), FixedPcdGet32(= PcdFlashNvStorageVariableSize)}, - {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase), FixedPcdGet32(PcdFla= shFvMicrocodeSize)}, - {0, 0} -}; - -FV_INFO mPlatformDefaultBaseAddress[] =3D { - {0, 0}, // {FixedPcdGet32(PcdFlashNvStorageVariableBase), FixedPcdGet32(= PcdFlashNvStorageVariableSize)}, - {0, 0}, // {FixedPcdGet32(PcdFlashFvMicrocodeBase), FixedPcdGet32(PcdFla= shFvMicrocodeSize)}, - {0, 0} -}; - FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate =3D { { { diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServic= eCommon.h b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbService= Common.h index e9d69e9858..d1d61b124f 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon= .h +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon= .h @@ -71,11 +71,6 @@ typedef struct { EFI_DEVICE_PATH_PROTOCOL EndDevPath; } FV_MEMMAP_DEVICE_PATH; =20 -typedef struct { - UINT32 FvBase; - UINT32 FvSize; -} FV_INFO; - // // Protocol APIs // @@ -152,7 +147,5 @@ extern FVB_GLOBAL mFvbModuleGlo= bal; 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/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServic= eMm.c b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c index 016f19587c..1d8d55b8f2 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c @@ -11,6 +11,7 @@ #include "SpiFvbServiceCommon.h" #include #include +#include #include =20 /** @@ -97,8 +98,12 @@ InstallFvbProtocol ( The function does the necessary initialization work for Firmware Volume Block Driver. =20 + @param VOID + + @retval EFI_SUCCESS The driver initialized successfully. + @retval EFI_UNSUPPORTED The driver failed to initialize properly. **/ -VOID +EFI_STATUS FvbInitialize ( VOID ) @@ -113,15 +118,17 @@ FvbInitialize ( UINT32 MaxLbaSize; UINT32 BytesWritten; UINTN BytesErased; + FV_INFO *BoardFvInfoTablePtr; =20 - mPlatformFvBaseAddress[0].FvBase =3D PcdGet32(PcdFlashNvStorageVariableB= ase); - mPlatformFvBaseAddress[0].FvSize =3D PcdGet32(PcdFlashNvStorageVariableS= ize); - mPlatformFvBaseAddress[1].FvBase =3D PcdGet32(PcdFlashFvMicrocodeBase); - mPlatformFvBaseAddress[1].FvSize =3D PcdGet32(PcdFlashFvMicrocodeSize); - mPlatformDefaultBaseAddress[0].FvBase =3D PcdGet32(PcdFlashNvStorageVari= ableBase); - mPlatformDefaultBaseAddress[0].FvSize =3D PcdGet32(PcdFlashNvStorageVari= ableSize); - mPlatformDefaultBaseAddress[1].FvBase =3D PcdGet32(PcdFlashFvMicrocodeBa= se); - mPlatformDefaultBaseAddress[1].FvSize =3D PcdGet32(PcdFlashFvMicrocodeSi= ze); + // + // Retrieve the FV Info from the board library + // + BoardFvInfoTablePtr =3D NULL; + ReportMmFv (&BoardFvInfoTablePtr); + if (!BoardFvInfoTablePtr) { + ASSERT (BoardFvInfoTablePtr !=3D NULL); + return EFI_UNSUPPORTED; + } =20 // // We will only continue with FVB installation if the @@ -132,11 +139,11 @@ FvbInitialize ( // Make sure all FVB are valid and/or fix if possible // for (Idx =3D 0;; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + if (BoardFvInfoTablePtr[Idx].FvSize =3D=3D 0 && BoardFvInfoTablePtr[= Idx].FvBase =3D=3D 0) { break; } =20 - BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; + BaseAddress =3D BoardFvInfoTablePtr[Idx].FvBase; FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -192,10 +199,10 @@ FvbInitialize ( // BufferSize =3D 0; for (Idx =3D 0; ; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + if (BoardFvInfoTablePtr[Idx].FvSize =3D=3D 0 && BoardFvInfoTablePtr[= Idx].FvBase =3D=3D 0) { break; } - BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; + BaseAddress =3D BoardFvInfoTablePtr[Idx].FvBase; FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -212,7 +219,7 @@ FvbInitialize ( mFvbModuleGlobal.FvbInstance =3D (EFI_FVB_INSTANCE *) AllocateRuntime= ZeroPool (BufferSize); if (mFvbModuleGlobal.FvbInstance =3D=3D NULL) { ASSERT (FALSE); - return; + return EFI_SUCCESS; } =20 MaxLbaSize =3D 0; @@ -220,10 +227,10 @@ FvbInitialize ( mFvbModuleGlobal.NumFv =3D 0; =20 for (Idx =3D 0; ; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + if (BoardFvInfoTablePtr[Idx].FvSize =3D=3D 0 && BoardFvInfoTablePtr[= Idx].FvBase =3D=3D 0) { break; } - BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; + BaseAddress =3D BoardFvInfoTablePtr[Idx].FvBase; FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { @@ -268,4 +275,6 @@ FvbInitialize ( =20 } } + + return EFI_SUCCESS; } diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServic= eSmm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceS= mm.inf index 10e51e1175..7b69bedcdc 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf @@ -34,6 +34,7 @@ UefiDriverEntryPoint SpiFlashCommonLib MmServicesTableLib + ReportFvLib =20 [Packages] MdePkg/MdePkg.dec diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServic= eStandaloneMm.inf b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFv= bServiceStandaloneMm.inf index 9f08d3673f..1dfb2520e7 100644 --- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStanda= loneMm.inf +++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStanda= loneMm.inf @@ -33,6 +33,7 @@ MmServicesTableLib SpiFlashCommonLib StandaloneMmDriverEntryPoint + ReportFvLib =20 [Packages] MdePkg/MdePkg.dec --=20 2.27.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 (#82164): https://edk2.groups.io/g/devel/message/82164 Mute This Topic: https://groups.io/mt/86360116/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-