summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Drivers/NorFlashDxe
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2018-04-11 22:50:18 +0200
committerLaszlo Ersek <lersek@redhat.com>2018-04-12 21:24:34 +0200
commit6281a2ed3bb3ffe57ed54cabd9a31dcf13b415f8 (patch)
tree9bc02ab8e771d3b11f72b5ff31e850b472728107 /ArmPlatformPkg/Drivers/NorFlashDxe
parent0f87c53d0d0eb7e7c003e209705ec79264e0852b (diff)
downloadedk2-6281a2ed3bb3ffe57ed54cabd9a31dcf13b415f8.tar.gz
edk2-6281a2ed3bb3ffe57ed54cabd9a31dcf13b415f8.tar.bz2
edk2-6281a2ed3bb3ffe57ed54cabd9a31dcf13b415f8.zip
ArmPlatformPkg/NorFlashDxe: cue the variable driver with NvVarStoreFormatted
The BEFORE depex opcode that we currently use to force ourselves in front of the variable driver cannot be combined with other depex opcodes. Replace the depex with TRUE, and signal NvVarStoreFormattedLib through the installation of "gEdkiiNvVarStoreFormattedGuid". Platforms that rely on NorFlashDxe to format the variable store (as opposed to formatting a variable store template through an FDF file, as part of the build) should hook NvVarStoreFormattedLib into the variable drivers they use, so that the latter await our cue. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Steve Capper <steve.capper@linaro.org> Cc: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Steve Capper <steve.capper@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Drivers/NorFlashDxe')
-rw-r--r--ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf7
-rw-r--r--ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c13
2 files changed, 16 insertions, 4 deletions
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
index 812dafd065..c40ac27a65 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
@@ -31,6 +31,7 @@
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
[LibraryClasses]
IoLib
@@ -49,6 +50,7 @@
gEfiVariableGuid
gEfiAuthenticatedVariableGuid
gEfiEventVirtualAddressChangeGuid
+ gEdkiiNvVarStoreFormattedGuid ## PRODUCES ## PROTOCOL
[Protocols]
gEfiBlockIoProtocolGuid
@@ -67,7 +69,4 @@
gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked
[Depex]
- #
- # NorFlashDxe must be loaded before VariableRuntimeDxe in case empty flash needs populating with default values
- #
- BEFORE gVariableRuntimeDxeFileGuid
+ TRUE
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
index c3e6489f39..e62ffbb433 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
@@ -25,6 +25,7 @@
#include <Guid/VariableFormat.h>
#include <Guid/SystemNvDataGuid.h>
+#include <Guid/NvVarStoreFormatted.h>
#include "NorFlashDxe.h"
@@ -777,6 +778,18 @@ NorFlashFvbInitialize (
}
//
+ // The driver implementing the variable read service can now be dispatched;
+ // the varstore headers are in place.
+ //
+ Status = gBS->InstallProtocolInterface (
+ &gImageHandle,
+ &gEdkiiNvVarStoreFormattedGuid,
+ EFI_NATIVE_INTERFACE,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
// Register for the virtual address change event
//
Status = gBS->CreateEventEx (