• Subject: [edk2] [PATCH edk2-platforms 0/3] DeveloperBox capsule update changes for progress reporting
  • Author: Ard Biesheuvel
  • Date: June 7, 2018, 11:32 a.m.
  • Patches: 3 / 3
Changeset
.../Socionext/DeveloperBox/DeveloperBox.dsc   |  7 +--
.../Socionext/DeveloperBox/DeveloperBox.fdf   |  1 +
.../StyxPlatformFlashAccessLib.c              |  1 +
.../SynQuacerPlatformFlashAccessLib.c         | 44 ++++++-------------
.../SynQuacerPlatformFlashAccessLib.inf       |  1 -
5 files changed, 17 insertions(+), 37 deletions(-)
Git apply log
Switched to a new branch '20180607113203.27606-1-ard.biesheuvel@linaro.org'
Applying: Platform/Socionext/DeveloperBox: add support for persistent capsules
fatal: sha1 information is lacking or useless (Platform/Socionext/DeveloperBox/DeveloperBox.dsc).
error: could not build fake ancestor
Patch failed at 0001 Platform/Socionext/DeveloperBox: add support for persistent 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 edk2-platforms 1/3] Platform/Socionext/DeveloperBox: add support for persistent capsules
[edk2] [PATCH edk2-platforms 0/3] DeveloperBox capsule update changes for progress reporting
Posted by Ard Biesheuvel, 2 weeks ago
These patches reimplement graphical progress reporting during capsule update.
They depend on MdeModulePkg and ArmPkg changes currently under review.

Patch #1 adds support for dispatching PersistAcrossReset capsules. This
requires a warm reboot implementation which is being proposed for ArmPkg.

Patch #2 actually builds our firmware update capsule as one that is applied
after a reboot. Such a capsule can only be applied by running firmware that
has patch #1 applied.

Patch #3 replaces the home cooked bootlogolib based progress reporting with
the generic solution being proposed by Mike.

Ard Biesheuvel (3):
  Platform/Socionext/DeveloperBox: add support for persistent capsules
  Platform/Socionext/DeveloperBox: switch to PersistAcrossReset capsules
  Silicon/SynQuacerPlatformFlashAccessLib: replace progress indication

 .../Socionext/DeveloperBox/DeveloperBox.dsc   |  7 +--
 .../Socionext/DeveloperBox/DeveloperBox.fdf   |  1 +
 .../StyxPlatformFlashAccessLib.c              |  1 +
 .../SynQuacerPlatformFlashAccessLib.c         | 44 ++++++-------------
 .../SynQuacerPlatformFlashAccessLib.inf       |  1 -
 5 files changed, 17 insertions(+), 37 deletions(-)

-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH edk2-platforms 1/3] Platform/Socionext/DeveloperBox: add support for persistent capsules
Posted by Ard Biesheuvel, 2 weeks ago
Add support for PersistAcrossReset capsules, by setting the associated
PCD, and by enabling the warm reboot implementation that reenters PEI
with interrupts, caches and MMU disabled.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
index 300e3fd656a5..1476257acce1 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
@@ -226,11 +226,8 @@ [PcdsFeatureFlag]
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
   gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE
 
-  #
-  # This requires support in ARM Trusted Firmware and SCP for warm reset,
-  # so disable for now
-  #
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE
+  gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot|TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|TRUE
 
   # needed for NFIT tables installed by RamDiskDxe
   gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH edk2-platforms 1/3] Platform/Socionext/DeveloperBox: add support for persistent capsules
Posted by Leif Lindholm, 1 week ago
On Thu, Jun 07, 2018 at 01:32:01PM +0200, Ard Biesheuvel wrote:
> Add support for PersistAcrossReset capsules, by setting the associated
> PCD, and by enabling the warm reboot implementation that reenters PEI
> with interrupts, caches and MMU disabled.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Feel free to push this one separately once everything is in place to
do so.

> ---
>  Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> index 300e3fd656a5..1476257acce1 100644
> --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
> @@ -226,11 +226,8 @@ [PcdsFeatureFlag]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
>    gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE
>  
> -  #
> -  # This requires support in ARM Trusted Firmware and SCP for warm reset,
> -  # so disable for now
> -  #
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE
> +  gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot|TRUE
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|TRUE
>  
>    # needed for NFIT tables installed by RamDiskDxe
>    gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
> -- 
> 2.17.0
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH edk2-platforms 1/3] Platform/Socionext/DeveloperBox: add support for persistent capsules
Posted by Ard Biesheuvel, 6 days ago
On 15 June 2018 at 19:22, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Jun 07, 2018 at 01:32:01PM +0200, Ard Biesheuvel wrote:
>> Add support for PersistAcrossReset capsules, by setting the associated
>> PCD, and by enabling the warm reboot implementation that reenters PEI
>> with interrupts, caches and MMU disabled.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>

Thanks.

> Feel free to push this one separately once everything is in place to
> do so.
>

Pushed as f65939a9d98b283351fa5b9d62a8d49c42143b4f

>> ---
>>  Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
>> index 300e3fd656a5..1476257acce1 100644
>> --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
>> +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
>> @@ -226,11 +226,8 @@ [PcdsFeatureFlag]
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
>>    gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE
>>
>> -  #
>> -  # This requires support in ARM Trusted Firmware and SCP for warm reset,
>> -  # so disable for now
>> -  #
>> -  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE
>> +  gArmTokenSpaceGuid.PcdArmReenterPeiForCapsuleWarmReboot|TRUE
>> +  gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|TRUE
>>
>>    # needed for NFIT tables installed by RamDiskDxe
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
>> --
>> 2.17.0
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH edk2-platforms 2/3] Platform/Socionext/DeveloperBox: switch to PersistAcrossReset capsules
Posted by Ard Biesheuvel, 2 weeks ago
Switch to the more common flavor of firmware update capsules that are
only staged by the UpdateCapsule() service, and dispatched and processed
after a warm reboot.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/Socionext/DeveloperBox/DeveloperBox.fdf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
index f3618fd1d50a..b3e0b4a9fe1b 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
@@ -381,6 +381,7 @@ [Capsule.SynQuacerFirmwareUpdateCapsuleFmpPkcs7]
 CAPSULE_GUID                = 6dcbd5ed-e82d-4c44-bda1-7194199ad92a # gEfiFmpCapsuleGuid
 CAPSULE_HEADER_SIZE         = 0x20
 CAPSULE_HEADER_INIT_VERSION = 0x1
+CAPSULE_FLAGS               = PersistAcrossReset,InitiateReset
 
   FMP_PAYLOAD = FmpPayloadSystemFirmwarePkcs7
 
-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [PATCH edk2-platforms 3/3] Silicon/SynQuacerPlatformFlashAccessLib: replace progress indication
Posted by Ard Biesheuvel, 2 weeks ago
Replace the home cooked progress indication with calls into the new
(*Progress)() argument to PerformFlashWriteWithProgress(), which
allows the flash access routine to report progress via a platform
provided callback.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c                        |  1 +
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c   | 44 ++++++--------------
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf |  1 -
 3 files changed, 14 insertions(+), 32 deletions(-)

diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
index 38f1830b5c2e..c5e46dcd4ddf 100644
--- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
+++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
@@ -72,6 +72,7 @@ PerformFlashWriteWithProgress (
 {
   EFI_STATUS                      Status;
   AMD_ISCP_DXE_PROTOCOL           *IscpDxeProtocol;
+  UINTN                           Remaining;
 
   if (FlashAddressType != FlashAddressTypeRelativeAddress) {
     DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeRelativeAddress supported\n",
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index 48d385993b38..ebb6ce189aa5 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -17,7 +17,6 @@
 #include <PiDxe.h>
 
 #include <Library/BaseMemoryLib.h>
-#include <Library/BootLogoLib.h>
 #include <Library/DebugLib.h>
 #include <Library/DxeServicesTableLib.h>
 #include <Library/MemoryAllocationLib.h>
@@ -195,17 +194,7 @@ PerformFlashWriteWithProgress (
   EFI_LBA                             Lba;
   EFI_PHYSICAL_ADDRESS                FvbBaseAddress;
   UINTN                               NumBytes;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
-  UINTN                               Resolution;
-  UINTN                               CurrentProgress;
-  BOOLEAN                             HaveBootGraphics;
-
-  Black.Raw = 0x00000000;
-  White.Raw = 0x00FFFFFF;
-
-  Status = BootLogoEnableLogo ();
-  HaveBootGraphics = !EFI_ERROR (Status);
+  UINTN                               Remaining;
 
   if (FlashAddressType != FlashAddressTypeAbsoluteAddress) {
     DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeAbsoluteAddress supported\n",
@@ -274,14 +263,8 @@ PerformFlashWriteWithProgress (
     return Status;
   }
 
-  if (HaveBootGraphics) {
-    Resolution = (BlockSize * 100) / Length + 1;
-    CurrentProgress = 0;
-
-    Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
-               L"Updating firmware - please wait", Black.Pixel, 100, 0);
-  } else {
-    Print (L"Updating firmware - please wait ");
+  if (Progress == NULL) {
+    Print (L"\n\nUpdating firmware - please wait ");
   }
 
   //
@@ -298,7 +281,8 @@ PerformFlashWriteWithProgress (
     return Status;
   }
 
-  while (Length > 0) {
+  Remaining = Length;
+  while (Remaining > 0) {
     //
     // Write the new data
     //
@@ -315,20 +299,18 @@ PerformFlashWriteWithProgress (
       }
     }
 
-    if (HaveBootGraphics) {
-      Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
-                L"Updating firmware - please wait", White.Pixel,
-                CurrentProgress + Resolution, CurrentProgress);
-      CurrentProgress += Resolution;
+    Buffer += BlockSize;
+    Remaining -= BlockSize;
+    Lba++;
+
+    if (Progress != NULL) {
+      Progress (EndPercentage -
+                (Remaining * (EndPercentage - StartPercentage)) / Length);
     } else {
       Print (L".");
     }
-
-    Buffer += BlockSize;
-    Length -= BlockSize;
-    Lba++;
   }
-  if (!HaveBootGraphics) {
+  if (Progress == NULL) {
     Print (L"\n");
   }
 
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
index 4dfa11372a38..6ca34ada1d03 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
@@ -33,7 +33,6 @@ [Protocols]
 
 [LibraryClasses]
   BaseMemoryLib
-  BootLogoLib
   DebugLib
   DxeServicesTableLib
   UefiBootServicesTableLib
-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH edk2-platforms 3/3] Silicon/SynQuacerPlatformFlashAccessLib: replace progress indication
Posted by Leif Lindholm, 1 week ago
On Thu, Jun 07, 2018 at 01:32:03PM +0200, Ard Biesheuvel wrote:
> Replace the home cooked progress indication with calls into the new
> (*Progress)() argument to PerformFlashWriteWithProgress(), which
> allows the flash access routine to report progress via a platform
> provided callback.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

I think 1-2 depends on changes that aren't currently happening based
on discussions. If I'm wrong, set me straight.

However, does this one not make sense on its own?
If so, it has
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c                        |  1 +
>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c   | 44 ++++++--------------
>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf |  1 -
>  3 files changed, 14 insertions(+), 32 deletions(-)
> 
> diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
> index 38f1830b5c2e..c5e46dcd4ddf 100644
> --- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
> +++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
> @@ -72,6 +72,7 @@ PerformFlashWriteWithProgress (
>  {
>    EFI_STATUS                      Status;
>    AMD_ISCP_DXE_PROTOCOL           *IscpDxeProtocol;
> +  UINTN                           Remaining;
>  
>    if (FlashAddressType != FlashAddressTypeRelativeAddress) {
>      DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeRelativeAddress supported\n",
> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
> index 48d385993b38..ebb6ce189aa5 100644
> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
> @@ -17,7 +17,6 @@
>  #include <PiDxe.h>
>  
>  #include <Library/BaseMemoryLib.h>
> -#include <Library/BootLogoLib.h>
>  #include <Library/DebugLib.h>
>  #include <Library/DxeServicesTableLib.h>
>  #include <Library/MemoryAllocationLib.h>
> @@ -195,17 +194,7 @@ PerformFlashWriteWithProgress (
>    EFI_LBA                             Lba;
>    EFI_PHYSICAL_ADDRESS                FvbBaseAddress;
>    UINTN                               NumBytes;
> -  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
> -  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
> -  UINTN                               Resolution;
> -  UINTN                               CurrentProgress;
> -  BOOLEAN                             HaveBootGraphics;
> -
> -  Black.Raw = 0x00000000;
> -  White.Raw = 0x00FFFFFF;
> -
> -  Status = BootLogoEnableLogo ();
> -  HaveBootGraphics = !EFI_ERROR (Status);
> +  UINTN                               Remaining;
>  
>    if (FlashAddressType != FlashAddressTypeAbsoluteAddress) {
>      DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeAbsoluteAddress supported\n",
> @@ -274,14 +263,8 @@ PerformFlashWriteWithProgress (
>      return Status;
>    }
>  
> -  if (HaveBootGraphics) {
> -    Resolution = (BlockSize * 100) / Length + 1;
> -    CurrentProgress = 0;
> -
> -    Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
> -               L"Updating firmware - please wait", Black.Pixel, 100, 0);
> -  } else {
> -    Print (L"Updating firmware - please wait ");
> +  if (Progress == NULL) {
> +    Print (L"\n\nUpdating firmware - please wait ");
>    }
>  
>    //
> @@ -298,7 +281,8 @@ PerformFlashWriteWithProgress (
>      return Status;
>    }
>  
> -  while (Length > 0) {
> +  Remaining = Length;
> +  while (Remaining > 0) {
>      //
>      // Write the new data
>      //
> @@ -315,20 +299,18 @@ PerformFlashWriteWithProgress (
>        }
>      }
>  
> -    if (HaveBootGraphics) {
> -      Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
> -                L"Updating firmware - please wait", White.Pixel,
> -                CurrentProgress + Resolution, CurrentProgress);
> -      CurrentProgress += Resolution;
> +    Buffer += BlockSize;
> +    Remaining -= BlockSize;
> +    Lba++;
> +
> +    if (Progress != NULL) {
> +      Progress (EndPercentage -
> +                (Remaining * (EndPercentage - StartPercentage)) / Length);
>      } else {
>        Print (L".");
>      }
> -
> -    Buffer += BlockSize;
> -    Length -= BlockSize;
> -    Lba++;
>    }
> -  if (!HaveBootGraphics) {
> +  if (Progress == NULL) {
>      Print (L"\n");
>    }
>  
> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
> index 4dfa11372a38..6ca34ada1d03 100644
> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
> @@ -33,7 +33,6 @@ [Protocols]
>  
>  [LibraryClasses]
>    BaseMemoryLib
> -  BootLogoLib
>    DebugLib
>    DxeServicesTableLib
>    UefiBootServicesTableLib
> -- 
> 2.17.0
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH edk2-platforms 3/3] Silicon/SynQuacerPlatformFlashAccessLib: replace progress indication
Posted by Ard Biesheuvel, 1 week ago
On 13 June 2018 at 00:52, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Jun 07, 2018 at 01:32:03PM +0200, Ard Biesheuvel wrote:
>> Replace the home cooked progress indication with calls into the new
>> (*Progress)() argument to PerformFlashWriteWithProgress(), which
>> allows the flash access routine to report progress via a platform
>> provided callback.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> I think 1-2 depends on changes that aren't currently happening based
> on discussions. If I'm wrong, set me straight.
>
> However, does this one not make sense on its own?

Not really. The progress reporting only works for PersistAcrossReset
capsules to begin with. That is essentially what all the fuss is
about.

I don't necessarily agree with that, but given that Windows and
Linux/x86 only use that type of capsule, it made sense for our stuff
to get aligned with that.

> If so, it has
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>

Thanks.

>> ---
>>  Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c                        |  1 +
>>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c   | 44 ++++++--------------
>>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf |  1 -
>>  3 files changed, 14 insertions(+), 32 deletions(-)
>>
>> diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
>> index 38f1830b5c2e..c5e46dcd4ddf 100644
>> --- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
>> +++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c
>> @@ -72,6 +72,7 @@ PerformFlashWriteWithProgress (
>>  {
>>    EFI_STATUS                      Status;
>>    AMD_ISCP_DXE_PROTOCOL           *IscpDxeProtocol;
>> +  UINTN                           Remaining;
>>
>>    if (FlashAddressType != FlashAddressTypeRelativeAddress) {
>>      DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeRelativeAddress supported\n",
>> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
>> index 48d385993b38..ebb6ce189aa5 100644
>> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
>> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
>> @@ -17,7 +17,6 @@
>>  #include <PiDxe.h>
>>
>>  #include <Library/BaseMemoryLib.h>
>> -#include <Library/BootLogoLib.h>
>>  #include <Library/DebugLib.h>
>>  #include <Library/DxeServicesTableLib.h>
>>  #include <Library/MemoryAllocationLib.h>
>> @@ -195,17 +194,7 @@ PerformFlashWriteWithProgress (
>>    EFI_LBA                             Lba;
>>    EFI_PHYSICAL_ADDRESS                FvbBaseAddress;
>>    UINTN                               NumBytes;
>> -  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
>> -  EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
>> -  UINTN                               Resolution;
>> -  UINTN                               CurrentProgress;
>> -  BOOLEAN                             HaveBootGraphics;
>> -
>> -  Black.Raw = 0x00000000;
>> -  White.Raw = 0x00FFFFFF;
>> -
>> -  Status = BootLogoEnableLogo ();
>> -  HaveBootGraphics = !EFI_ERROR (Status);
>> +  UINTN                               Remaining;
>>
>>    if (FlashAddressType != FlashAddressTypeAbsoluteAddress) {
>>      DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeAbsoluteAddress supported\n",
>> @@ -274,14 +263,8 @@ PerformFlashWriteWithProgress (
>>      return Status;
>>    }
>>
>> -  if (HaveBootGraphics) {
>> -    Resolution = (BlockSize * 100) / Length + 1;
>> -    CurrentProgress = 0;
>> -
>> -    Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
>> -               L"Updating firmware - please wait", Black.Pixel, 100, 0);
>> -  } else {
>> -    Print (L"Updating firmware - please wait ");
>> +  if (Progress == NULL) {
>> +    Print (L"\n\nUpdating firmware - please wait ");
>>    }
>>
>>    //
>> @@ -298,7 +281,8 @@ PerformFlashWriteWithProgress (
>>      return Status;
>>    }
>>
>> -  while (Length > 0) {
>> +  Remaining = Length;
>> +  while (Remaining > 0) {
>>      //
>>      // Write the new data
>>      //
>> @@ -315,20 +299,18 @@ PerformFlashWriteWithProgress (
>>        }
>>      }
>>
>> -    if (HaveBootGraphics) {
>> -      Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel,
>> -                L"Updating firmware - please wait", White.Pixel,
>> -                CurrentProgress + Resolution, CurrentProgress);
>> -      CurrentProgress += Resolution;
>> +    Buffer += BlockSize;
>> +    Remaining -= BlockSize;
>> +    Lba++;
>> +
>> +    if (Progress != NULL) {
>> +      Progress (EndPercentage -
>> +                (Remaining * (EndPercentage - StartPercentage)) / Length);
>>      } else {
>>        Print (L".");
>>      }
>> -
>> -    Buffer += BlockSize;
>> -    Length -= BlockSize;
>> -    Lba++;
>>    }
>> -  if (!HaveBootGraphics) {
>> +  if (Progress == NULL) {
>>      Print (L"\n");
>>    }
>>
>> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
>> index 4dfa11372a38..6ca34ada1d03 100644
>> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
>> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf
>> @@ -33,7 +33,6 @@ [Protocols]
>>
>>  [LibraryClasses]
>>    BaseMemoryLib
>> -  BootLogoLib
>>    DebugLib
>>    DxeServicesTableLib
>>    UefiBootServicesTableLib
>> --
>> 2.17.0
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel