ArmPkg/PlatformBootManagerLib: process pending capsules

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>
This commit is contained in:
Ard Biesheuvel 2017-09-11 17:50:29 +01:00
parent a3a4737051
commit 4bbcc285d5
3 changed files with 19 additions and 0 deletions

View File

@ -43,6 +43,7 @@
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

View File

@ -18,7 +18,9 @@
#include <IndustryStandard/Pci22.h> #include <IndustryStandard/Pci22.h>
#include <Library/BootLogoLib.h> #include <Library/BootLogoLib.h>
#include <Library/CapsuleLib.h>
#include <Library/DevicePathLib.h> #include <Library/DevicePathLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <Library/UefiBootManagerLib.h> #include <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
@ -447,6 +449,14 @@ PlatformBootManagerBeforeConsole (
VOID 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 // Signal EndOfDxe PI Event
// //
@ -528,6 +538,12 @@ PlatformBootManagerAfterConsole (
// //
EfiBootManagerConnectAll (); 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. // Enumerate all possible boot options.
// //

View File

@ -43,9 +43,11 @@
BaseLib BaseLib
BaseMemoryLib BaseMemoryLib
BootLogoLib BootLogoLib
CapsuleLib
DebugLib DebugLib
DevicePathLib DevicePathLib
DxeServicesLib DxeServicesLib
HobLib
MemoryAllocationLib MemoryAllocationLib
PcdLib PcdLib
PrintLib PrintLib