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