Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
Alexei Fedorov | 20fdf50 | 2020-07-27 17:36:38 +0100 | [diff] [blame] | 3 | # Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # |
| 9 | # This script builds the TF in different configs. |
| 10 | # Rather than telling cov-build to build TF using a simple 'make all' command, |
| 11 | # the goal here is to combine several build flags to analyse more of our source |
| 12 | # code in a single 'build'. The Coverity Scan service does not have the notion |
| 13 | # of separate types of build - there is just one linear sequence of builds in |
| 14 | # the project history. |
| 15 | # |
| 16 | |
| 17 | # Bail out as soon as an error is encountered. |
| 18 | set -e |
| 19 | |
| 20 | TF_SOURCES=$1 |
| 21 | if [ ! -d "$TF_SOURCES" ]; then |
| 22 | echo "ERROR: '$TF_SOURCES' does not exist or is not a directory" |
| 23 | echo "Usage: $(basename "$0") <trusted-firmware-directory>" |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
Leonardo Sandoval | 1c24ae5 | 2020-07-08 11:47:23 -0500 | [diff] [blame] | 27 | export CROSS_COMPILE=aarch64-none-elf- |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 28 | |
| 29 | # Get mbed TLS library code to build Trusted Firmware with Trusted Board Boot |
| 30 | # support. The version of mbed TLS to use here must be the same as when |
| 31 | # building TF in the usual context. |
| 32 | if [ ! -d mbedtls ]; then |
| 33 | git clone https://github.com/ARMmbed/mbedtls.git |
| 34 | fi |
| 35 | cd mbedtls |
| 36 | containing_dir="$(readlink -f "$(dirname "$0")/")" |
| 37 | . $containing_dir/common-def.sh |
| 38 | git checkout "$MBED_TLS_SOURCES_TAG" |
| 39 | cd - |
| 40 | TBB_OPTIONS="TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 MBEDTLS_DIR=$(pwd)/mbedtls" |
| 41 | ARM_TBB_OPTIONS="$TBB_OPTIONS ARM_ROTPK_LOCATION=devel_rsa" |
| 42 | |
| 43 | cd "$TF_SOURCES" |
| 44 | |
| 45 | # Clean TF source dir to make sure we don't analyse temporary files. |
| 46 | make distclean |
| 47 | |
| 48 | # |
| 49 | # Build TF in different configurations to get as much coverage as possible |
| 50 | # |
| 51 | |
| 52 | # We need to clean the platform build between each configuration because Trusted |
| 53 | # Firmware's build system doesn't track build options dependencies and won't |
| 54 | # rebuild the files affected by build options changes. |
| 55 | clean_build() |
| 56 | { |
| 57 | local flags="$*" |
| 58 | echo "Building TF with the following build flags:" |
| 59 | echo " $flags" |
| 60 | make $flags clean |
| 61 | make $flags all |
| 62 | echo "Build config complete." |
| 63 | echo |
| 64 | } |
| 65 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 66 | # Defines common flags between platforms |
| 67 | common_flags() { |
| 68 | local release="${1:-}" |
Leonardo Sandoval | 9b69f50 | 2020-08-14 13:00:38 -0500 | [diff] [blame^] | 69 | local num_cpus="$(/usr/bin/getconf _NPROCESSORS_ONLN)" |
| 70 | local parallel_make="-j $num_cpus" |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 71 | |
| 72 | # default to debug mode, unless a parameter is passed to the function |
| 73 | debug="DEBUG=1" |
| 74 | [ -n "$release" ] && debug="" |
| 75 | |
Leonardo Sandoval | 9b69f50 | 2020-08-14 13:00:38 -0500 | [diff] [blame^] | 76 | echo " $parallel_make $debug -s " |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 77 | } |
| 78 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 79 | # |
| 80 | # FVP platform |
| 81 | # We'll use the following flags for all FVP builds. |
| 82 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 83 | fvp_common_flags="$(common_flags) PLAT=fvp" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 84 | |
| 85 | # Try all possible SPDs. |
| 86 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} ARM_TSP_RAM_LOCATION=dram SPD=tspd |
| 87 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} ARM_TSP_RAM_LOCATION=dram SPD=tspd TSP_INIT_ASYNC=1 \ |
| 88 | TSP_NS_INTR_ASYNC_PREEMPT=1 |
| 89 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} SPD=opteed |
| 90 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} SPD=tlkd |
| 91 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 92 | # Dualroot chain of trust. |
| 93 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} SPD=tspd COT=dualroot |
| 94 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 95 | clean_build $fvp_common_flags SPD=trusty |
| 96 | clean_build $fvp_common_flags SPD=trusty TRUSTY_SPD_WITH_GENERIC_SERVICES=1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 97 | |
| 98 | # SDEI |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 99 | clean_build $fvp_common_flags SDEI_SUPPORT=1 EL3_EXCEPTION_HANDLING=1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 100 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 101 | # SDEI with fconf |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 102 | clean_build $fvp_common_flags SDEI_IN_FCONF=1 SDEI_SUPPORT=1 EL3_EXCEPTION_HANDLING=1 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 103 | |
| 104 | # Secure interrupt descriptors with fconf |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 105 | clean_build $fvp_common_flags SEC_INT_DESC_IN_FCONF=1 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 106 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 107 | # Without coherent memory |
| 108 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} ARM_TSP_RAM_LOCATION=dram SPD=tspd USE_COHERENT_MEM=0 |
| 109 | |
| 110 | # Using PSCI extended State ID format rather than the original format |
| 111 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} ARM_TSP_RAM_LOCATION=dram SPD=tspd PSCI_EXTENDED_STATE_ID=1 \ |
| 112 | ARM_RECOM_STATE_ID_ENC=1 |
| 113 | |
| 114 | # Alternative boot flows (This changes some of the platform initialisation code) |
| 115 | clean_build $fvp_common_flags EL3_PAYLOAD=0x80000000 |
| 116 | clean_build $fvp_common_flags PRELOADED_BL33_BASE=0x80000000 |
| 117 | |
| 118 | # Using the SP804 timer instead of the Generic Timer |
| 119 | clean_build $fvp_common_flags FVP_USE_SP804_TIMER=1 |
| 120 | |
| 121 | # Using the CCN driver and multi cluster topology |
| 122 | clean_build $fvp_common_flags FVP_CLUSTER_COUNT=4 |
| 123 | |
| 124 | # PMF |
| 125 | clean_build $fvp_common_flags ENABLE_PMF=1 |
| 126 | |
| 127 | # stack protector |
| 128 | clean_build $fvp_common_flags ENABLE_STACK_PROTECTOR=strong |
| 129 | |
| 130 | # AArch32 build |
Leonardo Sandoval | 1c24ae5 | 2020-07-08 11:47:23 -0500 | [diff] [blame] | 131 | clean_build $fvp_common_flags CROSS_COMPILE=arm-none-eabi- \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 132 | ARCH=aarch32 AARCH32_SP=sp_min \ |
| 133 | RESET_TO_SP_MIN=1 PRELOADED_BL33_BASE=0x80000000 |
Leonardo Sandoval | 1c24ae5 | 2020-07-08 11:47:23 -0500 | [diff] [blame] | 134 | clean_build $fvp_common_flags CROSS_COMPILE=arm-none-eabi- \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 135 | ARCH=aarch32 AARCH32_SP=sp_min |
| 136 | |
| 137 | # Xlat tables lib version 1 (AArch64 and AArch32) |
| 138 | clean_build $fvp_common_flags ARM_XLAT_TABLES_LIB_V1=1 RECLAIM_INIT_CODE=0 |
Leonardo Sandoval | 1c24ae5 | 2020-07-08 11:47:23 -0500 | [diff] [blame] | 139 | clean_build $fvp_common_flags CROSS_COMPILE=arm-none-eabi- \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 140 | ARCH=aarch32 AARCH32_SP=sp_min ARM_XLAT_TABLES_LIB_V1=1 RECLAIM_INIT_CODE=0 |
| 141 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 142 | # SPM support based on Management Mode Interface Specification |
| 143 | clean_build $fvp_common_flags SPM_MM=1 EL3_EXCEPTION_HANDLING=1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 144 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 145 | # SPM support with TOS(optee) as SPM sitting at S-EL1 |
| 146 | clean_build $fvp_common_flags SPD=spmd SPMD_SPM_AT_SEL2=0 |
| 147 | |
| 148 | # SPM support with Secure hafnium as SPM sitting at S-EL2 |
| 149 | # SP_LAYOUT_FILE is used only during FIP creation but build won't progress |
| 150 | # if we have NULL value to it, so passing a dummy string. |
| 151 | clean_build $fvp_common_flags SPD=spmd SPMD_SPM_AT_SEL2=1 ARM_ARCH_MINOR=4 \ |
| 152 | CTX_INCLUDE_EL2_REGS=1 SP_LAYOUT_FILE=dummy |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 153 | |
| 154 | #BL2 at EL3 support |
| 155 | clean_build $fvp_common_flags BL2_AT_EL3=1 |
Leonardo Sandoval | 1c24ae5 | 2020-07-08 11:47:23 -0500 | [diff] [blame] | 156 | clean_build $fvp_common_flags CROSS_COMPILE=arm-none-eabi- \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 157 | ARCH=aarch32 AARCH32_SP=sp_min BL2_AT_EL3=1 |
| 158 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 159 | # RAS Extension Support |
| 160 | clean_build $fvp_common_flags EL3_EXCEPTION_HANDLING=1 \ |
| 161 | FAULT_INJECTION_SUPPORT=1 HANDLE_EA_EL3_FIRST=1 RAS_EXTENSION=1 \ |
| 162 | SDEI_SUPPORT=1 |
| 163 | |
| 164 | # Hardware Assisted Coherency(DynamIQ) |
| 165 | clean_build $fvp_common_flags FVP_CLUSTER_COUNT=1 FVP_MAX_CPUS_PER_CLUSTER=8 \ |
| 166 | HW_ASSISTED_COHERENCY=1 USE_COHERENT_MEM=0 |
| 167 | |
| 168 | # Pointer Authentication Support |
| 169 | clean_build $fvp_common_flags CTX_INCLUDE_PAUTH_REGS=1 \ |
| 170 | ARM_ARCH_MINOR=5 EL3_EXCEPTION_HANDLING=1 BRANCH_PROTECTION=1 SDEI_SUPPORT=1 SPD=tspd TSP_NS_INTR_ASYNC_PREEMPT=1 |
| 171 | |
| 172 | # Undefined Behaviour Sanitizer |
| 173 | # Building with UBSAN SANITIZE_UB=on increases the executable size. |
| 174 | # Hence it is only properly supported in bl31 with RESET_TO_BL31 enabled |
| 175 | make $fvp_common_flags clean |
| 176 | make $fvp_common_flags SANITIZE_UB=on RESET_TO_BL31=1 bl31 |
| 177 | |
| 178 | # debugfs feature |
| 179 | clean_build $fvp_common_flags DEBUG=1 USE_DEBUGFS=1 |
| 180 | |
| 181 | # MPAM feature |
| 182 | clean_build $fvp_common_flags ENABLE_MPAM_FOR_LOWER_ELS=1 |
| 183 | |
| 184 | # Using GICv3.1 driver with extended PPI and SPI range |
| 185 | clean_build $fvp_common_flags GIC_EXT_INTID=1 |
| 186 | |
| 187 | # Using GICv4 features with extended PPI and SPI range |
| 188 | clean_build $fvp_common_flags GIC_ENABLE_V4_EXTN=1 GIC_EXT_INTID=1 |
| 189 | |
Alexei Fedorov | 20fdf50 | 2020-07-27 17:36:38 +0100 | [diff] [blame] | 190 | # Measured Boot |
| 191 | clean_build $fvp_common_flags ${ARM_TBB_OPTIONS} MEASURED_BOOT=1 |
| 192 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 193 | # |
| 194 | # Juno platform |
| 195 | # We'll use the following flags for all Juno builds. |
| 196 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 197 | juno_common_flags="$(common_flags) PLAT=juno" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 198 | clean_build $juno_common_flags SPD=tspd ${ARM_TBB_OPTIONS} |
| 199 | clean_build $juno_common_flags EL3_PAYLOAD=0x80000000 |
| 200 | clean_build $juno_common_flags ENABLE_STACK_PROTECTOR=strong |
| 201 | clean_build $juno_common_flags CSS_USE_SCMI_SDS_DRIVER=0 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 202 | clean_build $juno_common_flags SPD=tspd ${ARM_TBB_OPTIONS} ARM_CRYPTOCELL_INTEG=1 CCSBROM_LIB_PATH=${CRYPTOCELL_LIB_PATH} KEY_SIZE=2048 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 203 | |
| 204 | # |
| 205 | # System Guidance for Infrastructure platform SGI575 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 206 | # Enable build config with RAS_EXTENSION to cover more files |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 207 | make $(common_flags) PLAT=sgi575 ${ARM_TBB_OPTIONS} EL3_EXCEPTION_HANDLING=1 FAULT_INJECTION_SUPPORT=1 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 208 | HANDLE_EA_EL3_FIRST=1 RAS_EXTENSION=1 SDEI_SUPPORT=1 SPM_MM=1 all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 209 | # |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 210 | # System Guidance for Mobile platform SGM775 |
| 211 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 212 | make $(common_flags) PLAT=sgm775 ${ARM_TBB_OPTIONS} SPD=tspd \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 213 | CSS_USE_SCMI_SDS_DRIVER=1 all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 214 | |
| 215 | # |
Vijayenthiran Subramaniam | 2a47a6d | 2020-07-22 14:16:58 +0530 | [diff] [blame] | 216 | # System Guidance for Infrastructure platform RD-N1-Edge-Dual |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 217 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 218 | make $(common_flags) PLAT=rdn1edge CSS_SGI_CHIP_COUNT=2 ${ARM_TBB_OPTIONS} all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 219 | |
| 220 | # |
| 221 | # System Guidance for Infrastructure platform RD-E1Edge |
| 222 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 223 | make $(common_flags) PLAT=rde1edge ${ARM_TBB_OPTIONS} CSS_SGI_CHIP_COUNT=1 all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 224 | |
| 225 | # |
| 226 | # System Guidance for Infrastructure platform RD-Daniel |
| 227 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 228 | make $(common_flags) PLAT=rddaniel ${ARM_TBB_OPTIONS} all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 229 | |
| 230 | # |
| 231 | # System Guidance for Infrastructure platform RD-Danielxlr |
| 232 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 233 | make $(common_flags) PLAT=rddanielxlr ${ARM_TBB_OPTIONS} CSS_SGI_CHIP_COUNT=4 all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 234 | |
| 235 | # |
| 236 | # Neoverse N1 SDP platform |
| 237 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 238 | make $(common_flags) PLAT=n1sdp ${ARM_TBB_OPTIONS} all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 239 | |
| 240 | # |
| 241 | # FVP VE platform |
| 242 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 243 | make $(common_flags) PLAT=fvp_ve AARCH32_SP=sp_min ARCH=aarch32 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 244 | CROSS_COMPILE=arm-none-eabi- ARM_ARCH_MAJOR=7 \ |
| 245 | ARM_CORTEX_A5=yes ARM_XLAT_TABLES_LIB_V1=1 \ |
| 246 | FVP_HW_CONFIG_DTS=fdts/fvp-ve-Cortex-A5x1.dts all |
| 247 | |
| 248 | # |
| 249 | # A5 DesignStart Platform |
| 250 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 251 | make $(common_flags) PLAT=a5ds AARCH32_SP=sp_min ARCH=aarch32 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 252 | ARM_ARCH_MAJOR=7 ARM_CORTEX_A5=yes ARM_XLAT_TABLES_LIB_V1=1 \ |
| 253 | CROSS_COMPILE=arm-none-eabi- FVP_HW_CONFIG_DTS=fdts/a5ds.dts |
| 254 | |
| 255 | # |
| 256 | # Corstone700 Platform |
| 257 | # |
| 258 | |
| 259 | corstone700_common_flags="CROSS_COMPILE=arm-none-eabi- \ |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 260 | $(common_flags) \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 261 | PLAT=corstone700 \ |
| 262 | ARCH=aarch32 \ |
| 263 | RESET_TO_SP_MIN=1 \ |
| 264 | AARCH32_SP=sp_min \ |
| 265 | ARM_LINUX_KERNEL_AS_BL33=0 \ |
| 266 | ARM_PRELOADED_DTB_BASE=0x80400000 \ |
| 267 | ENABLE_PIE=1 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 268 | ENABLE_STACK_PROTECTOR=all \ |
| 269 | all" |
| 270 | |
| 271 | echo "Info: Building Corstone700 FVP ..." |
| 272 | |
| 273 | make TARGET_PLATFORM=fvp ${corstone700_common_flags} |
| 274 | |
| 275 | echo "Info: Building Corstone700 FPGA ..." |
| 276 | |
| 277 | make TARGET_PLATFORM=fpga ${corstone700_common_flags} |
| 278 | |
| 279 | # |
| 280 | # Arm internal FPGA port |
| 281 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 282 | make PLAT=arm_fpga $(common_flags) CROSS_COMPILE=aarch64-none-elf- \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 283 | FPGA_PRELOADED_DTB_BASE=0x88000000 PRELOADED_BL33_BASE=0x82080000 all |
| 284 | |
| 285 | # |
| 286 | # Total Compute platform |
| 287 | # |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 288 | make $(common_flags) PLAT=tc0 ${ARM_TBB_OPTIONS} all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 289 | |
| 290 | # Partners' platforms. |
| 291 | # Enable as many features as possible. |
| 292 | # We don't need to clean between each build here because we only do one build |
| 293 | # per platform so we don't hit the build flags dependency problem. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 294 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 295 | make PLAT=mt8173 $(common_flags) all |
| 296 | make PLAT=mt8183 $(common_flags) all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 297 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 298 | make PLAT=rk3288 CROSS_COMPILE=arm-none-eabi- \ |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 299 | $(common_flags) ARCH=aarch32 AARCH32_SP=sp_min all |
| 300 | make PLAT=rk3368 $(common_flags) COREBOOT=1 all |
| 301 | make PLAT=rk3399 $(common_flags) COREBOOT=1 PLAT_RK_DP_HDCP=1 all |
| 302 | make PLAT=rk3328 $(common_flags) COREBOOT=1 PLAT_RK_SECURE_DDR_MINILOADER=1 all |
| 303 | make PLAT=px30 $(common_flags) PLAT_RK_SECURE_DDR_MINILOADER=1 all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 304 | |
| 305 | # Although we do several consecutive builds for the Tegra platform below, we |
| 306 | # don't need to clean between each one because the Tegra makefiles specify |
| 307 | # a different build directory per SoC. |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 308 | make PLAT=tegra TARGET_SOC=t210 $(common_flags) all |
| 309 | make PLAT=tegra TARGET_SOC=t132 $(common_flags) all |
| 310 | make PLAT=tegra TARGET_SOC=t186 $(common_flags) all |
| 311 | make PLAT=tegra TARGET_SOC=t194 $(common_flags) all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 312 | |
| 313 | # For the Xilinx platform, artificially increase the extents of BL31 memory |
| 314 | # (using the platform-specific build options ZYNQMP_ATF_MEM_{BASE,SIZE}). |
| 315 | # If we keep the default values, BL31 doesn't fit when it is built with all |
| 316 | # these build flags. |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 317 | make PLAT=zynqmp $(common_flags) \ |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 318 | RESET_TO_BL31=1 SPD=tspd \ |
| 319 | ZYNQMP_ATF_MEM_BASE=0xFFFC0000 ZYNQMP_ATF_MEM_SIZE=0x00040000 \ |
| 320 | all |
| 321 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 322 | # Build both for silicon (default) and virtual QEMU platform. |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 323 | clean_build PLAT=versal $(common_flags) |
| 324 | clean_build PLAT=versal $(common_flags) VERSAL_PLATFORM=versal_virt |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 325 | |
| 326 | # Platforms from Allwinner |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 327 | make PLAT=sun50i_a64 $(common_flags) all |
| 328 | make PLAT=sun50i_h6 $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 329 | |
| 330 | # Platforms from i.MX |
| 331 | make AARCH32_SP=optee ARCH=aarch32 ARM_ARCH_MAJOR=7 ARM_CORTEX_A7=yes \ |
| 332 | CROSS_COMPILE=arm-none-eabi- PLAT=warp7 ${TBB_OPTIONS} \ |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 333 | $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 334 | make AARCH32_SP=optee ARCH=aarch32 CROSS_COMPILE=arm-none-eabi- PLAT=picopi \ |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 335 | $(common_flags) all |
| 336 | make PLAT=imx8mm $(common_flags) all |
| 337 | make PLAT=imx8mn $(common_flags) all |
| 338 | make PLAT=imx8mp $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 339 | |
| 340 | # Temporarily building in release mode until the following ticket is resolved: |
| 341 | # https://developer.trustedfirmware.org/T626 |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 342 | # make PLAT=imx8mq $(common_flags) all |
| 343 | make PLAT=imx8mq $(common_flags release) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 344 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 345 | make PLAT=imx8qm $(common_flags) all |
| 346 | make PLAT=imx8qx $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 347 | |
| 348 | # Platforms from Intel |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 349 | make PLAT=stratix10 $(common_flags) all |
| 350 | make PLAT=agilex $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 351 | |
| 352 | # Platforms from Broadcom |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 353 | clean_build PLAT=stingray $(common_flags) BOARD_CFG=bcm958742t INCLUDE_EMMC_DRIVER_ERASE_CODE=1 |
| 354 | clean_build PLAT=stingray $(common_flags) BOARD_CFG=bcm958742t-ns3 INCLUDE_EMMC_DRIVER_ERASE_CODE=1 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 355 | |
| 356 | # Platforms from Marvell |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 357 | make PLAT=a3700 $(common_flags) SCP_BL2=/dev/null all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 358 | # Source files from mv-ddr-marvell repository are necessary |
| 359 | # to build below four platforms |
Manish Pandey | 62dc3d9 | 2020-08-10 16:29:47 +0100 | [diff] [blame] | 360 | wget http://files.oss.arm.com/downloads/tf-a/mv-ddr-marvell/mv-ddr-marvell-fae3f6c98230ae51a78e248af5de96fac97a8fca.tar.gz 2> /dev/null |
| 361 | tar -xzf mv-ddr-marvell-fae3f6c98230ae51a78e248af5de96fac97a8fca.tar.gz 2> /dev/null |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 362 | mv mv-ddr-marvell drivers/marvell/mv_ddr |
| 363 | |
| 364 | # These platforms from Marvell have dependency on GCC-6.2.1 toolchain |
| 365 | make PLAT=a80x0 DEBUG=1 SCP_BL2=/dev/null \ |
| 366 | CROSS_COMPILE=/arm/pdsw/tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all |
| 367 | make PLAT=a80x0_mcbin DEBUG=1 SCP_BL2=/dev/null \ |
| 368 | CROSS_COMPILE=/arm/pdsw/tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all |
| 369 | make PLAT=a70x0 DEBUG=1 SCP_BL2=/dev/null \ |
| 370 | CROSS_COMPILE=/arm/pdsw/tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all |
| 371 | make PLAT=a70x0_amc DEBUG=1 SCP_BL2=/dev/null \ |
| 372 | CROSS_COMPILE=/arm/pdsw/tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all |
| 373 | make PLAT=a80x0_puzzle DEBUG=1 SCP_BL2=/dev/null \ |
| 374 | CROSS_COMPILE=/arm/pdsw/tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all |
| 375 | |
| 376 | # Removing the source files |
| 377 | rm -rf drivers/marvell/mv_ddr 2> /dev/null |
| 378 | |
| 379 | # Platforms from Meson |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 380 | make PLAT=gxbb $(common_flags) all |
| 381 | make PLAT=gxl $(common_flags) all |
| 382 | make PLAT=g12a $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 383 | |
| 384 | # Platforms from Renesas |
| 385 | # Renesas R-Car D3 Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 386 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 387 | BL33=Makefile LIFEC_DBSC_PROTECT_ENABLE=0 LSI=D3 \ |
| 388 | MBEDTLS_DIR=$(pwd)/mbedtls PMIC_ROHM_BD9571=0 \ |
| 389 | RCAR_AVS_SETTING_ENABLE=0 SPD=none RCAR_LOSSY_ENABLE=0 \ |
| 390 | RCAR_SA0_SIZE=0 RCAR_SYSTEM_SUSPEND=0 TRUSTED_BOARD_BOOT=1 |
| 391 | |
| 392 | # Renesas R-Car H3 Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 393 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 394 | BL33=Makefile MBEDTLS_DIR=$(pwd)/mbedtls LSI=H3 \ |
| 395 | MACHINE=ulcb PMIC_LEVEL_MODE=0 RCAR_DRAM_LPDDR4_MEMCONF=0 \ |
| 396 | RCAR_DRAM_SPLIT=1 RCAR_GEN3_ULCB=1 SPD=opteed \ |
| 397 | TRUSTED_BOARD_BOOT=1 |
| 398 | |
| 399 | # Renesas R-Car H3N Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 400 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 401 | BL33=Makefile MBEDTLS_DIR=$(pwd)/mbedtls LSI=H3N \ |
| 402 | SPD=opteed TRUSTED_BOARD_BOOT=1 |
| 403 | |
| 404 | # Renesas R-Car M3 Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 405 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 406 | BL33=Makefile MBEDTLS_DIR=$(pwd)/mbedtls LSI=M3 \ |
| 407 | MACHINE=ulcb PMIC_LEVEL_MODE=0 RCAR_DRAM_LPDDR4_MEMCONF=0 \ |
| 408 | RCAR_DRAM_SPLIT=2 RCAR_GEN3_ULCB=1 SPD=opteed \ |
| 409 | TRUSTED_BOARD_BOOT=1 |
| 410 | |
| 411 | # Renesas R-Car M3N Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 412 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 413 | BL33=Makefile MBEDTLS_DIR=$(pwd)/mbedtls LSI=M3N \ |
| 414 | MACHINE=ulcb PMIC_LEVEL_MODE=0 RCAR_DRAM_LPDDR4_MEMCONF=0 \ |
| 415 | RCAR_GEN3_ULCB=1 SPD=opteed TRUSTED_BOARD_BOOT=1 |
| 416 | |
| 417 | # Renesas R-Car E3 Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 418 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 419 | BL33=Makefile MBEDTLS_DIR=$(pwd)/mbedtls LSI=E3 \ |
| 420 | RCAR_AVS_SETTING_ENABLE=0 RCAR_DRAM_DDR3L_MEMCONF=0 \ |
| 421 | RCAR_SA0_SIZE=0 SPD=opteed TRUSTED_BOARD_BOOT=1 |
| 422 | |
| 423 | # Renesas R-Car V3M Automotive SoC |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 424 | clean_build PLAT=rcar $(common_flags) BL32=Makefile \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 425 | MBEDTLS_DIR=$(pwd)/mbedtls BL33=Makefile LSI=V3M MACHINE=eagle \ |
| 426 | PMIC_ROHM_BD9571=0 RCAR_DRAM_SPLIT=0 RCAR_SYSTEM_SUSPEND=0 \ |
| 427 | AVS_SETTING_ENABLE=0 SPD=none TRUSTED_BOARD_BOOT=1 |
| 428 | |
| 429 | # Platforms from ST |
| 430 | make PLAT=stm32mp1 CROSS_COMPILE=arm-none-eabi- \ |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 431 | $(common_flags) ARM_ARCH_MAJOR=7 STM32MP_EMMC=1 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 432 | STM32MP_RAW_NAND=1 STM32MP_SDMMC=1 STM32MP_SPI_NAND=1 STM32MP_SPI_NOR=1 \ |
| 433 | ARCH=aarch32 AARCH32_SP=sp_min ENABLE_STACK_PROTECTOR=strong bl1 bl2 bl32 |
| 434 | |
| 435 | # Platforms from TI |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 436 | make PLAT=k3 $(common_flags) all |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 437 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 438 | clean_build PLAT=qemu $(common_flags) ${TBB_OPTIONS} |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 439 | # Use GICV3 driver |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 440 | clean_build PLAT=qemu $(common_flags) QEMU_USE_GIC_DRIVER=QEMU_GICV3 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 441 | ENABLE_STACK_PROTECTOR=strong |
| 442 | # Use encrypted FIP feature. |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 443 | clean_build PLAT=qemu $(common_flags) ${TBB_OPTIONS} \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 444 | BL32_RAM_LOCATION=tdram DECRYPTION_SUPPORT=aes_gcm ENCRYPT_BL31=1 \ |
| 445 | ENCRYPT_BL32=1 FW_ENC_STATUS=0 SPD=opteed |
| 446 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 447 | clean_build PLAT=qemu_sbsa $(common_flags) |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 448 | |
| 449 | # For hikey enable PMF to include all files in the platform port |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 450 | make PLAT=hikey $(common_flags) ${TBB_OPTIONS} ENABLE_PMF=1 all |
| 451 | make PLAT=hikey960 $(common_flags) ${TBB_OPTIONS} all |
| 452 | make PLAT=poplar $(common_flags) all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 453 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 454 | # Platforms from Socionext |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 455 | clean_build PLAT=uniphier $(common_flags) ${TBB_OPTIONS} SPD=tspd |
| 456 | clean_build PLAT=uniphier $(common_flags) FIP_GZIP=1 |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 457 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 458 | clean_build PLAT=synquacer $(common_flags) SPM_MM=1 \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 459 | EL3_EXCEPTION_HANDLING=1 PRELOADED_BL33_BASE=0x0 |
| 460 | |
| 461 | # Support for SCP Message Interface protocol with platform specific drivers |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 462 | clean_build PLAT=synquacer $(common_flags) \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 463 | PRELOADED_BL33_BASE=0x0 SQ_USE_SCMI_DRIVER=1 |
| 464 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 465 | make PLAT=poplar $(common_flags) all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 466 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 467 | # Raspberry Pi Platforms |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 468 | make PLAT=rpi3 $(common_flags) ${TBB_OPTIONS} \ |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 469 | ENABLE_STACK_PROTECTOR=strong PRELOADED_BL33_BASE=0xDEADBEEF all |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 470 | make PLAT=rpi4 $(common_flags) all |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 471 | |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 472 | # Cannot use $(common_flags) for LS1043 platform, as then |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 473 | # the binaries do not fit in memory. |
| 474 | clean_build PLAT=ls1043 SPD=opteed ENABLE_STACK_PROTECTOR=strong |
| 475 | clean_build PLAT=ls1043 SPD=tspd |
| 476 | |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 477 | # A113D (AXG) platform. |
Leonardo Sandoval | 97e2ef0 | 2020-08-06 13:29:08 -0500 | [diff] [blame] | 478 | clean_build PLAT=axg $(common_flags) SPD=opteed |
| 479 | clean_build PLAT=axg $(common_flags) AML_USE_ATOS=1 |
Zelalem | c9531f8 | 2020-08-04 15:37:08 -0500 | [diff] [blame] | 480 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 481 | cd .. |