From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.36168.1601907207481963261 for ; Mon, 05 Oct 2020 07:13:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: chinni.b.duggapu@intel.com) IronPort-SDR: nWZuIyv/M1rLVLhWEodZUkD4woIi5wa6x2GNSSL1kaDXqSlJyN4g+Cw0G3bxMP1oS/vlj7n8v8 FokBchq9qTyw== X-IronPort-AV: E=McAfee;i="6000,8403,9764"; a="164265958" X-IronPort-AV: E=Sophos;i="5.77,338,1596524400"; d="scan'208";a="164265958" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2020 07:13:25 -0700 IronPort-SDR: /o1dPs/Lwc4SncG14sor+zt3uAOGjQpQNf9qLDJ3HR0abtGYXc/vBI+D7AG1l04MyU1emCs238 TEYmDGow0+tA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,338,1596524400"; d="scan'208";a="459598780" Received: from cbduggap-desk.gar.corp.intel.com ([10.66.179.79]) by orsmga004.jf.intel.com with ESMTP; 05 Oct 2020 07:13:23 -0700 From: "cbduggap" To: devel@edk2.groups.io Cc: cbduggap , Bob Feng , Liming Gao Subject: [Patch V5 1/1] Tools\FitGen: Add extra parameter to input the Top Flash Address Date: Mon, 5 Oct 2020 19:43:09 +0530 Message-Id: <20201005141309.12427-3-chinni.b.duggapu@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20201005141309.12427-1-chinni.b.duggapu@intel.com> References: <20201005141309.12427-1-chinni.b.duggapu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2981 Add extra parameter to the Fit Gen Tool to input the Top Flash 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 Cc: Bob Feng Cc: Liming Gao Signed-off-by: cbduggap --- 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/FitG= en/FitGen.c index c4006e69c8..cb60a3c324 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=0D #define DEFAULT_FIT_ENTRY_VERSION 0x0100=0D =0D +#define TOP_FLASH_ADDRESS (gFitTableContext.TopFlashAddressRemapValue)=0D +=0D #define MEMORY_TO_FLASH(FileBuffer, FvBuffer, FvSize) \=0D - (UINTN)(0x100000000 - ((UINTN)(FvBuffer) + (UINTN)(FvSize= ) - (UINTN)(FileBuffer)))=0D + (UINTN)(TOP_FLASH_ADDRESS - ((UINTN)(FvBuffer) + (UINTN)(= FvSize) - (UINTN)(FileBuffer)))=0D #define FLASH_TO_MEMORY(Address, FvBuffer, FvSize) \=0D - (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (0x= 100000000 - (UINTN)(Address)))=0D + (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) - (TO= P_FLASH_ADDRESS - (UINTN)(Address)))=0D =0D #define FIT_TABLE_TYPE_HEADER 0=0D #define FIT_TABLE_TYPE_MICROCODE 1=0D @@ -268,6 +270,7 @@ typedef struct { UINT32 MicrocodeVersion;=0D FIT_TABLE_CONTEXT_ENTRY OptionalModule[MAX_OPTIONAL_ENTRY];=0D FIT_TABLE_CONTEXT_ENTRY PortModule[MAX_PORT_ENTRY];=0D + UINT64 TopFlashAddressRemapValue;=0D } FIT_TABLE_CONTEXT;=0D =0D FIT_TABLE_CONTEXT gFitTableContext =3D {0};=0D @@ -330,6 +333,7 @@ Returns: "\t[-F ] [-F ] [-V= ]\n"=0D "\t[-NA]\n"=0D "\t[-A ]\n"=0D + "\t[-REMAP \n"=0D "\t[-CLEAR]\n"=0D "\t[-L ]\n"=0D "\t[-I ]\n"=0D @@ -986,6 +990,21 @@ Returns: Index +=3D 2;=0D }=0D =0D + if ((Index >=3D argc) ||=0D + ((strcmp (argv[Index], "-REMAP") =3D=3D 0) ||=0D + (strcmp (argv[Index], "-remap") =3D=3D 0)) ) {=0D + //=0D + // by pass=0D + //=0D + gFitTableContext.TopFlashAddressRemapValue =3D xtoi (argv[Index + 1]);= =0D + Index +=3D 2;=0D + } else {=0D + //=0D + // no remapping=0D + //=0D + gFitTableContext.TopFlashAddressRemapValue =3D 0x100000000;=0D + }=0D + printf ("Top Flash Address Value : 0x%llx\n", gFitTableContext.TopFlashA= ddressRemapValue);=0D //=0D // 0.4 Clear FIT table related memory=0D //=0D --=20 2.26.2.windows.1