From 79c9dd55a32752b7ae11d5f1a50fa3ae27d6d126 Mon Sep 17 00:00:00 2001 From: Marcin Wojtas Date: Mon, 16 Apr 2018 07:09:12 +0200 Subject: Marvell/Drivers: MvFvbDxe: Adjust to new dependencies Recent changes in the EDK2 mainline resulted in breaking of compilation and booting of Armada platforms. This patch adjust the MvFvbDxe driver by: * installation of gEdkiiNvVarStoreFormattedGuid in order to signal NvVarStoreFormattedLib to the generic variable runtime driver * making explicit dependency to ArmPkg/Drivers/CpuDxe drivers in order to enable successful calling of gDS->SetMemorySpaceAttributes Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas Reviewed-by: Ard Biesheuvel --- Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c | 21 +++++++++++++++++++++ Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf | 7 ++----- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'Silicon') diff --git a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c index 252ef67566..6e583a381f 100644 --- a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c +++ b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -1075,6 +1076,21 @@ MvFvbEntryPoint ( goto ErrorConfigureFlash; } + // + // 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); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "%a: Failed to install gEdkiiNvVarStoreFormattedGuid\n", + __FUNCTION__)); + goto ErrorInstallNvVarStoreFormatted; + } + // // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME // @@ -1126,6 +1142,11 @@ ErrorSetMemAttr: gDS->RemoveMemorySpace (RegionBaseAddress, RuntimeMmioRegionSize); ErrorAddSpace: + gBS->UninstallProtocolInterface (&gImageHandle, + &gEdkiiNvVarStoreFormattedGuid, + NULL); + +ErrorInstallNvVarStoreFormatted: gBS->UninstallMultipleProtocolInterfaces (&mFvbDevice->Handle, &gEfiDevicePathProtocolGuid, &gEfiFirmwareVolumeBlockProtocolGuid, diff --git a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf index 117fe8bdd6..fd3f2f72be 100644 --- a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf +++ b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf @@ -63,6 +63,7 @@ UefiRuntimeServicesTableLib [Guids] + gEdkiiNvVarStoreFormattedGuid gEfiAuthenticatedVariableGuid gEfiEventVirtualAddressChangeGuid gEfiSystemNvDataFvGuid @@ -84,8 +85,4 @@ gMarvellTokenSpaceGuid.PcdSpiMemoryBase [Depex] - # - # MvFvbDxe must be loaded before VariableRuntimeDxe in case empty - # flash needs populating with default values. - # - BEFORE gVariableRuntimeDxeFileGuid + gEfiCpuArchProtocolGuid -- cgit v1.2.3