ArmVirtPkg/VirtFdtDxe: make installation of FDT as config table optional

The arm64 kernel is hardwired to prefer DT over ACPI, unless 'acpi=force'
is passed on the kernel command line. The only other way to force the
kernel to use ACPI is not to pass an FDT to it in the first place. So
introduce a PCD that inhibits the installation of the QEMU supplied FDT
as a configuration table.

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-03-31 13:00:07 +02:00
parent 5eae4ff002
commit 7a63d29151
3 changed files with 48 additions and 31 deletions

View File

@ -98,3 +98,12 @@
# The default is to turn off the kludge; DSC's can selectively enable it.
#
gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|FALSE|BOOLEAN|0x00000006
#
# Pure ACPI boot
#
# Inhibit installation of the FDT as a configuration table if this feature
# PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI
# description of the platform, and it is up to the OS to choose.
#
gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a

View File

@ -317,9 +317,6 @@ InitializeVirtFdtDxe (
return EFI_NOT_FOUND;
}
Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
ASSERT_EFI_ERROR (Status);
DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, DeviceTreeBase));
RtcNode = -1;
@ -571,6 +568,14 @@ 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);
//
// UEFI takes ownership of the RTC hardware, and exposes its functionality
// through the UEFI Runtime Services GetTime, SetTime, etc. This means we
@ -604,6 +609,6 @@ InitializeVirtFdtDxe (
DEBUG ((EFI_D_WARN, "Failed to set /chosen/linux,pci-probe-only property\n"));
}
}
}
return EFI_SUCCESS;
}

View File

@ -73,6 +73,9 @@
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
[FeaturePcd]
gArmVirtTokenSpaceGuid.PcdPureAcpiBoot
[Protocols]
gEfiDevicePathProtocolGuid