From nobody Fri May 17 06:07:37 2024 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+99925+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+99925+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1675967251; cv=none; d=zohomail.com; s=zohoarc; b=P4ECygbD0BgZpppF8spvPeam3B+wJMQp/hB03ZZMoFru89aQYYAnGZ1ewGZLHlIVnrPLeVaT+mDA81WLsX7dyOueSaSM3znnLycnwpYV676+CLInfz6f47K6jRk14vQ+WYlyJliKDrBdGtRnOoUVLyuozP7p8mUcSgwhR0l47Wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675967251; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=6UoVkA+seilDalsKS2xVZ93c/SyjCKy7ut5+UVCyyE0=; b=FPn+5LYFPQqxYQuOtzodCT4PTD1cutodmUdlxd7vnD7Ya3HIUqOGAXjIOHsC+iLd8vROEzGS/lCM4iqM0zNDWoHu6YAnJxc7aavpu1nKLfiT5kYi9ow3ZUZDZN1qRMnDWSgfKRlZO9tbBPwA+QZg6gsKBTXmmDV2ld3qwiSV4vY= 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+99925+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 167596725120161.50663155966595; Thu, 9 Feb 2023 10:27:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6NJcYY1788612xuc2rkRSHUd; Thu, 09 Feb 2023 10:27:30 -0800 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.24742.1675967249886042438 for ; Thu, 09 Feb 2023 10:27:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="330218142" X-IronPort-AV: E=Sophos;i="5.97,284,1669104000"; d="scan'208";a="330218142" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 10:27:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="756505031" X-IronPort-AV: E=Sophos;i="5.97,284,1669104000"; d="scan'208";a="756505031" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.212.151.147]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 10:27:28 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Ashraf Ali S , Isaac Oram , Rangasai V Chaganty , Ray Ni , Michael Kubacki Subject: [edk2-devel] [edk2-platforms: PATCH v4] IntelSiliconPkg/SpiFvbServiceSmm: Support Additional NVS region. Date: Thu, 9 Feb 2023 10:27:18 -0800 Message-Id: <20230209182718.1942-1-chasel.chiu@intel.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,chasel.chiu@intel.com X-Gm-Message-State: T17K58pZlcwFTFHA83lv2Gaux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1675967250; bh=A1F83puvDh0/yMGrgTSTf0hmDmnplzaN/llA+8h6J1Q=; h=Cc:Date:From:Reply-To:Subject:To; b=LG7kl0LH7t1UPBR1lPOiRo97W/qqp3vb2Ny4e45eeqTC5GbnjnxrD1kO+rtqL8o41dW k98DvqoNAHaIWi+qJe72WJkMJq/eijqkGQrkU42drJ2Gq9dZrpy9J9MkT88klFBLfuS9g A7XQi1FiQWknJGD+uo+u2t16NFheXl0UTZM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1675967251664100001 Content-Type: text/plain; charset="utf-8" Platform may implement an additional NVS region following Regular variable region and in this case SpiFvbService should include both region size when calculating the total NVS region size. The PcdFlashNvStorageAdditionalSize is for compatible with legacy usages that should be deprecated. The new usage model should define separate regions without implicit connections to UEFI Variable or FTW regions. Example NVS flash map for such legacy usage: Note: PcdFlashNvStorageAdditionalSize is equal to platform PcdFlashFvNvStorageEventLogSize. --------------- |UEFI Variable| --------------- |EventLog | <=3D this is Additional NVS region --------------- |FTW Working | --------------- |FTW Spare | --------------- Cc: Ashraf Ali S Cc: Isaac Oram Cc: Rangasai V Chaganty Cc: Ray Ni Cc: Michael Kubacki Signed-off-by: Chasel Chiu Reviewed-by: Michael Kubacki Reviewed-by: Isaac Oram =20 --- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCom= mon.c | 22 ++++++++++++++++++++++ Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm= .inf | 7 ++++--- Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec = | 11 +++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiF= vbServiceCommon.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbServi= ce/SpiFvbServiceCommon.c index 942abf95a6..fcdc715263 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceCommon.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceCommon.c @@ -568,6 +568,28 @@ GetVariableFvInfo ( return; } =20 + // + // GetVariableFlashNvStorageInfo () only reports regular variable region= information, + // if platform implemented an additional NVS region following the regula= r variable region, + // then both region size should be included as overall NVS region size. + // + // The below PcdFlashNvStorageAdditionalSize is for compatible with lega= cy usages that should be deprecated. + // The new usage model should define separate regions without implicit c= onnections to UEFI Variable or FTW regions. + // + // Example NVS flash map for such legacy usage: + // Note: PcdFlashNvStorageAdditionalSize is equal to platform PcdFlashFv= NvStorageEventLogSize. + // --------------- + // |UEFI Variable| + // --------------- + // |EventLog | <=3D this is Additional NVS region + // --------------- + // |FTW Working | + // --------------- + // |FTW Spare | + // --------------- + // + NvStoreLength +=3D PcdGet32 (PcdFlashNvStorageAdditionalSize); + Status =3D GetVariableFlashFtwSpareInfo (&NvBaseAddress, &Length64); if (!EFI_ERROR (Status)) { // Stay within the current UINT32 size assumptions in the variable sta= ck. diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiF= vbServiceSmm.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbServic= e/SpiFvbServiceSmm.inf index 73049eceb2..f4009d8d8c 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceSmm.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceSmm.inf @@ -43,9 +43,10 @@ IntelSiliconPkg/IntelSiliconPkg.dec =20 [Pcd] - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUM= ES - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUM= ES - gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETI= MES_CONSUMES + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CON= SUMES + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CON= SUMES + gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOM= ETIMES_CONSUMES + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize ## CON= SUMES =20 [Sources] FvbInfo.c diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index 63dae756ad..d73a51ca52 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -194,3 +194,14 @@ # Other value: reserved for future use.
# @Prompt Flash Variable Store type. gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType|0x00|UINT8|0x00= 00000E + + ## Declares Additional NVS Region Size.

+ # Platform may implement a Regular variable region and an additional re= gion, which will require this PCD + # to tell SpiFvbService to include both regions. + # Note: This PCD is for compatible with legacy usages that should be de= precated. + # The new usage model should define separate regions without implicit c= onnections to UEFI Variable or FTW regions.
+ # Example legacy usage is to set this PCD equal to platform PcdFlashFvN= vStorageEventLogSize. + # 0: No additional NVS region.
+ # non-zero: The size of an additional NVS region following the Regular = variable region.
+ # @Prompt Additional NVS Region Size. + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize|0x0000000= 0|UINT32|0x0000000F --=20 2.35.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 (#99925): https://edk2.groups.io/g/devel/message/99925 Mute This Topic: https://groups.io/mt/96859489/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-