From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Ard Biesheuvel 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: [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: , X-List-Received-Date: Mon, 02 Oct 2017 18:59:21 -0000 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(-) 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 -- 2.11.0