# Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # Neither the name of ARM nor the names of its contributors may be used # to endorse or promote products derived from this software without specific # prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. #Set the default toolchain export CROSS_COMPILE_64=${TOP_DIR}/tools/gcc/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- export CROSS_COMPILE=$CROSS_COMPILE_64 export CROSS_COMPILE_32=${TOP_DIR}/tools/gcc/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- #BUILD_SCRIPTS - A list of scripts to be run, relative to this repository # root. This variable is added to throughout this file. BUILD_SCRIPTS="" #ARM_TF Options # Defaults are below. # To implement a platform define ARM_TF_PLATS # ARM_TF_PLATS - A list of the platforms. # For each of the values in ARM_TF_PLATS do the following (juno as an example # platform): # declare -A TBBR_juno # TBBR_juno[tbbr]=1 #or 0 for no TBBR # Extra options can be set if needed, see built-arm-tf.sh for more info. ARM_TF_BUILD_ENABLED=1 BUILD_SCRIPTS=$BUILD_SCRIPTS"build-arm-tf.sh " ARM_TF_PATH=arm-tf ARM_TF_DEBUG_ENABLED=${ARM_TF_DEBUG_ENABLED:-1} ARM_TF_ROT_KEY=$TOP_DIR/$ARM_TF_PATH/plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem ARM_TF_MBEDTLS_DIR=$TOP_DIR/mbedtls ARM_TF_TBBR_BUILD_FLAGS="TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 CREATE_KEYS=1 ARM_ROTPK_LOCATION=devel_rsa ROT_KEY=${ARM_TF_ROT_KEY} MBEDTLS_DIR=${ARM_TF_MBEDTLS_DIR}" ARM_TF_ARCH=aarch64 #LINUX Options. # Linux build is enabled by default. # Default config is defconfig, but other configs can be defined. # Simply add another name to the LINUX_CONFIG_LIST, then for that # config, create the following structure: # declare -A LINUX_foo # LINUX_foo[path]="linux" - Path # LINUX_foo[config]="" - List of configs to use. LINUX_CONFIG_LIST="defconfig" LINUX_CONFIG_DEFAULT=defconfig LINUX_PATH=linux LINUX_ARCH=arm64 LINUX_IMAGE_TYPE=${LINUX_IMAGE_TYPE:-Image} LINUX_BUILD_ENABLED=1 BUILD_SCRIPTS=$BUILD_SCRIPTS"build-linux.sh " declare -A LINUX_defconfig LINUX_defconfig[path]="linux" LINUX_defconfig[outpath]="linux" LINUX_defconfig[config]="" LINUX_defconfig[defconfig]=defconfig declare -A LINUX_mobile_oe LINUX_mobile_oe[path]="linux" LINUX_mobile_oe[outpath]="linux" source $DIR/big-LITTLE-conf.sh LINUX_mobile_oe[config]="linaro-base $BL_SUPPORT distribution vexpress64" declare -A LINUX_mobile_bb LINUX_mobile_bb[path]="linux" LINUX_mobile_bb[outpath]="linux" LINUX_mobile_bb[config]="linaro-base vexpress64 $BL_SUPPORT" declare -A LINUX_android LINUX_android[path]="linux" LINUX_android[outpath]="linux" LINUX_android[config]="linaro-base $BL_SUPPORT android vexpress64" #Default linux configs per OS - These can be overridden. BUSYBOX_LINUX_CONFIG_LIST=mobile_bb OE_LINUX_CONFIG_LIST=mobile_oe ANDROID_LINUX_CONFIG_LIST=android #U-Boot options # Defaults are set below. # To implement a platform, the following must be done. # Set UBOOT_BOARDS to the name of the platform (juno as an example): # UBOOT_BOARDS="vexpress_aemv8a_juno" # Then for each of the UBOOT_BOARDS values, set the name of the output folder # that artifacts should be copied into: # UBOOT_OUTPUT_DESTS[vexpress_aemv8a_juno]=juno UBOOT_BUILD_ENABLED=1 BUILD_SCRIPTS=$BUILD_SCRIPTS"build-uboot.sh " UBOOT_PATH=u-boot UBOOT_ARCH=aarch64 UBOOT_MKIMG=${TOP_DIR}/${UBOOT_PATH}/output/tools/mkimage UBOOT_UIMAGE_ADDRS="0x80080000" declare -A UBOOT_OUTPUT_DESTS #TARGET_BINS options # To implement a platform, the following must be done. # Set the TARGET_BINS_PLATS to the name of your platform: # TARGET_BINS_PLATS="juno" # Then create an array for options for that platform: # declare -A TARGET_juno # Finally, fill in properties into that array: # TARGET_juno[arm-tf]="juno" # TARGET_juno[scp]="juno_SILICON" # TARGET_juno[uboot]="juno" # TARGET_juno[uefi]="juno" # TARGET_juno[fdts]="juno juno-r1 juno-r2" # TARGET_juno[linux]="Image uImage.0x80080000" # TARGET_juno[ramdisk]=0x84000000 # TARGET_juno[tbbr]=1 # TARGET_juno[optee]=1 # For meanings behind all of the above options, refer # to the comments in build-target-bins.sh. BUILD_SCRIPTS=$BUILD_SCRIPTS"build-target-bins.sh " FINAL_BUILD_STEP="build-target-bins.sh" TARGET_BINS_BUILD_ENABLED=1 #UEFI options. # Some things will be required for each platform. # UEFI_PLATFORMS - A list of platforms to build # For each item in UEFI_PLATFORMS (juno is used as an example): # declare -A UEFI_PLAT_juno # UEFI_PLAT_juno[platname]="ArmJuno" # UEFI_PLAT_juno[output]=juno # UEFI_PLAT_juno[defines]= # UEFI_PLAT_juno[binary]="BL33_AP_UEFI.fd" # For meanings of options above, refer to build-uefi.sh # Defaults are listed below. UEFI_BUILD_ENABLED=${UEFI_BUILD_ENABLED:-1} BUILD_SCRIPTS=$BUILD_SCRIPTS"build-uefi.sh " UEFI_PATH=uefi/edk2 UEFI_BUILD_MODE=DEBUG UEFI_TOOLCHAIN=GCC5 UEFI_TOOLS_PATH=tools/uefi-tools UEFI_ACPICA_PATH=tools/acpica/generate/unix #OPTEE Options # Defaults are set below. To turn OPTEE on, the following must be done. # OPTEE_BUILD_ENABLED - Set this to 1 # OPTEE_PLATFORM="vexpress" - Set this to the platform name to build. # OPTEE_FLAVOUR="mobile" - Set the flavour name OPTEE_BUILD_ENABLED=0 BUILD_SCRIPTS=$BUILD_SCRIPTS"build-optee-os.sh " # set trusted firmware to use dram for TEE OPTEE_RAM_LOCATION=dram OPTEE_CLIENT_CROSS_COMPILE=${CROSS_COMPILE} OPTEE_OS_AARCH64_CORE=y OPTEE_OS_PATH=optee/optee_os OPTEE_CORE_LOG_LEVEL=4 OPTEE_OS_BIN_NAME="tee.bin" OPTEE_PLATFORM="vexpress" #SCP Options # Defaults are set below. By default scp is not built. # To build, set SCP_BUILD_ENABLED=1 and also set SCP_PLATFORMS to the # platform of choice. When building in debug mode "-d" parameter has been # given, then SCP will be set to build. If this is not desired, ensure your # platform explicitly sets SCP_BUILD_ENABLED=0. SCP_BUILD_ENABLED=${SCP_BUILD_ENABLED:="0"} BUILD_SCRIPTS=$BUILD_SCRIPTS"build-scp.sh " SCP_PATH=scp SCP_GCC_COMPILER_PREFIX=${TOP_DIR}/tools/gcc/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi- SCP_BUILD_MODE=debug declare -A SCP_BYPASS_ROM_SUPPORT ########################### # Extra packaging options # ########################### #TARGET_BINS_COPY_ENABLED - 0 or 1. # If 0, then TARGET_BINS_COPY_LIST is ignored. # If 1, then TARGET_BINS_COPY_LIST is used. TARGET_BINS_COPY_ENABLED=0 #TARGET_BINS_COPY_LIST - An array of "src" "dest" locations to be # passed into the cp command. # Set like the following: # TARGET_BINS_COPY_LIST[0]="${OUTDIR}/linux/Image /some/path/MyImage" # Takes a 0 based index. # To add cummulatively: # index=${#TARGET_BINS_COPY_LIST[@]} # TARGET_BINS_COPY_LIST[$[index++]]="src dest" declare -a TARGET_BINS_COPY_LIST #TARGET_BINS_COPY_LIST_BUSYBOX - An array just like TARGET_BINS_COPY_LIST # except it only applies if the busybox filesystem is being built declare -a TARGET_BINS_COPY_LIST_BUSYBOX #TARGET_BINS_COPY_LIST_OE - An array just like TARGET_BINS_COPY_LIST # except it only applies if the oe filesystem is being built declare -a TARGET_BINS_COPY_LIST_OE #TARGET_BINS_COPY_LIST_ANDROID - An array just like TARGET_BINS_COPY_LIST # except it only applies if the android filesystem is being built declare -a TARGET_BINS_COPY_LIST_ANDROID #TARGET_BINS_COPY_LIST_UEFI - An array just like TARGET_BINS_COPY_LIST # except it only applies if the UEFI only "filesystem" is being built declare -a TARGET_BINS_COPY_LIST_UEFI #TARGET_BINS_EXTRA_TAR_LIST - A string list of folders that need to be # tarred up. Space delimited. The tar name is just the folder name # with ".tar.gz" appended on the end. #Prebuilt options # If -d option is given to the build scripts, scripts will use the # ANDROID_LUNCH_TARGET_PREBUILT variable. Otherwise the variable # ANDROID_LUNCH_TARGET_SRC will be used. PREBUILT_MPG=${PREBUILT_MPG:="true"} ANDROID_BINS_VARIANTS=$ANDROID_BINS_VARIANTS_PLAT if [ "$PREBUILT_MPG" = "true" ] ; then ANDROID_LUNCH_TARGET=$ANDROID_LUNCH_TARGET_PREBUILT else ANDROID_LUNCH_TARGET=$ANDROID_LUNCH_TARGET_SRC fi # Filesystem options # VALID_FILESYSTEMS should be set to the filesystems that are supported by the # platform. If your platform only supports particular platforms, then reduce # this list. This means the build scripts will only source files under the # filesystems directory that apply to your platform. VALID_FILESYSTEMS="android oe busybox uefi" COMPONENT_FLAVOUR=$FLAVOUR