public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Guo Dong" <guo.dong@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"mikuback@linux.microsoft.com" <mikuback@linux.microsoft.com>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB
Date: Sun, 10 Apr 2022 23:22:34 +0000	[thread overview]
Message-ID: <BYAPR11MB3622A6C844B6189019A152A59EEB9@BYAPR11MB3622.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220408211733.1332-2-mikuback@linux.microsoft.com>


Does the range (NvStorageBaseAddress, NvStorageLength) includes FTW spare range and FTW working range?
If not, maybe rename them as  (NvVariableBaseAddress, NvVariableLength) to make it clear.

For these 3 ranges, are there any other requirements (e.g. base address must be 4KB aligned, or FtwSpaceLength >= NvVariablelength)?
If yes, had better add to this interface file to make the HOB producer easy to build the HOB.

Thanks,
Guo

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Kubacki
Sent: Friday, April 8, 2022 2:17 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

Adds a new GUID that is used to identify a HOB that passes variable flash information to UEFI variable drivers in HOB consumption phases such as DXE, Traditional MM, and Standalone MM.

This information was previously passed directly with PCDs such as EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize.

However, the Standalone MM variable driver instance does not have direct access to the PCD database. Therefore, this HOB will first be considered as the source for variable flash information and if platforms do not produce the HOB, reading the information from the PCDs directly will be a backup to provide backward compatibility.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 ++++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec                 |  4 ++
 2 files changed, 43 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
new file mode 100644
index 000000000000..e526e362aab9
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
@@ -0,0 +1,39 @@
+/** @file
+  This file defines the GUID and data structure used to pass 
+information about
+  a variable store mapped on flash (i.e. a MMIO firmware volume) to the DXE and MM environment.
+
+  Copyright (c) Microsoft Corporation.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef VARIABLE_FLASH_INFO_H_
+#define VARIABLE_FLASH_INFO_H_
+
+#define VARIABLE_FLASH_INFO_HOB_GUID \
+  { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, 
+0xfc, 0x90 }}
+
+#define VARIABLE_FLASH_INFO_HOB_VERSION  1
+
+extern EFI_GUID  gVariableFlashInfoHobGuid;
+
+#pragma pack (push, 1)
+
+///
+/// This structure can be used to describe UEFI variable /// flash 
+information.
+///
+typedef struct {
+  UINT32                  Version;
+  EFI_PHYSICAL_ADDRESS    NvStorageBaseAddress;
+  UINT64                  NvStorageLength;
+  EFI_PHYSICAL_ADDRESS    FtwSpareBaseAddress;
+  UINT64                  FtwSpareLength;
+  EFI_PHYSICAL_ADDRESS    FtwWorkingBaseAddress;
+  UINT64                  FtwWorkingLength;
+} VARIABLE_FLASH_INFO;
+
+#pragma pack (pop)
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -226,6 +226,10 @@ [Guids]
   #  Include/Guid/SmmVariableCommon.h
   gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
 
+  ## Guid of the variable flash information HOB.
+  #  Include/Guid/VariableFlashInfo.h
+  gVariableFlashInfoHobGuid = { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 
+ 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }}
+
   ## Performance protocol guid that also acts as the performance HOB guid and performance variable GUID
   #  Include/Guid/Performance.h
   gPerformanceProtocolGuid       = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88650): https://edk2.groups.io/g/devel/message/88650
Mute This Topic: https://groups.io/mt/90345653/1781375
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com]
-=-=-=-=-=-=



  reply	other threads:[~2022-04-10 23:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 21:17 [PATCH v2 0/8] Add Variable Flash Info HOB Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 1/8] MdeModulePkg: " Michael Kubacki
2022-04-10 23:22   ` Guo Dong [this message]
2022-04-11 17:47     ` [edk2-devel] " Michael Kubacki
2022-04-11 21:23       ` Guo Dong
2022-04-08 21:17 ` [PATCH v2 2/8] MdeModulePkg/VariableFlashInfoLib: Add initial library Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 3/8] MdeModulePkg/Variable: Consume Variable Flash Info Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 4/8] MdeModulePkg/FaultTolerantWrite: " Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 5/8] ArmVirtPkg/ArmVirt.dsc.inc: Add VariableFlashInfoLib Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 6/8] EmulatorPkg: " Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 7/8] OvmfPkg: " Michael Kubacki
2022-04-08 21:17 ` [PATCH v2 8/8] UefiPayloadPkg: " Michael Kubacki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB3622A6C844B6189019A152A59EEB9@BYAPR11MB3622.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox