From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4716E802AE for ; Thu, 9 Mar 2017 08:51:50 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D3A3E85547; Thu, 9 Mar 2017 16:51:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-228.phx2.redhat.com [10.3.116.228]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v29Gpnkq005107; Thu, 9 Mar 2017 11:51:49 -0500 To: Ard Biesheuvel , edk2-devel@ml01.01.org References: <1489075441-23745-1-git-send-email-ard.biesheuvel@linaro.org> <1489075441-23745-2-git-send-email-ard.biesheuvel@linaro.org> Cc: drjones@redhat.com, leif.lindholm@linaro.org From: Laszlo Ersek Message-ID: Date: Thu, 9 Mar 2017 17:51:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1489075441-23745-2-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 09 Mar 2017 16:51:50 +0000 (UTC) Subject: Re: [PATCH 1/3] 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: , X-List-Received-Date: Thu, 09 Mar 2017 16:51:50 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/09/17 17:03, Ard Biesheuvel wrote: > 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 > --- > ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c | 22 +++++++++----------- > ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf | 3 --- > 2 files changed, 10 insertions(+), 15 deletions(-) > > 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 > Reviewed-by: Laszlo Ersek