From nobody Sun May 5 07:43:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+41618+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41618+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1559140482; cv=none; d=zoho.com; s=zohoarc; b=RuNlqCS2XzS1ZOR5RD1WFa2Ww5nfMOO+v7HERxAc1tB9wWqJIZ/4/SPikJhNvQNkpP+7WYWOxKITXAUKyBQFTw6+O2IiIZGRUeCrPTESPXfXYLi4wCAMm+nhuc26fJr5IXJRLXnEXwpHC03ON110ziMhtHBOSl9VmUoklDPB3/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559140482; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=66BLvJ9Z8RA8Ao0ut7Bv2LIJ+jhQ49hXBvPT9CeHw8Q=; b=NqJCHGSAb+EW+3DCl8iwPkxCgwZdGMjUsPYW6YFaL5byjF4raMXo8MgV1uGW2EtCB+8a6OAaVst6oxrepppU2TOvD6y9XtEz4kUPzFQ757biNx1I4XmzbK/lLFfrwao9qcWV49U9uY7L2QfG4UDojpUQUOMBteBR/jDOYmdwDlk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41618+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1559140482299516.5889769514373; Wed, 29 May 2019 07:34:42 -0700 (PDT) Return-Path: X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Wed, 29 May 2019 07:34:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 07:34:35 -0700 X-ExtLoop1: 1 X-Received: from cchiu4-mobl1.gar.corp.intel.com ([10.252.190.33]) by orsmga002.jf.intel.com with ESMTP; 29 May 2019 07:34:33 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Maurice Ma , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/FspSplitBin.py: Support rebasing 1.x binary. Date: Wed, 29 May 2019 22:33:24 +0800 Message-Id: <20190529143324.15956-1-chasel.chiu@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1559140481; bh=7LcKLVY6NoD2j1nb2B0mWcXHwWbr1fCTb6tD0ZAws54=; h=Cc:Date:From:Reply-To:Subject:To; b=vwLgbzjWs57+bR3Oj7qCKUNWA5dyuEUoQugVXx9uJiKEOVQQ4htvzI2EZX1F2XRxNL8 PKrLzyNk/s9kuNXA6qYFZ1UQgwT/d1ruqA0FzIH0yvFdGdZUq4m8Z6dx1ZntI5wtoCu3Y JCtQeX18i/0wZKSGCDe3cCS19KgThTDKFHM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1308 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 Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/Tools/SplitFspBin.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/IntelFsp2Pkg/Tools/SplitFspBin.py b/IntelFsp2Pkg/Tools/SplitFs= pBin.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.
+# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -14,12 +14,12 @@ import argparse from ctypes import * =20 """ -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 """ =20 CopyRightHeaderFile =3D """/* @@ -500,8 +500,6 @@ class FirmwareDevice: =20 fih =3D None for fsp in self.FspList: - if fsp.Fih.HeaderRevision < 3: - raise Exception("ERROR: FSP 1.x is not supported by this t= ool !") if not fih: fih =3D fsp.Fih else: @@ -713,6 +711,8 @@ def SplitFspBin (fspfile, outdir, nametemplate): fd.ParseFsp () =20 for fsp in fd.FspList: + if fsp.Fih.HeaderRevision < 3: + raise Exception("ERROR: FSP 1.x is not supported by the split = command !") ftype =3D fsp.Type if not nametemplate: nametemplate =3D fspfile @@ -742,6 +742,11 @@ def RebaseFspBin (FspBinary, FspComponent, FspBase, Ou= tputDir, OutputFile): =20 found =3D False for fsp in fd.FspList: + # Is this FSP 1.x single binary? + if fsp.Fih.HeaderRevision < 3: + found =3D True + ftype =3D 'X' + break ftype =3D fsp.Type.lower() if ftype =3D=3D fspcomp: found =3D True --=20 2.13.3.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41618): https://edk2.groups.io/g/devel/message/41618 Mute This Topic: https://groups.io/mt/31834320/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-