public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: chinni.b.duggapu@intel.com
To: devel@edk2.groups.io
Cc: cbduggap <chinni.b.duggapu@intel.com>
Subject: [Patch V1 1/1] \Silicon\Intel\Tools\FitGen: Add extra parameter to the Fit Gen Tool to input the Higher Flash Address
Date: Tue, 22 Sep 2020 14:38:24 +0530	[thread overview]
Message-ID: <20200922090824.3605-1-chinni.b.duggapu@intel.com> (raw)

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2981

Add extra parameter to the Fit Gen Tool to input the Higher Address.
Default Address should be 4GB and if some one inputs new address,
tool must consume that address instead of Default address (4GB).

Signed-off-by: cbduggap <chinni.b.duggapu@intel.com>
---
 Silicon/Intel/Tools/FitGen/FitGen.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c b/Silicon/Intel/Tools/FitGen/FitGen.c
index c4006e69c8..c17a0fabc0 100644
--- a/Silicon/Intel/Tools/FitGen/FitGen.c
+++ b/Silicon/Intel/Tools/FitGen/FitGen.c
@@ -209,10 +209,12 @@ typedef struct {
 #define DEFAULT_FIT_TABLE_POINTER_OFFSET  0x40
 #define DEFAULT_FIT_ENTRY_VERSION         0x0100
 
+#define HIGHER_FLASH_ADDRESS  (gFitTableContext.HigherAddressRemapValue)
+
 #define MEMORY_TO_FLASH(FileBuffer, FvBuffer, FvSize)  \
-                 (UINTN)(0x100000000 - ((UINTN)(FvBuffer) + (UINTN)(FvSize) - (UINTN)(FileBuffer)))
+                 (UINTN)(HIGHER_FLASH_ADDRESS - ((UINTN)(FvBuffer) + (UINTN)(FvSize) - (UINTN)(FileBuffer)))
 #define FLASH_TO_MEMORY(Address, FvBuffer, FvSize)  \
-                 (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (0x100000000 - (UINTN)(Address)))
+                 (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (HIGHER_FLASH_ADDRESS - (UINTN)(Address)))
 
 #define FIT_TABLE_TYPE_HEADER                 0
 #define FIT_TABLE_TYPE_MICROCODE              1
@@ -268,6 +270,7 @@ typedef struct {
   UINT32                     MicrocodeVersion;
   FIT_TABLE_CONTEXT_ENTRY    OptionalModule[MAX_OPTIONAL_ENTRY];
   FIT_TABLE_CONTEXT_ENTRY    PortModule[MAX_PORT_ENTRY];
+  UINT64                      HigherAddressRemapValue;
 } FIT_TABLE_CONTEXT;
 
 FIT_TABLE_CONTEXT   gFitTableContext = {0};
@@ -330,6 +333,7 @@ Returns:
           "\t[-F <FitTablePointerOffset>] [-F <FitTablePointerOffset>] [-V <FitHeaderVersion>]\n"
           "\t[-NA]\n"
           "\t[-A <MicrocodeAlignment>]\n"
+           "\t[-REMAP <FlashHigherAddress>\n"
           "\t[-CLEAR]\n"
           "\t[-L <MicrocodeSlotSize> <MicrocodeFfsGuid>]\n"
           "\t[-I <BiosInfoGuid>]\n"
@@ -986,6 +990,21 @@ Returns:
     Index += 2;
   }
 
+  if ((Index >= argc) ||
+      ((strcmp (argv[Index], "-REMAP") == 0) ||
+       (strcmp (argv[Index], "-remap") == 0)) ) {
+    //
+    // by pass
+    //
+    gFitTableContext.HigherAddressRemapValue = xtoi (argv[Index + 1]);
+    Index += 2;
+  } else {
+    //
+    // no remapping
+    //
+    gFitTableContext.HigherAddressRemapValue = 0x100000000;
+  }
+  printf ("Higher Address Value : 0x%llx\n", gFitTableContext.HigherAddressRemapValue);
   //
   // 0.4 Clear FIT table related memory
   //
-- 
2.26.2.windows.1


             reply	other threads:[~2020-09-22  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  9:08 chinni.b.duggapu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-22 10:36 [Patch V1 1/1] \Silicon\Intel\Tools\FitGen: Add extra parameter to the Fit Gen Tool to input the Higher Flash Address cbduggap
2020-09-30  5:25 cbduggap
2020-09-30  5:48 cbduggap
2020-10-05 14:13 cbduggap

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=20200922090824.3605-1-chinni.b.duggapu@intel.com \
    --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