From 1e7143d81a08c18d0b684853a756362ad7f693f3 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 8 Apr 2016 11:45:08 +0200 Subject: [PATCH] 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 Reviewed-by: Laszlo Ersek --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 11 +++++++++++ ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 4 ++++ ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c | 10 ---------- ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf | 4 ---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index 9c589e620c..c336e24100 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -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); } diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf index 3647d37b02..3a0cd37040 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -43,6 +43,10 @@ [Guids] gFdtHobGuid + gFdtTableGuid + +[FeaturePcd] + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot [Depex] TRUE diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c index 8fe1277b6b..cebd4aa91f 100644 --- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c +++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -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; } diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf index 8c098e5885..4dd46cf870 100644 --- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf +++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf @@ -45,13 +45,9 @@ XenIoMmioLib [Guids] - gFdtTableGuid gVirtioMmioTransportGuid gFdtHobGuid -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Protocols] gEfiDevicePathProtocolGuid -- 2.39.2