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