public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, leif.lindholm@linaro.org,
	ryan.harkin@linaro.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v2 07/13] Platforms/FVP-AArch64: switch to simpler DT platform driver
Date: Fri, 31 Mar 2017 15:15:45 +0100	[thread overview]
Message-ID: <20170331141547.20987-8-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20170331141547.20987-1-ard.biesheuvel@linaro.org>

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(-)

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
 
-- 
2.9.3



  parent reply	other threads:[~2017-03-31 14:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 14:15 [PATCH v2 00/13] EDK2 spring cleaning -- OpenPlatformPkg edition Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 01/13] Platforms/VExpress: remove unused logo PCD Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 02/13] Platforms/VExpress: remove unused StatusCode references Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 03/13] Platforms/VExpress: get rid of Tiano compression Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 04/13] Platforms/VExpress: remove BdsLib library class resolutions Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 05/13] Platforms/TC2: move to new DtPlatformDxe driver Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 06/13] Platforms/FVP: add DtPlatformDtbLoaderLib implementation Ard Biesheuvel
2017-03-31 14:15 ` Ard Biesheuvel [this message]
2017-03-31 14:15 ` [PATCH v2 08/13] Platforms/Juno: add non-discoverable device driver and library Ard Biesheuvel
2017-03-31 14:15 ` [PATCH v2 09/13] Platforms/Juno: add PciHostBridgeLib implementation Ard Biesheuvel
2017-04-04  8:31   ` Ard Biesheuvel
2017-03-31 14:19 ` [PATCH v2 10/13] Platforms/Juno: switch to generic PCI host bridge driver Ard Biesheuvel
2017-03-31 14:19   ` [PATCH v2 11/13] Platforms/Juno: remove BdsLib dependency Ard Biesheuvel
2017-03-31 14:19   ` [PATCH v2 12/13] Platforms/Juno: add DtPlatformDtbLoaderLib implementation Ard Biesheuvel
2017-03-31 14:19   ` [PATCH v2 13/13] Platforms/Juno: switch to DtPlatformDxe Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170331141547.20987-8-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox