* [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules
@ 2017-09-15 23:03 Ard Biesheuvel
2017-09-18 10:16 ` Leif Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2017-09-15 23:03 UTC (permalink / raw)
To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel
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>
---
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 <IndustryStandard/Pci22.h>
#include <Library/BootLogoLib.h>
+#include <Library/CapsuleLib.h>
#include <Library/DevicePathLib.h>
+#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h>
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules
2017-09-15 23:03 [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules Ard Biesheuvel
@ 2017-09-18 10:16 ` Leif Lindholm
2017-09-19 16:42 ` Ard Biesheuvel
0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2017-09-18 10:16 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: edk2-devel
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 <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
/
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 <IndustryStandard/Pci22.h>
> #include <Library/BootLogoLib.h>
> +#include <Library/CapsuleLib.h>
> #include <Library/DevicePathLib.h>
> +#include <Library/HobLib.h>
> #include <Library/PcdLib.h>
> #include <Library/UefiBootManagerLib.h>
> #include <Library/UefiLib.h>
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules
2017-09-18 10:16 ` Leif Lindholm
@ 2017-09-19 16:42 ` Ard Biesheuvel
0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2017-09-19 16:42 UTC (permalink / raw)
To: Leif Lindholm; +Cc: edk2-devel@lists.01.org
On 18 September 2017 at 03:16, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> 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 <ard.biesheuvel@linaro.org>
>
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
Pushed as 4bbcc285d5f74d34ec40733dde807f5a4f0cdf8c
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-19 16:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-15 23:03 [PATCH v2] ArmPkg/PlatformBootManagerLib: process pending capsules Ard Biesheuvel
2017-09-18 10:16 ` Leif Lindholm
2017-09-19 16:42 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox