From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.1.72; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0072.outbound.protection.outlook.com [104.47.1.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 37C9621FD73DA for ; Wed, 21 Feb 2018 20:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+q+zG/G1ZHhTKV52UCNtJ6/ZtzanBiv8YkNjrguuHXI=; b=dPgL4wMnpJN3lN/RDBiLlmWlgpDZvnotEfvvKkT3ActHCeWXyohdughoQ8M0CHsJkA0L+MiKUrSeZXEAsn8I827u5/R5HlDSTloM+uaDBwfH9Ab9sUEdxwncS2GqMgdFUozmFNVqnaU53usf6p42Ufxn5fs+UyLA+oM08bIcNHw= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB5PR04MB1416.eurprd04.prod.outlook.com (10.162.221.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 22 Feb 2018 04:58:39 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::5b4:dfb7:891f:32ce]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([fe80::5b4:dfb7:891f:32ce%13]) with mapi id 15.20.0506.023; Thu, 22 Feb 2018 04:58:38 +0000 From: Meenakshi Aggarwal To: Leif Lindholm CC: "ard.biesheuvel@linaro.org" , "michael.d.kinney@intel.com" , "edk2-devel@lists.01.org" , Udit Kumar , Varun Sethi , Wasim Khan Thread-Topic: [PATCH edk2-platforms 09/39] Build : Add build script and environment script Thread-Index: AQHTpwOQmHSeCc2y50eSj1L2HTTn/KOvDKmAgADXvrA= Date: Thu, 22 Feb 2018 04:58:38 +0000 Message-ID: References: <1518771035-6733-1-git-send-email-meenakshi.aggarwal@nxp.com> <1518771035-6733-10-git-send-email-meenakshi.aggarwal@nxp.com> <20180221160216.y2btjetxiou7gzr5@bivouac.eciton.net> In-Reply-To: <20180221160216.y2btjetxiou7gzr5@bivouac.eciton.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR04MB1416; 7:widcjHHDt0+9n692n5fXHrxypt2wO2FGoXzI+VTd3AiyDZb8y+0CzorIJAqp/0hdr2GO3ZvzIPHzSthkzm8rZTRq026qCOaHa5ENUC97ifIMVOFUbupeXAGA8N1HfTIDMJt20VTAdqpCsk5hnPHT9LvVin4BgBVPMAbrMqwwazUPJOWxKxYzuo+6oJ1R8qoLUwRSZsuk6V2Z9EMLGN2W2pXD53OJvh3BHqphoLSbL8X1enqqn/g1SfBhF7zzRkFV x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(39860400002)(39380400002)(199004)(189003)(174874002)(13464003)(966005)(8676002)(2900100001)(102836004)(81156014)(81166006)(106356001)(14454004)(316002)(5250100002)(5660300001)(99286004)(4326008)(229853002)(59450400001)(26005)(105586002)(2906002)(76176011)(186003)(6916009)(2950100002)(8936002)(3280700002)(6116002)(53546011)(33656002)(66066001)(6506007)(97736004)(7696005)(3846002)(305945005)(7736002)(478600001)(6246003)(55016002)(74316002)(6306002)(9686003)(68736007)(575784001)(86362001)(3660700001)(53936002)(25786009)(45080400002)(6436002)(54906003)(16799955002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1416; H:DB5PR04MB0998.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 960af812-645f-42fe-372b-08d579b0ef9a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:DB5PR04MB1416; x-ms-traffictypediagnostic: DB5PR04MB1416: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(111885846020525)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001075)(6040501)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231101)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DB5PR04MB1416; BCL:0; PCL:0; RULEID:; SRVR:DB5PR04MB1416; x-forefront-prvs: 059185FE08 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nxlFLX6LuD9Gbo/rOH0PWbULrOo1tt28cC8l4ZDg68D6SXuuzENZIgsN+4KPjI+ciG0McnqC824RavaSnLGie84JZMdy9mCCJIWiz8MjkxBKW77o32vfcXHyh8ITHcGGybgJxdUzaKy1yniOGGs2ILlnxTAAlm2cfdp3I7bGIek= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 960af812-645f-42fe-372b-08d579b0ef9a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2018 04:58:38.2140 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1416 Subject: Re: [PATCH edk2-platforms 09/39] Build : Add build script and environment script X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2018 04:52:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Thanks, Meenakshi > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Wednesday, February 21, 2018 9:32 PM > To: Meenakshi Aggarwal > Cc: ard.biesheuvel@linaro.org; michael.d.kinney@intel.com; edk2- > devel@lists.01.org; Udit Kumar ; Varun Sethi > ; Wasim Khan > Subject: Re: [PATCH edk2-platforms 09/39] Build : Add build script and > environment script >=20 > We need to have a tree where we can build all of the platforms in a > predictable manner, so I am not inclined to take any platform-specific > build helper scripts. >=20 > (If a platform that needs some special scripts to post-process the > built image before writing it to a target, that is a different thing.) >=20 > What would be really useful here would be a Readme.md listing the > platforms supported, with a brief description, and the location of > their .dsc files (and any option that can be specified on the command > line at build time). >=20 Yes, Sounds Valid. Let me give a try to same. > I would be more than happy to add some entries for these platforms to > (the entirely unofficial) uefi-tools set of helper scripts available > from > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit. > linaro.org%2Fuefi%2Fuefi- > tools.git&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7Cdab85d129 > a9f4bfd36c608d579447d69%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C > 0%7C636548257431632170&sdata=3DVHMKWjdfr2FSy8uClW4%2BLeosuVPYpD > wOYhrIIUop5w0%3D&reserved=3D0. >=20 > (edk2-build.sh in there supports the same sort of 'figure out which > toolchain profile to use' as these scripts implement) >=20 > Also, feel free to add a link to your Readme.md from > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit > hub.com%2Ftianocore%2Fedk2-platforms%23supported- > platforms&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7Cdab85d1 > 29a9f4bfd36c608d579447d69%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0% > 7C0%7C636548257431788421&sdata=3DzrQfMandU%2BpMoSiZhc3R9%2F3vrRK > 9tF5gMJX%2FgBrt5Lc%3D&reserved=3D0 >=20 > / > Leif >=20 > On Fri, Feb 16, 2018 at 02:20:05PM +0530, Meenakshi wrote: > > From: Meenakshi Aggarwal > > > > Build script and Environment setup script. > > Readme to explain how to run build script > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Meenakshi Aggarwal > > Signed-off-by: Wasim Khan > > --- > > Platform/NXP/Env.cshrc | 78 +++++++++++++++++++++++++++++++++ > > Platform/NXP/Readme.md | 17 +++++++ > > Platform/NXP/build.sh | 117 > +++++++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 212 insertions(+) > > create mode 100755 Platform/NXP/Env.cshrc > > create mode 100644 Platform/NXP/Readme.md > > create mode 100755 Platform/NXP/build.sh > > > > diff --git a/Platform/NXP/Env.cshrc b/Platform/NXP/Env.cshrc > > new file mode 100755 > > index 0000000..eb51018 > > --- /dev/null > > +++ b/Platform/NXP/Env.cshrc > > @@ -0,0 +1,78 @@ > > +# @file. > > +# > > +# Copyright 2017 NXP > > +# > > +# This program and the accompanying materials are licensed and made > available under > > +# the terms and conditions of the BSD License which accompanies this > distribution. > > +# The full text of the license may be found at > > +# > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fope > nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7Cdab85d > 129a9f4bfd36c608d579447d69%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0 > %7C0%7C636548257431788421&sdata=3DUt5kElH5tECkkHPBx53AJD0LeoqScX9w > 6%2FoMz7eRclU%3D&reserved=3D0 > > +# > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > BASIS, > > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > > +# > > +# > > + > > +unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion > > + > > +if [ X"$CROSS_COMPILE_64" !=3D X"" ]; then > > + ARM64_PREFIX=3D"$CROSS_COMPILE_64" > > +elif [ X"$CROSS_COMPILE" !=3D X"" ]; then > > + ARM64_PREFIX=3D"$CROSS_COMPILE" > > +else > > + ARM64_PREFIX=3D"aarch64-linux-gnu-" > > +fi > > + > > +GCC_UTILITY=3D"${ARM64_PREFIX}gcc" > > +CheckGcc=3D`which $GCC_UTILITY >/dev/null 2>&1` > > +if [ "$?" -eq 0 ];then > > + GCC_VERSION=3D`$GCC_UTILITY -v 2>&1 | tail -n 1 | awk '{print $3}'` > > + MajorVersion=3D`echo $GCC_VERSION | cut -d . -f 1` > > + MinorVersion=3D`echo $GCC_VERSION | cut -d . -f 2` > > + GCC_ARCH_PREFIX=3D > > + NOTSUPPORTED=3D0 > > + > > + case $MajorVersion in > > + 4) > > + case $MinorVersion in > > + 9) > > + GCC_ARCH_PREFIX=3D"GCC49_AARCH64_PREFIX" > > + ;; > > + *) > > + NOTSUPPORTED=3D1 > > + ;; > > + esac > > + ;; > > + 5) > > + case $MinorVersion in > > + 4) > > + GCC_ARCH_PREFIX=3D"GCC5_AARCH64_PREFIX" > > + ;; > > + *) > > + GCC_ARCH_PREFIX=3D"GCC5_AARCH64_PREFIX" > > + echo "Warning: ${GCC_UTILITY} version > ($MajorVersion.$MinorVersion) has not been tested, please use at own > risk." > > + ;; > > + esac > > + ;; > > + *) > > + NOTSUPPORTED=3D1 > > + ;; > > + esac > > + > > + [ "$NOTSUPPORTED" -eq 1 ] && { > > + echo "Error: ${GCC_UTILITY} version ($MajorVersion.$MinorVersion= ) > not supported ." > > + unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion > > + } > > + > > + [ -n "$GCC_ARCH_PREFIX" ] && { > > + export GCC_ARCH_PREFIX=3D"$GCC_ARCH_PREFIX" > > + export "$GCC_ARCH_PREFIX=3D$ARM64_PREFIX" > > + } > > + > > + unset ARCH > > +else > > + echo "Error: ${GCC_UTILITY} not found. Please check PATH variable.= " > > + unset GCC_UTILITY GCC_VERSION MajorVersion MinorVersion > > +fi > > + > > +# Export the edk2-platforms path > > +export PACKAGES_PATH=3D`dirname \`dirname "$PWD"\`` > > diff --git a/Platform/NXP/Readme.md b/Platform/NXP/Readme.md > > new file mode 100644 > > index 0000000..94174a7 > > --- /dev/null > > +++ b/Platform/NXP/Readme.md > > @@ -0,0 +1,17 @@ > > +Support for all NXP boards is available in this directory. > > + > > +# How to build > > + > > +build script source environment file Env.cshrc > > + > > +user need to run only build command. > > + > > +1. source Env.cshrc > > + > > +2. Build desired board > > + ./build.sh > (optional) > > + > > + Soc-name : LS1043 / LS1046 / LS2088 > > + board-type : RDB / QDS > > + build-candidate : DEBUG / RELEASE > > + > > diff --git a/Platform/NXP/build.sh b/Platform/NXP/build.sh > > new file mode 100755 > > index 0000000..eea83ee > > --- /dev/null > > +++ b/Platform/NXP/build.sh > > @@ -0,0 +1,117 @@ > > +#!/bin/bash > > + > > +# UEFI build script for NXP LS SoCs > > +# > > +# Copyright 2017 NXP > > +# > > +# This program and the accompanying materials > > +# are licensed and made available under the terms and conditions of th= e > BSD License > > +# which accompanies this distribution. The full text of the license m= ay be > found at > > +# > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fope > nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cmeenakshi.aggarwal%40nxp.com%7Cdab85d > 129a9f4bfd36c608d579447d69%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0 > %7C0%7C636548257431788421&sdata=3DUt5kElH5tECkkHPBx53AJD0LeoqScX9w > 6%2FoMz7eRclU%3D&reserved=3D0 > > +# > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > BASIS, > > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > > +# > > + > > +# source environment file > > +source Env.cshrc > > + > > +# Global Defaults > > +ARCH=3DAARCH64 > > +TARGET_TOOLS=3D`echo $GCC_ARCH_PREFIX | cut -d _ -f 1` > > +BASE_DIR=3D../../.. > > + > > +[ -z "$TARGET_TOOLS" ] && { > > + echo "TARGET_TOOLS not found. Please run \"source Env.cshrc\" ." > > + exit 1 > > +} > > + > > +print_usage_banner() > > +{ > > + echo "" > > + echo "This shell script expects:" > > + echo " Arg 1 (mandatory): SoC Type (can be LS1043 / LS1046 / LS= 2088)." > > + echo " Arg 2 (mandatory): Board Type (can be RDB / QDS)." > > + echo " Arg 3 (mandatory): Build candidate (can be RELEASE or DE= BUG). > By > > + default we build the RELEASE candidate." > > + echo " Arg 4 (optional): clean - To do a 'make clean' operation= ." > > +} > > + > > +# Check for total num of input arguments > > +if [[ "$#" -gt 4 ]]; then > > + echo "Illegal number of parameters" > > + print_usage_banner > > + exit > > +fi > > + > > +# Check for third parameter to be clean only > > +if [[ "$4" && $4 !=3D "clean" ]]; then > > + echo "Error ! Either clean or emplty" > > + print_usage_banner > > + exit > > +fi > > + > > +# Check for input arguments > > +if [[ $1 =3D=3D "" || $2 =3D=3D "" || $3 =3D=3D "" ]]; then > > + echo "Error !" > > + print_usage_banner > > + exit > > +fi > > + > > +# Check for input arguments > > +if [[ $1 !=3D "LS1043" && $1 !=3D "LS1046" && $1 !=3D "LS2088" ]]; the= n > > + echo "Error ! Incorrect Soc Type specified." > > + print_usage_banner > > + exit > > +fi > > + > > +# Check for input arguments > > +if [[ $2 !=3D "RDB" && $2 !=3D "QDS" ]]; then > > + echo "Error ! Incorrect Board Type specified." > > + print_usage_banner > > + exit > > +fi > > + > > +# Check for input arguments > > +if [[ $3 !=3D "RELEASE" ]]; then > > + if [[ $3 !=3D "DEBUG" ]]; then > > + echo "Error ! Incorrect build target specified." > > + print_usage_banner > > + exit > > + fi > > +fi > > + > > +# Set Package drirectory > > +if [[ $2 =3D=3D "RDB" ]]; then > > + PKG=3D"aRdbPkg" > > + if [[ $2 =3D=3D "QDS" ]]; then > > + PKG=3D"aQdsPkg" > > + fi > > +fi > > + > > +echo ".........................................." > > +echo "Welcome to $1$PKG UEFI Build environment" > > +echo ".........................................." > > + > > +if [[ $4 =3D=3D "clean" ]]; then > > + echo "Cleaning up the build directory '$BASE_DIR/Build/$1$PKG/'.." > > + rm -rf $BASE_DIR/Build/$1$PKG/* > > + exit > > +fi > > + > > +# Clean-up > > +set -e > > +shopt -s nocasematch > > + > > +# > > +# Setup workspace now > > +# > > +echo Initializing workspace > > +cd $BASE_DIR > > + > > +# Use the BaseTools in edk2 > > +export EDK_TOOLS_PATH=3D`pwd`/BaseTools > > +source edksetup.sh BaseTools > > + > > + > > +build -p "$PACKAGES_PATH/Platform/NXP/$1$PKG/$1$PKG.dsc" -a > $ARCH -t $TARGET_TOOLS -b $3 > > -- > > 1.9.1 > >