From patchwork Fri Sep 15 23:03:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 112762 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1144949qgf; Fri, 15 Sep 2017 16:03:39 -0700 (PDT) X-Received: by 10.98.87.193 with SMTP id i62mr25889197pfj.186.1505516619727; Fri, 15 Sep 2017 16:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505516619; cv=none; d=google.com; s=arc-20160816; b=oQIBWPVYiF7IhJd9u1pUuGiQtIaip989ApceFR4S7iooEvvq9pWKj/HCzYtC4JZMWM DbCqWOh3NIYAqBXX4z3dv4iuO6pmiTmounA+2jQtacE48r0wu+60eZqaBO5x0ytom0qb mjJAWLPVu6d2DKIqVEtY7406JczqxZ5uqnHr+zGXLpFU0QjELeSh9cRk5fnq97qUbgO/ vHQB3vWoZzDuq6UUEWQAxZlXS+DsBNvwdNtTNVwHJG/H7nAUs3Mz3h2/7nT5+99VtTz/ 2vbS47F47bqMcwra5qBgE9xB9X40PY/voNj8UwACY619AvQ/5YXFD2dLjS1qZylxGr4M JKTQ== 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=HMsd3NdrDofzNlG74nar1pS/Ut+h1yAKz6Oe+bR7KyM=; b=dIvSaKsdlk1KH6xvUzJhQwyKnvb8osus87yfZc0IB7zLmpYMlMH2UiaNYjeG8rQUwe 7KJrXYjC1DVme/9tau5OjcxqrmJDLth1GYSQYGF4W1vNRORvHoLWcHoFTUTG/g1zR8Qn p9f+gwBklB1WKbcYUPWb69ZJnhf0xxtKmN8xEugibBk00yOOKCpnP89ycnSzhGeiEIBr PMDh7yLt/M1LgnFAL5gqkt5nK1SWvwF0rfSeBpfWowHPvxXBdyQNFxz0nLqOa/R57L3T mhf7KF5ctd/w/nbTKsoTy2LsS4Rcyto47ulIf8Rc7qWNfjxuWoXg6Pw9jw10mjWkAXxO G1ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NPdL66mI; 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 q12si1373966plk.186.2017.09.15.16.03.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 16:03:39 -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=NPdL66mI; 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 4525420945B8D; Fri, 15 Sep 2017 16:00:38 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (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 DA09220945B7C for ; Fri, 15 Sep 2017 16:00:36 -0700 (PDT) Received: by mail-pf0-x235.google.com with SMTP id r71so2142211pfe.12 for ; Fri, 15 Sep 2017 16:03:37 -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=kLgZMFhyq6CI1r0zG1jUUKL1M66mSZDLI8r4mJW2jQI=; b=NPdL66mIko+gxKv+tBanovKFNgMiO/DR6VhnFy72BYbINRZMbp7IVtR7w7q+Uy6nye Lh+x8T4kRQfXZuZvD6+8NXbcJCDWa/l6gOPvGIZUyfxAHQa0e0NKS2DE/IxNoFxHHSCe AhM0QhQIW/DgWGcOGdT5qtLIJNIfOk1ADY2nU= 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=kLgZMFhyq6CI1r0zG1jUUKL1M66mSZDLI8r4mJW2jQI=; b=RS/mBCCr/37ve4ymxcC+1e42RAKtE9J7HRdZ8JkzJ5ylgksdt9YIIRczIOaVKd4uIr VL6pg3wMMHWx2gtJrQBUqguGSR0V6Y7UjJaT8/V+5ySUmbY8IFYVC/l2aj0xsqE8Dvav bIMvYWDUb/YZeSmZ2c1v8hyNGTHzW0AAdXG0Dc8kKtuffSt9sxhLKzFAEsvjENXZxGme ZftNrRBAKDq+ppGHamcLsyJxu9SmFAOP/odHY7Jkg5PS1k+/IVWLuyITdcRaWIEF6btF eK+Pl3WkhCKczzgTNtxYReuadxcgkEuMivGf25t2eToCDw9JWKPeO44GUP0PgIqq+wuF 9FHg== X-Gm-Message-State: AHPjjUiU1eyBFbgFg7T20XNe1WjsVeYwDV0U9ye9SG0glpD7VsJx/5u2 GfUSpUEGh6fYGjopd9IbOA== X-Google-Smtp-Source: ADKCNb7R4Y4WmuVA6Vd3rq4Wv+2T3fVrjcIt8uOigr61NS8jvINEIwyqPk9dw4dIkhSrFhjDckL6Mg== X-Received: by 10.99.63.136 with SMTP id m130mr25226072pga.162.1505516617008; Fri, 15 Sep 2017 16:03:37 -0700 (PDT) Received: from localhost.localdomain ([12.145.98.253]) by smtp.gmail.com with ESMTPSA id l27sm3571919pfg.172.2017.09.15.16.03.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 16:03:36 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 16:03:32 -0700 Message-Id: <20170915230332.23477-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH v2] 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 --- v2: add CapsuleLib resolution to ArmPkg.dsc ArmPkg/ArmPkg.dsc | 1 + ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 16 ++++++++++++++++ ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 ++ 3 files changed, 19 insertions(+) -- 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/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index cf86f89bd702..fc24a788df57 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -43,6 +43,7 @@ BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf 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 @@ BaseLib BaseMemoryLib BootLogoLib + CapsuleLib DebugLib DevicePathLib DxeServicesLib + HobLib MemoryAllocationLib PcdLib PrintLib