From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 9FBB621D046C3 for ; Mon, 18 Sep 2017 03:13:13 -0700 (PDT) Received: by mail-wm0-x22a.google.com with SMTP id g206so1230591wme.0 for ; Mon, 18 Sep 2017 03:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XPMdBbrWt1AastDnu5SIhydDgGWm4MBWVqD6n+VBZSM=; b=Ubc4H7gvXNlRDqDADWrxEyRcedSJddClTJ+zTU9+2BGvpXTlgXn/iPKAFRHNPOE63B m1jIwktkwNKuQtWGMA5EcCEhpDjxWDNAf1M3Vn0W3MaNju9scJ3u5o2hQl9CDE2XnTF8 XGwzRPzVFtH5S5I2xTt9miV7DlURbIZy40eKI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XPMdBbrWt1AastDnu5SIhydDgGWm4MBWVqD6n+VBZSM=; b=ETGIx3Cm5RPAdsbwv1sWjz6IvjqOoRhN/gHeOoV6uYENJIamQa/YSDmNAStLhr2/lA 1mpOyjE6je10e422jr7YUPfSJn8Df2A3Px4xVpdpaOCaCmaCVANVY+kkPESWA8oZu/wW xwa3N+XpX5zPCQTLj9tx2oweiIWxasZDlpXCIy1qwoOj+Xoy11j0obN4cVw7htZaH/2B 8Zyx4ZB1l6B7YwumIE3cpi1Wa2kiiW69T0BqGySUAKyFpslmvIzEtl4tKez4WIywdrmO KkTBloCds8gXI3jgZlI/sIfvTuI7/mfLEqiNZ5vLaEh8l8d3FrlggGdU0uw8KSXTEaHo AWTw== X-Gm-Message-State: AHPjjUhcji6+i9yIpMEPQvOBpQX9lDXpa5pIwZD/ZHQhd0DtPFV8U5pV +NSng/sYc7pjetmxbJnKleXZYg== X-Google-Smtp-Source: AOwi7QCt5KXUimQNYbFUBpbPDfWR4DQSj6SjP8yKvSg4QiYVgpcj6fqg1cFQUZ9x/mydEj0UUUwfYw== X-Received: by 10.28.134.143 with SMTP id i137mr1225830wmd.27.1505729775410; Mon, 18 Sep 2017 03:16:15 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id m128sm309136wmf.0.2017.09.18.03.16.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2017 03:16:14 -0700 (PDT) Date: Mon, 18 Sep 2017 11:16:01 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20170918101600.tls6jmarforc7gvg@bivouac.eciton.net> References: <20170915230332.23477-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20170915230332.23477-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: Mon, 18 Sep 2017 10:13:14 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 15, 2017 at 04:03:32PM -0700, Ard Biesheuvel wrote: > 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 Reviewed-by: Leif Lindholm / Leif > --- > 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 >