From patchwork Mon Apr 10 16:22:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 97184 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1426405obc; Mon, 10 Apr 2017 09:22:32 -0700 (PDT) X-Received: by 10.237.51.5 with SMTP id u5mr59326543qtd.247.1491841352072; Mon, 10 Apr 2017 09:22:32 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 95si13853685qkw.208.2017.04.10.09.22.31; Mon, 10 Apr 2017 09:22:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 46A3D63DC0; Mon, 10 Apr 2017 16:22:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2BB4863E0E; Mon, 10 Apr 2017 16:22:29 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 28BBD63DC3; Mon, 10 Apr 2017 16:22:28 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id DA36D609A1 for ; Mon, 10 Apr 2017 16:22:25 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id o81so43253675wmb.1 for ; Mon, 10 Apr 2017 09:22:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PZPKsY7EnUXf3XpDwXXLsosa5fq6gN60D6DHpnUvX64=; b=hTrADng2UJeAsTgUsCwOjl5W2W7Qb2Si5x01b8xcc8y7N9I3YYaCeOl8+r9AiemUo3 czT17PQE3C4g9dUofumgnhcqvwoSpLyHfZcGkrIdvf3YU9xAeFnpE2z1JVMf8o+TkzgK iLZ+xHQxmKvn1stqGwRVn4fyET9MUF9fUoiEmb9BXV9wxkMktTx3f47AGLUidq+QX7tX Jf3XScgtUCj3WjoBB5MQyL+OeW7qhrxggsMsJmw1zchdrBwPCR1Np0ZDQE0S0UXfyrG8 soFABaCKRuhcB0LL64dD8RPIZHkqnMSmTE9LoX9GcDXgEXFHqEahw5REgHdfq+4grsLP +HvA== X-Gm-Message-State: AN3rC/7CjtEP2eVzRpHo4nSv+VeEYoNrMyOL25iJRwwLJVel9/n52VPqx65/HPkG6e8SWPe3FH4= X-Received: by 10.28.113.135 with SMTP id d7mr1689767wmi.71.1491841344758; Mon, 10 Apr 2017 09:22:24 -0700 (PDT) Received: from localhost.localdomain ([196.85.182.219]) by smtp.gmail.com with ESMTPSA id z38sm18140215wrc.36.2017.04.10.09.22.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 09:22:24 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org Date: Mon, 10 Apr 2017 17:22:08 +0100 Message-Id: <20170410162208.20611-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170410162208.20611-1-ard.biesheuvel@linaro.org> References: <20170410162208.20611-1-ard.biesheuvel@linaro.org> Subject: [Linaro-uefi] [PATCH v3 6/6] Platforms/FVP-AArch64: switch to simpler DT platform driver X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" 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 Reviewed-by: Leif Lindholm --- Platforms/ARM/Juno/ArmJuno.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 27 ++++++++------ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 37 ++++++-------------- Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 8 ----- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc index 6adb33c76087..4ff2246822e6 100644 --- a/Platforms/ARM/Juno/ArmJuno.dsc +++ b/Platforms/ARM/Juno/ArmJuno.dsc @@ -340,6 +340,14 @@ NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } + # + # FDT installation + # + EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { + + BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf + } + [Components.AARCH64] # # EBC diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc index 55640837ba7c..d1cfc719837c 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc @@ -284,3 +284,11 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } + + # + # FDT installation + # + EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { + + BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf + } diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index 5b19184b061e..1e95971cddfd 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 @@ -58,6 +59,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 @@ -172,15 +175,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 @@ -261,7 +255,13 @@ # # ACPI Support # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf { +!if $(DT_SUPPORT) == TRUE + + NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf +!endif + } + MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf OpenPlatformPkg/Platforms/ARM/VExpress/AcpiTables/AcpiTables.inf @@ -314,3 +314,10 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } + +!if $(DT_SUPPORT) == TRUE + # + # FDT installation + # + 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 diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index 9dfe2ac9e440..8c4de54c8875 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -491,14 +491,6 @@ MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf # - # FDT installation - # - EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { - - BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf - } - - # # UEFI application (Shell Embedded Boot Loader) # ShellPkg/Application/Shell/Shell.inf {