From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: leif.lindholm@linaro.org, Ard Biesheuvel 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: [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: , X-List-Received-Date: Fri, 15 Sep 2017 23:00:37 -0000 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(+) 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 -- 2.11.0