ArmVirtPkg/VirtFdtDxe: move FDT config table installation to FdtClientDxe

Now that FdtClientDxe is the core driver that takes ownership of the host
supplied FDT, it makes sense to put it in charge of installing the FDT
configuration table as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Ard Biesheuvel 2016-04-08 11:45:08 +02:00
parent 70bff56093
commit 1e7143d81a
4 changed files with 15 additions and 14 deletions

View File

@ -20,6 +20,7 @@
#include <Library/HobLib.h>
#include <libfdt.h>
#include <Guid/Fdt.h>
#include <Guid/FdtHob.h>
#include <Protocol/FdtClient.h>
@ -234,6 +235,7 @@ InitializeFdtClientDxe (
{
VOID *Hob;
VOID *DeviceTreeBase;
EFI_STATUS Status;
Hob = GetFirstGuidHob (&gFdtHobGuid);
if (Hob == NULL || GET_GUID_HOB_DATA_SIZE (Hob) != sizeof (UINT64)) {
@ -251,6 +253,15 @@ InitializeFdtClientDxe (
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));
if (!FeaturePcdGet (PcdPureAcpiBoot)) {
//
// Only install the FDT as a configuration table if we want to leave it up
// to the OS to decide whether it prefers ACPI over DT.
//
Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
ASSERT_EFI_ERROR (Status);
}
return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,
EFI_NATIVE_INTERFACE, &mFdtClientProtocol);
}

View File

@ -43,6 +43,10 @@
[Guids]
gFdtHobGuid
gFdtTableGuid
[FeaturePcd]
gArmVirtTokenSpaceGuid.PcdPureAcpiBoot
[Depex]
TRUE

View File

@ -28,7 +28,6 @@
#include <libfdt.h>
#include <Library/XenIoMmioLib.h>
#include <Guid/Fdt.h>
#include <Guid/VirtioMmioTransport.h>
#include <Guid/FdtHob.h>
@ -215,14 +214,5 @@ InitializeVirtFdtDxe (
}
}
if (!FeaturePcdGet (PcdPureAcpiBoot)) {
//
// Only install the FDT as a configuration table if we want to leave it up
// to the OS to decide whether it prefers ACPI over DT.
//
Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
ASSERT_EFI_ERROR (Status);
}
return EFI_SUCCESS;
}

View File

@ -45,13 +45,9 @@
XenIoMmioLib
[Guids]
gFdtTableGuid
gVirtioMmioTransportGuid
gFdtHobGuid
[FeaturePcd]
gArmVirtTokenSpaceGuid.PcdPureAcpiBoot
[Protocols]
gEfiDevicePathProtocolGuid