diff options
author | Chasel Chiu <chasel.chiu@intel.com> | 2019-05-28 21:51:39 +0800 |
---|---|---|
committer | Chasel Chiu <chasel.chiu@intel.com> | 2019-06-11 15:12:10 +0800 |
commit | 8349b8683640cc73522e5728d6f9ea2a45487be8 (patch) | |
tree | d19fc9bdb825fa885e993c2198626b7fae06ed47 /IntelFsp2Pkg/Tools/SplitFspBin.py | |
parent | 42666243419561d72d2004ee59aa1260de7c7a4a (diff) | |
download | edk2-8349b8683640cc73522e5728d6f9ea2a45487be8.tar.gz |
IntelFsp2Pkg/SplitFspBin.py: Support rebasing 1.x binary.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1308
Support rebasing FSP 1.x binary.
FSP 1.x has single component in binary so not supported
by split command and rebase can be done with the same
command for rebasing FSP-T component in FSP 2.x image.
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>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Diffstat (limited to 'IntelFsp2Pkg/Tools/SplitFspBin.py')
-rw-r--r-- | IntelFsp2Pkg/Tools/SplitFspBin.py | 21 |
1 files 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
|