blob: b35effdf164140ccef07b144dbde5ec17aa916bd [file] [log] [blame]
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +01001#
Yann Gautierb9e252a2025-02-12 14:05:14 +01002# Copyright (c) 2016-2025, Arm Limited. All rights reserved.
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +01003#
dp-arm82cb2c12017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +01005#
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
Antonio Nino Diaz8fd9d4d2018-08-08 16:28:43 +010013# Use T32 by default
14AARCH32_INSTRUCTION_SET := T32
15
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010016# 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
Alexei Fedorovf1821792020-12-07 16:38:53 +000022# ARM Architecture feature modifiers: none by default
23ARM_ARCH_FEATURE := none
24
Jeenu Viswambharanc877b412017-01-16 16:52:35 +000025# ARM Architecture major and minor versions: 8.0 by default.
26ARM_ARCH_MAJOR := 8
27ARM_ARCH_MINOR := 0
28
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010029# Base commit to perform code check on
30BASE_COMMIT := origin/master
31
Roberto Vargasb1d27b42017-10-30 14:43:43 +000032# Execute BL2 at EL3
Arvind Ram Prakash42d4d3b2022-11-22 14:41:00 -060033RESET_TO_BL2 := 0
Roberto Vargasb1d27b42017-10-30 14:43:43 +000034
Balint Dobszay46789a72021-03-26 16:23:18 +010035# Only use SP packages if SP layout JSON is defined
36BL2_ENABLE_SP_LOAD := 0
37
Jiafei Pan7d173fc2018-03-21 07:20:09 +000038# BL2 image is stored in XIP memory, for now, this option is only supported
Arvind Ram Prakash42d4d3b2022-11-22 14:41:00 -060039# when RESET_TO_BL2 is 1.
Jiafei Pan7d173fc2018-03-21 07:20:09 +000040BL2_IN_XIP_MEM := 0
41
Hadi Asyrafib90f2072019-08-20 15:33:27 +080042# Do dcache invalidate upon BL2 entry at EL3
43BL2_INV_DCACHE := 1
44
Alexei Fedorov9fc59632019-05-24 12:17:09 +010045# Select the branch protection features to use.
46BRANCH_PROTECTION := 0
47
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010048# 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
Julius Werner3429c772017-06-09 15:17:15 -070052# 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
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010056# 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# Debug build
67DEBUG := 0
68
Sumit Garg7cda17b2019-11-15 10:43:00 +053069# By default disable authenticated decryption support.
70DECRYPTION_SUPPORT := none
71
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010072# Build platform
73DEFAULT_PLAT := fvp
74
Christoph Müllner9e4609f2019-04-24 09:45:30 +020075# Disable the generation of the binary image (ELF only).
76DISABLE_BIN_GENERATION := 0
77
Soby Mathew209a60c2018-03-26 12:43:37 +010078# Enable capability to disable authentication dynamically. Only meant for
79# development platforms.
80DYN_DISABLE_AUTH := 0
81
Chris Kay68120782021-05-05 13:38:30 +010082# Enable the Maximum Power Mitigation Mechanism on supporting cores.
83ENABLE_MPMM := 0
84
85# Enable MPMM configuration via FCONF.
86ENABLE_MPMM_FCONF := 0
87
Soby Mathew3bd17c02018-08-28 11:13:55 +010088# Flag to Enable Position Independant support (PIE)
89ENABLE_PIE := 0
90
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +010091# Flag to enable Performance Measurement Framework
92ENABLE_PMF := 0
93
94# Flag to enable PSCI STATs functionality
95ENABLE_PSCI_STAT := 0
96
97# Flag to enable runtime instrumentation using PMF
98ENABLE_RUNTIME_INSTRUMENTATION := 0
99
Douglas Raillard51faada2017-02-24 18:14:15 +0000100# Flag to enable stack corruption protection
101ENABLE_STACK_PROTECTOR := 0
102
Jeenu Viswambharan21b818c2017-09-22 08:32:10 +0100103# Flag to enable exception handling in EL3
104EL3_EXCEPTION_HANDLING := 0
105
Yann Gautierb9e252a2025-02-12 14:05:14 +0100106# Flag to include all errata for all CPUs TF-A implements workarounds for
107# Its supposed to be used only for testing.
108ENABLE_ERRATA_ALL := 0
109
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530110# By default BL31 encryption disabled
111ENCRYPT_BL31 := 0
112
113# By default BL32 encryption disabled
114ENCRYPT_BL32 := 0
115
116# Default dummy firmware encryption key
117ENC_KEY := 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
118
119# Default dummy nonce for firmware encryption
120ENC_NONCE := 1234567890abcdef12345678
121
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100122# Build flag to treat usage of deprecated platform and framework APIs as error.
123ERROR_DEPRECATED := 0
124
Jeenu Viswambharan1a7c1cf2017-12-08 12:13:51 +0000125# Fault injection support
126FAULT_INJECTION_SUPPORT := 0
127
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +0000128# Flag to enable architectural features detection mechanism
129FEATURE_DETECTION := 0
130
Masahiro Yamada1c75d5d2016-12-25 13:52:22 +0900131# Byte alignment that each component in FIP is aligned to
132FIP_ALIGN := 0
133
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100134# Default FIP file name
135FIP_NAME := fip.bin
136
137# Default FWU_FIP file name
138FWU_FIP_NAME := fwu_fip.bin
139
Sumit Gargc6ba9b42019-11-14 16:33:45 +0530140# By default firmware encryption with SSK
141FW_ENC_STATUS := 0
142
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100143# For Chain of Trust
144GENERATE_COT := 0
145
Jeenu Viswambharan74dce7f2017-09-22 08:32:09 +0100146# Hint platform interrupt control layer that Group 0 interrupts are for EL3. By
147# default, they are for Secure EL1.
148GICV2_G0_FOR_EL3 := 0
149
Manish Pandey46cc41d2022-10-10 11:43:08 +0100150# Route NS External Aborts to EL3. Disabled by default; External Aborts are handled
Jeenu Viswambharan76454ab2017-11-30 12:54:15 +0000151# by lower ELs.
Manish Pandey46cc41d2022-10-10 11:43:08 +0100152HANDLE_EA_EL3_FIRST_NS := 0
Jeenu Viswambharan76454ab2017-11-30 12:54:15 +0000153
Raymond Mao3ba2c152023-07-25 07:53:35 -0700154# Enable Handoff protocol using transfer lists
155TRANSFER_LIST := 0
156
Bipin Ravi9cec5492023-09-28 13:17:24 -0500157# Enables support for the gcc compiler option "-mharden-sls=all".
158# By default, disables all SLS hardening.
159HARDEN_SLS := 0
160
Alexei Fedorovae3cf1f2020-10-06 15:54:12 +0100161# Secure hash algorithm flag, accepts 3 values: sha256, sha384 and sha512.
162# The default value is sha256.
163HASH_ALG := sha256
164
Jeenu Viswambharan3c251af2017-01-04 13:51:42 +0000165# Whether system coherency is managed in hardware, without explicit software
166# operations.
167HW_ASSISTED_COHERENCY := 0
168
Varun Wadekar0ed3be62023-04-13 21:06:18 +0100169# Flag to enable trapping of implementation defined sytem registers
170IMPDEF_SYSREG_TRAP := 0
171
Soby Mathew20917552017-08-31 11:49:32 +0100172# Set the default algorithm for the generation of Trusted Board Boot keys
173KEY_ALG := rsa
174
Leonardo Sandovalee15a172020-06-18 17:32:55 -0500175# Set the default key size in case KEY_ALG is rsa
176ifeq ($(KEY_ALG),rsa)
177KEY_SIZE := 2048
178endif
179
Alexei Fedorov8c105292020-01-23 14:27:38 +0000180# Option to build TF with Measured Boot support
181MEASURED_BOOT := 0
182
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100183# NS timer register save and restore
184NS_TIMER_SWITCH := 0
185
Varun Wadekar77f1f7a2019-01-31 09:22:30 -0800186# Include lib/libc in the final image
187OVERRIDE_LIBC := 0
188
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100189# Build PL011 UART driver in minimal generic UART mode
190PL011_GENERIC_UART := 0
191
192# By default, consider that the platform's reset address is not programmable.
193# The platform Makefile is free to override this value.
194PROGRAMMABLE_RESET_ADDRESS := 0
195
Antonio Nino Diaz73308612019-02-28 13:35:21 +0000196# Flag used to choose the power state format: Extended State-ID or Original
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100197PSCI_EXTENDED_STATE_ID := 0
198
Wing Li64b47102023-01-26 18:33:36 -0800199# Enable PSCI OS-initiated mode support
200PSCI_OS_INIT_MODE := 0
201
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100202# By default, BL1 acts as the reset handler, not BL31
203RESET_TO_BL31 := 0
204
205# For Chain of Trust
206SAVE_KEYS := 0
207
Jeenu Viswambharanb7cb1332017-10-16 08:43:14 +0100208# Software Delegated Exception support
johpow01dc78e622021-07-08 14:14:00 -0500209SDEI_SUPPORT := 0
Jeenu Viswambharanb7cb1332017-10-16 08:43:14 +0100210
Jayanth Dodderi Chidanand0b22e592022-10-11 17:16:07 +0100211# True Random Number firmware Interface support
johpow01dc78e622021-07-08 14:14:00 -0500212TRNG_SUPPORT := 0
Jimmy Brisson7dfb9912020-06-22 14:18:42 -0500213
Sona Mathewffea3842022-11-18 18:05:38 -0600214# Check to see if Errata ABI is supported
215ERRATA_ABI_SUPPORT := 0
216
Sona Mathewef63f5b2023-03-14 14:02:03 -0500217# Check to enable Errata ABI for platforms with non-arm interconnect
218ERRATA_NON_ARM_INTERCONNECT := 0
219
Jeremy Lintonc7a28aa2020-11-18 10:12:41 -0600220# SMCCC PCI support
johpow01dc78e622021-07-08 14:14:00 -0500221SMC_PCI_SUPPORT := 0
Jeremy Lintonc7a28aa2020-11-18 10:12:41 -0600222
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100223# Whether code and read-only data should be put on separate memory pages. The
224# platform Makefile is free to override this value.
225SEPARATE_CODE_AND_RODATA := 0
226
Samuel Hollandf8578e62018-10-17 21:40:18 -0500227# Put NOBITS sections (.bss, stacks, page tables, and coherent memory) in a
228# separate memory region, which may be discontiguous from the rest of BL31.
229SEPARATE_NOBITS_REGION := 0
230
Jiafei Pan96a8ed12022-02-24 10:47:33 +0800231# Put BL2 NOLOAD sections (.bss, stacks, page tables) in a separate memory
232# region, platform Makefile is free to override this value.
233SEPARATE_BL2_NOLOAD_REGION := 0
234
Daniel Boulby1dcc28c2018-09-18 11:45:51 +0100235# If the BL31 image initialisation code is recalimed after use for the secondary
236# cores stack
237RECLAIM_INIT_CODE := 0
238
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100239# SPD choice
240SPD := none
241
Paul Beesley3f3c3412019-09-16 11:29:03 +0000242# Enable the Management Mode (MM)-based Secure Partition Manager implementation
243SPM_MM := 0
Antonio Nino Diaz2d7b9e52018-10-30 11:08:08 +0000244
Marc Bonnici1d63ae42021-12-01 18:00:40 +0000245# Use the FF-A SPMC implementation in EL3.
246SPMC_AT_EL3 := 0
247
Nishant Sharma801cd3c2023-06-27 00:36:01 +0100248# Enable SEL0 SP when SPMC is enabled at EL3
249SPMC_AT_EL3_SEL0_SP :=0
250
Max Shvetsov033039f2020-02-25 13:55:00 +0000251# Use SPM at S-EL2 as a default config for SPMD
252SPMD_SPM_AT_SEL2 := 1
253
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100254# Flag to introduce an infinite loop in BL1 just before it exits into the next
255# image. This is meant to help debugging the post-BL2 phase.
256SPIN_ON_BL1_EXIT := 0
257
258# Flags to build TF with Trusted Boot support
259TRUSTED_BOARD_BOOT := 0
260
Antonio Nino Diaze23e0572018-09-25 09:41:08 +0100261# Build option to choose whether Trusted Firmware uses Coherent memory or not.
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100262USE_COHERENT_MEM := 1
263
Olivier Deprez0ca39132019-09-19 17:46:46 +0200264# Build option to add debugfs support
265USE_DEBUGFS := 0
266
Louis Mayencourt0a6e7e32019-10-24 15:18:46 +0100267# Build option to fconf based io
Balint Dobszaycbf9e842019-12-18 15:28:00 +0100268ARM_IO_IN_DTB := 0
269
270# Build option to support SDEI through fconf
Madhukar Pappireddy452d5e52020-06-02 09:26:30 -0500271SDEI_IN_FCONF := 0
272
273# Build option to support Secure Interrupt descriptors through fconf
274SEC_INT_DESC_IN_FCONF := 0
Louis Mayencourt0a6e7e32019-10-24 15:18:46 +0100275
Antonio Nino Diaze23e0572018-09-25 09:41:08 +0100276# Build option to choose whether Trusted Firmware uses library at ROM
277USE_ROMLIB := 0
Roberto Vargas5accce52018-05-22 16:05:42 +0100278
Petre-Ionut Tudor60e8f3c2019-11-07 15:18:03 +0000279# Build option to choose whether the xlat tables of BL images can be read-only.
280# Note that this only serves as a higher level option to PLAT_RO_XLAT_TABLES,
281# which is the per BL-image option that actually enables the read-only tables
282# API. The reason for having this additional option is to have a common high
283# level makefile where we can check for incompatible features/build options.
284ALLOW_RO_XLAT_TABLES := 0
285
Sandrine Bailleux3bff9102020-01-15 10:23:25 +0100286# Chain of trust.
287COT := tbbr
288
Masahiro Yamadabb41eb72017-05-22 12:11:24 +0900289# Use tbbr_oid.h instead of platform_oid.h
Antonio Nino Diaze23e0572018-09-25 09:41:08 +0100290USE_TBBR_DEFS := 1
Masahiro Yamadabb41eb72017-05-22 12:11:24 +0900291
Jeenu Viswambharan2fae4b12016-10-24 14:31:51 +0100292# Build verbosity
293V := 0
Soby Mathewbcc3c492017-04-10 22:35:42 +0100294
295# Whether to enable D-Cache early during warm boot. This is usually
296# applicable for platforms wherein interconnect programming is not
297# required to enable cache coherency after warm reset (eg: single cluster
298# platforms).
299WARMBOOT_ENABLE_DCACHE_EARLY := 0
dp-armd832aee2017-05-23 09:32:49 +0100300
Mark Brownbebcf272022-04-20 18:14:32 +0100301# Default SVE vector length to maximum architected value
302SVE_VECTOR_LEN := 2048
303
Justin Chadwell1f461972019-08-20 11:01:52 +0100304SANITIZE_UB := off
Soby Mathewc97cba42019-09-25 14:03:41 +0100305
306# For ARMv8.1 (AArch64) platforms, enabling this option selects the spinlock
307# implementation variant using the ARMv8.1-LSE compare-and-swap instruction.
308# Default: disabled
309USE_SPINLOCK_CAS := 0
zelalem-awekeedbce9a2019-11-12 16:20:17 -0600310
311# Enable Link Time Optimization
312ENABLE_LTO := 0
Max Shvetsov28f39f02020-02-25 13:56:19 +0000313
Govindraj Rajaf1910cc2022-11-21 13:10:40 +0000314# This option will include EL2 registers in cpu context save and restore during
315# EL2 firmware entry/exit. Internal flag not meant for direct setting.
316# Use SPD=spmd and SPMD_SPM_AT_SEL2=1 or ENABLE_RME=1 to enable
317# CTX_INCLUDE_EL2_REGS.
Max Shvetsov28f39f02020-02-25 13:56:19 +0000318CTX_INCLUDE_EL2_REGS := 0
Manish V Badarkhe7ff088d2020-03-22 05:06:38 +0000319
320# Enable Memory tag extension which is supported for architecture greater
321# than Armv8.5-A
322# By default it is set to "no"
323SUPPORT_STACK_MEMTAG := no
Manish V Badarkhe45aecff2020-04-28 04:53:32 +0100324
325# Select workaround for AT speculative behaviour.
johpow01dc78e622021-07-08 14:14:00 -0500326ERRATA_SPECULATIVE_AT := 0
Varun Wadekarfbc44bd2020-06-12 10:11:28 -0700327
Manish Pandey00e8f792022-09-27 14:30:34 +0100328# Trap RAS error record access from Non secure
329RAS_TRAP_NS_ERR_REC_ACCESS := 0
Manish V Badarkhe84ef9cd2020-06-29 10:32:53 +0100330
331# Build option to create cot descriptors using fconf
332COT_DESC_IN_DTB := 0
Manish V Badarkhe582e4e72020-07-29 10:58:44 +0100333
Juan Pablo Condecf2dd172022-10-25 19:41:02 -0400334# Build option to provide OpenSSL directory path
Manish V Badarkhe582e4e72020-07-29 10:58:44 +0100335OPENSSL_DIR := /usr
Madhukar Pappireddyfddfb3b2020-08-12 13:18:19 -0500336
Salome Thirote95abc42022-07-14 16:14:15 +0100337# Select the openssl binary provided in OPENSSL_DIR variable
338ifeq ("$(wildcard ${OPENSSL_DIR}/bin)", "")
339 OPENSSL_BIN_PATH = ${OPENSSL_DIR}/apps
340else
341 OPENSSL_BIN_PATH = ${OPENSSL_DIR}/bin
342endif
343
Madhukar Pappireddyfddfb3b2020-08-12 13:18:19 -0500344# Build option to use the SP804 timer instead of the generic one
345USE_SP804_TIMER := 0
Manish V Badarkhe5357f832021-03-16 10:01:27 +0000346
347# Build option to define number of firmware banks, used in firmware update
348# metadata structure.
349NR_OF_FW_BANKS := 2
350
351# Build option to define number of images in firmware bank, used in firmware
352# update metadata structure.
353NR_OF_IMAGES_IN_FW_BANK := 1
Manish V Badarkhe396b3392021-06-25 23:28:59 +0100354
355# Disable Firmware update support by default
356PSA_FWU_SUPPORT := 0
Manish V Badarkhe813524e2021-07-02 09:10:56 +0100357
Tamas Ban0ce20722022-01-18 16:20:47 +0100358# By default, disable the mocking of RSS provided services
359PLAT_RSS_NOT_SUPPORTED := 0
Manish V Badarkhe00e28872022-03-02 12:06:35 +0000360
361# Dynamic Root of Trust for Measurement support
362DRTM_SUPPORT := 0
Okash Khawaja04c73032022-11-04 12:38:01 +0000363
364# Check platform if cache management operations should be performed.
365# Disabled by default.
366CONDITIONAL_CMO := 0
Raghu Krishnamurthy890b5082023-02-25 13:26:10 -0800367
368# By default, disable SPMD Logical partitions
369ENABLE_SPMD_LP := 0
Manish V Badarkhe5782b892023-09-06 09:08:28 +0100370
371# By default, disable PSA crypto (use MbedTLS legacy crypto API).
372PSA_CRYPTO := 0
Sandrine Bailleux85bebe12023-10-11 08:38:00 +0200373
374# getc() support from the console(s).
375# Disabled by default because it constitutes an attack vector into TF-A. It
376# should only be enabled if there is a use case for it.
377ENABLE_CONSOLE_GETC := 0
Arvind Ram Prakash183329a2023-08-15 16:28:06 -0500378
379# Build option to disable EL2 when it is not used.
380# Most platforms switch from EL3 to NS-EL2 and hence the unused NS-EL2
381# functions must be enabled by platforms if they require it.
382# Disabled by default.
383INIT_UNUSED_NS_EL2 := 0