1# 2# Copyright (c) 2016-2022, Arm Limited. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7# Default, static values for build variables, listed in alphabetic order. 8# Dependencies between build options, if any, are handled in the top-level 9# Makefile, after this file is included. This ensures that the former is better 10# poised to handle dependencies, as all build variables would have a default 11# value by then. 12 13# Use T32 by default 14AARCH32_INSTRUCTION_SET := T32 15 16# The AArch32 Secure Payload to be built as BL32 image 17AARCH32_SP := none 18 19# The Target build architecture. Supported values are: aarch64, aarch32. 20ARCH := aarch64 21 22# ARM Architecture feature modifiers: none by default 23ARM_ARCH_FEATURE := none 24 25# ARM Architecture major and minor versions: 8.0 by default. 26ARM_ARCH_MAJOR := 8 27ARM_ARCH_MINOR := 0 28 29# Base commit to perform code check on 30BASE_COMMIT := origin/master 31 32# Execute BL2 at EL3 33BL2_AT_EL3 := 0 34 35# Only use SP packages if SP layout JSON is defined 36BL2_ENABLE_SP_LOAD := 0 37 38# BL2 image is stored in XIP memory, for now, this option is only supported 39# when BL2_AT_EL3 is 1. 40BL2_IN_XIP_MEM := 0 41 42# Do dcache invalidate upon BL2 entry at EL3 43BL2_INV_DCACHE := 1 44 45# Select the branch protection features to use. 46BRANCH_PROTECTION := 0 47 48# By default, consider that the platform may release several CPUs out of reset. 49# The platform Makefile is free to override this value. 50COLD_BOOT_SINGLE_CPU := 0 51 52# Flag to compile in coreboot support code. Exclude by default. The coreboot 53# Makefile system will set this when compiling TF as part of a coreboot image. 54COREBOOT := 0 55 56# For Chain of Trust 57CREATE_KEYS := 1 58 59# Build flag to include AArch32 registers in cpu context save and restore during 60# world switch. This flag must be set to 0 for AArch64-only platforms. 61CTX_INCLUDE_AARCH32_REGS := 1 62 63# Include FP registers in cpu context 64CTX_INCLUDE_FPREGS := 0 65 66# Include pointer authentication (ARMv8.3-PAuth) registers in cpu context. This 67# must be set to 1 if the platform wants to use this feature in the Secure 68# world. It is not needed to use it in the Non-secure world. 69CTX_INCLUDE_PAUTH_REGS := 0 70 71# Include Nested virtualization control (Armv8.4-NV) registers in cpu context. 72# This must be set to 1 if architecture implements Nested Virtualization 73# Extension and platform wants to use this feature in the Secure world 74CTX_INCLUDE_NEVE_REGS := 0 75 76# Debug build 77DEBUG := 0 78 79# By default disable authenticated decryption support. 80DECRYPTION_SUPPORT := none 81 82# Build platform 83DEFAULT_PLAT := fvp 84 85# Disable the generation of the binary image (ELF only). 86DISABLE_BIN_GENERATION := 0 87 88# Disable MTPMU if FEAT_MTPMU is supported. Default is 0 to keep backwards 89# compatibility. 90DISABLE_MTPMU := 0 91 92# Enable capability to disable authentication dynamically. Only meant for 93# development platforms. 94DYN_DISABLE_AUTH := 0 95 96# Build option to enable MPAM for lower ELs 97ENABLE_MPAM_FOR_LOWER_ELS := 0 98 99# Enable the Maximum Power Mitigation Mechanism on supporting cores. 100ENABLE_MPMM := 0 101 102# Enable MPMM configuration via FCONF. 103ENABLE_MPMM_FCONF := 0 104 105# Flag to Enable Position Independant support (PIE) 106ENABLE_PIE := 0 107 108# Flag to enable Performance Measurement Framework 109ENABLE_PMF := 0 110 111# Flag to enable PSCI STATs functionality 112ENABLE_PSCI_STAT := 0 113 114# Flag to enable Realm Management Extension (FEAT_RME) 115ENABLE_RME := 0 116 117# Flag to enable runtime instrumentation using PMF 118ENABLE_RUNTIME_INSTRUMENTATION := 0 119 120# Flag to enable stack corruption protection 121ENABLE_STACK_PROTECTOR := 0 122 123# Flag to enable exception handling in EL3 124EL3_EXCEPTION_HANDLING := 0 125 126# Flag to enable Branch Target Identification. 127# Internal flag not meant for direct setting. 128# Use BRANCH_PROTECTION to enable BTI. 129ENABLE_BTI := 0 130 131# Flag to enable Pointer Authentication. 132# Internal flag not meant for direct setting. 133# Use BRANCH_PROTECTION to enable PAUTH. 134ENABLE_PAUTH := 0 135 136# Flag to enable access to the HAFGRTR_EL2 register 137ENABLE_FEAT_AMUv1 := 0 138 139# Flag to enable AMUv1p1 extension. 140ENABLE_FEAT_AMUv1p1 := 0 141 142# Flag to enable CSV2_2 extension. 143ENABLE_FEAT_CSV2_2 := 0 144 145# Flag to enable access to the HCRX_EL2 register by setting SCR_EL3.HXEn. 146ENABLE_FEAT_HCX := 0 147 148# Flag to enable access to the HDFGRTR_EL2 register 149ENABLE_FEAT_FGT := 0 150 151# Flag to enable access to the CNTPOFF_EL2 register 152ENABLE_FEAT_ECV := 0 153 154# Flag to enable use of the DIT feature. 155ENABLE_FEAT_DIT := 0 156 157# Flag to enable access to Privileged Access Never bit of PSTATE. 158ENABLE_FEAT_PAN := 0 159 160# Flag to enable access to the Random Number Generator registers 161ENABLE_FEAT_RNG := 0 162 163# Flag to enable support for EL3 trapping of reads of the RNDR and RNDRRS 164# registers, by setting SCR_EL3.TRNDR. 165ENABLE_FEAT_RNG_TRAP := 0 166 167# Flag to enable Speculation Barrier Instruction 168ENABLE_FEAT_SB := 0 169 170# Flag to enable Secure EL-2 feature. 171ENABLE_FEAT_SEL2 := 0 172 173# Flag to enable Virtualization Host Extensions 174ENABLE_FEAT_VHE := 0 175 176# Flag to enable delayed trapping of WFE instruction (FEAT_TWED) 177ENABLE_FEAT_TWED := 0 178 179# By default BL31 encryption disabled 180ENCRYPT_BL31 := 0 181 182# By default BL32 encryption disabled 183ENCRYPT_BL32 := 0 184 185# Default dummy firmware encryption key 186ENC_KEY := 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef 187 188# Default dummy nonce for firmware encryption 189ENC_NONCE := 1234567890abcdef12345678 190 191# Build flag to treat usage of deprecated platform and framework APIs as error. 192ERROR_DEPRECATED := 0 193 194# Fault injection support 195FAULT_INJECTION_SUPPORT := 0 196 197# Flag to enable architectural features detection mechanism 198FEATURE_DETECTION := 0 199 200# Byte alignment that each component in FIP is aligned to 201FIP_ALIGN := 0 202 203# Default FIP file name 204FIP_NAME := fip.bin 205 206# Default FWU_FIP file name 207FWU_FIP_NAME := fwu_fip.bin 208 209# By default firmware encryption with SSK 210FW_ENC_STATUS := 0 211 212# For Chain of Trust 213GENERATE_COT := 0 214 215# Hint platform interrupt control layer that Group 0 interrupts are for EL3. By 216# default, they are for Secure EL1. 217GICV2_G0_FOR_EL3 := 0 218 219# Route NS External Aborts to EL3. Disabled by default; External Aborts are handled 220# by lower ELs. 221HANDLE_EA_EL3_FIRST_NS := 0 222 223# Secure hash algorithm flag, accepts 3 values: sha256, sha384 and sha512. 224# The default value is sha256. 225HASH_ALG := sha256 226 227# Whether system coherency is managed in hardware, without explicit software 228# operations. 229HW_ASSISTED_COHERENCY := 0 230 231# Set the default algorithm for the generation of Trusted Board Boot keys 232KEY_ALG := rsa 233 234# Set the default key size in case KEY_ALG is rsa 235ifeq ($(KEY_ALG),rsa) 236KEY_SIZE := 2048 237endif 238 239# Option to build TF with Measured Boot support 240MEASURED_BOOT := 0 241 242# NS timer register save and restore 243NS_TIMER_SWITCH := 0 244 245# Include lib/libc in the final image 246OVERRIDE_LIBC := 0 247 248# Build PL011 UART driver in minimal generic UART mode 249PL011_GENERIC_UART := 0 250 251# By default, consider that the platform's reset address is not programmable. 252# The platform Makefile is free to override this value. 253PROGRAMMABLE_RESET_ADDRESS := 0 254 255# Flag used to choose the power state format: Extended State-ID or Original 256PSCI_EXTENDED_STATE_ID := 0 257 258# Enable RAS support 259RAS_EXTENSION := 0 260 261# By default, BL1 acts as the reset handler, not BL31 262RESET_TO_BL31 := 0 263 264# For Chain of Trust 265SAVE_KEYS := 0 266 267# Software Delegated Exception support 268SDEI_SUPPORT := 0 269 270# True Random Number firmware Interface support 271TRNG_SUPPORT := 0 272 273# SMCCC PCI support 274SMC_PCI_SUPPORT := 0 275 276# Whether code and read-only data should be put on separate memory pages. The 277# platform Makefile is free to override this value. 278SEPARATE_CODE_AND_RODATA := 0 279 280# Put NOBITS sections (.bss, stacks, page tables, and coherent memory) in a 281# separate memory region, which may be discontiguous from the rest of BL31. 282SEPARATE_NOBITS_REGION := 0 283 284# Put BL2 NOLOAD sections (.bss, stacks, page tables) in a separate memory 285# region, platform Makefile is free to override this value. 286SEPARATE_BL2_NOLOAD_REGION := 0 287 288# If the BL31 image initialisation code is recalimed after use for the secondary 289# cores stack 290RECLAIM_INIT_CODE := 0 291 292# SPD choice 293SPD := none 294 295# Enable the Management Mode (MM)-based Secure Partition Manager implementation 296SPM_MM := 0 297 298# Use the FF-A SPMC implementation in EL3. 299SPMC_AT_EL3 := 0 300 301# Use SPM at S-EL2 as a default config for SPMD 302SPMD_SPM_AT_SEL2 := 1 303 304# Flag to introduce an infinite loop in BL1 just before it exits into the next 305# image. This is meant to help debugging the post-BL2 phase. 306SPIN_ON_BL1_EXIT := 0 307 308# Flags to build TF with Trusted Boot support 309TRUSTED_BOARD_BOOT := 0 310 311# Build option to choose whether Trusted Firmware uses Coherent memory or not. 312USE_COHERENT_MEM := 1 313 314# Build option to add debugfs support 315USE_DEBUGFS := 0 316 317# Build option to fconf based io 318ARM_IO_IN_DTB := 0 319 320# Build option to support SDEI through fconf 321SDEI_IN_FCONF := 0 322 323# Build option to support Secure Interrupt descriptors through fconf 324SEC_INT_DESC_IN_FCONF := 0 325 326# Build option to choose whether Trusted Firmware uses library at ROM 327USE_ROMLIB := 0 328 329# Build option to choose whether the xlat tables of BL images can be read-only. 330# Note that this only serves as a higher level option to PLAT_RO_XLAT_TABLES, 331# which is the per BL-image option that actually enables the read-only tables 332# API. The reason for having this additional option is to have a common high 333# level makefile where we can check for incompatible features/build options. 334ALLOW_RO_XLAT_TABLES := 0 335 336# Chain of trust. 337COT := tbbr 338 339# Use tbbr_oid.h instead of platform_oid.h 340USE_TBBR_DEFS := 1 341 342# Build verbosity 343V := 0 344 345# Whether to enable D-Cache early during warm boot. This is usually 346# applicable for platforms wherein interconnect programming is not 347# required to enable cache coherency after warm reset (eg: single cluster 348# platforms). 349WARMBOOT_ENABLE_DCACHE_EARLY := 0 350 351# Build option to enable/disable the Statistical Profiling Extensions 352ENABLE_SPE_FOR_LOWER_ELS := 1 353 354# SPE is only supported on AArch64 so disable it on AArch32. 355ifeq (${ARCH},aarch32) 356 override ENABLE_SPE_FOR_LOWER_ELS := 0 357endif 358 359# Include Memory Tagging Extension registers in cpu context. This must be set 360# to 1 if the platform wants to use this feature in the Secure world and MTE is 361# enabled at ELX. 362CTX_INCLUDE_MTE_REGS := 0 363 364ENABLE_AMU := 0 365ENABLE_AMU_AUXILIARY_COUNTERS := 0 366ENABLE_AMU_FCONF := 0 367AMU_RESTRICT_COUNTERS := 0 368 369# Enable SVE for non-secure world by default 370ENABLE_SVE_FOR_NS := 1 371# SVE is only supported on AArch64 so disable it on AArch32. 372ifeq (${ARCH},aarch32) 373 override ENABLE_SVE_FOR_NS := 0 374endif 375ENABLE_SVE_FOR_SWD := 0 376 377# Default SVE vector length to maximum architected value 378SVE_VECTOR_LEN := 2048 379 380# SME defaults to disabled 381ENABLE_SME_FOR_NS := 0 382ENABLE_SME_FOR_SWD := 0 383 384# If SME is enabled then force SVE off 385ifeq (${ENABLE_SME_FOR_NS},1) 386 override ENABLE_SVE_FOR_NS := 0 387 override ENABLE_SVE_FOR_SWD := 0 388endif 389 390SANITIZE_UB := off 391 392# For ARMv8.1 (AArch64) platforms, enabling this option selects the spinlock 393# implementation variant using the ARMv8.1-LSE compare-and-swap instruction. 394# Default: disabled 395USE_SPINLOCK_CAS := 0 396 397# Enable Link Time Optimization 398ENABLE_LTO := 0 399 400# This option will include EL2 registers in cpu context save and restore during 401# EL2 firmware entry/exit. Internal flag not meant for direct setting. 402# Use SPD=spmd and SPMD_SPM_AT_SEL2=1 or ENABLE_RME=1 to enable 403# CTX_INCLUDE_EL2_REGS. 404CTX_INCLUDE_EL2_REGS := 0 405 406# Enable Memory tag extension which is supported for architecture greater 407# than Armv8.5-A 408# By default it is set to "no" 409SUPPORT_STACK_MEMTAG := no 410 411# Select workaround for AT speculative behaviour. 412ERRATA_SPECULATIVE_AT := 0 413 414# Trap RAS error record access from Non secure 415RAS_TRAP_NS_ERR_REC_ACCESS := 0 416 417# Build option to create cot descriptors using fconf 418COT_DESC_IN_DTB := 0 419 420# Build option to provide OpenSSL directory path 421OPENSSL_DIR := /usr 422 423# Select the openssl binary provided in OPENSSL_DIR variable 424ifeq ("$(wildcard ${OPENSSL_DIR}/bin)", "") 425 OPENSSL_BIN_PATH = ${OPENSSL_DIR}/apps 426else 427 OPENSSL_BIN_PATH = ${OPENSSL_DIR}/bin 428endif 429 430# Build option to use the SP804 timer instead of the generic one 431USE_SP804_TIMER := 0 432 433# Build option to define number of firmware banks, used in firmware update 434# metadata structure. 435NR_OF_FW_BANKS := 2 436 437# Build option to define number of images in firmware bank, used in firmware 438# update metadata structure. 439NR_OF_IMAGES_IN_FW_BANK := 1 440 441# Disable Firmware update support by default 442PSA_FWU_SUPPORT := 0 443 444# By default, disable access of trace buffer control registers from NS 445# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused 446# if FEAT_TRBE is implemented. 447# Note FEAT_TRBE is only supported on AArch64 - therefore do not enable in 448# AArch32. 449ifneq (${ARCH},aarch32) 450 ENABLE_TRBE_FOR_NS := 0 451else 452 override ENABLE_TRBE_FOR_NS := 0 453endif 454 455# By default, disable access to branch record buffer control registers from NS 456# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused 457# if FEAT_BRBE is implemented. 458ENABLE_BRBE_FOR_NS := 0 459 460# By default, disable access of trace system registers from NS lower 461# ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused if 462# system register trace is implemented. 463ENABLE_SYS_REG_TRACE_FOR_NS := 0 464 465# By default, disable trace filter control registers access to NS 466# lower ELs, i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused 467# if FEAT_TRF is implemented. 468ENABLE_TRF_FOR_NS := 0 469 470# In v8.6+ platforms with delayed trapping of WFE being supported 471# via FEAT_TWED, this flag takes the delay value to be set in the 472# SCR_EL3.TWEDEL(4bit) field, when FEAT_TWED is implemented. 473# By default it takes 0, and need to be updated by the platforms. 474TWED_DELAY := 0 475 476# By default, disable the mocking of RSS provided services 477PLAT_RSS_NOT_SUPPORTED := 0 478 479# Dynamic Root of Trust for Measurement support 480DRTM_SUPPORT := 0 481 482# Check platform if cache management operations should be performed. 483# Disabled by default. 484CONDITIONAL_CMO := 0 485