From patchwork Thu Mar 9 17:21:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95127 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp458582qgd; Thu, 9 Mar 2017 09:21:20 -0800 (PST) X-Received: by 10.99.157.2 with SMTP id i2mr14873212pgd.139.1489080080619; Thu, 09 Mar 2017 09:21:20 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id y13si336247pgc.196.2017.03.09.09.21.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 09:21:20 -0800 (PST) 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 392F380391; Thu, 9 Mar 2017 09:21:20 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 387E580391 for ; Thu, 9 Mar 2017 09:21:18 -0800 (PST) Received: by mail-wm0-x229.google.com with SMTP id t189so61434813wmt.1 for ; Thu, 09 Mar 2017 09:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m+B5S733ME4JFNSNA+aufOS8/xLrS9kYQFk9POMHQ84=; b=HmUEjW253bKkV1IzoSAxE6HbNEclhIV9T5BW/s8+DbdBTMuOiypaqnRk31y+X54CkN tFaZnx1APbz1LPx3HIRF43pB/IlSrp9c3zuou3FYVAqZkXZNNZ5Q4DLXOurS9pCGUXzY BvqfcXRGJ35ZrzPkMq4mXHAPk40hDnkpDMApQ= 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=m+B5S733ME4JFNSNA+aufOS8/xLrS9kYQFk9POMHQ84=; b=iWIc3SgobSnTZdSCDf1VHBiKzG2NB6tc8JckiO8DSb9cVUF/nZkcgMBCQyGwQ0YT8M EAnCR5plJubOT9/eDozNcdBblSv3JwEqHWRTj6PbtwOCyVA/RZz+izb+LW9GHS/PRFW/ /oZHfmYnneDteFrx/YIorQgORzROdiGbjk4YwV7LhpToFdQ6dyJ0o1AV11n6v/LoIpAl YEQi5kM5nilpsNwEr9N8GxItQFqbj/NM8eVznTz5vYfIiaAmDQ7vH/fHMJHECQhk05Fs qZ784RdWkRgBXM1qYDSBFpQhXE0QO32HmoJaI0qJpRQuxjxA52BBGSUtgi+AgRnM7SzN Jjog== X-Gm-Message-State: AMke39n51mjS0MTO+GUMwfn2CYVklUzWzb8szH7Q9LUuaus/3rHYu+ezHrV2zc+uBZAeeFOX X-Received: by 10.28.113.9 with SMTP id m9mr30563432wmc.60.1489080076840; Thu, 09 Mar 2017 09:21:16 -0800 (PST) Received: from ards-macbook-pro.c.hoisthospitality.com ([109.74.48.129]) by smtp.gmail.com with ESMTPSA id p93sm8928768wrc.67.2017.03.09.09.21.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 09:21:16 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 9 Mar 2017 18:21:10 +0100 Message-Id: <1489080073-13328-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/4] ArmVirtPkg/FdtClientDxe: supplement missing EFIAPI calling conv specifiers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Laszlo Ersek Add missing EFIAPI calling convention specifiers to STATIC function that are exposed via the FdtClientProtocol interface. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index 7cc0c44ca12a..547a29fce62c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -29,6 +29,7 @@ STATIC VOID *mDeviceTreeBase; STATIC EFI_STATUS +EFIAPI GetNodeProperty ( IN FDT_CLIENT_PROTOCOL *This, IN INT32 Node, @@ -55,6 +56,7 @@ GetNodeProperty ( STATIC EFI_STATUS +EFIAPI SetNodeProperty ( IN FDT_CLIENT_PROTOCOL *This, IN INT32 Node, @@ -267,6 +269,7 @@ FindMemoryNodeReg ( STATIC EFI_STATUS +EFIAPI GetOrInsertChosenNode ( IN FDT_CLIENT_PROTOCOL *This, OUT INT32 *Node From patchwork Thu Mar 9 17:21:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95128 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp458598qgd; Thu, 9 Mar 2017 09:21:22 -0800 (PST) X-Received: by 10.99.157.143 with SMTP id i137mr15075544pgd.132.1489080082336; Thu, 09 Mar 2017 09:21:22 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id r26si319203pge.381.2017.03.09.09.21.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 09:21:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; 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 2001:19d0:306:5::1 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 6C7F380395; Thu, 9 Mar 2017 09:21:21 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 76C7A80391 for ; Thu, 9 Mar 2017 09:21:19 -0800 (PST) Received: by mail-wm0-x234.google.com with SMTP id n11so144687820wma.1 for ; Thu, 09 Mar 2017 09:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b7oOGP3Gq9wvFpSwIWWlEm+gDvSeVqU3JcSYgD9/bA8=; b=Esz2JpWh2tYKUAeImxjXFeAl5Zzp3kig9K4nfAildCK81YN2vO5XmZLqd3C1chp2sk 5Csgr4OdSQw3l/oCYKMEkMOfgNLkrFId5AjqxvNG39FdEdyX5iePBTCbFMGFlpskrkhj uJKN+Ky+6jeNztmKpnNDEpLUtTdp7u1yjIjf4= 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=b7oOGP3Gq9wvFpSwIWWlEm+gDvSeVqU3JcSYgD9/bA8=; b=dlERqHTsNNedKxJ895hQErzGEEVMHZWFnE+LN8k6VlQEQzodi4Ws0pl3Q4rJ9atV+c s9Be4Q1+c+PN0jp0K1jZp+0wHcL19ispUFYWg6XnMr262McuYlob9AIky4NvBS8UtPUW sHukrDpbz2mkV4kwWovdpwTlxgXruVNK7jvmju9IGFKHUarpjWGBym1HVbU46uM6YBeC 5LlClMPgQuUEJL0NL5Jd2rVJO4cBvmrEmTck9gm2jC2uxuv5g4iSYvrwodjkk1/r4G0t mHTBViVC6WQ8IScXeaECrMU4CdKqTHtDWQkowwMiySrIWgQJRRZqBWl466J9mXjznEz5 xNtw== X-Gm-Message-State: AMke39kfgQxAe9AsB2smgzGxF7q+VoptQrdrBwVF8vnGJ1QftMm9ip6XvyNJwBl6OEe+yum+ X-Received: by 10.28.178.84 with SMTP id b81mr31327392wmf.83.1489080078050; Thu, 09 Mar 2017 09:21:18 -0800 (PST) Received: from ards-macbook-pro.c.hoisthospitality.com ([109.74.48.129]) by smtp.gmail.com with ESMTPSA id p93sm8928768wrc.67.2017.03.09.09.21.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 09:21:17 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 9 Mar 2017 18:21:11 +0100 Message-Id: <1489080073-13328-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 2/4] ArmVirtPkg/ArmVirtPL031FdtClientLib: unconditionally disable DT node X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Disable the PL031 RTC DT node unconditionally rather than only when the DT will be exposed to the OS. This allows us to defer the decision whether to expose it to the OS to a later time without creating an additional dependency on the FDT client code by the RTC driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Laszlo Ersek --- ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c | 22 +++++++++----------- ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf | 3 --- 2 files changed, 10 insertions(+), 15 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c index 82de7a51b32e..d168424a52f5 100644 --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c @@ -66,18 +66,16 @@ ArmVirtPL031FdtClientLibConstructor ( DEBUG ((EFI_D_INFO, "Found PL031 RTC @ 0x%Lx\n", RegBase)); - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // UEFI takes ownership of the RTC hardware, and exposes its functionality - // through the UEFI Runtime Services GetTime, SetTime, etc. This means we - // need to disable it in the device tree to prevent the OS from attaching - // its device driver as well. - // - Status = FdtClient->SetNodeProperty (FdtClient, Node, "status", - "disabled", sizeof ("disabled")); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_WARN, "Failed to set PL031 status to 'disabled'\n")); - } + // + // UEFI takes ownership of the RTC hardware, and exposes its functionality + // through the UEFI Runtime Services GetTime, SetTime, etc. This means we + // need to disable it in the device tree to prevent the OS from attaching + // its device driver as well. + // + Status = FdtClient->SetNodeProperty (FdtClient, Node, "status", + "disabled", sizeof ("disabled")); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_WARN, "Failed to set PL031 status to 'disabled'\n")); } return EFI_SUCCESS; diff --git a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf index 32dbff6f0852..342193651a86 100644 --- a/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf +++ b/ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf @@ -42,8 +42,5 @@ [Protocols] [Pcd] gArmPlatformTokenSpaceGuid.PcdPL031RtcBase -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] gFdtClientProtocolGuid From patchwork Thu Mar 9 17:21:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95129 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp458613qgd; Thu, 9 Mar 2017 09:21:24 -0800 (PST) X-Received: by 10.99.171.5 with SMTP id p5mr14939768pgf.182.1489080084526; Thu, 09 Mar 2017 09:21:24 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id d24si7006445plj.282.2017.03.09.09.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 09:21:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; 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 2001:19d0:306:5::1 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 A3ACA80398; Thu, 9 Mar 2017 09:21:22 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 8A87A80394 for ; Thu, 9 Mar 2017 09:21:20 -0800 (PST) Received: by mail-wm0-x234.google.com with SMTP id t189so61435599wmt.1 for ; Thu, 09 Mar 2017 09:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K+TSXRYOhG1qOMOaMRKD+PU5iR5sL2ymvObH0i5EPDs=; b=SEqJcWzBfhfMMzMlA3FRc1t6DJiFdkD0TQYwD3fr6CVztlAnD4C0K51Q1Vc3xUBO8m uyDO7A/gEowtCzgoZxL4x5bJnLonPm8wmSi08J33KJRFM8NA2+KA3eKOUd5aILxZ4VZn HzD4GrBCNUlQjvkpOu6QlkfqsLhOJ5y3p7A3s= 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=K+TSXRYOhG1qOMOaMRKD+PU5iR5sL2ymvObH0i5EPDs=; b=sbE/e3BJFjNr05uJf45JnZYL0fJoSEKVhTv3OE4eUH58kGxPg1u8ronPMja+8tTPbT TyiJGg0lIjz8nWQMw8SaHxF7u+FtZhuV6CUR9+483w+a35RWivVsWR8iyYMvzz3j3Svg QWWI8iD5BLZ/LWrUfxE1zbP9AgZX0o07J6kjDUeVJMO4eBYqKcNXxbnula6ENkEnIlJ+ c0tCIgPIDEagyF/VVzPR2hToM5yPm6Zc31rSXEKgJaF8CZ/bHxLw7tVFpH+etZ6f0ugZ QthWNtk6pYG+Kl1wPxWvD3jQ/rxaaYmojqwKQefssIMHP5tbdo7HZyAizjEi9FHESblp cuGw== X-Gm-Message-State: AMke39lDgzBfCHbes7ZcroorrycM8ZtYSFrCQqzlhiNEV7P+9piwODYMmLeVlJcACuRyr9lA X-Received: by 10.28.5.72 with SMTP id 69mr11249959wmf.6.1489080079123; Thu, 09 Mar 2017 09:21:19 -0800 (PST) Received: from ards-macbook-pro.c.hoisthospitality.com ([109.74.48.129]) by smtp.gmail.com with ESMTPSA id p93sm8928768wrc.67.2017.03.09.09.21.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 09:21:18 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 9 Mar 2017 18:21:12 +0100 Message-Id: <1489080073-13328-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 3/4] ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Defer FDT configuration table installation until ReadyToBoot is signaled. This allows any driver to make modifications in the mean time, and will also allow us to defer the decision of whether to install it in the first place to later on in the boot. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 49 ++++++++++++++++---- ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 1 + 2 files changed, 41 insertions(+), 9 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index 547a29fce62c..4cf79f70cb2a 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -306,6 +307,30 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol = { GetOrInsertChosenNode, }; +STATIC +VOID +EFIAPI +OnReadyToBoot ( + EFI_EVENT Event, + VOID *Context + ) +{ + EFI_STATUS Status; + + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // Only install the FDT as a configuration table if we want to leave it up + // to the OS to decide whether it prefers ACPI over DT. + // + Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase); + ASSERT_EFI_ERROR (Status); + } + + gBS->CloseEvent (Event); +} + +STATIC EFI_EVENT mReadyToBootEvent; + EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -333,15 +358,21 @@ InitializeFdtClientDxe ( DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // Only install the FDT as a configuration table if we want to leave it up - // to the OS to decide whether it prefers ACPI over DT. - // - Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase); - ASSERT_EFI_ERROR (Status); + Status = gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid, + EFI_NATIVE_INTERFACE, &mFdtClientProtocol); + if (EFI_ERROR (Status)) { + return Status; } - return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + OnReadyToBoot, + NULL, + &gEfiEventReadyToBootGuid, + &mReadyToBootEvent + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; } diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf index 3a0cd37040eb..00017727c32c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,6 +42,7 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES [Guids] + gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid From patchwork Thu Mar 9 17:21:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95130 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp458626qgd; Thu, 9 Mar 2017 09:21:26 -0800 (PST) X-Received: by 10.84.129.2 with SMTP id 2mr18692334plb.119.1489080086835; Thu, 09 Mar 2017 09:21:26 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id c21si342991pgi.128.2017.03.09.09.21.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 09:21:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; 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 2001:19d0:306:5::1 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 D90888039B; Thu, 9 Mar 2017 09:21:23 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 DB4C680398 for ; Thu, 9 Mar 2017 09:21:21 -0800 (PST) Received: by mail-wm0-x22f.google.com with SMTP id n11so61522531wma.0 for ; Thu, 09 Mar 2017 09:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HKL0Tz5LT3em3Ue5HMT0EuITjGhhSVgk+iVV4GSXnMI=; b=cXivIGiUZZICekjrWJi0EF5U7sUDwrjpDsH+TlczNhCoJrWAbEhJZeqDCp2uJ7f5QV jxJzPC6gBG3+yNDouKZdtIKoOTuKJK9BLuU0HaJHJEZc3XhVgU2Ku4nBaj22IJIFc2Rh lFsOhVZf4J+xwQYqM59YdvMOS8qs6wQBydK3Y= 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=HKL0Tz5LT3em3Ue5HMT0EuITjGhhSVgk+iVV4GSXnMI=; b=eQl3rIT41EPMx1l3KUSZEco9zki1ShZY/h6V/+wC2fTFwL/koUUQgqF1fmOrEvyScf zRs4kisS6++3bbbsz5hufiHIe0zhwdsxTlty3bMEl4ZvvGUl39lRI9j+ELQQjgZRlDgH 4gUSBmuO4X0DuWD7FpO77DT+SS/mybImYZXyTU6fvT3B+wlsJcWebEdq5yOlL8aQPYmC yocssEkOy2T5gMrJglpClEMFb7LYdJr9/gkONQcLYjGmub6NxCaENVWPCY01AKKlr3bl xua6r2zPac0nW73fT820Of9Q1ZTMDq5a7f3hXBhtexuN8Ufab/ZymoK+jub+WnReWEzr ovQg== X-Gm-Message-State: AMke39nA2jXmzIp0GyD5td7aggsuZ/r20yK4jzyaZnoB9ZdwsHYBQBWkH1uGeKp1rhJLHns5 X-Received: by 10.28.229.140 with SMTP id c134mr28477894wmh.29.1489080080404; Thu, 09 Mar 2017 09:21:20 -0800 (PST) Received: from ards-macbook-pro.c.hoisthospitality.com ([109.74.48.129]) by smtp.gmail.com with ESMTPSA id p93sm8928768wrc.67.2017.03.09.09.21.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 09:21:19 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 9 Mar 2017 18:21:13 +0100 Message-Id: <1489080073-13328-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489080073-13328-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 4/4] ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 --- ArmVirtPkg/ArmVirtPkg.dec | 10 ---------- ArmVirtPkg/ArmVirtQemu.dsc | 5 ----- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 16 +++++++++++----- ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 5 ++--- 4 files changed, 13 insertions(+), 23 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index a5ec42166445..efe83a383d55 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,13 +58,3 @@ [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 - -[PcdsFeatureFlag] - # - # Pure ACPI boot - # - # Inhibit installation of the FDT as a configuration table if this feature - # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI - # description of the platform, and it is up to the OS to choose. - # - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 477dfdcfc764..7b266b98b949 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -34,7 +34,6 @@ [Defines] # -D FLAG=VALUE # DEFINE SECURE_BOOT_ENABLE = FALSE - DEFINE PURE_ACPI_BOOT_ENABLE = FALSE !include ArmVirtPkg/ArmVirt.dsc.inc @@ -94,10 +93,6 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE -!if $(PURE_ACPI_BOOT_ENABLE) == TRUE - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE -!endif - [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 !if $(ARCH) == AARCH64 diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index 4cf79f70cb2a..21c1074e331c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -17,9 +17,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -316,12 +318,16 @@ OnReadyToBoot ( ) { EFI_STATUS Status; + VOID *Table; - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // Only install the FDT as a configuration table if we want to leave it up - // to the OS to decide whether it prefers ACPI over DT. - // + // + // Only install the FDT as a configuration table if we are not exposing + // ACPI 2.0 (or later) tables. Note that the legacy ACPI table GUID has + // no meaning on ARM since we need at least ACPI 5.0 support, and the + // 64-bit ACPI 2.0 table GUID is mandatory in that case. + // + Status = EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Table); + if (EFI_ERROR (Status) || Table == NULL) { Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase); ASSERT_EFI_ERROR (Status); } diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf index 00017727c32c..9861f41e968b 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -37,17 +37,16 @@ [LibraryClasses] HobLib UefiBootServicesTableLib UefiDriverEntryPoint + UefiLib [Protocols] gFdtClientProtocolGuid ## PRODUCES [Guids] + gEfiAcpi20TableGuid gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] TRUE