From patchwork Wed Mar 29 15:19:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96208 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp2249048qgd; Wed, 29 Mar 2017 08:19:51 -0700 (PDT) X-Received: by 10.98.77.69 with SMTP id a66mr1110632pfb.4.1490800791428; Wed, 29 Mar 2017 08:19:51 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id x33si7725315plb.145.2017.03.29.08.19.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 08:19:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DA97A2041D9E6; Wed, 29 Mar 2017 08:19:50 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ABF602041D9E6 for ; Wed, 29 Mar 2017 08:19:49 -0700 (PDT) Received: by mail-wr0-x22b.google.com with SMTP id w11so19219192wrc.3 for ; Wed, 29 Mar 2017 08:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0Cf7JzJGxvOhwstnIlnYLgT4M9ItoYUk54pATtSL/gE=; b=Ryy3lyvJP2EYwVvBA1Qih1Fb3ZikZ5iDzBeh8ZkhR2BobUkCcMiwwcuXq7dvpPh99w 7/SclpaZ7UAlEQo7hZbP8q0XWpiRwhUExYBtayqwaXsUGmBVczOUznmZRJVz56rSDj6g 4H18QlwUqq5pYwlUg8scJZ0x0vtef5kIX1/pM= 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; bh=0Cf7JzJGxvOhwstnIlnYLgT4M9ItoYUk54pATtSL/gE=; b=nKN3nWZLGIooiJD1TVkdFyqDZlnQa7xUSvAqTjcf4ATwNGDmQ5cMWSzSj2rHOxy0p+ CRi9Y+P1huerB0f1DME+IKvRMDyzp0Sm2+8/HtYAYEbNHRVhAd/Kkzkp3rOMSgTfusbp BxHhSQV84ZsDnN8NtzSB6zPhQuryf/IWPv/nN8QuJ7ocYcfggaD6EPPpLEdgGRQWErQi mXklYWZMAnVPYQ1nRCSx44S6eq1kOODeJq9sO4apcyGDCazDEhMp3VblobyM6D2xJaz5 RiBwCbTlKqggpoyOVlcGWKTif9cPQNiYt1F9qgpp0q0Dx9Gq0k5nf14V4/BsfZj3DAdh NH0Q== X-Gm-Message-State: AFeK/H0J9i7blL7uV+ef3s0gUf22seAFXsb9y+lkB4wCSikgqkDK20co2tZGIP5R5kCqddNQ X-Received: by 10.223.175.103 with SMTP id z94mr1004093wrc.3.1490800787634; Wed, 29 Mar 2017 08:19:47 -0700 (PDT) Received: from localhost.localdomain ([196.81.160.3]) by smtp.gmail.com with ESMTPSA id m7sm8542308wmi.34.2017.03.29.08.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 08:19:46 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 29 Mar 2017 16:19:40 +0100 Message-Id: <20170329151940.23397-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [edk2] [PATCH] ArmVirtPkg/PlatformHasAcpiDtDxe: allow manual override for DT installation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" In general, we should not present two separate (and inevitably different) hardware descriptions to the OS, in the form of ACPI tables and a device tree blob. For this reason, we recently added the logic to ArmVirtQemu to only expose the ACPI 2.0 entry point if no DT binary is being passed, and vice versa. However, this is arguably a regression for those who rely on both descriptions being available, even if the use cases in question are uncommon. So allow a secret handshake with the UEFI Shell, to set a variable that will result in both descriptions being exposed on the next boot, if executing in the default 'ACPI-only' mode. setvar -nv -bs -guid 50bea1e5-a2c5-46e9-9b3a-59596516b00a ForceDt =01 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtPkg.dec | 8 ++++++++ ArmVirtPkg/ArmVirtQemu.dsc | 3 +++ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c | 7 ++++++- ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 5 +++++ 4 files changed, 22 insertions(+), 1 deletion(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Nacked-by: Laszlo Ersek diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index efe83a383d55..ae5473a3f3f3 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -34,6 +34,8 @@ [Guids.common] gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } gEarlyPL011BaseAddressGuid = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } } + gArmVirtVariableGuid = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } } + [Protocols] gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } } @@ -58,3 +60,9 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # EFI_VT_100_GUID. # gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007 + +[PcdsDynamic] + # + # Whether to force the DT to be exposed to the OS, even in the presence of + # ACPI tables. + gArmVirtTokenSpaceGuid.PcdAcpiDtForceDt|0x0|UINT8|0x00000003 diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 4075b92aa2cb..bbb517e40242 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -210,6 +210,9 @@ [PcdsDynamicDefault.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE +[PcdsDynamicHii] + gArmVirtTokenSpaceGuid.PcdAcpiDtForceDt|L"ForceDt"|gArmVirtVariableGuid|0x0|0|NV,BS + ################################################################################ # # Components Section - list of all EDK II Modules needed by this Platform diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c index 8932dacabec5..4c53825d54ad 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c @@ -58,7 +58,12 @@ PlatformHasAcpiDt ( goto Failed; } - return Status; + if (!PcdGet8 (PcdAcpiDtForceDt)) { + return EFI_SUCCESS; + } + DEBUG ((DEBUG_WARN, + "%a: ForceDt is set: installing both ACPI and DT tables\n", + __FUNCTION__)); } // diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf index 4466bead57c2..5bc9ea43c05b 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -25,6 +25,7 @@ [Sources] PlatformHasAcpiDtDxe.c [Packages] + ArmVirtPkg/ArmVirtPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec OvmfPkg/OvmfPkg.dec @@ -32,6 +33,7 @@ [Packages] [LibraryClasses] BaseLib DebugLib + PcdLib QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint @@ -40,5 +42,8 @@ [Guids] gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL +[Pcd] + gArmVirtTokenSpaceGuid.PcdAcpiDtForceDt + [Depex] TRUE