• Subject: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules
  • Author: Ard Biesheuvel
  • Date: Sept. 11, 2017, 4:50 p.m.
  • Patches: 1 / 1
Changeset
ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 16 ++++++++++++++++
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  2 ++
2 files changed, 18 insertions(+)
Git apply log
Switched to a new branch '20170911165029.2391-1-ard.biesheuvel@linaro.org'
Applying: ArmPkg/PlatformBootManagerLib: process pending capsules
error: patch failed: ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c:18
error: ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c: patch does not apply
error: patch failed: ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf:43
error: ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Using index info to reconstruct a base tree...
Patch failed at 0001 ArmPkg/PlatformBootManagerLib: process pending capsules
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules
[edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules
Posted by Ard Biesheuvel, 1 week ago
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>
---
 ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 16 ++++++++++++++++
 ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  2 ++
 2 files changed, 18 insertions(+)

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 @@ [LibraryClasses]
   BaseLib
   BaseMemoryLib
   BootLogoLib
+  CapsuleLib
   DebugLib
   DevicePathLib
   DxeServicesLib
+  HobLib
   MemoryAllocationLib
   PcdLib
   PrintLib
-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules
Posted by Leif Lindholm, 1 week ago
On Mon, Sep 11, 2017 at 05:50:29PM +0100, 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>
> ---
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 16 ++++++++++++++++
>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  2 ++
>  2 files changed, 18 insertions(+)
> 
> 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 @@ [LibraryClasses]
>    BaseLib
>    BaseMemoryLib
>    BootLogoLib
> +  CapsuleLib

There is no CapsuleLib resolution in ArmPkg.dsc.
That should probably be added by this patch.

/
    Leif

>    DebugLib
>    DevicePathLib
>    DxeServicesLib
> +  HobLib
>    MemoryAllocationLib
>    PcdLib
>    PrintLib
> -- 
> 2.11.0
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] ArmPkg/PlatformBootManagerLib: process pending capsules
Posted by Ard Biesheuvel, 1 week ago
On 15 September 2017 at 09:22, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Mon, Sep 11, 2017 at 05:50:29PM +0100, 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>
>> ---
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c               | 16 ++++++++++++++++
>>  ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  2 ++
>>  2 files changed, 18 insertions(+)
>>
>> 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 @@ [LibraryClasses]
>>    BaseLib
>>    BaseMemoryLib
>>    BootLogoLib
>> +  CapsuleLib
>
> There is no CapsuleLib resolution in ArmPkg.dsc.
> That should probably be added by this patch.
>

Yeah, good point.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel