* [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. @ 2019-05-29 14:33 Chiu, Chasel 2019-05-29 15:19 ` Zeng, Star 0 siblings, 1 reply; 3+ messages in thread From: Chiu, Chasel @ 2019-05-29 14:33 UTC (permalink / raw) To: devel; +Cc: Maurice Ma, Nate DeSimone, Star Zeng REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1308 Support rebasing FSP 1.X binary. Test: both FSP 2.X (Kabylake) and FSP 1.X (BroadwellDE) binary can be rebased successfully. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> --- IntelFsp2Pkg/Tools/SplitFspBin.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/SplitFspBin.py index 2458231d09..15c8bebee2 100644 --- a/IntelFsp2Pkg/Tools/SplitFspBin.py +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py @@ -1,6 +1,6 @@ ## @ FspTool.py # -# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 +14,12 @@ import argparse from ctypes import * """ -This utility supports some operations for Intel FSP 2.0 image. +This utility supports some operations for Intel FSP 1.x/2.x image. It supports: - - Display FSP 2.0 information header - - Split FSP 2.0 image into individual FSP-T/M/S/O component - - Rebase FSP 2.0 components to a different base address - - Generate FSP mapping C header file + - Display FSP 1.x/2.x information header + - Split FSP 2.x image into individual FSP-T/M/S/O component + - Rebase FSP 1.x/2.x components to a different base address + - Generate FSP 1.x/2.x mapping C header file """ CopyRightHeaderFile = """/* @@ -500,8 +500,6 @@ class FirmwareDevice: fih = None for fsp in self.FspList: - if fsp.Fih.HeaderRevision < 3: - raise Exception("ERROR: FSP 1.x is not supported by this tool !") if not fih: fih = fsp.Fih else: @@ -713,6 +711,8 @@ def SplitFspBin (fspfile, outdir, nametemplate): fd.ParseFsp () for fsp in fd.FspList: + if fsp.Fih.HeaderRevision < 3: + raise Exception("ERROR: FSP 1.x is not supported by the split command !") ftype = fsp.Type if not nametemplate: nametemplate = fspfile @@ -742,6 +742,11 @@ def RebaseFspBin (FspBinary, FspComponent, FspBase, OutputDir, OutputFile): found = False for fsp in fd.FspList: + # Is this FSP 1.x single binary? + if fsp.Fih.HeaderRevision < 3: + found = True + ftype = 'X' + break ftype = fsp.Type.lower() if ftype == fspcomp: found = True -- 2.13.3.windows.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. 2019-05-29 14:33 [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary Chiu, Chasel @ 2019-05-29 15:19 ` Zeng, Star 2019-05-30 1:24 ` Chiu, Chasel 0 siblings, 1 reply; 3+ messages in thread From: Zeng, Star @ 2019-05-29 15:19 UTC (permalink / raw) To: Chiu, Chasel, devel@edk2.groups.io Cc: Ma, Maurice, Desimone, Nathaniel L, Zeng, Star Shouldn't the SplitFspBinUserManual.md also be updated? Thanks, Star > -----Original Message----- > From: Chiu, Chasel > Sent: Wednesday, May 29, 2019 10:33 PM > To: devel@edk2.groups.io > Cc: Ma, Maurice <maurice.ma@intel.com>; Desimone, Nathaniel L > <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1308 > > Support rebasing FSP 1.X binary. > > Test: both FSP 2.X (Kabylake) and FSP 1.X (BroadwellDE) binary > can be rebased successfully. > > Cc: Maurice Ma <maurice.ma@intel.com> > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> > Cc: Star Zeng <star.zeng@intel.com> > Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> > --- > IntelFsp2Pkg/Tools/SplitFspBin.py | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py > b/IntelFsp2Pkg/Tools/SplitFspBin.py > index 2458231d09..15c8bebee2 100644 > --- a/IntelFsp2Pkg/Tools/SplitFspBin.py > +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py > @@ -1,6 +1,6 @@ > ## @ FspTool.py > # > -# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR> > +# Copyright (c) 2015 - 2019, Intel Corporation. All rights > +reserved.<BR> > # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 +14,12 @@ > import argparse > from ctypes import * > > """ > -This utility supports some operations for Intel FSP 2.0 image. > +This utility supports some operations for Intel FSP 1.x/2.x image. > It supports: > - - Display FSP 2.0 information header > - - Split FSP 2.0 image into individual FSP-T/M/S/O component > - - Rebase FSP 2.0 components to a different base address > - - Generate FSP mapping C header file > + - Display FSP 1.x/2.x information header > + - Split FSP 2.x image into individual FSP-T/M/S/O component > + - Rebase FSP 1.x/2.x components to a different base address > + - Generate FSP 1.x/2.x mapping C header file > """ > > CopyRightHeaderFile = """/* > @@ -500,8 +500,6 @@ class FirmwareDevice: > > fih = None > for fsp in self.FspList: > - if fsp.Fih.HeaderRevision < 3: > - raise Exception("ERROR: FSP 1.x is not supported by this tool !") > if not fih: > fih = fsp.Fih > else: > @@ -713,6 +711,8 @@ def SplitFspBin (fspfile, outdir, nametemplate): > fd.ParseFsp () > > for fsp in fd.FspList: > + if fsp.Fih.HeaderRevision < 3: > + raise Exception("ERROR: FSP 1.x is not supported by the > + split command !") > ftype = fsp.Type > if not nametemplate: > nametemplate = fspfile > @@ -742,6 +742,11 @@ def RebaseFspBin (FspBinary, FspComponent, > FspBase, OutputDir, OutputFile): > > found = False > for fsp in fd.FspList: > + # Is this FSP 1.x single binary? > + if fsp.Fih.HeaderRevision < 3: > + found = True > + ftype = 'X' > + break > ftype = fsp.Type.lower() > if ftype == fspcomp: > found = True > -- > 2.13.3.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. 2019-05-29 15:19 ` Zeng, Star @ 2019-05-30 1:24 ` Chiu, Chasel 0 siblings, 0 replies; 3+ messages in thread From: Chiu, Chasel @ 2019-05-30 1:24 UTC (permalink / raw) To: Zeng, Star, devel@edk2.groups.io; +Cc: Ma, Maurice, Desimone, Nathaniel L Yes. I will update the document. Thanks! Chasel > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, May 29, 2019 11:20 PM > To: Chiu, Chasel <chasel.chiu@intel.com>; devel@edk2.groups.io > Cc: Ma, Maurice <maurice.ma@intel.com>; Desimone, Nathaniel L > <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com> > Subject: RE: [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. > > Shouldn't the SplitFspBinUserManual.md also be updated? > > > Thanks, > Star > > > -----Original Message----- > > From: Chiu, Chasel > > Sent: Wednesday, May 29, 2019 10:33 PM > > To: devel@edk2.groups.io > > Cc: Ma, Maurice <maurice.ma@intel.com>; Desimone, Nathaniel L > > <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com> > > Subject: [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1308 > > > > Support rebasing FSP 1.X binary. > > > > Test: both FSP 2.X (Kabylake) and FSP 1.X (BroadwellDE) binary > > can be rebased successfully. > > > > Cc: Maurice Ma <maurice.ma@intel.com> > > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> > > Cc: Star Zeng <star.zeng@intel.com> > > Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> > > --- > > IntelFsp2Pkg/Tools/SplitFspBin.py | 21 +++++++++++++-------- > > 1 file changed, 13 insertions(+), 8 deletions(-) > > > > diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py > > b/IntelFsp2Pkg/Tools/SplitFspBin.py > > index 2458231d09..15c8bebee2 100644 > > --- a/IntelFsp2Pkg/Tools/SplitFspBin.py > > +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py > > @@ -1,6 +1,6 @@ > > ## @ FspTool.py > > # > > -# Copyright (c) 2015 - 2018, Intel Corporation. All rights > > reserved.<BR> > > +# Copyright (c) 2015 - 2019, Intel Corporation. All rights > > +reserved.<BR> > > # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 > > +14,12 @@ import argparse > > from ctypes import * > > > > """ > > -This utility supports some operations for Intel FSP 2.0 image. > > +This utility supports some operations for Intel FSP 1.x/2.x image. > > It supports: > > - - Display FSP 2.0 information header > > - - Split FSP 2.0 image into individual FSP-T/M/S/O component > > - - Rebase FSP 2.0 components to a different base address > > - - Generate FSP mapping C header file > > + - Display FSP 1.x/2.x information header > > + - Split FSP 2.x image into individual FSP-T/M/S/O component > > + - Rebase FSP 1.x/2.x components to a different base address > > + - Generate FSP 1.x/2.x mapping C header file > > """ > > > > CopyRightHeaderFile = """/* > > @@ -500,8 +500,6 @@ class FirmwareDevice: > > > > fih = None > > for fsp in self.FspList: > > - if fsp.Fih.HeaderRevision < 3: > > - raise Exception("ERROR: FSP 1.x is not supported by this tool !") > > if not fih: > > fih = fsp.Fih > > else: > > @@ -713,6 +711,8 @@ def SplitFspBin (fspfile, outdir, nametemplate): > > fd.ParseFsp () > > > > for fsp in fd.FspList: > > + if fsp.Fih.HeaderRevision < 3: > > + raise Exception("ERROR: FSP 1.x is not supported by the > > + split command !") > > ftype = fsp.Type > > if not nametemplate: > > nametemplate = fspfile > > @@ -742,6 +742,11 @@ def RebaseFspBin (FspBinary, FspComponent, > > FspBase, OutputDir, OutputFile): > > > > found = False > > for fsp in fd.FspList: > > + # Is this FSP 1.x single binary? > > + if fsp.Fih.HeaderRevision < 3: > > + found = True > > + ftype = 'X' > > + break > > ftype = fsp.Type.lower() > > if ftype == fspcomp: > > found = True > > -- > > 2.13.3.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-30 1:24 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-05-29 14:33 [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary Chiu, Chasel 2019-05-29 15:19 ` Zeng, Star 2019-05-30 1:24 ` Chiu, Chasel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox