## @ FspTool.py\r
#\r
-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials are licensed and made available under\r
-# the terms and conditions of the BSD License that accompanies this distribution.\r
-# The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
##\r
\r
from ctypes import *\r
\r
"""\r
-This utility supports some operations for Intel FSP 2.0 image.\r
+This utility supports some operations for Intel FSP 1.x/2.x image.\r
It supports:\r
- - Display FSP 2.0 information header\r
- - Split FSP 2.0 image into individual FSP-T/M/S/O component\r
- - Rebase FSP 2.0 components to a different base address\r
- - Generate FSP mapping C header file\r
+ - Display FSP 1.x/2.x information header\r
+ - Split FSP 2.x image into individual FSP-T/M/S/O component\r
+ - Rebase FSP 1.x/2.x components to a different base address\r
+ - Generate FSP 1.x/2.x mapping C header file\r
"""\r
\r
CopyRightHeaderFile = """/*\r
\r
fih = None\r
for fsp in self.FspList:\r
- if fsp.Fih.HeaderRevision < 3:\r
- raise Exception("ERROR: FSP 1.x is not supported by this tool !")\r
if not fih:\r
fih = fsp.Fih\r
else:\r
fd.ParseFsp ()\r
\r
for fsp in fd.FspList:\r
+ if fsp.Fih.HeaderRevision < 3:\r
+ raise Exception("ERROR: FSP 1.x is not supported by the split command !")\r
ftype = fsp.Type\r
if not nametemplate:\r
nametemplate = fspfile\r
fspname, ext = os.path.splitext(os.path.basename(nametemplate))\r
filename = os.path.join(outdir, fspname + '_' + fsp.Type + ext)\r
hfsp = open(filename, 'wb')\r
- print ("Ceate FSP component file '%s'" % filename)\r
+ print ("Create FSP component file '%s'" % filename)\r
for fvidx in fsp.FvIdxList:\r
fv = fd.FvList[fvidx]\r
hfsp.write(fv.FvData)\r
\r
found = False\r
for fsp in fd.FspList:\r
+ # Is this FSP 1.x single binary?\r
+ if fsp.Fih.HeaderRevision < 3:\r
+ found = True\r
+ ftype = 'X'\r
+ break\r
ftype = fsp.Type.lower()\r
if ftype == fspcomp:\r
found = True\r