From nobody Sat Nov 2 14:29:51 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489075458754854.2610460706238; Thu, 9 Mar 2017 08:04:18 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7DE9580395; Thu, 9 Mar 2017 08:04:13 -0800 (PST) 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 CBB328038F for ; Thu, 9 Mar 2017 08:04:11 -0800 (PST) Received: by mail-wm0-x22f.google.com with SMTP id n11so59749791wma.0 for ; Thu, 09 Mar 2017 08:04:11 -0800 (PST) Received: from ards-macbook-pro.c.hoisthospitality.com ([109.74.48.129]) by smtp.gmail.com with ESMTPSA id t194sm27830872wmd.13.2017.03.09.08.04.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 08:04:09 -0800 (PST) X-Original-To: edk2-devel@lists.01.org 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=MgiKS4l3zKU8aOhetE7xTpDCzz2Fte6+KhmR5XwOgZE=; b=kZU+ruQ6pKXfTb9Nh7PYfTbGiJLrvQHjh8g12X+Ar4PyiJC5HAuuFZOHcn0DflmJHj WMGM6kbcNhB1e4uaIM49e0LusRDhe9X/qSocyW4E4nx6TO2OVr+M0ddAr/Aru83KWw27 fPRwTWU578lJ4RZgFsQ7ZOaW5fJMNyzWe4PDA= 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=MgiKS4l3zKU8aOhetE7xTpDCzz2Fte6+KhmR5XwOgZE=; b=FmgWUjfevfDhtc4HhWEruVe1Uhso2CD+5DBsxytiKcgFu3WtitDVpr0YGaaoPjncxk dm06pCxhmsVpwudjE0whh7ltuaS0rlLmkKrDr3ZBxahZ9/RhbgxIjZnZrWxfbHHMVIKk SM7BmkZlQdyh8UKhRD/bST6i9JqzTZSiHy8rt9ZBjz7dwPcbFOOXnM1hdoxqJCb4spaI Mj+KzX+YJa3hlxZJFvXTQ4WsLUTA6DWoXdxownXaaeNxJ0UTWIBT+lG0X+avoXJw84su Pp6cQfJSsUowPGcxocIvkRtoA1CsPWJqg/Je4ZoXDihXtg61WvPRTSP6TgpgeVQjXN/o vGYA== X-Gm-Message-State: AMke39naT4C1Bq3QlDgp99vCHR7p6MtBs43x5G5eV2sHaRduZnTNbW/6Vqpx0raVTlABeh1Z X-Received: by 10.28.170.67 with SMTP id t64mr28270575wme.18.1489075450256; Thu, 09 Mar 2017 08:04:10 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Thu, 9 Mar 2017 17:04:00 +0100 Message-Id: <1489075441-23745-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489075441-23745-1-git-send-email-ard.biesheuvel@linaro.org> References: <1489075441-23745-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 2/3] 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 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Wait for ReadyToBoot to install the FDT configuration table. 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 | 41 ++++++++++++++++---- ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 1 + 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 7cc0c44ca12a..0327af5739f2 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -303,6 +303,30 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOrInsertChosenNode, }; =20 +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 i= t up + // to the OS to decide whether it prefers ACPI over DT. + // + Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTree= Base); + ASSERT_EFI_ERROR (Status); + } + + gBS->CloseEvent (Event); +} + +STATIC EFI_EVENT ReadyToBootEvent; + EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -330,14 +354,15 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // Only install the FDT as a configuration table if we want to leave i= t up - // to the OS to decide whether it prefers ACPI over DT. - // - Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); - ASSERT_EFI_ERROR (Status); - } + Status =3D gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + OnReadyToBoot, + NULL, + &gEfiEventReadyToBootGuid, + &ReadyToBootEvent + ); + ASSERT_EFI_ERROR (Status); =20 return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, EFI_NATIVE_INTERFACE, &mFdtClientProtocol); diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 3a0cd37040eb..00017727c32c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,6 +42,7 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] + gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel