]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 9 Mar 2017 15:59:34 +0000 (16:59 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 9 Mar 2017 17:37:04 +0000 (18:37 +0100)
Instead of having a build time switch to prevent the FDT configuration
table from being installed, make this behavior dependent on whether we
are passing ACPI tables to the OS. This is done by looking for the
ACPI 2.0 configuration table, and only installing the FDT one if the
ACPI one cannot be found.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/ArmVirtPkg.dec
ArmVirtPkg/ArmVirtQemu.dsc
ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf

index a5ec421664450eda2495ede370d2b3501081c50d..efe83a383d552e7d3752e615c494723c6a0f8867 100644 (file)
   # EFI_VT_100_GUID.\r
   #\r
   gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007\r
   # EFI_VT_100_GUID.\r
   #\r
   gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007\r
-\r
-[PcdsFeatureFlag]\r
-  #\r
-  # Pure ACPI boot\r
-  #\r
-  # Inhibit installation of the FDT as a configuration table if this feature\r
-  # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI\r
-  # description of the platform, and it is up to the OS to choose.\r
-  #\r
-  gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a\r
index 477dfdcfc76465ae650c06ba14fd856be0978940..7b266b98b94947c1c3c23c46ea5fd29f93e95316 100644 (file)
@@ -34,7 +34,6 @@
   # -D FLAG=VALUE\r
   #\r
   DEFINE SECURE_BOOT_ENABLE      = FALSE\r
   # -D FLAG=VALUE\r
   #\r
   DEFINE SECURE_BOOT_ENABLE      = FALSE\r
-  DEFINE PURE_ACPI_BOOT_ENABLE   = FALSE\r
 \r
 !include ArmVirtPkg/ArmVirt.dsc.inc\r
 \r
 \r
 !include ArmVirtPkg/ArmVirt.dsc.inc\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE\r
 \r
-!if $(PURE_ACPI_BOOT_ENABLE) == TRUE\r
-  gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE\r
-!endif\r
-\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdCoreCount|1\r
 !if $(ARCH) == AARCH64\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdCoreCount|1\r
 !if $(ARCH) == AARCH64\r
index 4cf79f70cb2ae857797fb0452c8bd7427078b231..21c1074e331cf4e575742e3ffcc7d806c76e5871 100644 (file)
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
 #include <Library/HobLib.h>\r
 #include <libfdt.h>\r
 \r
 #include <Library/HobLib.h>\r
 #include <libfdt.h>\r
 \r
+#include <Guid/Acpi.h>\r
 #include <Guid/EventGroup.h>\r
 #include <Guid/Fdt.h>\r
 #include <Guid/FdtHob.h>\r
 #include <Guid/EventGroup.h>\r
 #include <Guid/Fdt.h>\r
 #include <Guid/FdtHob.h>\r
@@ -316,12 +318,16 @@ OnReadyToBoot (
   )\r
 {\r
   EFI_STATUS      Status;\r
   )\r
 {\r
   EFI_STATUS      Status;\r
+  VOID            *Table;\r
 \r
 \r
-  if (!FeaturePcdGet (PcdPureAcpiBoot)) {\r
-    //\r
-    // Only install the FDT as a configuration table if we want to leave it up\r
-    // to the OS to decide whether it prefers ACPI over DT.\r
-    //\r
+  //\r
+  // Only install the FDT as a configuration table if we are not exposing\r
+  // ACPI 2.0 (or later) tables. Note that the legacy ACPI table GUID has\r
+  // no meaning on ARM since we need at least ACPI 5.0 support, and the\r
+  // 64-bit ACPI 2.0 table GUID is mandatory in that case.\r
+  //\r
+  Status = EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Table);\r
+  if (EFI_ERROR (Status) || Table == NULL) {\r
     Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
     Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase);\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
index 00017727c32caef95667bcda7829249cf1e00cbd..9861f41e968b5b86d1f5ba49d2559a1886db6c60 100644 (file)
   HobLib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
   HobLib\r
   UefiBootServicesTableLib\r
   UefiDriverEntryPoint\r
+  UefiLib\r
 \r
 [Protocols]\r
   gFdtClientProtocolGuid                  ## PRODUCES\r
 \r
 [Guids]\r
 \r
 [Protocols]\r
   gFdtClientProtocolGuid                  ## PRODUCES\r
 \r
 [Guids]\r
+  gEfiAcpi20TableGuid\r
   gEfiEventReadyToBootGuid\r
   gFdtHobGuid\r
   gFdtTableGuid\r
 \r
   gEfiEventReadyToBootGuid\r
   gFdtHobGuid\r
   gFdtTableGuid\r
 \r
-[FeaturePcd]\r
-  gArmVirtTokenSpaceGuid.PcdPureAcpiBoot\r
-\r
 [Depex]\r
   TRUE\r
 [Depex]\r
   TRUE\r