From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: nathaniel.l.desimone@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 07 Oct 2019 15:27:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2019 15:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,269,1566889200"; d="scan'208";a="183564635" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga007.jf.intel.com with ESMTP; 07 Oct 2019 15:27:50 -0700 Received: from orsmsx115.amr.corp.intel.com (10.22.240.11) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 7 Oct 2019 15:27:50 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.55]) by ORSMSX115.amr.corp.intel.com ([169.254.4.199]) with mapi id 14.03.0439.000; Mon, 7 Oct 2019 15:27:50 -0700 From: "Nate DeSimone" To: "Agyeman, Prince" , "devel@edk2.groups.io" CC: "Sinha, Ankit" , "Kubacki, Michael A" Subject: Re: [edk2-platforms] [PATCH 5/5] Platform/Intel: Add FIT generation tool Thread-Topic: [edk2-platforms] [PATCH 5/5] Platform/Intel: Add FIT generation tool Thread-Index: AQHVei9a8VGjKJRXsE2jyO5ZIyrh9KdPyG6Q Date: Mon, 7 Oct 2019 22:27:49 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AAEF33C2C@ORSMSX114.amr.corp.intel.com> References: <20191003211259.49664-1-prince.agyeman@intel.com> <20191003211259.49664-6-prince.agyeman@intel.com> In-Reply-To: <20191003211259.49664-6-prince.agyeman@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTliYmVhNjMtYTZlMy00NjI2LTk1OGItMjNjY2RkNDY3NWE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibXpaMXZubnV5T0xyWjg2eU82YVBNcmxlSnRcL0JCMW56SDJvc2RzM1VIUUUrbXQ2a0V6MWFQVURKMmdPVlVibnEifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Return-Path: nathaniel.l.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: Agyeman, Prince =20 Sent: Thursday, October 3, 2019 2:13 PM To: devel@edk2.groups.io Cc: Sinha, Ankit ; Desimone, Nathaniel L ; Kubacki, Michael A Subject: [edk2-platforms] [PATCH 5/5] Platform/Intel: Add FIT generation to= ol Added fit generation tool to the build process. What was done: Added BIOS_INFO_GUID to the build.cfg Added BIOS_INFO_GUID to GalagoPro3, KabylakeRvp3 and WhiskeylakeURvp build_config.cfg This allows the boards to= specify the GUID associated with the its Bios Info PEIM BIOS_INFO_GUID is passed as an argument to FitGen in the FIT table generati= on process Cc: Ankit Sinha Cc: Nate DeSimone Cc: Michael Kubacki Signed-off-by: Prince Agyeman --- .../GalagoPro3/build_config.cfg | 1 + .../KabylakeRvp3/build_config.cfg | 1 + .../WhiskeylakeURvp/build_config.cfg | 1 + Platform/Intel/build.cfg | 1 + Platform/Intel/build_bios.py | 57 +++++++++++++++++++ 5 files changed, 61 insertions(+) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/build_config.cf= g b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/build_config.cfg index 8c6c51abb4..3f64239a29 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/build_config.cfg +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/build_config.cfg @@ -31,3 +31,4 @@ FSP_PKG_NAME =3D KabylakeFspPkg FSP_BINARY_BUILD =3D FAL= SE FSP_TEST_RELEASE =3D FALSE SECURE_BOOT_ENABLE =3D FALSE +BIOS_INFO_GUID =3D 3132E669-D16B-4AA7-B09B-BC0EB5F40E1F diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.= cfg b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg index 78f808bfaf..f6ae4b342a 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg @@ -33,3 +33,4 @@ FSP_PKG_NAME =3D AmberLakeFspPkg FSP_BINARY_BUILD =3D FA= LSE FSP_TEST_RELEASE =3D FALSE SECURE_BOOT_ENABLE =3D FALSE +BIOS_INFO_GUID =3D C83BCE0E-6F16-4D3C-8D9F-4D6F5A032929 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_c= onfig.cfg b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_co= nfig.cfg index 1b0619bc1c..1dfe5ffd10 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_config.c= fg +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_confi +++ g.cfg @@ -31,3 +31,4 @@ FSP_PKG_NAME =3D CoffeelakeSiliconPkg FSP_BINARY_BUILD = =3D FALSE FSP_TEST_RELEASE =3D FALSE SECURE_BOOT_ENABLE =3D FALSE +BIOS_INFO_GUID =3D A842B2D2-5C88-44E9-A9E2-4830F26662B7 diff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg index 2040= 774d1b..6aee96694c 100644 --- a/Platform/Intel/build.cfg +++ b/Platform/Intel/build.cfg @@ -48,6 +48,7 @@ SECURE_BOOT_ENABLE =3D FALSE REBUILD_MODE =3D BUILD_ROM= _ONLY =3D NUMBER_OF_PROCESSORS =3D 0 +BIOS_INFO_GUID =3D =20 =20 [PLATFORMS] diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py in= dex 46285df19a..ea098de705 100644 --- a/Platform/Intel/build_bios.py +++ b/Platform/Intel/build_bios.py @@ -196,6 +196,31 @@ def pre_build(build_config, build_type=3D"DEBUG", sile= nt=3DFalse, toolchain=3DNone): if return_code !=3D 0: build_failed(config) =20 + # + # build platform silicon tools + # + # save the current workspace + saved_work_directory =3D config["WORKSPACE"] + # change the workspace to silicon tools directory + config["WORKSPACE"] =3D os.path.join(config["WORKSPACE_SILICON"],=20 + "Tools") + + command =3D ["nmake"] + if os.name =3D=3D "posix": # linux + command =3D ["make"] + # add path to generated FitGen binary to + # environment path variable + config["PATH"] +=3D os.pathsep + \ + os.path.join(config["BASE_TOOLS_PATH"], + "Source", "C", "bin") + + # build the silicon tools + _, _, result, return_code =3D execute_script(command, config, shell=3D= shell) + if return_code !=3D 0: + build_failed(config) + + # restore WORKSPACE environment variable + config["WORKSPACE"] =3D saved_work_directory + config["SILENT_MODE"] =3D 'TRUE' if silent else 'FALSE' =20 print("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= ") @@ -404,6 +429,35 @@ def post_build(config): :returns: nothing """ print("Running post_build to complete the build process.") + board_fd =3D config["BOARD"].upper() + final_fd =3D os.path.join(config["BUILD_DIR_PATH"], "FV", + "{}.fd".format(board_fd)) + + if config["BIOS_INFO_GUID"]: + # Generate the fit table + print("Generating FIT ...") + if os.path.isfile(final_fd): + temp_fd =3D os.path.join(config["BUILD_DIR_PATH"], "FV", + "{}_.fd".format(board_fd)) + shell =3D True + command =3D ["FitGen", "-D", + final_fd, temp_fd, "-NA", + "-I", config["BIOS_INFO_GUID"]] + + if os.name =3D=3D "posix": # linux + shell =3D False + + _, _, result, return_code =3D execute_script(command, config, = shell=3Dshell) + if return_code !=3D 0: + print("Error while generating fit") + else: + # copy output to final binary + shutil.copyfile(temp_fd, final_fd) + # remove temp file + os.remove(temp_fd) + else: + print("{} does not exist".format(final_fd)) + # remove temp file =20 # Additional build scripts for this platform result =3D post_build_ex(config) @@ -426,6 +480,9 @@ def post_build(config): except OSError: pass =20 + print("Done") + if os.path.isfile(final_fd): + print("Fd file can be found at {}".format(final_fd)) =20 def build_failed(config): """Displays results when build fails -- 2.19.1.windows.1