public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms v2 2/2] Silicon/NorFlashSynQuacerLib: describe entire firmware region as FV
Date: Wed, 13 Jun 2018 18:28:26 +0200	[thread overview]
Message-ID: <20180613162826.19986-3-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20180613162826.19986-1-ard.biesheuvel@linaro.org>

In order to allow for more flexibility when updating parts of the
firmware via capsule update, expand the description of the code FV
to cover the entire 4 MB region at the base of the NOR flash.

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

diff --git a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
index 816d8ba33f8c..d44fe3e4e94c 100644
--- a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
+++ b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
@@ -19,12 +19,20 @@
 
 #include <Platform/MemoryMap.h>
 
+#define FW_CODE_REGION_BASE SYNQUACER_SPI_NOR_BASE
+#define FW_CODE_REGION_SIZE (FW_ENV_REGION_BASE - FW_CODE_REGION_BASE)
+
+#define FW_ENV_REGION_BASE  FixedPcdGet32 (PcdFlashNvStorageVariableBase)
+#define FW_ENV_REGION_SIZE  (FixedPcdGet32 (PcdFlashNvStorageVariableSize) + \
+                             FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + \
+                             FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize))
+
 STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
   {
     // UEFI code region
     SYNQUACER_SPI_NOR_BASE,                             // device base
-    FixedPcdGet64 (PcdFdBaseAddress),                   // region base
-    FixedPcdGet32 (PcdFdSize),                          // region size
+    FW_CODE_REGION_BASE,                                // region base
+    FW_CODE_REGION_SIZE,                                // region size
     SIZE_64KB,                                          // block size
     {
       0x19c118b0, 0xc423, 0x42be, { 0xb8, 0x0f, 0x70, 0x6f, 0x1f, 0xcb, 0x59, 0x9a }
@@ -33,10 +41,8 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
   {
     // Environment variable region
     SYNQUACER_SPI_NOR_BASE,                             // device base
-    FixedPcdGet32 (PcdFlashNvStorageVariableBase),      // region base
-    FixedPcdGet32 (PcdFlashNvStorageVariableSize) +
-    FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
-    FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize),      // region size
+    FW_ENV_REGION_BASE,                                 // region base
+    FW_ENV_REGION_SIZE,                                 // region size
     SIZE_64KB,                                          // block size
     {
       0x3105bd7a, 0x82c3, 0x486f, { 0xb1, 0x03, 0x1e, 0x09, 0x54, 0xec, 0x85, 0x75 }
-- 
2.17.1



  parent reply	other threads:[~2018-06-13 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 16:28 [PATCH edk2-platforms v2 0/2]DeveloperBox: prepare for expanding the capsule payload Ard Biesheuvel
2018-06-13 16:28 ` [PATCH edk2-platforms v2 1/2] Silicon/SynQuacerPlatformFlashAccessLib: relax FV address check Ard Biesheuvel
2018-06-13 16:28 ` Ard Biesheuvel [this message]
2018-06-13 18:56 ` [PATCH edk2-platforms v2 0/2]DeveloperBox: prepare for expanding the capsule payload Leif Lindholm
2018-06-15 10:51   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180613162826.19986-3-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox