public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware
@ 2018-03-16 16:13 Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found Ard Biesheuvel
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

Now that the NOR flash layout has been updated to split the actual SCP
firmware from the startup code and the builtin flasher, we can add the
SCP image to the capsule update to make it field upgradeable.

This involves some rather nasty plumbing, since making changes to capsule
update installable via capsule update requires some additional care.

Patch #1 fixes a bug in the FVB handling code of the flash access library.

Patch #2 addresses an issue where we accidentally started to dereference
arbitrary data as an FV header by incorporating the secure firmware binary
into the flash device.

Patch #3 is an optimization that speeds up flashing of sparse capsules.

Patch #4 adds a PCD that holds the minimum firmware version that is allowed
by a platform. We will use this to ensure that systems using the new layout
cannot be flashed using older capsules, which is unlikely to work in any
case, but not guaranteed to fail in a harmless manner.

Patch #5 is a temporary hack we will need to use to build capsules that
allow upgrading from the old layout to the new layout

Patch #6 implements the new layout, and adds support to set the minimum
version on the build command line.

Ard Biesheuvel (6):
  Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB
    found
  Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header
    fields
  Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks
  Silicon/SynQuacer: make lowest supported f/w version PCD configurable
  TEMPORARY
  Platform/Socionext/DeveloperBox: add SCP firmware image to capsule

 Platform/Socionext/DeveloperBox/DeveloperBox.dsc                                                      |  3 ++
 Platform/Socionext/DeveloperBox/DeveloperBox.fdf                                                      | 15 ++++---
 Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf                 |  2 +
 Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc           |  2 +-
 Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini             |  4 +-
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 46 ++++++++++++++++----
 Silicon/Socionext/SynQuacer/SynQuacer.dec                                                             |  3 ++
 7 files changed, 58 insertions(+), 17 deletions(-)

-- 
2.15.1



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 2/6] Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header fields Ard Biesheuvel
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

If no suitable FVB protocol implementation is found to apply the capsule
update, and the last one we disregarded was ruled out because it has the
read-only attribute, we will exit the function returning EFI_SUCCESS
without assigning a value to *OutFvb, resulting in a crash when it
subsequently gets dereferenced. So set the correct value for Status for
that case.

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

diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index fbb8f1f9e48c..1af4abc16aa5 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -99,6 +99,7 @@ GetFvbByAddress (
       DEBUG ((DEBUG_INFO,
         "%a: ignoring read-only FVB protocol implementation\n",
         __FUNCTION__));
+      Status = EFI_NOT_FOUND;
       continue;
     }
 
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 2/6] Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header fields
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 3/6] Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks Ard Biesheuvel
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

When we updated the capsule definition to cover the ARM Trusted Firmware
binary image as well as the firmware volume containing the EDK2 code, we
failed to recognize that the start of the image no longer constitutes a
Firmware Volume header, and so we should not interpret the data as such.

Note that this makes the FVB protocol slighty less appropriate as the
abstraction to use to write this data, but given that there does not
appear to be a better match (disk I/O, block I/O), let's stick with it
for now, but require the base address to match the capsule's target
address exactly rather than reading the size of the FV from the header.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index 1af4abc16aa5..82fe3f74aa7f 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -53,7 +53,6 @@ GetFvbByAddress (
   UINTN                               HandleCount;
   UINTN                               Index;
   EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *Fvb;
-  EFI_FIRMWARE_VOLUME_HEADER          *FwVolHeader;
   EFI_FVB_ATTRIBUTES_2                Attributes;
 
   //
@@ -103,8 +102,7 @@ GetFvbByAddress (
       continue;
     }
 
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) *FvbBaseAddress);
-    if ((Address >= *FvbBaseAddress) && (Address <= (*FvbBaseAddress + FwVolHeader->FvLength))) {
+    if (Address == *FvbBaseAddress) {
       *OutFvb  = Fvb;
       Status   = EFI_SUCCESS;
       break;
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 3/6] Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 2/6] Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header fields Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable Ard Biesheuvel
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

Before adding more payload to the capsule which may be only partially
occupied, add some logic to skip writing these blocks after erasing
them.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 41 +++++++++++++++++---
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index 82fe3f74aa7f..0131e33a4fe7 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -115,6 +115,35 @@ GetFvbByAddress (
   return Status;
 }
 
