From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22e; helo=mail-wr0-x22e.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 17068223C1778 for ; Wed, 21 Feb 2018 07:56:21 -0800 (PST) Received: by mail-wr0-x22e.google.com with SMTP id k9so5906264wre.9 for ; Wed, 21 Feb 2018 08:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2n4ocWzq7mgPRBh8aSsAsK8fw7sThiQ9Epo0+D0KNUU=; b=GrTZNdCq28P++xzdUJB+JEagB0Em2o3YbiBFSiyANCz7neSZXKigIzlAw1GVcO/mLv VG/y4KAXJPUXxks7Z200fjMilraLAE0um5Ebl0duMr+kmUqgQ8FoCWbx1fO66TiUjLJa ogc2tDLNNiZwmtx6NLNGtBb9whpu9MZmXBKZ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2n4ocWzq7mgPRBh8aSsAsK8fw7sThiQ9Epo0+D0KNUU=; b=ZEBF7ARgIwMMMZLyVrgsVmStuaQd+nopvh8t+AcZAoW4Sf0SYR9xIto1nmLFhu/6nr 4LzpVzvfzpXh6AZEGnsDdaVktjV4S3zAcfc0hrIKhQmkzoc1DcfgxbnY18smYGvnj0W5 wISG6+gUcaeYhl/995D/IuBupq82vvja6ck/A7UNzWMQ2qg23/jI2dImrRHIsrILkgbp w/jwlAW0f0Noqo9Rnl9w9LC22Q7EdS2rbc00GzB+m04IDg78EpeTJkB8sEiNxBGQy3hC 7bOd0XScl5xHgoQvisczqOFJZ93FvUBGqArJueYEkO+vB5LqqwGw8HwspngcGrbdD/mc aJwg== X-Gm-Message-State: APf1xPAo+vr5u2RgqvinU94ncJs9THruVsm4/kNY4PyDQU09xQZre4zD 5+6rE6mSOxltKGaVl9B3KjDi2w== X-Google-Smtp-Source: AH8x227yM1zaV5L2wvspLryE6hwMVAmTT/ipYOo2+YQ8HCp+cTcwy6mPNHA2UTpRbWu1omE7uRsQsA== X-Received: by 10.223.133.182 with SMTP id 51mr3224763wrt.226.1519228939961; Wed, 21 Feb 2018 08:02:19 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id p14sm27489830wrg.42.2018.02.21.08.02.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Feb 2018 08:02:18 -0800 (PST) Date: Wed, 21 Feb 2018 16:02:17 +0000 From: Leif Lindholm To: Meenakshi Cc: ard.biesheuvel@linaro.org, michael.d.kinney@intel.com, edk2-devel@lists.01.org, udit.kumar@nxp.com, v.sethi@nxp.com, Wasim Khan Message-ID: <20180221160216.y2btjetxiou7gzr5@bivouac.eciton.net> References: <1518771035-6733-1-git-send-email-meenakshi.aggarwal@nxp.com> <1518771035-6733-10-git-send-email-meenakshi.aggarwal@nxp.com> MIME-Version: 1.0 In-Reply-To: <1518771035-6733-10-git-send-email-meenakshi.aggarwal@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) 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: Wed, 21 Feb 2018 15:56:22 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. (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.) 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). 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://git.linaro.org/uefi/uefi-tools.git. (edk2-build.sh in there supports the same sort of 'figure out which toolchain profile to use' as these scripts implement) Also, feel free to add a link to your Readme.md from https://github.com/tianocore/edk2-platforms#supported-platforms / Leif 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 > +# http://opensource.org/licenses/bsd-license.php > +# > +# 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" != X"" ]; then > + ARM64_PREFIX="$CROSS_COMPILE_64" > +elif [ X"$CROSS_COMPILE" != X"" ]; then > + ARM64_PREFIX="$CROSS_COMPILE" > +else > + ARM64_PREFIX="aarch64-linux-gnu-" > +fi > + > +GCC_UTILITY="${ARM64_PREFIX}gcc" > +CheckGcc=`which $GCC_UTILITY >/dev/null 2>&1` > +if [ "$?" -eq 0 ];then > + GCC_VERSION=`$GCC_UTILITY -v 2>&1 | tail -n 1 | awk '{print $3}'` > + MajorVersion=`echo $GCC_VERSION | cut -d . -f 1` > + MinorVersion=`echo $GCC_VERSION | cut -d . -f 2` > + GCC_ARCH_PREFIX= > + NOTSUPPORTED=0 > + > + case $MajorVersion in > + 4) > + case $MinorVersion in > + 9) > + GCC_ARCH_PREFIX="GCC49_AARCH64_PREFIX" > + ;; > + *) > + NOTSUPPORTED=1 > + ;; > + esac > + ;; > + 5) > + case $MinorVersion in > + 4) > + GCC_ARCH_PREFIX="GCC5_AARCH64_PREFIX" > + ;; > + *) > + GCC_ARCH_PREFIX="GCC5_AARCH64_PREFIX" > + echo "Warning: ${GCC_UTILITY} version ($MajorVersion.$MinorVersion) has not been tested, please use at own risk." > + ;; > + esac > + ;; > + *) > + NOTSUPPORTED=1 > + ;; > + 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="$GCC_ARCH_PREFIX" > + export "$GCC_ARCH_PREFIX=$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=`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 the BSD License > +# which accompanies this distribution. The full text of the license may be found at > +# http://opensource.org/licenses/bsd-license.php > +# > +# 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=AARCH64 > +TARGET_TOOLS=`echo $GCC_ARCH_PREFIX | cut -d _ -f 1` > +BASE_DIR=../../.. > + > +[ -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 / LS2088)." > + echo " Arg 2 (mandatory): Board Type (can be RDB / QDS)." > + echo " Arg 3 (mandatory): Build candidate (can be RELEASE or DEBUG). 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 != "clean" ]]; then > + echo "Error ! Either clean or emplty" > + print_usage_banner > + exit > +fi > + > +# Check for input arguments > +if [[ $1 == "" || $2 == "" || $3 == "" ]]; then > + echo "Error !" > + print_usage_banner > + exit > +fi > + > +# Check for input arguments > +if [[ $1 != "LS1043" && $1 != "LS1046" && $1 != "LS2088" ]]; then > + echo "Error ! Incorrect Soc Type specified." > + print_usage_banner > + exit > +fi > + > +# Check for input arguments > +if [[ $2 != "RDB" && $2 != "QDS" ]]; then > + echo "Error ! Incorrect Board Type specified." > + print_usage_banner > + exit > +fi > + > +# Check for input arguments > +if [[ $3 != "RELEASE" ]]; then > + if [[ $3 != "DEBUG" ]]; then > + echo "Error ! Incorrect build target specified." > + print_usage_banner > + exit > + fi > +fi > + > +# Set Package drirectory > +if [[ $2 == "RDB" ]]; then > + PKG="aRdbPkg" > + if [[ $2 == "QDS" ]]; then > + PKG="aQdsPkg" > + fi > +fi > + > +echo ".........................................." > +echo "Welcome to $1$PKG UEFI Build environment" > +echo ".........................................." > + > +if [[ $4 == "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=`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 >