From patchwork Mon Sep 11 16:50:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 112204 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4071954qgf; Mon, 11 Sep 2017 09:50:57 -0700 (PDT) X-Received: by 10.36.213.212 with SMTP id a203mr13858652itg.59.1505148657620; Mon, 11 Sep 2017 09:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505148657; cv=none; d=google.com; s=arc-20160816; b=knq/BKefVNPjbYC8BM2w8avVUxh9hHPHU2pWTbcmnkIZ6ZuIeflFc0qUGyZIJop9TW cFlDBuOoDEQBothdiGYk4ls8eweHhzS9ej5sg7GqCgctrSbjpIdDRQMzt0boTzTJYPNa L1tX4gecQVai+u4vuzSFP+m1fgc8MMOM8jrqRVTvF6s6EH/0dwuJ7FVGtysaa6OaOgnW SBSXk+LDZIhx+WmqEacd6naju/XGn6CMfztFUPeD46W21i1S06Nkzi5rSSwRLipHzpI/ bSEEe+hC795J8IrgVCuUOgt3QNrfP3YlwsnyETF0aL/ebgZMWa5MrTjerS0RiVfLp09r AX8Q== 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=LEoEEZN7vH5pGTc1XdMvHF8kTuy1N+/RXexERyLDZ/w=; b=FbIJPHId0KWvvyxdfB5MMZkiabzT+/M/iaPxi912h8a2W5b5nzDqAnC5JZaniESfsL SMn4UkyaIlYf1zXcQsVq/weMVIcRupg6ts+MJCdNgBwUGGS1LkuLvFyajvLvzZGKYDic Ok8Ayk7pgEvm84RodEUle4Z1a9DxFOqyNOXRnZev88CbR53Dxqup1t7F3TkXFk7aa50T ovVg1a2MJMG1SOlNU3+1rIvYAqm2grNUgYos6cZZ5lP9J7UnlGG3OdVst3eDFxe+sUe0 Q6XKRxZGyro1m4dAsQWk42xJ0JPmBYSLc9nkulZg/rblAEclH+0cP3Yh1VAHgqJTfbBc JVkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J5e88u6Y; 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 c92si7882824ioj.48.2017.09.11.09.50.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 09:50:57 -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=J5e88u6Y; 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 8BCA621CEB0F8; Mon, 11 Sep 2017 09:48:00 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (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 20CF820958BCF for ; Mon, 11 Sep 2017 09:47:59 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id a137so10278005wma.0 for ; Mon, 11 Sep 2017 09:50:55 -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=7NWaoupHClODnWWYYbJ0iiNLyxWJoRx5Ga/oPb7hSLk=; b=J5e88u6Y+MF6bE/fXC1TUlfRwz3v/L56a+Anf9mNkhiRqRjc2OZsbp/n0pJuVv4caR FJO5fhvqjusEzJuTsL9k+CaXZMtN++rW8YlFAK3EF6WkZsiHVmZ8KH7iLd+rmNDXkif+ CvcPEV4LuX2YzCwjt/Twxeb+1UDR9WUH9rZxc= 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=7NWaoupHClODnWWYYbJ0iiNLyxWJoRx5Ga/oPb7hSLk=; b=cdpIuW8yCnSjyEwS9p3aaU2pgh4kcwV+bs1bdUTiXiJ8G6Nr/cuN4pMIIrXk/YdA0M l47UL2iR5D5qIf5sc8vXXYRo5592w64J/b+nepuIIUVZHImCVjxCDBzuB4KH37oRPK65 DzHKBTvJK+ck+jxrLpV83ruxTiCZTTbmhc/g63f6rjk7fXQ6jMb2tvaD8DxohkoBjhqQ LUlZ5SGdKcbdIoHF0sFdv/iT5v5qm5hpf++r/WhsuYbhCuoXZaytJ8hW5HJhaPh/eiNC 8IndEc1Fg3j8ySB6z8iZb1QEromDNTGW7o2Rqlxe2uXxe6pMLdQBDQIhzFo4uGBWt8CU 4Kmg== X-Gm-Message-State: AHPjjUhbTxam5U4AfV4IkTxqDCtTaX0wIqJWwXffNxrQvBPehAxYBsIi UV2g47W5fx+TuYJ/sJjPr1Zo8KYkHPU= X-Google-Smtp-Source: AOwi7QD30ajLO1cy0ruHu4GiAzglBRmkJd45pUBafi5tYnItUmnJVO6sv3dVsqIaP5VjCdZOWFdBaw== X-Received: by 10.28.164.68 with SMTP id n65mr7981741wme.23.1505148653298; Mon, 11 Sep 2017 09:50:53 -0700 (PDT) Received: from localhost.localdomain ([154.151.68.52]) by smtp.gmail.com with ESMTPSA id 188sm594756wmg.45.2017.09.11.09.50.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 09:50:34 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 11 Sep 2017 17:50:29 +0100 Message-Id: <20170911165029.2391-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules 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: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Process any capsule HOBs that were left for us by CapsulePei. This involves calling ProcessCapsules() twice, as explained in the comment in DxeCapsuleLibFmp [sic]. 1) The first call must be before EndOfDxe. The system capsules is processed. If device capsule FMP protocols are exposted at this time and device FMP capsule has zero EmbeddedDriverCount, the device capsules are processed. Each individual capsule result is recorded in capsule record variable. System may reset in this function, if reset is required by capsule and all capsules are processed. If not all capsules are processed, reset will be defered to second call. 2) The second call must be after EndOfDxe and after ConnectAll, so that all device capsule FMP protocols are exposed. The system capsules are skipped. If the device capsules are NOT processed in first call, they are processed here. Each individual capsule result is recorded in capsule record variable. System may reset in this function, if reset is required by capsule processed in first call and second call. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 16 ++++++++++++++++ ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 ++ 2 files changed, 18 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index 6c0b352ae366..a3b2d7925f72 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -18,7 +18,9 @@ #include #include +#include #include +#include #include #include #include @@ -447,6 +449,14 @@ PlatformBootManagerBeforeConsole ( VOID ) { + EFI_STATUS Status; + + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { + DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); + Status = ProcessCapsules (); + DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); + } + // // Signal EndOfDxe PI Event // @@ -528,6 +538,12 @@ PlatformBootManagerAfterConsole ( // EfiBootManagerConnectAll (); + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { + DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); + Status = ProcessCapsules (); + DEBUG((DEBUG_INFO, "ProcessCapsules returned %r\n", Status)); + } + // // Enumerate all possible boot options. // diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index e5ffd5db4276..58c4d6d2c7d6 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -43,9 +43,11 @@ [LibraryClasses] BaseLib BaseMemoryLib BootLogoLib + CapsuleLib DebugLib DevicePathLib DxeServicesLib + HobLib MemoryAllocationLib PcdLib PrintLib