From patchwork Thu Mar 2 16:15:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 94794 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp235452qgd; Thu, 2 Mar 2017 08:15:25 -0800 (PST) X-Received: by 10.98.193.69 with SMTP id i66mr16475296pfg.35.1488471325478; Thu, 02 Mar 2017 08:15:25 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id x5si7810119pgj.207.2017.03.02.08.15.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 08:15:25 -0800 (PST) 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; 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 87E86821F8; Thu, 2 Mar 2017 08:15:24 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (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 6D312821ED for ; Thu, 2 Mar 2017 08:15:22 -0800 (PST) Received: by mail-wm0-x229.google.com with SMTP id t193so16232838wmt.1 for ; Thu, 02 Mar 2017 08:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lQs9ws4NqlwTku8oB8GQqupss9+QnIGREg8E8e90TpY=; b=dp3rz7JC5diLnE0n0AWxmAy311SIA/2HZlfXLQW52XtMVboiOx40GT73fzvylH8fWr LxpS2HjS0aWtnomwFA/vqpXIL9tn3TDcCVxRT3S84/wc6pMS53mWhZkHzGHM05+9F5NX lb9eSnn3LnzsUfYlmbQYHS3FU9xw/Zx60xB94= 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:in-reply-to :references; bh=lQs9ws4NqlwTku8oB8GQqupss9+QnIGREg8E8e90TpY=; b=h93LP5zOKwA8V1oOwQ9asdcwiZAfA4A4lvAW4+Dpg6aFxLDREybGkLGrYfNSUpJCFw cSmOlr6sYU4Zd7GcX1lmbY6TfDg9gxqQ58sA1aRvlhjmrjWjjR6g7KI0P9tlZby5NNtQ OAjy9bX4x/1vAuOG6EN6eF/SQWknKUjDPMqtQ41+V8JGU0/M9iARtqKI06LVtL3AfE1j 24fq61/hrfbYV0G55PVM0/Czh1HSMNnzMzUmvStgLyXA3UTCtTjsMh/9jMey/imc//FI WxEtBwDMawPWTZ97KcusLjtU5KDSoY9rnAEoWu9t/4H87MG2Uitncftv65axS+BNbHzQ /67w== X-Gm-Message-State: AMke39kiG8989ehl1T40nqQrehH6+rwpBYF8APKaenzmWRbRxpeT8V+v2flMHMuGGmjlNi5J X-Received: by 10.28.207.7 with SMTP id f7mr9001066wmg.112.1488471320773; Thu, 02 Mar 2017 08:15:20 -0800 (PST) Received: from localhost.localdomain ([105.147.1.203]) by smtp.gmail.com with ESMTPSA id n13sm11412650wra.17.2017.03.02.08.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Mar 2017 08:15:20 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com, leif.lindholm@linaro.org Date: Thu, 2 Mar 2017 16:15:04 +0000 Message-Id: <1488471305-23752-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488471305-23752-1-git-send-email-ard.biesheuvel@linaro.org> References: <1488471305-23752-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 3/4] ArmVirtPkg/PlatformBootManagerLib: process pending capsules X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiewen.yao@intel.com, 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. 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.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 17 +++++++++++++++++ ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 ++ 2 files changed, 19 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 94da51ad49f1..1ebfecd992f7 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -17,7 +17,9 @@ #include #include +#include #include +#include #include #include #include @@ -579,6 +581,13 @@ PlatformBootManagerBeforeConsole ( ) { RETURN_STATUS PcdStatus; + EFI_STATUS Status; + + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { + DEBUG((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n")); + Status = ProcessCapsules (); + DEBUG((DEBUG_INFO, "ProcessCapsules %r\n", Status)); + } // // Signal EndOfDxe PI Event @@ -663,6 +672,8 @@ PlatformBootManagerAfterConsole ( VOID ) { + EFI_STATUS Status; + // // Show the splash screen. // @@ -673,6 +684,12 @@ PlatformBootManagerAfterConsole ( // EfiBootManagerConnectAll (); + if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) { + DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n")); + Status = ProcessCapsules (); + DEBUG((DEBUG_INFO, "ProcessCapsules %r\n", Status)); + } + // // Process QEMU's -kernel command line option. Note that the kernel booted // this way should receive ACPI tables, which is why we connect all devices diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 1f162c663fc1..4d218097a420 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -45,8 +45,10 @@ [LibraryClasses] BaseLib BaseMemoryLib BootLogoLib + CapsuleLib DebugLib DevicePathLib + HobLib MemoryAllocationLib PcdLib PrintLib