+/**
+  Check whether a buffer has any data in it, i.e., bytes with value != 0xff
+
+  @param[in] Buffer       Address of the buffer
+  @param[in] Length       Size of the buffer
+
+  @retval TRUE            A non-0xff byte was found
+  @retval FALSE           Buffer has 0xff bytes only
+
+**/
+STATIC
+BOOLEAN
+BufferHasData (
+  IN  VOID      *Buffer,
+  IN  UINTN     Length
+  )
+{
+  UINT8   *Data;
+  UINTN   Index;
+
+  Data = Buffer;
+  for (Index = 0; Index < Length; Index++) {
+    if (Data[Index] != 0xff) {
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
 /**
   Perform flash write operation.
 
@@ -257,11 +286,13 @@ PerformFlashWrite (
       __FUNCTION__, BlockSize, Lba));
 
     NumBytes = BlockSize;
-    Status = Fvb->Write (Fvb, Lba, 0, &NumBytes, Buffer);
-    if (EFI_ERROR (Status)) {
-      DEBUG ((DEBUG_ERROR,
-        "%a: write of LBA 0x%lx failed - %r (NumBytes == 0x%lx)\n",
-        __FUNCTION__, Lba, Status, NumBytes));
+    if (BufferHasData (Buffer, NumBytes)) {
+      Status = Fvb->Write (Fvb, Lba, 0, &NumBytes, Buffer);
+      if (EFI_ERROR (Status)) {
+        DEBUG ((DEBUG_ERROR,
+          "%a: write of LBA 0x%lx failed - %r (NumBytes == 0x%lx)\n",
+          __FUNCTION__, Lba, Status, NumBytes));
+      }
     }
 
     if (HaveBootGraphics) {
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 3/6] Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-03-19  8:12   ` Leif Lindholm
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 5/6] TEMPORARY Ard Biesheuvel
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

Allow the lowest supported firmware version to be configured by PCD
so that each platform can set it individually.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf       | 2 ++
 Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc | 2 +-
 Silicon/Socionext/SynQuacer/SynQuacer.dec                                                   | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
index 95a5e482a713..db0c9c43b2e5 100644
--- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
+++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
@@ -29,6 +29,7 @@ [Packages]
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
   SignedCapsulePkg/SignedCapsulePkg.dec
+  Silicon/Socionext/SynQuacer/SynQuacer.dec
 
 [LibraryClasses]
   DebugLib
@@ -39,6 +40,7 @@ [LibraryClasses]
 [FixedPcd]
   gArmTokenSpaceGuid.PcdFdSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
+  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion
 
 [Pcd]
   gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor
diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
index fb69de078313..12a56315a5ab 100644
--- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
+++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
@@ -25,7 +25,7 @@
 #define BUILD_STRING(x)                     L"build #" __BUILD_STRING(x)
 #define CURRENT_FIRMWARE_VERSION            FixedPcdGet32 (PcdFirmwareRevision)
 #define CURRENT_FIRMWARE_VERSION_STRING     BUILD_STRING (FixedPcdGet32 (PcdFirmwareRevision))
-#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x00000001
+#define LOWEST_SUPPORTED_FIRMWARE_VERSION   FixedPcdGet32 (PcdLowestSupportedFirmwareVersion)
 
 #define IMAGE_ID                            SIGNATURE_64('S', 'N', 'D', 'E', 'V', 'B', 'O', 'X')
 #define IMAGE_ID_STRING                     L"Socionext Developer Box"
diff --git a/Silicon/Socionext/SynQuacer/SynQuacer.dec b/Silicon/Socionext/SynQuacer/SynQuacer.dec
index eb4fc4ace2f7..ccaf80def06b 100644
--- a/Silicon/Socionext/SynQuacer/SynQuacer.dec
+++ b/Silicon/Socionext/SynQuacer/SynQuacer.dec
@@ -44,6 +44,9 @@ [PcdsFixedAtBuild]
 
   gSynQuacerTokenSpaceGuid.PcdI2cReferenceClock|62500000|UINT32|0x00000005
 
+  # for capsule update
+  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion|1|UINT32|0x00000009
+
 [PcdsPatchableInModule, PcdsDynamic]
   # Enable both RC #0 and RC #1 by default
   gSynQuacerTokenSpaceGuid.PcdPcieEnableMask|0x3|UINT8|0x00000007
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 5/6] TEMPORARY
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
                   ` (3 preceding siblings ...)
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 6/6] Platform/Socionext/DeveloperBox: add SCP firmware image to capsule Ard Biesheuvel
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

Needed to make change to capsule footprint installable via capsule update.
Will be reverted in next patch, and will be squashed together before
going upstream.
---
 Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c              | 4 ++--
 Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
index 816d8ba33f8c..cd6ab582fdc5 100644
--- a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
+++ b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
@@ -23,8 +23,8 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
   {
     // UEFI code region
     SYNQUACER_SPI_NOR_BASE,                             // device base
-    FixedPcdGet64 (PcdFdBaseAddress),                   // region base
-    FixedPcdGet32 (PcdFdSize),                          // region size
+    0x8100000, //FixedPcdGet64 (PcdFdBaseAddress),                   // region base
+    0x300000, //FixedPcdGet32 (PcdFdSize),                          // region size
     SIZE_64KB,                                          // block size
     {
       0x19c118b0, 0xc423, 0x42be, { 0xb8, 0x0f, 0x70, 0x6f, 0x1f, 0xcb, 0x59, 0x9a }
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
index 1402ecafce4a..963d568e43df 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
@@ -57,8 +57,8 @@ STATIC CONST EFI_RESOURCE_ATTRIBUTE_TYPE mDramResourceAttributes =
 
 STATIC CONST ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable[] = {
   // Memory mapped SPI NOR flash
-  ARM_CACHED_DEVICE_REGION (FixedPcdGet64 (PcdFdBaseAddress),
-                            FixedPcdGet32 (PcdFdSize)),
+  ARM_CACHED_DEVICE_REGION (0x8100000,//FixedPcdGet64 (PcdFdBaseAddress),
+                            0x300000),//FixedPcdGet32 (PcdFdSize)),
 
   // SynQuacer OnChip peripherals
   ARM_DEVICE_REGION (SYNQUACER_PERIPHERALS_BASE,
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [RFC PATCH edk2-platforms 6/6] Platform/Socionext/DeveloperBox: add SCP firmware image to capsule
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
                   ` (4 preceding siblings ...)
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 5/6] TEMPORARY Ard Biesheuvel
@ 2018-03-16 16:13 ` Ard Biesheuvel
  2018-05-31  6:04 ` [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
  2018-06-01  9:51 ` Leif Lindholm
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-16 16:13 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, Ard Biesheuvel

Modify the .FDF definitions describing the Flash Device and the
capsule payload so that the SCP firmware can be updated along with
the ARM Trusted Firmware and EDK2 code.

Note that this does not increase the likelihood some kind of recovery
is needed when a capsule update fails: the NOR layout has been updated
to allow the serial flasher to execute even if the SCP firmware has
been corrupted, and a failed flash of just UEFI already requires such
recovery anyway.

Since this constitutes a backward incompatible changes as far as
capsule update is concerned, add a provision for setting the minimum
supported firmware version via the build command line.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc                                          |  3 +++
 Platform/Socionext/DeveloperBox/DeveloperBox.fdf                                          | 15 +++++++++------
 Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini |  4 ++--
 Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c              |  4 ++--
 Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c |  4 ++--
 5 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
index 538488253d9b..af2930bcbba5 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
@@ -29,6 +29,7 @@ [Defines]
   BUILD_NUMBER                   = 1
 
   DEFINE DO_X86EMU               = FALSE
+  DEFINE MIN_BUILD_NUMBER        = 1
 
 [BuildOptions]
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
@@ -404,6 +405,8 @@ [PcdsFixedAtBuild.common]
 !endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision|$(BUILD_NUMBER)
 
+  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion|$(MIN_BUILD_NUMBER)
+
   #
   # 96boards mezzanine support
   #
diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
index ddd9757201aa..b2de8a2255c9 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
@@ -26,13 +26,13 @@
 ################################################################################
 
 [FD.SPI_NOR_IMAGE]
-BaseAddress   = 0x08180000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in NOR Flash.
-Size          = 0x00280000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device
+BaseAddress   = 0x08100000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in NOR Flash.
+Size          = 0x00300000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device
 ErasePolarity = 1
 
 # This one is tricky, it must be: BlockSize * NumBlocks = Size
 BlockSize     = 0x00010000
-NumBlocks     = 0x28
+NumBlocks     = 0x30
 
 ################################################################################
 #
@@ -50,13 +50,16 @@ [FD.SPI_NOR_IMAGE]
 #
 ################################################################################
 
-0x00000000|0x00078000
+0x00000000|0x00080000
+FILE = Platform/Socionext/DeveloperBox/scp_firmware.bin
+
+0x00080000|0x00078000
 FILE = Platform/Socionext/DeveloperBox/fip_all_arm_tf.bin
 
-0x00078000|0x00008000
+0x000f8000|0x00008000
 FILE = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/$(ARCH)/Silicon/Socionext/SynQuacer/Stage2Tables/Stage2Tables/OUTPUT/Stage2Tables.bin
 
-0x00080000|0x00200000
+0x00100000|0x00200000
 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
 FV = FVMAIN_COMPACT
 
diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini b/Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini
index 1f77aeab5049..32b342bd0a1b 100644
--- a/Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini
+++ b/Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini
@@ -19,7 +19,7 @@ Update0 = SynQuacerFvMain
 [SynQuacerFvMain]
 FirmwareType  = 0             # SystemFirmware
 AddressType   = 1             # 0 - relative address, 1 - absolute address.
-BaseAddress   = 0x08180000    # Base address offset on flash
-Length        = 0x00240000    # Length
+BaseAddress   = 0x08100000    # Base address offset on flash
+Length        = 0x00300000    # Length
 ImageOffset   = 0x00000000    # Image offset of this SystemFirmware image
 FileGuid      = e99b89f7-c120-4b25-4db1-8394edb0b4f5  # PcdEdkiiSystemFirmwareFileGuid
diff --git a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
index cd6ab582fdc5..816d8ba33f8c 100644
--- a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
+++ b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
@@ -23,8 +23,8 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
   {
     // UEFI code region
     SYNQUACER_SPI_NOR_BASE,                             // device base
-    0x8100000, //FixedPcdGet64 (PcdFdBaseAddress),                   // region base
-    0x300000, //FixedPcdGet32 (PcdFdSize),                          // region size
+    FixedPcdGet64 (PcdFdBaseAddress),                   // region base
+    FixedPcdGet32 (PcdFdSize),                          // region size
     SIZE_64KB,                                          // block size
     {
       0x19c118b0, 0xc423, 0x42be, { 0xb8, 0x0f, 0x70, 0x6f, 0x1f, 0xcb, 0x59, 0x9a }
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
index 963d568e43df..1402ecafce4a 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerMemoryInitPeiLib/SynQuacerMemoryInitPeiLib.c
@@ -57,8 +57,8 @@ STATIC CONST EFI_RESOURCE_ATTRIBUTE_TYPE mDramResourceAttributes =
 
 STATIC CONST ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable[] = {
   // Memory mapped SPI NOR flash
-  ARM_CACHED_DEVICE_REGION (0x8100000,//FixedPcdGet64 (PcdFdBaseAddress),
-                            0x300000),//FixedPcdGet32 (PcdFdSize)),
+  ARM_CACHED_DEVICE_REGION (FixedPcdGet64 (PcdFdBaseAddress),
+                            FixedPcdGet32 (PcdFdSize)),
 
   // SynQuacer OnChip peripherals
   ARM_DEVICE_REGION (SYNQUACER_PERIPHERALS_BASE,
-- 
2.15.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable Ard Biesheuvel
@ 2018-03-19  8:12   ` Leif Lindholm
  2018-03-19  8:18     ` Ard Biesheuvel
  0 siblings, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2018-03-19  8:12 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel

On Fri, Mar 16, 2018 at 04:13:20PM +0000, Ard Biesheuvel wrote:
> Allow the lowest supported firmware version to be configured by PCD
> so that each platform can set it individually.

Is there a case for adding this PCD to MdeModulePkg?

/
    Leif

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf       | 2 ++
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc | 2 +-
>  Silicon/Socionext/SynQuacer/SynQuacer.dec                                                   | 3 +++
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
> index 95a5e482a713..db0c9c43b2e5 100644
> --- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
> @@ -29,6 +29,7 @@ [Packages]
>    MdeModulePkg/MdeModulePkg.dec
>    MdePkg/MdePkg.dec
>    SignedCapsulePkg/SignedCapsulePkg.dec
> +  Silicon/Socionext/SynQuacer/SynQuacer.dec
>  
>  [LibraryClasses]
>    DebugLib
> @@ -39,6 +40,7 @@ [LibraryClasses]
>  [FixedPcd]
>    gArmTokenSpaceGuid.PcdFdSize
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
> +  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion
>  
>  [Pcd]
>    gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor
> diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
> index fb69de078313..12a56315a5ab 100644
> --- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
> @@ -25,7 +25,7 @@
>  #define BUILD_STRING(x)                     L"build #" __BUILD_STRING(x)
>  #define CURRENT_FIRMWARE_VERSION            FixedPcdGet32 (PcdFirmwareRevision)
>  #define CURRENT_FIRMWARE_VERSION_STRING     BUILD_STRING (FixedPcdGet32 (PcdFirmwareRevision))
> -#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x00000001
> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION   FixedPcdGet32 (PcdLowestSupportedFirmwareVersion)
>  
>  #define IMAGE_ID                            SIGNATURE_64('S', 'N', 'D', 'E', 'V', 'B', 'O', 'X')
>  #define IMAGE_ID_STRING                     L"Socionext Developer Box"
> diff --git a/Silicon/Socionext/SynQuacer/SynQuacer.dec b/Silicon/Socionext/SynQuacer/SynQuacer.dec
> index eb4fc4ace2f7..ccaf80def06b 100644
> --- a/Silicon/Socionext/SynQuacer/SynQuacer.dec
> +++ b/Silicon/Socionext/SynQuacer/SynQuacer.dec
> @@ -44,6 +44,9 @@ [PcdsFixedAtBuild]
>  
>    gSynQuacerTokenSpaceGuid.PcdI2cReferenceClock|62500000|UINT32|0x00000005
>  
> +  # for capsule update
> +  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion|1|UINT32|0x00000009
> +
>  [PcdsPatchableInModule, PcdsDynamic]
>    # Enable both RC #0 and RC #1 by default
>    gSynQuacerTokenSpaceGuid.PcdPcieEnableMask|0x3|UINT8|0x00000007
> -- 
> 2.15.1
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable
  2018-03-19  8:12   ` Leif Lindholm
@ 2018-03-19  8:18     ` Ard Biesheuvel
  2018-03-19  9:17       ` Zeng, Star
  0 siblings, 1 reply; 13+ messages in thread
From: Ard Biesheuvel @ 2018-03-19  8:18 UTC (permalink / raw)
  To: Leif Lindholm, Zeng, Star, Ruiyu Ni, Eric Dong; +Cc: edk2-devel@lists.01.org

On 19 March 2018 at 16:12, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Fri, Mar 16, 2018 at 04:13:20PM +0000, Ard Biesheuvel wrote:
>> Allow the lowest supported firmware version to be configured by PCD
>> so that each platform can set it individually.
>
> Is there a case for adding this PCD to MdeModulePkg?
>

Given that generic Capsule support is implemented there, I agree this
should probably be added to MdeModulePkg instead.



>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf       | 2 ++
>>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc | 2 +-
>>  Silicon/Socionext/SynQuacer/SynQuacer.dec                                                   | 3 +++
>>  3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>> index 95a5e482a713..db0c9c43b2e5 100644
>> --- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf
>> @@ -29,6 +29,7 @@ [Packages]
>>    MdeModulePkg/MdeModulePkg.dec
>>    MdePkg/MdePkg.dec
>>    SignedCapsulePkg/SignedCapsulePkg.dec
>> +  Silicon/Socionext/SynQuacer/SynQuacer.dec
>>
>>  [LibraryClasses]
>>    DebugLib
>> @@ -39,6 +40,7 @@ [LibraryClasses]
>>  [FixedPcd]
>>    gArmTokenSpaceGuid.PcdFdSize
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
>> +  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion
>>
>>  [Pcd]
>>    gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor
>> diff --git a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
>> index fb69de078313..12a56315a5ab 100644
>> --- a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
>> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc
>> @@ -25,7 +25,7 @@
>>  #define BUILD_STRING(x)                     L"build #" __BUILD_STRING(x)
>>  #define CURRENT_FIRMWARE_VERSION            FixedPcdGet32 (PcdFirmwareRevision)
>>  #define CURRENT_FIRMWARE_VERSION_STRING     BUILD_STRING (FixedPcdGet32 (PcdFirmwareRevision))
>> -#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x00000001
>> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION   FixedPcdGet32 (PcdLowestSupportedFirmwareVersion)
>>
>>  #define IMAGE_ID                            SIGNATURE_64('S', 'N', 'D', 'E', 'V', 'B', 'O', 'X')
>>  #define IMAGE_ID_STRING                     L"Socionext Developer Box"
>> diff --git a/Silicon/Socionext/SynQuacer/SynQuacer.dec b/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> index eb4fc4ace2f7..ccaf80def06b 100644
>> --- a/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> +++ b/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> @@ -44,6 +44,9 @@ [PcdsFixedAtBuild]
>>
>>    gSynQuacerTokenSpaceGuid.PcdI2cReferenceClock|62500000|UINT32|0x00000005
>>
>> +  # for capsule update
>> +  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion|1|UINT32|0x00000009
>> +
>>  [PcdsPatchableInModule, PcdsDynamic]
>>    # Enable both RC #0 and RC #1 by default
>>    gSynQuacerTokenSpaceGuid.PcdPcieEnableMask|0x3|UINT8|0x00000007
>> --
>> 2.15.1
>>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable
  2018-03-19  8:18     ` Ard Biesheuvel
@ 2018-03-19  9:17       ` Zeng, Star
  0 siblings, 0 replies; 13+ messages in thread
From: Zeng, Star @ 2018-03-19  9:17 UTC (permalink / raw)
  To: Ard Biesheuvel, Leif Lindholm, Yao, Jiewen, Ni, Ruiyu, Dong, Eric
  Cc: edk2-devel@lists.01.org, Zeng, Star

It is to be used to fill the structure with EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR type, right?
EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR is defined in SignedCapsulePkg.
Is it better to define this PCD in SignedCapsulePkg if needed?


Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
Sent: Monday, March 19, 2018 4:19 PM
To: Leif Lindholm <leif.lindholm@linaro.org>; Zeng, Star <star.zeng@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Dong, Eric <eric.dong@intel.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable

On 19 March 2018 at 16:12, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Fri, Mar 16, 2018 at 04:13:20PM +0000, Ard Biesheuvel wrote:
>> Allow the lowest supported firmware version to be configured by PCD 
>> so that each platform can set it individually.
>
> Is there a case for adding this PCD to MdeModulePkg?
>

Given that generic Capsule support is implemented there, I agree this should probably be added to MdeModulePkg instead.



>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf       | 2 ++
>>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc | 2 +-
>>  Silicon/Socionext/SynQuacer/SynQuacer.dec                                                   | 3 +++
>>  3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git 
>> a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptor.inf 
>> b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptor.inf index 95a5e482a713..db0c9c43b2e5 100644
>> --- 
>> a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptor.inf
>> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/System
>> +++ FirmwareDescriptor.inf
>> @@ -29,6 +29,7 @@ [Packages]
>>    MdeModulePkg/MdeModulePkg.dec
>>    MdePkg/MdePkg.dec
>>    SignedCapsulePkg/SignedCapsulePkg.dec
>> +  Silicon/Socionext/SynQuacer/SynQuacer.dec
>>
>>  [LibraryClasses]
>>    DebugLib
>> @@ -39,6 +40,7 @@ [LibraryClasses]
>>  [FixedPcd]
>>    gArmTokenSpaceGuid.PcdFdSize
>>    gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
>> +  gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion
>>
>>  [Pcd]
>>    
>> gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescrip
>> tor diff --git 
>> a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptorTable.aslc 
>> b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptorTable.aslc index fb69de078313..12a56315a5ab 100644
>> --- 
>> a/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirm
>> wareDescriptorTable.aslc
>> +++ b/Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/System
>> +++ FirmwareDescriptorTable.aslc
>> @@ -25,7 +25,7 @@
>>  #define BUILD_STRING(x)                     L"build #" __BUILD_STRING(x)
>>  #define CURRENT_FIRMWARE_VERSION            FixedPcdGet32 (PcdFirmwareRevision)
>>  #define CURRENT_FIRMWARE_VERSION_STRING     BUILD_STRING (FixedPcdGet32 (PcdFirmwareRevision))
>> -#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x00000001
>> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION   FixedPcdGet32 (PcdLowestSupportedFirmwareVersion)
>>
>>  #define IMAGE_ID                            SIGNATURE_64('S', 'N', 'D', 'E', 'V', 'B', 'O', 'X')
>>  #define IMAGE_ID_STRING                     L"Socionext Developer Box"
>> diff --git a/Silicon/Socionext/SynQuacer/SynQuacer.dec 
>> b/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> index eb4fc4ace2f7..ccaf80def06b 100644
>> --- a/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> +++ b/Silicon/Socionext/SynQuacer/SynQuacer.dec
>> @@ -44,6 +44,9 @@ [PcdsFixedAtBuild]
>>
>>    
>> gSynQuacerTokenSpaceGuid.PcdI2cReferenceClock|62500000|UINT32|0x00000
>> 005
>>
>> +  # for capsule update
>> +  
>> + gSynQuacerTokenSpaceGuid.PcdLowestSupportedFirmwareVersion|1|UINT32
>> + |0x00000009
>> +
>>  [PcdsPatchableInModule, PcdsDynamic]
>>    # Enable both RC #0 and RC #1 by default
>>    gSynQuacerTokenSpaceGuid.PcdPcieEnableMask|0x3|UINT8|0x00000007
>> --
>> 2.15.1
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
                   ` (5 preceding siblings ...)
  2018-03-16 16:13 ` [RFC PATCH edk2-platforms 6/6] Platform/Socionext/DeveloperBox: add SCP firmware image to capsule Ard Biesheuvel
@ 2018-05-31  6:04 ` Ard Biesheuvel
  2018-06-01  9:51 ` Leif Lindholm
  7 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-05-31  6:04 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Leif Lindholm, Ard Biesheuvel

On 16 March 2018 at 17:13, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> Now that the NOR flash layout has been updated to split the actual SCP
> firmware from the startup code and the builtin flasher, we can add the
> SCP image to the capsule update to make it field upgradeable.
>
> This involves some rather nasty plumbing, since making changes to capsule
> update installable via capsule update requires some additional care.
>
> Patch #1 fixes a bug in the FVB handling code of the flash access library.
>
> Patch #2 addresses an issue where we accidentally started to dereference
> arbitrary data as an FV header by incorporating the secure firmware binary
> into the flash device.
>
> Patch #3 is an optimization that speeds up flashing of sparse capsules.
>
> Patch #4 adds a PCD that holds the minimum firmware version that is allowed
> by a platform. We will use this to ensure that systems using the new layout
> cannot be flashed using older capsules, which is unlikely to work in any
> case, but not guaranteed to fail in a harmless manner.
>
> Patch #5 is a temporary hack we will need to use to build capsules that
> allow upgrading from the old layout to the new layout
>
> Patch #6 implements the new layout, and adds support to set the minimum
> version on the build command line.
>
> Ard Biesheuvel (6):
>   Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB
>     found
>   Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header
>     fields
>   Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks
>   Silicon/SynQuacer: make lowest supported f/w version PCD configurable
>   TEMPORARY
>   Platform/Socionext/DeveloperBox: add SCP firmware image to capsule
>
>  Platform/Socionext/DeveloperBox/DeveloperBox.dsc                                                      |  3 ++
>  Platform/Socionext/DeveloperBox/DeveloperBox.fdf                                                      | 15 ++++---
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf                 |  2 +
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc           |  2 +-
>  Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini             |  4 +-
>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 46 ++++++++++++++++----
>  Silicon/Socionext/SynQuacer/SynQuacer.dec                                                             |  3 ++
>  7 files changed, 58 insertions(+), 17 deletions(-)
>

Ping?


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware
  2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
                   ` (6 preceding siblings ...)
  2018-05-31  6:04 ` [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
@ 2018-06-01  9:51 ` Leif Lindholm
  2018-06-01  9:59   ` Ard Biesheuvel
  7 siblings, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2018-06-01  9:51 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel

On Fri, Mar 16, 2018 at 04:13:16PM +0000, Ard Biesheuvel wrote:
> Now that the NOR flash layout has been updated to split the actual SCP
> firmware from the startup code and the builtin flasher, we can add the
> SCP image to the capsule update to make it field upgradeable.
> 
> This involves some rather nasty plumbing, since making changes to capsule
> update installable via capsule update requires some additional care.
> 
> Patch #1 fixes a bug in the FVB handling code of the flash access library.
> 
> Patch #2 addresses an issue where we accidentally started to dereference
> arbitrary data as an FV header by incorporating the secure firmware binary
> into the flash device.
> 
> Patch #3 is an optimization that speeds up flashing of sparse capsules.
> 
> Patch #4 adds a PCD that holds the minimum firmware version that is allowed
> by a platform. We will use this to ensure that systems using the new layout
> cannot be flashed using older capsules, which is unlikely to work in any
> case, but not guaranteed to fail in a harmless manner.
> 
> Patch #5 is a temporary hack we will need to use to build capsules that
> allow upgrading from the old layout to the new layout
> 
> Patch #6 implements the new layout, and adds support to set the minimum
> version on the build command line.
> 
> Ard Biesheuvel (6):
>   Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB
>     found
>   Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header
>     fields
>   Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks
>   Silicon/SynQuacer: make lowest supported f/w version PCD configurable
>   TEMPORARY
>   Platform/Socionext/DeveloperBox: add SCP firmware image to capsule

I have a few comments on the 5/6 layout thing, but apart from that I'm
happy with the series. I guess 4 doesn't make much sense before we're
ready to include the SCP firmware in the build.
But still - for 1-4/6:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Feel free to push as many or as few of those as you like.

>  Platform/Socionext/DeveloperBox/DeveloperBox.dsc                                                      |  3 ++
>  Platform/Socionext/DeveloperBox/DeveloperBox.fdf                                                      | 15 ++++---
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptor.inf                 |  2 +
>  Platform/Socionext/DeveloperBox/SystemFirmwareDescriptor/SystemFirmwareDescriptorTable.aslc           |  2 +-
>  Platform/Socionext/DeveloperBox/SystemFirmwareUpdateConfig/SystemFirmwareUpdateConfig.ini             |  4 +-
>  Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 46 ++++++++++++++++----
>  Silicon/Socionext/SynQuacer/SynQuacer.dec                                                             |  3 ++
>  7 files changed, 58 insertions(+), 17 deletions(-)
> 
> -- 
> 2.15.1
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware
  2018-06-01  9:51 ` Leif Lindholm
@ 2018-06-01  9:59   ` Ard Biesheuvel
  0 siblings, 0 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2018-06-01  9:59 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel@lists.01.org

On 1 June 2018 at 11:51, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Fri, Mar 16, 2018 at 04:13:16PM +0000, Ard Biesheuvel wrote:
>> Now that the NOR flash layout has been updated to split the actual SCP
>> firmware from the startup code and the builtin flasher, we can add the
>> SCP image to the capsule update to make it field upgradeable.
>>
>> This involves some rather nasty plumbing, since making changes to capsule
>> update installable via capsule update requires some additional care.
>>
>> Patch #1 fixes a bug in the FVB handling code of the flash access library.
>>
>> Patch #2 addresses an issue where we accidentally started to dereference
>> arbitrary data as an FV header by incorporating the secure firmware binary
>> into the flash device.
>>
>> Patch #3 is an optimization that speeds up flashing of sparse capsules.
>>
>> Patch #4 adds a PCD that holds the minimum firmware version that is allowed
>> by a platform. We will use this to ensure that systems using the new layout
>> cannot be flashed using older capsules, which is unlikely to work in any
>> case, but not guaranteed to fail in a harmless manner.
>>
>> Patch #5 is a temporary hack we will need to use to build capsules that
>> allow upgrading from the old layout to the new layout
>>
>> Patch #6 implements the new layout, and adds support to set the minimum
>> version on the build command line.
>>
>> Ard Biesheuvel (6):
>>   Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB
>>     found
>>   Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header
>>     fields
>>   Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks
>>   Silicon/SynQuacer: make lowest supported f/w version PCD configurable
>>   TEMPORARY
>>   Platform/Socionext/DeveloperBox: add SCP firmware image to capsule
>
> I have a few comments on the 5/6 layout thing, but apart from that I'm
> happy with the series. I guess 4 doesn't make much sense before we're
> ready to include the SCP firmware in the build.
> But still - for 1-4/6:
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
> Feel free to push as many or as few of those as you like.
>

Thanks

#1 - #3 pushed as c9be7b11ea10..e45ae44ec07e

#4 will be updated to use PcdLowestSupportedFirmwareVersion from
SignedCapsulePkg, and that patch is still under review.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-06-01  9:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-16 16:13 [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found Ard Biesheuvel
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 2/6] Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header fields Ard Biesheuvel
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 3/6] Silicon/SynQuacerPlatformFlashAccessLib: skip empty blocks Ard Biesheuvel
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 4/6] Silicon/SynQuacer: make lowest supported f/w version PCD configurable Ard Biesheuvel
2018-03-19  8:12   ` Leif Lindholm
2018-03-19  8:18     ` Ard Biesheuvel
2018-03-19  9:17       ` Zeng, Star
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 5/6] TEMPORARY Ard Biesheuvel
2018-03-16 16:13 ` [RFC PATCH edk2-platforms 6/6] Platform/Socionext/DeveloperBox: add SCP firmware image to capsule Ard Biesheuvel
2018-05-31  6:04 ` [RFC PATCH edk2-platforms 0/6] expand capsule to include SCP firmware Ard Biesheuvel
2018-06-01  9:51 ` Leif Lindholm
2018-06-01  9:59   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox