From patchwork Mon Oct 2 19:02:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 114640 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1005655qgn; Mon, 2 Oct 2017 12:02:43 -0700 (PDT) X-Received: by 10.159.194.10 with SMTP id x10mr15291276pln.47.1506970963324; Mon, 02 Oct 2017 12:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506970963; cv=none; d=google.com; s=arc-20160816; b=QHNpaBoEkowHGFAVn/FFKTzEpVWfK6ajhyqUKN+89yJaPfg3X3Yi+9aS1hffWMhTqN /B2XU1LY/OfoMRKXV/lGo6qUPdIfzo/rro520S+WPxFinHU0obVzD1g+qeB75WTiM/86 VQ3zw2mMs9uFAEii5ImYup3+4DJLGgeOK0Y6IFf3vBs/DUtY42ZrNFH8/zZ+SjY7nkEH a615R0GTgyQixzoNU1/74IlegpiJPANbOBQEN9KMfGIeBnLWwmIclXvZA1UJhDOhgP52 N1Vq3kEU+tnzuQknZgWGlhzjEVvYenr/z+LHu9LzW3wRX2mt7WS5bz+iPkTxGHoPtIhm LAhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=Bstw+2QIQipsyR4vT0/Wk4v1z9zV7X8lHg0sSAn5SwY=; b=CozTdZG7YX2exOCixmC7mA6wmV/s4oLP1oJCizJbxZQ7CvGZn2wC0brjce6GoXnuNu XBv9EyfV4R7rDYwzAsi+3SJ2Wdj8c8L28NrCqdndE+Fuy2MlpjXrmxwy0oO2p3z475v9 IpV5e+2vMDw79qqib0UsAjV0lKdHUz20+6zPyDsdce5cGCIj5tctMBobpCwA6WvO1Ulw rG0NqqECQCTtz/OwtjhHIY12+9wCrAi8M9VT0iG4BAAb36iFhFSmADsfzkLX6WCZr4Fl NGlB9r4A4QqgCO09cVhmM+MGvORdJJFfX45sl0fZAe14GzpcuEC9qEF2lD781boJh6Tx Xh8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RDvDBn9O; 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 Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id l36si8825795plg.198.2017.10.02.12.02.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 12:02:43 -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 header.s=google header.b=RDvDBn9O; 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 D557E21F303F7; Mon, 2 Oct 2017 11:59:22 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22f; helo=mail-wr0-x22f.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::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 C503D21F9B69C for ; Mon, 2 Oct 2017 11:59:20 -0700 (PDT) Received: by mail-wr0-x22f.google.com with SMTP id p10so2924520wrc.6 for ; Mon, 02 Oct 2017 12:02:40 -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=tPadn4XSeb8mqY46lXICK4+WPsrZcj6AYPOIEq04ldk=; b=RDvDBn9OXgUJqL3U9dyGsTSWtFCs4Q7mvLy79vy908HiFmNJyD7U9ALXZdVteld0FJ l/r/sCguN++cdbNQtK8gdtH7DvAYodJo/iNJDCyRgOPdvYVD5GBmY/7VVnRJXqAy305A +p/YVaaehDFnOpJdBh/h56gETPn8PVfF25pag= 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=tPadn4XSeb8mqY46lXICK4+WPsrZcj6AYPOIEq04ldk=; b=hzcxbZqJpBe9nOAvMJItD+5S20hdYNdn6MTrG+sJYxqufSk4TS8yopXdxvrT0Bfknn O/QGQyfPEytg4CxzYx32ZQ/GAOi+BgW0DXW0SqKQPBEro/OP54mSjDXCah9V6Norq9/q S0t6TER1SjNNOAigawRhTGm3ol+xsRc//gz2Ye/HGkjVHxukAxnEmTZG0j33hhvH/xfm EfOfekNh4LHFx0OHlWxPTgl8vdsf/lbi4vnGTaXsbazxcubEI4Myatj/OL8IcxIOawI9 pF0WYhzKCwh5cU6wvuyN75wTp6FQ+rfD8hm5uyVdajmzUuujTYKGLkWyEmqKGkMbqlof zgpQ== X-Gm-Message-State: AHPjjUjEGBx/S0pgxTqM4+Rfq+tsqkR4xRMCZidl5cWC8avQB2DCzvMR pd1Y2oj1HLccdAyyHarNe/Q7kDcvxy4= X-Google-Smtp-Source: AOwi7QBtw3Ty/aLWUikcAT9AtVkIq8hiUoALbLP+4DL6pqZCeUO4wNdLS5NmsdOD1687iDmLXRD+4g== X-Received: by 10.223.145.166 with SMTP id 35mr14636454wri.51.1506970957820; Mon, 02 Oct 2017 12:02:37 -0700 (PDT) Received: from localhost.localdomain ([160.90.203.54]) by smtp.gmail.com with ESMTPSA id 5sm6485623wrb.9.2017.10.02.12.02.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 12:02:36 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Mon, 2 Oct 2017 20:02:26 +0100 Message-Id: <20171002190226.25103-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: call ESRT hooks at appropriate times 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: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The ESRT management protocol needs to be invoked at the appropriate times to get the ESRT config table to be published at when the ReadyToBoot is signalled. So add this handling to the default ArmPkg implementation of PlatformBootManagerLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 23 ++++++++++++++++++-- ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index a3b2d7925f72..d4a7859ca9e8 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -449,12 +450,23 @@ PlatformBootManagerBeforeConsole ( VOID ) { - EFI_STATUS Status; + EFI_STATUS Status; + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); Status = ProcessCapsules (); DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); + } else { + if (EsrtManagement != NULL) { + EsrtManagement->SyncEsrtFmp(); + } + } + + Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, + (VOID **)&EsrtManagement); + if (EFI_ERROR(Status)) { + EsrtManagement = NULL; } // @@ -524,7 +536,8 @@ PlatformBootManagerAfterConsole ( VOID ) { - EFI_STATUS Status; + ESRT_MANAGEMENT_PROTOCOL *EsrtManagement; + EFI_STATUS Status; // // Show the splash screen. @@ -538,6 +551,12 @@ PlatformBootManagerAfterConsole ( // EfiBootManagerConnectAll (); + Status = gBS->LocateProtocol(&gEsrtManagementProtocolGuid, NULL, + (VOID **)&EsrtManagement); + if (!EFI_ERROR(Status)) { + EsrtManagement->SyncEsrtFmp(); + } + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); Status = ProcessCapsules (); diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 58c4d6d2c7d6..fce7349ff867 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -82,3 +82,4 @@ [Protocols] gEfiLoadedImageProtocolGuid gEfiPciRootBridgeIoProtocolGuid gEfiSimpleFileSystemProtocolGuid + gEsrtManagementProtocolGuid