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.web11.22578.1675963465536498595 for ; Thu, 09 Feb 2023 09:24:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=fqRt1i91; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 4107B20C8AEC; Thu, 9 Feb 2023 09:24:24 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4107B20C8AEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675963465; bh=pZ3NEoacP/9TzWeFUamXDqLROpKIHTpmGP8CxZdcDCU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fqRt1i913NadOqBdS6FBoUADAo3uidrXo5jI0zpQhk8gIxusTSTxK8UCMfqLv/9fo 6azCDhxSqaKfr3Le4zaWFnDB0XomkkGRAWYlJgPIl6/ftZzmyw2X4SynggrqLdJpAa TRaJ/ysPgauuoh9F8qYB+cAgLK6/rmodmQfXdRNc= Message-ID: <2278b2d3-0d28-4395-a6fb-327cf0cbe18c@linux.microsoft.com> Date: Thu, 9 Feb 2023 12:24:23 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [edk2-devel] [edk2-platforms: PATCH v3] IntelSiliconPkg/SpiFvbServiceSmm: Support Additional NVS region. To: devel@edk2.groups.io, chasel.chiu@intel.com Cc: Ashraf Ali S , Isaac Oram , Rangasai V Chaganty , Ray Ni , Michael Kubacki References: <20230209172008.1568-1-chasel.chiu@intel.com> From: "Michael Kubacki" In-Reply-To: <20230209172008.1568-1-chasel.chiu@intel.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Please fix the typo in the commit message and code comment before pushing. "|UEI Variable|" -> "|UEFI Variable|" Reviewed-by: Michael Kubacki On 2/9/2023 12:20 PM, Chiu, Chasel wrote: > 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. > > One usage model is EventLog NVS region and there could be others. > Example NVS flash map for such usage model: > -------------- > |UEI Variable| > -------------- > |EventLog | <= 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 > --- > Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c | 17 +++++++++++++++++ > Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf | 7 ++++--- > Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 8 ++++++++ > 3 files changed, 29 insertions(+), 3 deletions(-) > > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c > index 942abf95a6..cf5a40bf27 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c > @@ -568,6 +568,23 @@ GetVariableFvInfo ( > return; > > } > > > > + // > > + // GetVariableFlashNvStorageInfo () only reports regular variable region information, > > + // if platform implemented an additional NVS region following the regular variable region, > > + // the both region size should be included as overall NVS region size. > > + // Example NVS flash map for such usage model: > > + // -------------- > > + // |UEI Variable| > > + // -------------- > > + // |EventLog | <= this is Additional NVS region > > + // -------------- > > + // |FTW Working | > > + // -------------- > > + // |FTW Spare | > > + // -------------- > > + // > > + NvStoreLength += PcdGet32 (PcdFlashNvStorageAdditionalSize); > > + > > Status = GetVariableFlashFtwSpareInfo (&NvBaseAddress, &Length64); > > if (!EFI_ERROR (Status)) { > > // Stay within the current UINT32 size assumptions in the variable stack. > > diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf > index 73049eceb2..f4009d8d8c 100644 > --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf > +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf > @@ -43,9 +43,10 @@ > IntelSiliconPkg/IntelSiliconPkg.dec > > > > [Pcd] > > - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES > > - gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES > > - gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETIMES_CONSUMES > > + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES > > + gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES > > + gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETIMES_CONSUMES > > + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize ## CONSUMES > > > > [Sources] > > FvbInfo.c > > diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec > index 63dae756ad..b10529b69d 100644 > --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec > +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec > @@ -194,3 +194,11 @@ > # Other value: reserved for future use.
> > # @Prompt Flash Variable Store type. > > gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType|0x00|UINT8|0x0000000E > > + > > + ## Declares Additional NVS Variable Region Size.

> > + # Platform may implement a Regular variable region and an additional variable region, which will require this PCD > > + # to tell SpiFvbService to include both regions.
> > + # 0: No additional variable region.
> > + # non-zero: The size of an additional variable region following the Regular variable region.
> > + # @Prompt Additional NVS Variable Region Size. > > + gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize|0x00000000|UINT32|0x0000000F >