Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SplitFspBin.py: Revert FSP 1.x support.
Reviewed-by: Nate DeSimone -Original Message- From: devel@edk2.groups.io On Behalf Of Chiu, Chasel Sent: Friday, May 31, 2019 12:09 AM To: devel@edk2.groups.io Cc: Gao, Liming Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/SplitFspBin.py: Revert FSP 1.x support. This reverts commit: 591b8cb7f3d026d2fa4483c59f3d5fb14be181bf. Will submit again after freeze done. Cc: Liming Gao Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/Tools/SplitFspBin.py | 21 - IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md | 47 ++- 2 files changed, 30 insertions(+), 38 deletions(-) diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/SplitFspBin.py index 15c8bebee2..2458231d09 100644 --- a/IntelFsp2Pkg/Tools/SplitFspBin.py +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py @@ -1,6 +1,6 @@ ## @ FspTool.py # -# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2018, Intel Corporation. All rights +reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 +14,12 @@ import argparse from ctypes import * """ -This utility supports some operations for Intel FSP 1.x/2.x image. +This utility supports some operations for Intel FSP 2.0 image. It supports: -- 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 +- 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 """ CopyRightHeaderFile = """/* @@ -500,6 +500,8 @@ 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: @@ -711,8 +713,6 @@ 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,11 +742,6 @@ 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 diff --git a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md index 06d87bbb2e..064e0ac845 100644 --- a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md +++ b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md @@ -1,71 +1,68 @@ -# SplitFspBin.py is a python script to support some operations on Intel FSP 1.x/2.x image. +# SplitFspBin.py is a python script to support some operations on Intel FSP 2.0 image. It supports: -- Split Intel FSP 2.x image into individual FSP-T/M/S/O component +- Split Intel FSP 2.0 image into individual FSP-T/M/S/O component -- Rebase Intel FSP 1.x/2.x components to different base addresses +- Rebase Intel FSP 2.0 components to different base addresses -- Generate Intel FSP 1.x/2.x C header file +- Generate Intel FSP 2.0 C header file -- Display Intel FSP 1.x/2.x information header for each FSP component +- Display Intel FSP 2.0 information header for each FSP component -## Split Intel FSP 2.x image +## Split Intel FSP 2.0 image -FSP 1.x image is not supported by split command. -To split individual FSP component in Intel FSP 2.x image, the following +To split individual FSP component in Intel FSP 2.0 image, the following command can be used: **python SplitFspBin.py split [-h] -f FSPBINARY [-o OUTPUTDIR] [-n NAMETEMPLATE]** -For example: +For example: `python SplitFspBin.py split -f FSP.bin` It will create FSP_T.bin, FSP_M.bin and FSP_S.bin in current directory. -## Rebase Intel FSP 1.x/2.x components +## Rebase Intel FSP 2.0 components -To rebase one or multiple FSP components in Intel FSP 1.x/2.x image, the following +To rebase one or multiple FSP components in Intel FSP 2.0 image, the +following command can be used: **python SplitFspBin.py rebase [-h] -f FSPBINARY -c {t,m,s,o} [{t,m,s,o} ...] -b FSPBASE [FSPBASE ...] [-o OUTPUTDIR] [-n OUTPUTFILE]** -For example: +For example: - `python SplitFspBin.py rebase -f FSP.bin -c t -b 0xFFF0 -n FSP_new.bi
Re: [edk2-devel] [PATCH] IntelFsp2Pkg/SplitFspBin.py: Revert FSP 1.x support.
Reviewed-by: Liming Gao >-Original Message- >From: Chiu, Chasel >Sent: Friday, May 31, 2019 3:09 PM >To: devel@edk2.groups.io >Cc: Gao, Liming >Subject: [PATCH] IntelFsp2Pkg/SplitFspBin.py: Revert FSP 1.x support. > >This reverts commit: > 591b8cb7f3d026d2fa4483c59f3d5fb14be181bf. >Will submit again after freeze done. > >Cc: Liming Gao >Signed-off-by: Chasel Chiu >--- > IntelFsp2Pkg/Tools/SplitFspBin.py | 21 > - > IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md | 47 >++- > 2 files changed, 30 insertions(+), 38 deletions(-) > >diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py >b/IntelFsp2Pkg/Tools/SplitFspBin.py >index 15c8bebee2..2458231d09 100644 >--- a/IntelFsp2Pkg/Tools/SplitFspBin.py >+++ b/IntelFsp2Pkg/Tools/SplitFspBin.py >@@ -1,6 +1,6 @@ > ## @ FspTool.py > # >-# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. >+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved. > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > ## >@@ -14,12 +14,12 @@ import argparse > from ctypes import * > > """ >-This utility supports some operations for Intel FSP 1.x/2.x image. >+This utility supports some operations for Intel FSP 2.0 image. > It supports: >-- 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 >+- 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 > """ > > CopyRightHeaderFile = """/* >@@ -500,6 +500,8 @@ 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: >@@ -711,8 +713,6 @@ 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,11 +742,6 @@ 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 >diff --git a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md >b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md >index 06d87bbb2e..064e0ac845 100644 >--- a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md >+++ b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md >@@ -1,71 +1,68 @@ >-# SplitFspBin.py is a python script to support some operations on Intel FSP >1.x/2.x image. >+# SplitFspBin.py is a python script to support some operations on Intel FSP >2.0 image. > > It supports: > >-- Split Intel FSP 2.x image into individual FSP-T/M/S/O component >+- Split Intel FSP 2.0 image into individual FSP-T/M/S/O component > >-- Rebase Intel FSP 1.x/2.x components to different base addresses >+- Rebase Intel FSP 2.0 components to different base addresses > >-- Generate Intel FSP 1.x/2.x C header file >+- Generate Intel FSP 2.0 C header file > >-- Display Intel FSP 1.x/2.x information header for each FSP component >+- Display Intel FSP 2.0 information header for each FSP component > >-## Split Intel FSP 2.x image >+## Split Intel FSP 2.0 image > >-FSP 1.x image is not supported by split command. >-To split individual FSP component in Intel FSP 2.x image, the following >+To split individual FSP component in Intel FSP 2.0 image, the following > command can be used: > >**python SplitFspBin.py split [-h] -f FSPBINARY [-o OUTPUTDIR] [-n >NAMETEMPLATE]** > >-For example: >+For example: > >`python SplitFspBin.py split -f FSP.bin` > >It will create FSP_T.bin, FSP_M.bin and FSP_S.bin in current directory. > >-## Rebase Intel FSP 1.x/2.x components >+## Rebase Intel FSP 2.0 components > >-To rebase one or multiple FSP components in Intel FSP 1.x/2.x image, the >following >+To rebase one or multiple FSP components in Intel FSP 2.0 image, the >following > command can be used: > >**python SplitFspBin.py rebase [-h] -f FSPBINARY -c {t,m,s,o} [{t,m,s,o} > ...] - >b FSPBASE [FSPBASE ...] [-o OUTPUTDIR] [-n OUTPUTFILE]** > >-For example: >+For example: > >- `python SplitFspBin.py rebase -f FSP.bin -c t -b 0xFFF0 -n FSP_new.bin` >+ `python SplitFspBin.py re
[edk2-devel] [PATCH] IntelFsp2Pkg/SplitFspBin.py: Revert FSP 1.x support.
This reverts commit: 591b8cb7f3d026d2fa4483c59f3d5fb14be181bf. Will submit again after freeze done. Cc: Liming Gao Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/Tools/SplitFspBin.py | 21 - IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md | 47 ++- 2 files changed, 30 insertions(+), 38 deletions(-) diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/SplitFspBin.py index 15c8bebee2..2458231d09 100644 --- a/IntelFsp2Pkg/Tools/SplitFspBin.py +++ b/IntelFsp2Pkg/Tools/SplitFspBin.py @@ -1,6 +1,6 @@ ## @ FspTool.py # -# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. +# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 +14,12 @@ import argparse from ctypes import * """ -This utility supports some operations for Intel FSP 1.x/2.x image. +This utility supports some operations for Intel FSP 2.0 image. It supports: -- 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 +- 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 """ CopyRightHeaderFile = """/* @@ -500,6 +500,8 @@ 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: @@ -711,8 +713,6 @@ 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,11 +742,6 @@ 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 diff --git a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md index 06d87bbb2e..064e0ac845 100644 --- a/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md +++ b/IntelFsp2Pkg/Tools/UserManuals/SplitFspBinUserManual.md @@ -1,71 +1,68 @@ -# SplitFspBin.py is a python script to support some operations on Intel FSP 1.x/2.x image. +# SplitFspBin.py is a python script to support some operations on Intel FSP 2.0 image. It supports: -- Split Intel FSP 2.x image into individual FSP-T/M/S/O component +- Split Intel FSP 2.0 image into individual FSP-T/M/S/O component -- Rebase Intel FSP 1.x/2.x components to different base addresses +- Rebase Intel FSP 2.0 components to different base addresses -- Generate Intel FSP 1.x/2.x C header file +- Generate Intel FSP 2.0 C header file -- Display Intel FSP 1.x/2.x information header for each FSP component +- Display Intel FSP 2.0 information header for each FSP component -## Split Intel FSP 2.x image +## Split Intel FSP 2.0 image -FSP 1.x image is not supported by split command. -To split individual FSP component in Intel FSP 2.x image, the following +To split individual FSP component in Intel FSP 2.0 image, the following command can be used: **python SplitFspBin.py split [-h] -f FSPBINARY [-o OUTPUTDIR] [-n NAMETEMPLATE]** -For example: +For example: `python SplitFspBin.py split -f FSP.bin` It will create FSP_T.bin, FSP_M.bin and FSP_S.bin in current directory. -## Rebase Intel FSP 1.x/2.x components +## Rebase Intel FSP 2.0 components -To rebase one or multiple FSP components in Intel FSP 1.x/2.x image, the following +To rebase one or multiple FSP components in Intel FSP 2.0 image, the following command can be used: **python SplitFspBin.py rebase [-h] -f FSPBINARY -c {t,m,s,o} [{t,m,s,o} ...] -b FSPBASE [FSPBASE ...] [-o OUTPUTDIR] [-n OUTPUTFILE]** -For example: +For example: - `python SplitFspBin.py rebase -f FSP.bin -c t -b 0xFFF0 -n FSP_new.bin` + `python SplitFspBin.py rebase -f FSP.bin –c t –b 0xFFF0 –n FSP_new.bin` It will rebase FSP-T component inside FSP.bin to new base 0xFFF0 and save the - rebased Intel FSP 2.x image into file FSP_new.bin. - For FSP 1.x image there is only one component in binary so above command also - works for FSP 1.x image. + rebased Intel FSP 2.0 i