public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jordan Justen <jordan.l.justen@intel.com>
To: edk2-devel@lists.01.org
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: [PATCH 12/12] OvmfPkg QemuFlashFvbServicesRuntimeDxe: Cleanup init now done in PEI
Date: Mon, 27 Mar 2017 01:05:44 -0700	[thread overview]
Message-ID: <20170327080544.24748-13-jordan.l.justen@intel.com> (raw)
In-Reply-To: <20170327080544.24748-1-jordan.l.justen@intel.com>

This is now done in PEI since commit "OvmfPkg PlatformPei: Set flash
variable PCDs".

Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 .../FvbServicesRuntimeDxe.inf                      |  4 ----
 .../FvbServicesSmm.inf                             |  4 ----
 .../FwBlockService.c                               | 28 ++++------------------
 3 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
index c0dda75bf7..8656d185f6 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
@@ -78,11 +78,7 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize
 
 [Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable
 
 [FeaturePcd]
diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
index ba2d3679a4..c9cbc34901 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
@@ -77,11 +77,7 @@
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize
 
 [Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable
 
 [FeaturePcd]
diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
index ff27c1100c..857b1e3878 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
@@ -965,9 +965,9 @@ FvbInitialize (
   EFI_PHYSICAL_ADDRESS                BaseAddress;
   UINTN                               Length;
   UINTN                               NumOfBlocks;
-  RETURN_STATUS                       PcdStatus;
 
-  if (EFI_ERROR (QemuFlashInitialize ())) {
+  if (!PcdGetBool (PcdOvmfFlashVariablesEnable)) {
+    ASSERT (!FeaturePcdGet (PcdSmmSmramRequire));
     //
     // Return an error so image will be unloaded
     //
@@ -976,6 +976,9 @@ FvbInitialize (
     return EFI_WRITE_PROTECTED;
   }
 
+  Status = QemuFlashInitialize ();
+  ASSERT_RETURN_ERROR (Status);
+
   //
   // Allocate runtime services data for global variable, which contains
   // the private data of all firmware volume block instances
@@ -1093,25 +1096,6 @@ FvbInitialize (
 
   MarkMemoryRangeForRuntimeAccess (BaseAddress, Length);
 
-  //
-  // Set several PCD values to point to flash
-  //
-  PcdStatus = PcdSet64S (
-    PcdFlashNvStorageVariableBase64,
-    (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)
-    );
-  ASSERT_RETURN_ERROR (PcdStatus);
-  PcdStatus = PcdSet32S (
-    PcdFlashNvStorageFtwWorkingBase,
-    PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)
-    );
-  ASSERT_RETURN_ERROR (PcdStatus);
-  PcdStatus = PcdSet32S (
-    PcdFlashNvStorageFtwSpareBase,
-    PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)
-    );
-  ASSERT_RETURN_ERROR (PcdStatus);
-
   FwhInstance = (EFI_FW_VOL_INSTANCE *)
     (
       (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength +
@@ -1123,7 +1107,5 @@ FvbInitialize (
   //
   InstallVirtualAddressChangeHandler ();
 
-  PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);
-  ASSERT_RETURN_ERROR (PcdStatus);
   return EFI_SUCCESS;
 }
-- 
2.11.0



  parent reply	other threads:[~2017-03-27  8:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27  8:05 [PATCH 00/12] OvmfPkg: Enable variable access in PEI Jordan Justen
2017-03-27  8:05 ` [PATCH 01/12] OvmfPkg/build.sh: Add support for --disable-flash switch Jordan Justen
2017-03-27  8:05 ` [PATCH 02/12] OvmfPkg: resolve PcdLib for all PEIMs individually Jordan Justen
2017-03-27  8:05 ` [PATCH 03/12] OvmfPkg: resolve PcdLib for PEIMs to PeiPcdLib by default Jordan Justen
2017-03-27  8:05 ` [PATCH 04/12] OvmfPkg QemuFlash: Make QemuFlash.* Base class safe Jordan Justen
2017-03-27  8:05 ` [PATCH 05/12] OvmfPkg QemuFlash: Make QemuFlashDetected external Jordan Justen
2017-03-27  8:05 ` [PATCH 06/12] OvmfPkg QemuFlash: Add DetectFlashBaseLib.inf 'NULL' library Jordan Justen
2017-03-27  8:05 ` [PATCH 07/12] OvmfPkg PlatformPei: Detect and set PcdOvmfFlashVariablesEnable Jordan Justen
2017-03-27  8:05 ` [PATCH 08/12] OvmfPkg/EmuVariableFvbRuntimeDxe: Use PcdOvmfFlashVariablesEnable Jordan Justen
2017-03-27  8:05 ` [PATCH 09/12] OvmfPkg PlatformPei: Set flash variable PCDs Jordan Justen
2017-03-27  8:05 ` [PATCH 10/12] OvmfPkg PlatformPei: Initialize memory based variable store buffer Jordan Justen
2017-03-27  8:05 ` [PATCH 11/12] OvmfPkg: Enable PEI variable access Jordan Justen
2017-03-27  8:05 ` Jordan Justen [this message]
2017-03-27 18:03 ` [PATCH 00/12] OvmfPkg: Enable variable access in PEI Laszlo Ersek
2017-03-27 21:47   ` Jordan Justen
2017-03-28  9:22     ` Laszlo Ersek
2017-03-29  5:24       ` Jordan Justen

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=20170327080544.24748-13-jordan.l.justen@intel.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