From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.10160.1602237748862021732 for ; Fri, 09 Oct 2020 03:02:29 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 09 Oct 2020 18:02:23 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'cbduggap'" , Cc: "'Bob Feng'" References: <20201005141309.12427-1-chinni.b.duggapu@intel.com> <20201005141309.12427-3-chinni.b.duggapu@intel.com> In-Reply-To: <20201005141309.12427-3-chinni.b.duggapu@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUGF0Y2ggVjUgMS8xXSBUb29sc1xGaXRHZW46IEFkZCBleHRyYSBwYXJhbWV0ZXIgdG8gaW5wdXQgdGhlIFRvcCBGbGFzaCBBZGRyZXNz?= Date: Fri, 9 Oct 2020 18:02:26 +0800 Message-ID: <002001d69e23$4a5d97e0$df18c7a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGZB7Pbmqx2olZ2nzmt+TRNFu3sEQG9aGLRqfxLcrA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: cbduggap > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA10=D4=C25=C8=D5 22:13 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: cbduggap ; Bob Feng > ; Liming Gao > =D6=F7=CC=E2: [Patch V5 1/1] Tools\FitGen: Add extra parameter to = input the Top Flash > Address >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2981 >=20 > 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). >=20 > Signed-off-by: cbduggap > Cc: Bob Feng > Cc: Liming Gao >=20 > Signed-off-by: cbduggap > --- > Silicon/Intel/Tools/FitGen/FitGen.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/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 >=20 > #define DEFAULT_FIT_ENTRY_VERSION 0x0100 >=20 >=20 >=20 > +#define TOP_FLASH_ADDRESS > (gFitTableContext.TopFlashAddressRemapValue) >=20 > + >=20 > #define MEMORY_TO_FLASH(FileBuffer, FvBuffer, FvSize) \ >=20 > - (UINTN)(0x100000000 - ((UINTN)(FvBuffer) + > (UINTN)(FvSize) - (UINTN)(FileBuffer))) >=20 > + (UINTN)(TOP_FLASH_ADDRESS - ((UINTN)(FvBuffer) + > (UINTN)(FvSize) - (UINTN)(FileBuffer))) >=20 > #define FLASH_TO_MEMORY(Address, FvBuffer, FvSize) \ >=20 > - (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) = - > (0x100000000 - (UINTN)(Address))) >=20 > + (VOID *)(UINTN)((UINTN)(FvBuffer) + (UINTN)(FvSize) = - > (TOP_FLASH_ADDRESS - (UINTN)(Address))) >=20 >=20 >=20 > #define FIT_TABLE_TYPE_HEADER 0 >=20 > #define FIT_TABLE_TYPE_MICROCODE 1 >=20 > @@ -268,6 +270,7 @@ typedef struct { > UINT32 MicrocodeVersion; >=20 > FIT_TABLE_CONTEXT_ENTRY > OptionalModule[MAX_OPTIONAL_ENTRY]; >=20 > FIT_TABLE_CONTEXT_ENTRY PortModule[MAX_PORT_ENTRY]; >=20 > + UINT64 TopFlashAddressRemapValue; >=20 > } FIT_TABLE_CONTEXT; >=20 >=20 >=20 > FIT_TABLE_CONTEXT gFitTableContext =3D {0}; >=20 > @@ -330,6 +333,7 @@ Returns: > "\t[-F ] [-F = ] [-V > ]\n" >=20 > "\t[-NA]\n" >=20 > "\t[-A ]\n" >=20 > + "\t[-REMAP \n" >=20 > "\t[-CLEAR]\n" >=20 > "\t[-L ]\n" >=20 > "\t[-I ]\n" >=20 > @@ -986,6 +990,21 @@ Returns: > Index +=3D 2; >=20 > } >=20 >=20 >=20 > + if ((Index >=3D argc) || >=20 > + ((strcmp (argv[Index], "-REMAP") =3D=3D 0) || >=20 > + (strcmp (argv[Index], "-remap") =3D=3D 0)) ) { >=20 > + // >=20 > + // by pass >=20 > + // >=20 > + gFitTableContext.TopFlashAddressRemapValue =3D xtoi (argv[Index + = 1]); >=20 > + Index +=3D 2; >=20 > + } else { >=20 > + // >=20 > + // no remapping >=20 > + // >=20 > + gFitTableContext.TopFlashAddressRemapValue =3D 0x100000000; >=20 > + } >=20 > + printf ("Top Flash Address Value : 0x%llx\n", > gFitTableContext.TopFlashAddressRemapValue); >=20 > // >=20 > // 0.4 Clear FIT table related memory >=20 > // >=20 > -- > 2.26.2.windows.1