[edk2,v2,07/13] Platforms/FVP-AArch64: switch to simpler DT platform driver

Message ID 20170331141547.20987-8-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • EDK2 spring cleaning -- OpenPlatformPkg edition
Related show

Commit Message

Ard Biesheuvel March 31, 2017, 2:15 p.m.
Replace the elaborate but awkward FdtPlatformDxe with the new
DtPlatformDxe, which supports embedded DTBs only. This is
sufficient for virtually all use cases, and if it is not, there
are various way to override the device tree binary presented to
the OS.

As a bonus, this driver makes ACPI and DT mutually exclusive - this
can be configured via the setup screen.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 27 +++++++-------
 Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 37 ++++++--------------
 2 files changed, 24 insertions(+), 40 deletions(-)

-- 
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch hide | download patch | download mbox

diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
index e6778aafe8c6..1125f22f9172 100644
--- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
+++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
@@ -35,6 +35,7 @@ 
   DEFINE EDK2_SKIP_PEICORE=1
 !endif
 
+  DT_SUPPORT                     = FALSE
 
 !include OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
 
@@ -59,6 +60,8 @@ 
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
 !endif
 
+  DtPlatformDtbLoaderLib|OpenPlatformPkg/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
+
 [LibraryClasses.common.SEC]
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
@@ -173,15 +176,6 @@ 
   # the entire FVP address space can be covered by 36 bit VAs
   gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|36
 
-[PcdsDynamicDefault.common]
-  #
-  # The size of a dynamic PCD of the (VOID*) type can not be increased at run
-  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128
-  # character "empty" string, to allow to be able to set FDT text device paths
-  # up to 128 characters long.
-  #
-  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "
-
 ################################################################################
 #
 # Components Section - list of all EDK II Modules needed by this Platform
@@ -262,7 +256,13 @@ 
   #
   # ACPI Support
   #
-  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
+!if $(DT_SUPPORT) == TRUE
+  <LibraryClasses>
+    NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
+!endif
+  }
+
   MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   OpenPlatformPkg/Platforms/ARM/VExpress/AcpiTables/AcpiTables.inf
 
@@ -316,10 +316,9 @@ 
       NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
   }
 
+!if $(DT_SUPPORT) == TRUE
   #
   # FDT installation
   #
-  EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
-    <LibraryClasses>
-      BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
-  }
+  EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+!endif
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
index 262515150dd9..7b2397417534 100644
--- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
+++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
@@ -170,35 +170,20 @@  FvNameGuid         = 87940482-fc81-41c3-87e6-399cf85ac8a0
   # FV Filesystem
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
 
+!if $(DT_SUPPORT) == TRUE
   #
   # FDT installation
   #
-  # The UEFI driver is at the end of the list of the driver to be dispatched
-  # after the device drivers (eg: Ethernet) to ensure we have support for them.
-  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
-
-!ifdef $(DTB_DIR)
-  #
-  # Embed flattened device tree (FDT) images for all known
-  # variants of this platform
-  #
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2) {
-    $(DTB_DIR)/fvp-base-gicv2-psci.dtb
-  }
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy) {
-    $(DTB_DIR)/fvp-base-gicv2legacy-psci.dtb
-  }
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3) {
-    $(DTB_DIR)/fvp-base-gicv3-psci.dtb
-  }
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2) {
-    $(DTB_DIR)/fvp-foundation-gicv2-psci.dtb
-  }
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy) {
-    $(DTB_DIR)/fvp-foundation-gicv2legacy-psci.dtb
-  }
-  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3) {
-    $(DTB_DIR)/fvp-foundation-gicv3-psci.dtb
+  INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+
+  # builtin device tree binaries -- order matches ARM_VEXPRESS_PLATFORM_ID
+  FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 {
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2-psci.dtb
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2legacy-psci.dtb
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv3-psci.dtb
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2-psci.dtb
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2legacy-psci.dtb
+    SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv3-psci.dtb
   }
 !endif