]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/PlatformBootManagerLib: process pending capsules
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 11 Sep 2017 16:50:29 +0000 (17:50 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 19 Sep 2017 16:39:01 +0000 (09:39 -0700)
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 <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/ArmPkg.dsc
ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf

index cf86f89bd702cac9f87d1435573afbb89bc58abe..fc24a788df571b5fe2bb4d5e536fea7d40e677a3 100644 (file)
@@ -43,6 +43,7 @@
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
   CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf\r
+  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf\r
   DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
index 6c0b352ae36601b0ba2d2af2ea46309c925b4271..a3b2d7925f72c66ca8f2f0d4af3b2e7250804ba3 100644 (file)
@@ -18,7 +18,9 @@
 \r
 #include <IndustryStandard/Pci22.h>\r
 #include <Library/BootLogoLib.h>\r
+#include <Library/CapsuleLib.h>\r
 #include <Library/DevicePathLib.h>\r
+#include <Library/HobLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/UefiBootManagerLib.h>\r
 #include <Library/UefiLib.h>\r
@@ -447,6 +449,14 @@ PlatformBootManagerBeforeConsole (
   VOID\r
   )\r
 {\r
+  EFI_STATUS    Status;\r
+\r
+  if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {\r
+    DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));\r
+    Status = ProcessCapsules ();\r
+    DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));\r
+  }\r
+\r
   //\r
   // Signal EndOfDxe PI Event\r
   //\r
@@ -528,6 +538,12 @@ PlatformBootManagerAfterConsole (
   //\r
   EfiBootManagerConnectAll ();\r
 \r
+  if (GetBootModeHob() == BOOT_ON_FLASH_UPDATE) {\r
+    DEBUG((DEBUG_INFO, "ProcessCapsules After EndOfDxe ......\n"));\r
+    Status = ProcessCapsules ();\r
+    DEBUG((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));\r
+  }\r
+\r
   //\r
   // Enumerate all possible boot options.\r
   //\r
index e5ffd5db4276e6584f77cfea213778866979a98a..58c4d6d2c7d61f0fda17e88388c9bb260c01ee8a 100644 (file)
   BaseLib\r
   BaseMemoryLib\r
   BootLogoLib\r
+  CapsuleLib\r
   DebugLib\r
   DevicePathLib\r
   DxeServicesLib\r
+  HobLib\r
   MemoryAllocationLib\r
   PcdLib\r
   PrintLib\r