xref: /optee_os/mk/config.mk (revision d4a87690eba3c5031f5ac9c7592bb7d2d150697d)
1120c43adSJerome Forissier# Default configuration values for OP-TEE core (all platforms).
2120c43adSJerome Forissier#
3120c43adSJerome Forissier# Platform-specific overrides are in core/arch/arm32/plat-*/conf.mk.
4120c43adSJerome Forissier# Some subsystem-specific defaults are not here but rather in */sub.mk.
5120c43adSJerome Forissier#
6120c43adSJerome Forissier# Configuration values may be assigned from multiple sources.
7120c43adSJerome Forissier# From higher to lower priority:
8120c43adSJerome Forissier#
9120c43adSJerome Forissier#   1. Make arguments ('make CFG_FOO=bar...')
10120c43adSJerome Forissier#   2. The file specified by $(CFG_OPTEE_CONFIG) (if defined)
11120c43adSJerome Forissier#   3. The environment ('CFG_FOO=bar make...')
12120c43adSJerome Forissier#   4. The platform-specific configuration file: core/arch/arm32/plat-*/conf.mk
13120c43adSJerome Forissier#   5. This file
14120c43adSJerome Forissier#   6. Subsystem-specific makefiles (*/sub.mk)
15120c43adSJerome Forissier#
16b5569a68SPascal Brand# Actual values used during the build are output to $(out-dir)/conf.mk
17120c43adSJerome Forissier# (CFG_* variables only).
18120c43adSJerome Forissier
19a75f2e14SJerome Forissier# Cross-compiler prefix and suffix
2031bcbe52SJerome Forissierifeq ($(ARCH),arm)
21a75f2e14SJerome ForissierCROSS_COMPILE ?= arm-linux-gnueabihf-
22c042fbefSJerome ForissierCROSS_COMPILE64 ?= aarch64-linux-gnu-
2331bcbe52SJerome Forissierendif
2431bcbe52SJerome Forissierifeq ($(ARCH),riscv)
2531bcbe52SJerome ForissierCROSS_COMPILE ?= riscv-linux-gnu-
2631bcbe52SJerome ForissierCROSS_COMPILE64 ?= riscv64-linux-gnu-
2731bcbe52SJerome Forissierendif
2831bcbe52SJerome ForissierCROSS_COMPILE32 ?= $(CROSS_COMPILE)
29a75f2e14SJerome ForissierCOMPILER ?= gcc
30a75f2e14SJerome Forissier
31b09cddcaSJerome Forissier# For convenience
32b09cddcaSJerome Forissierifdef CFLAGS
33b09cddcaSJerome ForissierCFLAGS32 ?= $(CFLAGS)
34b09cddcaSJerome ForissierCFLAGS64 ?= $(CFLAGS)
35b09cddcaSJerome Forissierendif
36b09cddcaSJerome Forissier
37120c43adSJerome Forissier# Compiler warning level.
38120c43adSJerome Forissier# Supported values: undefined, 1, 2 and 3. 3 gives more warnings.
39b0104773SPascal BrandWARNS ?= 3
40b0104773SPascal Brand
41b4faf480SDick Olsson# Path to the Python interpreter used by the build system.
42b4faf480SDick Olsson# This variable is set to the default python3 interpreter in the user's
43b4faf480SDick Olsson# path. But build environments that require more explicit control can
44b4faf480SDick Olsson# set the path to a specific interpreter through this variable.
45b4faf480SDick OlssonPYTHON3 ?= python3
46b4faf480SDick Olsson
473f17b838SEtienne Carriere# Define DEBUG=1 to compile without optimization (forces -O0)
48b0104773SPascal Brand# DEBUG=1
490e6830baSEtienne Carriereifeq ($(DEBUG),1)
500e6830baSEtienne Carriere# For backwards compatibility
510e6830baSEtienne Carriere$(call force,CFG_CC_OPT_LEVEL,0)
520e6830baSEtienne Carriere$(call force,CFG_DEBUG_INFO,y)
530e6830baSEtienne Carriereendif
540e6830baSEtienne Carriere
550e6830baSEtienne Carriere# CFG_CC_OPT_LEVEL sets compiler optimization level passed with -O directive.
560e6830baSEtienne Carriere# Optimize for size by default, usually gives good performance too.
570e6830baSEtienne CarriereCFG_CC_OPT_LEVEL ?= s
580e6830baSEtienne Carriere
590e6830baSEtienne Carriere# Enabling CFG_DEBUG_INFO makes debug information embedded in core.
600e6830baSEtienne CarriereCFG_DEBUG_INFO ?= y
61b0104773SPascal Brand
624ec2358eSJerome Forissier# If y, enable debug features of the TEE core (assertions and lock checks
634ec2358eSJerome Forissier# are enabled, panic and assert messages are more verbose, data and prefetch
644ec2358eSJerome Forissier# aborts show a stack dump). When disabled, the NDEBUG directive is defined
654ec2358eSJerome Forissier# so assertions are disabled.
664ec2358eSJerome ForissierCFG_TEE_CORE_DEBUG ?= y
67b0104773SPascal Brand
683f58e4ecSOvidiu Mihalachi# Log levels for the TEE core. Defines which core messages are displayed
693f58e4ecSOvidiu Mihalachi# on the secure console. Disabling core log (level set to 0) also disables
703f58e4ecSOvidiu Mihalachi# logs from the TAs.
7109ca9f8bSJerome Forissier# 0: none
7209ca9f8bSJerome Forissier# 1: error
7314c68b3cSJerome Forissier# 2: error + info
7414c68b3cSJerome Forissier# 3: error + info + debug
7514c68b3cSJerome Forissier# 4: error + info + debug + flow
7614c68b3cSJerome ForissierCFG_TEE_CORE_LOG_LEVEL ?= 2
773f58e4ecSOvidiu Mihalachi
783f58e4ecSOvidiu Mihalachi# TA log level
793f58e4ecSOvidiu Mihalachi# If user-mode library libutils.a is built with CFG_TEE_TA_LOG_LEVEL=0,
803f58e4ecSOvidiu Mihalachi# TA tracing is disabled regardless of the value of CFG_TEE_TA_LOG_LEVEL
813f58e4ecSOvidiu Mihalachi# when the TA is built.
82e0042c88SPascal BrandCFG_TEE_TA_LOG_LEVEL ?= 1
83b0104773SPascal Brand
847c876f12SPascal Brand# TA enablement
857c876f12SPascal Brand# When defined to "y", TA traces are output according to
867c876f12SPascal Brand# CFG_TEE_TA_LOG_LEVEL. Otherwise, they are not output at all
877c876f12SPascal BrandCFG_TEE_CORE_TA_TRACE ?= y
88b0104773SPascal Brand
898c8e1441SJerome Forissier# If y, enable the memory leak detection feature in the bget memory allocator.
908c8e1441SJerome Forissier# When this feature is enabled, calling mdbg_check(1) will print a list of all
918c8e1441SJerome Forissier# the currently allocated buffers and the location of the allocation (file and
928c8e1441SJerome Forissier# line number).
938c8e1441SJerome Forissier# Note: make sure the log level is high enough for the messages to show up on
948c8e1441SJerome Forissier# the secure console! For instance:
958c8e1441SJerome Forissier# - To debug user-mode (TA) allocations: build OP-TEE *and* the TA with:
968c8e1441SJerome Forissier#   $ make CFG_TEE_TA_MALLOC_DEBUG=y CFG_TEE_TA_LOG_LEVEL=3
978c8e1441SJerome Forissier# - To debug TEE core allocations: build OP-TEE with:
988c8e1441SJerome Forissier#   $ make CFG_TEE_CORE_MALLOC_DEBUG=y CFG_TEE_CORE_LOG_LEVEL=3
990fcbddd4SSY ChiuCFG_TEE_CORE_MALLOC_DEBUG ?= n
1000fcbddd4SSY ChiuCFG_TEE_TA_MALLOC_DEBUG ?= n
101c2ce4186SJens Wiklander# Prints an error message and dumps the stack on failed memory allocations
102c2ce4186SJens Wiklander# using malloc() and friends.
103c2ce4186SJens WiklanderCFG_CORE_DUMP_OOM ?= $(CFG_TEE_CORE_MALLOC_DEBUG)
1040fcbddd4SSY Chiu
1052bfab756SJerome Forissier# Mask to select which messages are prefixed with long debugging information
10664fad262SVolodymyr Babchuk# (severity, core ID, thread ID, component name, function name, line number)
10764fad262SVolodymyr Babchuk# based on the message level. If BIT(level) is set, the long prefix is shown.
1082bfab756SJerome Forissier# Otherwise a short prefix is used (severity and component name only).
109f4aa5b11SJerome Forissier# Levels: 0=none 1=error 2=info 3=debug 4=flow
1102bfab756SJerome ForissierCFG_MSG_LONG_PREFIX_MASK ?= 0x1a
111f4aa5b11SJerome Forissier
112120c43adSJerome Forissier# Number of threads
113120c43adSJerome ForissierCFG_NUM_THREADS ?= 2
114ab35d7adSCedric Chaumont
115ab35d7adSCedric Chaumont# API implementation version
116ab35d7adSCedric ChaumontCFG_TEE_API_VERSION ?= GPD-1.1-dev
117ab35d7adSCedric Chaumont
118ab35d7adSCedric Chaumont# Implementation description (implementation-dependent)
119ab35d7adSCedric ChaumontCFG_TEE_IMPL_DESCR ?= OPTEE
120ab35d7adSCedric Chaumont
12129cff5cfSJerome Forissier# Should OPTEE_SMC_CALL_GET_OS_REVISION return a build identifier to Normal
12229cff5cfSJerome Forissier# World?
12329cff5cfSJerome ForissierCFG_OS_REV_REPORTS_GIT_SHA1 ?= y
12429cff5cfSJerome Forissier
12535c507f2SJerome Forissier# The following values are not extracted from the "git describe" output because
12635c507f2SJerome Forissier# we might be outside of a Git environment, or the tree may have been cloned
12735c507f2SJerome Forissier# with limited depth not including any tag, so there is really no guarantee
12835c507f2SJerome Forissier# that TEE_IMPL_VERSION contains the major and minor revision numbers.
1292a5b1d12SJerome ForissierCFG_OPTEE_REVISION_MAJOR ?= 4
13012d7c4eeSJoakim BechCFG_OPTEE_REVISION_MINOR ?= 2
1313bfa418bSJerome ForissierCFG_OPTEE_REVISION_EXTRA ?=
132ab35d7adSCedric Chaumont
13348ca43e8SJerome Forissier# Trusted OS implementation version
13448ca43e8SJerome ForissierTEE_IMPL_VERSION ?= $(shell git describe --always --dirty=-dev 2>/dev/null || \
1353bfa418bSJerome Forissier		      echo Unknown_$(CFG_OPTEE_REVISION_MAJOR).$(CFG_OPTEE_REVISION_MINOR))$(CFG_OPTEE_REVISION_EXTRA)
13648ca43e8SJerome Forissier
137ab35d7adSCedric Chaumont# Trusted OS implementation manufacturer name
138ab35d7adSCedric ChaumontCFG_TEE_MANUFACTURER ?= LINARO
139ab35d7adSCedric Chaumont
140ab35d7adSCedric Chaumont# Trusted firmware version
141ab35d7adSCedric ChaumontCFG_TEE_FW_IMPL_VERSION ?= FW_IMPL_UNDEF
142ab35d7adSCedric Chaumont
143ab35d7adSCedric Chaumont# Trusted OS implementation manufacturer name
144ab35d7adSCedric ChaumontCFG_TEE_FW_MANUFACTURER ?= FW_MAN_UNDEF
145ab35d7adSCedric Chaumont
146b44708c1SJerome Forissier# Rich Execution Environment (REE) file system support: normal world OS
147b44708c1SJerome Forissier# provides the actual storage.
148b44708c1SJerome Forissier# This is the default FS when enabled (i.e., the one used when
149b44708c1SJerome Forissier# TEE_STORAGE_PRIVATE is passed to the trusted storage API)
150b44708c1SJerome ForissierCFG_REE_FS ?= y
151bc420748SJens Wiklander
15288e6e089SJerome Forissier# RPMB file system support
15388e6e089SJerome ForissierCFG_RPMB_FS ?= n
15488e6e089SJerome Forissier
155f5411aafSJudy Wang# Enable roll-back protection of REE file system using RPMB.
156f5411aafSJudy Wang# Roll-back protection only works if CFG_RPMB_FS = y.
157f5411aafSJudy WangCFG_REE_FS_INTEGRITY_RPMB ?= $(CFG_RPMB_FS)
158f5411aafSJudy Wang$(eval $(call cfg-depends-all,CFG_REE_FS_INTEGRITY_RPMB,CFG_RPMB_FS))
159f5411aafSJudy Wang
16088e6e089SJerome Forissier# Device identifier used when CFG_RPMB_FS = y.
16188e6e089SJerome Forissier# The exact meaning of this value is platform-dependent. On Linux, the
16288e6e089SJerome Forissier# tee-supplicant process will open /dev/mmcblk<id>rpmb
16388e6e089SJerome ForissierCFG_RPMB_FS_DEV_ID ?= 0
16488e6e089SJerome Forissier
1657d97159bSManuel Huber# This config variable determines the number of entries read in from RPMB at
1667d97159bSManuel Huber# once whenever a function traverses the RPMB FS. Increasing the default value
1677d97159bSManuel Huber# has the following consequences:
1687d97159bSManuel Huber# - More memory required on heap. A single FAT entry currently has a size of
1697d97159bSManuel Huber#   256 bytes.
1707d97159bSManuel Huber# - Potentially significant speed-ups for RPMB I/O. Depending on how many
1717d97159bSManuel Huber#   entries a function needs to traverse, the number of time-consuming RPMB
1727d97159bSManuel Huber#   read-in operations can be reduced.
1737d97159bSManuel Huber# Chosing a proper value is both platform- (available memory) and use-case-
1747d97159bSManuel Huber# dependent (potential number of FAT fs entries), so overwrite in platform
1757d97159bSManuel Huber# config files
1767d97159bSManuel HuberCFG_RPMB_FS_RD_ENTRIES ?= 8
1777d97159bSManuel Huber
1785f68d784SManuel Huber# Enables caching of FAT FS entries when set to a value greater than zero.
1795f68d784SManuel Huber# When enabled, the cache stores the first 'CFG_RPMB_FS_CACHE_ENTRIES' FAT FS
1805f68d784SManuel Huber# entries. The cache is populated when FAT FS entries are initially read in.
1815f68d784SManuel Huber# When traversing the FAT FS entries, we read from the cache instead of reading
1825f68d784SManuel Huber# in the entries from RPMB storage. Consequently, when a FAT FS entry is
1835f68d784SManuel Huber# written, the cache is updated. In scenarios where an estimate of the number
1845f68d784SManuel Huber# of FAT FS entries can be made, the cache may be specifically tailored to
1855f68d784SManuel Huber# store all entries. The caching can improve RPMB I/O at the cost
1865f68d784SManuel Huber# of additional memory.
1875f68d784SManuel Huber# Without caching, we temporarily require
1885f68d784SManuel Huber# CFG_RPMB_FS_RD_ENTRIES*sizeof(struct rpmb_fat_entry) bytes of heap memory
1895f68d784SManuel Huber# while traversing the FAT FS (e.g. in read_fat).
1905f68d784SManuel Huber# For example 8*256 bytes = 2kB while in read_fat.
1915f68d784SManuel Huber# With caching, we constantly require up to
1925f68d784SManuel Huber# CFG_RPMB_FS_CACHE_ENTRIES*sizeof(struct rpmb_fat_entry) bytes of heap memory
1935f68d784SManuel Huber# depending on how many elements are in the cache, and additional temporary
1945f68d784SManuel Huber# CFG_RPMB_FS_RD_ENTRIES*sizeof(struct rpmb_fat_entry) bytes of heap memory
1955f68d784SManuel Huber# in case the cache is too small to hold all elements when traversing.
1965f68d784SManuel HuberCFG_RPMB_FS_CACHE_ENTRIES ?= 0
1975f68d784SManuel Huber
1988443e88eSEtienne Carriere# Print RPMB data frames sent to and received from the RPMB device
1998443e88eSEtienne CarriereCFG_RPMB_FS_DEBUG_DATA ?= n
2008443e88eSEtienne Carriere
2018443e88eSEtienne Carriere# Clear RPMB content at cold boot
2028443e88eSEtienne CarriereCFG_RPMB_RESET_FAT ?= n
2038443e88eSEtienne Carriere
2048443e88eSEtienne Carriere# Use a hard coded RPMB key instead of deriving it from the platform HUK
2058443e88eSEtienne CarriereCFG_RPMB_TESTKEY ?= n
2068443e88eSEtienne Carriere
207ed1993b7SJerome Forissier# Enables RPMB key programming by the TEE, in case the RPMB partition has not
208ed1993b7SJerome Forissier# been configured yet.
209ed1993b7SJerome Forissier# !!! Security warning !!!
210ed1993b7SJerome Forissier# Do *NOT* enable this in product builds, as doing so would allow the TEE to
211ed1993b7SJerome Forissier# leak the RPMB key.
212ed1993b7SJerome Forissier# This option is useful in the following situations:
213ed1993b7SJerome Forissier# - Testing
214ed1993b7SJerome Forissier# - RPMB key provisioning in a controlled environment (factory setup)
215ed1993b7SJerome ForissierCFG_RPMB_WRITE_KEY ?= n
216ed1993b7SJerome Forissier
21707fda6c7SJerome Forissier_CFG_WITH_SECURE_STORAGE := $(call cfg-one-enabled,CFG_REE_FS CFG_RPMB_FS)
21807fda6c7SJerome Forissier
2193ecd96bbSVesa Jääskeläinen# Signing key for OP-TEE TA's
2203ecd96bbSVesa Jääskeläinen# When performing external HSM signing for TA's TA_SIGN_KEY can be set to dummy
2213ecd96bbSVesa Jääskeläinen# key and then set TA_PUBLIC_KEY to match public key from the HSM.
2223ecd96bbSVesa Jääskeläinen# TA_PUBLIC_KEY's public key will be embedded into OP-TEE OS.
223bc420748SJens WiklanderTA_SIGN_KEY ?= keys/default_ta.pem
2243ecd96bbSVesa JääskeläinenTA_PUBLIC_KEY ?= $(TA_SIGN_KEY)
225c4553de7SJerome Forissier
226c34d0d91SJens Wiklander# Subkeys is a complement to the normal TA_SIGN_KEY where a subkey is used
227c34d0d91SJens Wiklander# to verify a TA instead. To sign a TA using a previously prepared subkey
228c34d0d91SJens Wiklander# two new options are added, TA_SUBKEY_ARGS and TA_SUBKEY_DEPS.  It is
229c34d0d91SJens Wiklander# typically used by assigning the following in the TA Makefile:
230c34d0d91SJens Wiklander# BINARY = <TA-uuid-string>
231c34d0d91SJens Wiklander# TA_SIGN_KEY = subkey.pem
232c34d0d91SJens Wiklander# TA_SUBKEY_ARGS = --subkey subkey.bin --name subkey_ta
233c34d0d91SJens Wiklander# TA_SUBKEY_DEPS = subkey.bin
234c34d0d91SJens Wiklander# See the documentation for more details on subkeys.
235c34d0d91SJens Wiklander
236c4553de7SJerome Forissier# Include lib/libutils/isoc in the build? Most platforms need this, but some
237c4553de7SJerome Forissier# may not because they obtain the isoc functions from elsewhere
238c4553de7SJerome ForissierCFG_LIBUTILS_WITH_ISOC ?= y
239fce4cfa1SJens Wiklander
2400de9a5fbSJens Wiklander# Enables floating point support for user TAs
2410de9a5fbSJens Wiklander# ARM32: EABI defines both a soft-float ABI and a hard-float ABI,
2420de9a5fbSJens Wiklander#	 hard-float is basically a super set of soft-float. Hard-float
2430de9a5fbSJens Wiklander#	 requires all the support routines provided for soft-float, but the
2440de9a5fbSJens Wiklander#	 compiler may choose to optimize to not use some of them and use
2450de9a5fbSJens Wiklander#	 the floating-point registers instead.
2460de9a5fbSJens Wiklander# ARM64: EABI doesn't define a soft-float ABI, everything is hard-float (or
2470de9a5fbSJens Wiklander#	 nothing with ` -mgeneral-regs-only`)
2480de9a5fbSJens Wiklander# With CFG_TA_FLOAT_SUPPORT enabled TA code is free use floating point types
2490de9a5fbSJens WiklanderCFG_TA_FLOAT_SUPPORT ?= y
250923c1f34SJens Wiklander
2517411e0e1SJerome Forissier# Stack unwinding: print a stack dump to the console on core or TA abort, or
2527411e0e1SJerome Forissier# when a TA panics.
25331a29642SJerome Forissier# If CFG_UNWIND is enabled, both the kernel and user mode call stacks can be
25431a29642SJerome Forissier# unwound (not paged TAs, however).
25531a29642SJerome Forissier# Note that 32-bit ARM code needs unwind tables for this to work, so enabling
25631a29642SJerome Forissier# this option will increase the size of the 32-bit TEE binary by a few KB.
25731a29642SJerome Forissier# Similarly, TAs have to be compiled with -funwind-tables (default when the
25831a29642SJerome Forissier# option is set) otherwise they can't be unwound.
2597411e0e1SJerome Forissier# Warning: since the unwind sequence for user-mode (TA) code is implemented in
2607411e0e1SJerome Forissier# the privileged layer of OP-TEE, enabling this feature will weaken the
2617411e0e1SJerome Forissier# user/kernel isolation. Therefore it should be disabled in release builds.
2623f17b838SEtienne Carriereifeq ($(CFG_TEE_CORE_DEBUG),y)
26331a29642SJerome ForissierCFG_UNWIND ?= y
264923c1f34SJens Wiklanderendif
2656fbac37eSJens Wiklander
2666fbac37eSJens Wiklander# Enable support for dynamically loaded user TAs
2676fbac37eSJens WiklanderCFG_WITH_USER_TA ?= y
2682a142248SJens Wiklander
2692c20168bSBalsam CHIHI# Build user TAs included in this source tree
2702c20168bSBalsam CHIHICFG_BUILD_IN_TREE_TA ?= y
2712c20168bSBalsam CHIHI
27224d49094SJerome Forissier# Choosing the architecture(s) of user-mode libraries (used by TAs)
27324d49094SJerome Forissier#
27424d49094SJerome Forissier# Platforms may define a list of supported architectures for user-mode code
27524d49094SJerome Forissier# by setting $(supported-ta-targets). Valid values are "ta_arm32", "ta_arm64",
27624d49094SJerome Forissier# "ta_arm32 ta_arm64" and "ta_arm64 ta_arm32".
27724d49094SJerome Forissier# $(supported-ta-targets) defaults to "ta_arm32" when the TEE core is 32-bits,
27824d49094SJerome Forissier# and "ta_arm32 ta_arm64" when it is 64-bits (that is, when CFG_ARM64_core=y).
27924d49094SJerome Forissier# The first entry in $(supported-ta-targets) has a special role, see
28024d49094SJerome Forissier# CFG_USER_TA_TARGET_<ta-name> below.
28124d49094SJerome Forissier#
28224d49094SJerome Forissier# CFG_USER_TA_TARGETS may be defined to restrict $(supported-ta-targets) or
28324d49094SJerome Forissier# change the order of the values.
28424d49094SJerome Forissier#
28524d49094SJerome Forissier# The list of TA architectures is ultimately stored in $(ta-targets).
28624d49094SJerome Forissier
28724d49094SJerome Forissier# CFG_USER_TA_TARGET_<ta-name> (for example, CFG_USER_TA_TARGET_avb), if
28824d49094SJerome Forissier# defined, selects the unique TA architecture mode for building the in-tree TA
28924d49094SJerome Forissier# <ta-name>. Can be either ta_arm32 or ta_arm64.
29024d49094SJerome Forissier# By default, in-tree TAs are built using the first architecture specified in
29124d49094SJerome Forissier# $(ta-targets).
29224d49094SJerome Forissier
2937dfff131SJerome Forissier# Address Space Layout Randomization for user-mode Trusted Applications
2947dfff131SJerome Forissier#
2957dfff131SJerome Forissier# When this flag is enabled, the ELF loader will introduce a random offset
2967dfff131SJerome Forissier# when mapping the application in user space. ASLR makes the exploitation of
2977dfff131SJerome Forissier# memory corruption vulnerabilities more difficult.
29887372da4SJens WiklanderCFG_TA_ASLR ?= y
2997dfff131SJerome Forissier
3007dfff131SJerome Forissier# How much ASLR may shift the base address (in pages). The base address is
3017dfff131SJerome Forissier# randomly shifted by an integer number of pages comprised between these two
3027dfff131SJerome Forissier# values. Bigger ranges are more secure because they make the addresses harder
3037dfff131SJerome Forissier# to guess at the expense of using more memory for the page tables.
3047dfff131SJerome ForissierCFG_TA_ASLR_MIN_OFFSET_PAGES ?= 0
3057dfff131SJerome ForissierCFG_TA_ASLR_MAX_OFFSET_PAGES ?= 128
3067dfff131SJerome Forissier
307170e9084SJens Wiklander# Address Space Layout Randomization for TEE Core
308170e9084SJens Wiklander#
309170e9084SJens Wiklander# When this flag is enabled, the early init code will introduce a random
310170e9084SJens Wiklander# offset when mapping TEE Core. ASLR makes the exploitation of memory
311170e9084SJens Wiklander# corruption vulnerabilities more difficult.
31287372da4SJens WiklanderCFG_CORE_ASLR ?= y
313170e9084SJens Wiklander
31445507d10SKhoa Hoang# Stack Protection for TEE Core
31545507d10SKhoa Hoang# This flag enables the compiler stack protection mechanisms -fstack-protector.
31645507d10SKhoa Hoang# It will check the stack canary value before returning from a function to
31745507d10SKhoa Hoang# prevent buffer overflow attacks. Stack protector canary logic will be added
31845507d10SKhoa Hoang# for vulnerable functions that contain:
31945507d10SKhoa Hoang# - A character array larger than 8 bytes.
32045507d10SKhoa Hoang# - An 8-bit integer array larger than 8 bytes.
32145507d10SKhoa Hoang# - A call to alloca() with either a variable size or a constant size bigger
32245507d10SKhoa Hoang#   than 8 bytes.
32345507d10SKhoa HoangCFG_CORE_STACK_PROTECTOR ?= n
32445507d10SKhoa Hoang# This enable stack protector flag -fstack-protector-strong. Stack protector
32545507d10SKhoa Hoang# canary logic will be added for vulnerable functions that contain:
32645507d10SKhoa Hoang# - An array of any size and type.
32745507d10SKhoa Hoang# - A call to alloca().
32845507d10SKhoa Hoang# - A local variable that has its address taken.
32945507d10SKhoa HoangCFG_CORE_STACK_PROTECTOR_STRONG ?= y
33045507d10SKhoa Hoang# This enable stack protector flag -fstack-protector-all. Stack protector canary
33145507d10SKhoa Hoang# logic will be added to all functions regardless of their vulnerability.
33245507d10SKhoa HoangCFG_CORE_STACK_PROTECTOR_ALL ?= n
33345507d10SKhoa Hoang# Stack Protection for TA
33445507d10SKhoa HoangCFG_TA_STACK_PROTECTOR ?= n
33545507d10SKhoa HoangCFG_TA_STACK_PROTECTOR_STRONG ?= y
33645507d10SKhoa HoangCFG_TA_STACK_PROTECTOR_ALL ?= n
33745507d10SKhoa Hoang
33845507d10SKhoa Hoang_CFG_CORE_STACK_PROTECTOR := $(call cfg-one-enabled, CFG_CORE_STACK_PROTECTOR \
33945507d10SKhoa Hoang						     CFG_CORE_STACK_PROTECTOR_STRONG \
34045507d10SKhoa Hoang						     CFG_CORE_STACK_PROTECTOR_ALL)
34145507d10SKhoa Hoang_CFG_TA_STACK_PROTECTOR := $(call cfg-one-enabled, CFG_TA_STACK_PROTECTOR \
34245507d10SKhoa Hoang						   CFG_TA_STACK_PROTECTOR_STRONG \
34345507d10SKhoa Hoang						   CFG_TA_STACK_PROTECTOR_ALL)
34445507d10SKhoa Hoang
345ee664c19SJerome Forissier# Load user TAs from the REE filesystem via tee-supplicant
346ee664c19SJerome ForissierCFG_REE_FS_TA ?= y
347ee664c19SJerome Forissier
3487db24ad6SJerome Forissier# Pre-authentication of TA binaries loaded from the REE filesystem
3497db24ad6SJerome Forissier#
3507db24ad6SJerome Forissier# - If CFG_REE_FS_TA_BUFFERED=y: load TA binary into a temporary buffer in the
3517db24ad6SJerome Forissier#   "Secure DDR" pool, check the signature, then process the file only if it is
3527db24ad6SJerome Forissier#   valid.
3537db24ad6SJerome Forissier# - If disabled: hash the binaries as they are being processed and verify the
3547db24ad6SJerome Forissier#   signature as a last step.
355e6e68745SJerome ForissierCFG_REE_FS_TA_BUFFERED ?= n
3567db24ad6SJerome Forissier$(eval $(call cfg-depends-all,CFG_REE_FS_TA_BUFFERED,CFG_REE_FS_TA))
3577db24ad6SJerome Forissier
358623b9bd4SJens Wiklander# When CFG_REE_FS=y:
359300faa62SEtienne Carriere# Allow secure storage in the REE FS to be entirely deleted without causing
360300faa62SEtienne Carriere# anti-rollback errors. That is, rm /data/tee/dirf.db or rm -rf /data/tee (or
361300faa62SEtienne Carriere# whatever path is configured in tee-supplicant as CFG_TEE_FS_PARENT_PATH)
362300faa62SEtienne Carriere# can be used to reset the secure storage to a clean, empty state.
3633251835dSSumit Garg# Intended to be used for testing only since it weakens storage security.
3643251835dSSumit Garg# Warning: If enabled for release build then it will break rollback protection
3653251835dSSumit Garg# of TAs and the entire REE FS secure storage.
366300faa62SEtienne CarriereCFG_REE_FS_ALLOW_RESET ?= n
367300faa62SEtienne Carriere
368d0c63614SJerome Forissier# Support for loading user TAs from a special section in the TEE binary.
369d0c63614SJerome Forissier# Such TAs are available even before tee-supplicant is available (hence their
370d0c63614SJerome Forissier# name), but note that many services exported to TAs may need tee-supplicant,
371d0c63614SJerome Forissier# so early use is limited to a subset of the TEE Internal Core API (crypto...)
372d0c63614SJerome Forissier# To use this feature, set EARLY_TA_PATHS to the paths to one or more TA ELF
373d0c63614SJerome Forissier# file(s). For example:
374d0c63614SJerome Forissier#   $ make ... \
375d0c63614SJerome Forissier#     EARLY_TA_PATHS="path/to/8aaaf200-2450-11e4-abe2-0002a5d5c51b.stripped.elf \
376d0c63614SJerome Forissier#                     path/to/cb3e5ba0-adf1-11e0-998b-0002a5d5c51b.stripped.elf"
377d0c63614SJerome Forissier# Typical build steps:
378d0c63614SJerome Forissier#   $ make ta_dev_kit CFG_EARLY_TA=y # Create the dev kit (user mode libraries,
379d0c63614SJerome Forissier#                                    # headers, makefiles), ready to build TAs.
380d0c63614SJerome Forissier#                                    # CFG_EARLY_TA=y is optional, it prevents
381d0c63614SJerome Forissier#                                    # later library recompilations.
382d0c63614SJerome Forissier#   <build some TAs>
383d0c63614SJerome Forissier#   $ make EARLY_TA_PATHS=<paths>    # Build OP-TEE and embbed the TA(s)
3843638ea32SJens Wiklander#
3853638ea32SJens Wiklander# Another option is CFG_IN_TREE_EARLY_TAS which is used to point at
3863638ea32SJens Wiklander# in-tree TAs. CFG_IN_TREE_EARLY_TAS is formatted as:
3873638ea32SJens Wiklander# <name-of-ta>/<uuid>
3883638ea32SJens Wiklander# for instance avb/023f8f1a-292a-432b-8fc4-de8471358067
3893638ea32SJens Wiklanderifneq ($(EARLY_TA_PATHS)$(CFG_IN_TREE_EARLY_TAS),)
390d0c63614SJerome Forissier$(call force,CFG_EARLY_TA,y)
391d0c63614SJerome Forissierelse
392d0c63614SJerome ForissierCFG_EARLY_TA ?= n
393d0c63614SJerome Forissierendif
394dea46be3SJelle Sels
39505ee04a8SJelle Selsifeq ($(CFG_EARLY_TA),y)
39605ee04a8SJelle Sels$(call force,CFG_EMBEDDED_TS,y)
39705ee04a8SJelle Selsendif
39805ee04a8SJelle Sels
399dea46be3SJelle Selsifneq ($(SP_PATHS),)
400dea46be3SJelle Sels$(call force,CFG_EMBEDDED_TS,y)
401dea46be3SJelle Selselse
402dea46be3SJelle SelsCFG_SECURE_PARTITION ?= n
403dea46be3SJelle Selsendif
404dea46be3SJelle Sels
40505ee04a8SJelle Selsifeq ($(CFG_SECURE_PARTITION),y)
40605ee04a8SJelle Sels$(call force,CFG_EMBEDDED_TS,y)
40705ee04a8SJelle Selsendif
40805ee04a8SJelle Sels
409dea46be3SJelle Selsifeq ($(CFG_EMBEDDED_TS),y)
410509a9802SJerome Forissier$(call force,CFG_ZLIB,y)
411509a9802SJerome Forissierendif
412d0c63614SJerome Forissier
413c082c54dSEtienne Carriere# By default the early TAs are compressed in the TEE binary, it is possible to
414c082c54dSEtienne Carriere# not compress them with CFG_EARLY_TA_COMPRESS=n
415c082c54dSEtienne CarriereCFG_EARLY_TA_COMPRESS ?= y
416c082c54dSEtienne Carriere
417a884c935SJens Wiklander# Enable paging, requires SRAM, can't be enabled by default
418a884c935SJens WiklanderCFG_WITH_PAGER ?= n
419a884c935SJens Wiklander
420b757e307SJens Wiklander# Use the pager for user TAs
421b757e307SJens WiklanderCFG_PAGED_USER_TA ?= $(CFG_WITH_PAGER)
422b757e307SJens Wiklander
423b757e307SJens Wiklander# If paging of user TAs, that is, R/W paging default to enable paging of
424b757e307SJens Wiklander# TAG and IV in order to reduce heap usage.
425b757e307SJens WiklanderCFG_CORE_PAGE_TAG_AND_IV ?= $(CFG_PAGED_USER_TA)
426b757e307SJens Wiklander
427ab0df69eSJerome Forissier# Runtime lock dependency checker: ensures that a proper locking hierarchy is
428ab0df69eSJerome Forissier# used in the TEE core when acquiring and releasing mutexes. Any violation will
429ab0df69eSJerome Forissier# cause a panic as soon as the invalid locking condition is detected. If
4302288b071SJerome Forissier# CFG_UNWIND and CFG_LOCKDEP_RECORD_STACK are both enabled, the algorithm
4312288b071SJerome Forissier# records the call stacks when locks are taken, and prints them when a
4322288b071SJerome Forissier# potential deadlock is found.
433ab0df69eSJerome Forissier# Expect a significant performance impact when enabling this.
434ab0df69eSJerome ForissierCFG_LOCKDEP ?= n
4352288b071SJerome ForissierCFG_LOCKDEP_RECORD_STACK ?= y
436ab0df69eSJerome Forissier
437bde8a250SJoakim Bech# BestFit algorithm in bget reduces the fragmentation of the heap when running
438ab0df69eSJerome Forissier# with the pager enabled or lockdep
439ab0df69eSJerome ForissierCFG_CORE_BGET_BESTFIT ?= $(call cfg-one-enabled, CFG_WITH_PAGER CFG_LOCKDEP)
440bde8a250SJoakim Bech
441be715239SJens Wiklander# Enable support for detected undefined behavior in C
4421d171f95SJens Wiklander# Uses a lot of memory, can't be enabled by default
443be715239SJens WiklanderCFG_CORE_SANITIZE_UNDEFINED ?= n
444b908c675SJens Wiklander
4451d171f95SJens Wiklander# Enable Kernel Address sanitizer, has a huge performance impact, uses a
4461d171f95SJens Wiklander# lot of memory and need platform specific adaptations, can't be enabled by
4471d171f95SJens Wiklander# default
4481d171f95SJens WiklanderCFG_CORE_SANITIZE_KADDRESS ?= n
4491d171f95SJens Wiklander
45083d0edeeSJerome Forissierifeq (y-y,$(CFG_CORE_SANITIZE_KADDRESS)-$(CFG_CORE_ASLR))
45183d0edeeSJerome Forissier$(error CFG_CORE_SANITIZE_KADDRESS and CFG_CORE_ASLR are not compatible)
45283d0edeeSJerome Forissierendif
45383d0edeeSJerome Forissier
45435e770dfSJerome Forissier# Add stack guards before/after stacks and periodically check them
45535e770dfSJerome ForissierCFG_WITH_STACK_CANARIES ?= y
45635e770dfSJerome Forissier
457e2f03e07SJerome Forissier# Use compiler instrumentation to troubleshoot stack overflows.
458e2f03e07SJerome Forissier# When enabled, most C functions check the stack pointer against the current
459e2f03e07SJerome Forissier# stack limits on entry and panic immediately if it is out of range.
460e2f03e07SJerome ForissierCFG_CORE_DEBUG_CHECK_STACKS ?= n
461e2f03e07SJerome Forissier
462cca7b5ebSJorge Ramirez-Ortiz# Use when the default stack allocations are not sufficient.
463cca7b5ebSJorge Ramirez-OrtizCFG_STACK_THREAD_EXTRA ?= 0
464cca7b5ebSJorge Ramirez-OrtizCFG_STACK_TMP_EXTRA ?= 0
465cca7b5ebSJorge Ramirez-Ortiz
466b908c675SJens Wiklander# Device Tree support
467c95b9511SEtienne Carriere#
468c95b9511SEtienne Carriere# When CFG_DT is enabled core embeds the FDT library (libfdt) allowing
469c95b9511SEtienne Carriere# device tree blob (DTB) parsing from the core.
470c95b9511SEtienne Carriere#
471c95b9511SEtienne Carriere# When CFG_DT is enabled, the TEE _start function expects to find
472c95b9511SEtienne Carriere# the address of a DTB in register X2/R2 provided by the early boot stage
473c95b9511SEtienne Carriere# or value 0 if boot stage provides no DTB.
474c95b9511SEtienne Carriere#
4757c2317a7SGatien Chevallier# When CFG_EXTERNAL_DT is enabled, the external device tree ABI is implemented
4767c2317a7SGatien Chevallier# and the external device tree is expected to be used/modified. Its value
4777c2317a7SGatien Chevallier# defaults to CFG_DT.
4787c2317a7SGatien Chevallier#
479bf31bf10SImre Kis# When CFG_MAP_EXT_DT_SECURE is enabled the external device tree is expected to
480bf31bf10SImre Kis# be in the secure memory.
481bf31bf10SImre Kis#
482c95b9511SEtienne Carriere# When CFG_EMBED_DTB is enabled, CFG_EMBED_DTB_SOURCE_FILE shall define the
483c95b9511SEtienne Carriere# relative path of a DTS file located in core/arch/$(ARCH)/dts.
484c95b9511SEtienne Carriere# The DTS file is compiled into a DTB file which content is embedded in a
485c95b9511SEtienne Carriere# read-only section of the core.
486c95b9511SEtienne Carriereifneq ($(strip $(CFG_EMBED_DTB_SOURCE_FILE)),)
487c95b9511SEtienne CarriereCFG_EMBED_DTB ?= y
488c95b9511SEtienne Carriereendif
4893050ae8aSJens Wiklanderifeq ($(filter y,$(CFG_EMBED_DTB) $(CFG_CORE_SEL1_SPMC) $(CFG_CORE_SEL2_SPMC) \
4903050ae8aSJens Wiklander		 $(CFG_CORE_EL3_SPMC)),y)
491c95b9511SEtienne Carriere$(call force,CFG_DT,y)
492c95b9511SEtienne Carriereendif
493c95b9511SEtienne CarriereCFG_EMBED_DTB ?= n
494b908c675SJens WiklanderCFG_DT ?= n
4957c2317a7SGatien ChevallierCFG_EXTERNAL_DT ?= $(CFG_DT)
496bf31bf10SImre KisCFG_MAP_EXT_DT_SECURE ?= n
497bf31bf10SImre Kisifeq ($(CFG_MAP_EXT_DT_SECURE),y)
498bf31bf10SImre Kis$(call force,CFG_DT,y)
499bf31bf10SImre Kisendif
50076358becSJens Wiklander
501a1222502SRaymond Mao# This option enables OP-TEE to support boot arguments handover via Transfer
502a1222502SRaymond Mao# List defined in Firmware Handoff specification.
503397d66f8SRaymond Mao# Note: This is an experimental feature and incompatible ABI changes can be
504397d66f8SRaymond Mao# expected. It should be off by default until Firmware Handoff specification
505397d66f8SRaymond Mao# has a stable release.
506a1222502SRaymond Mao# This feature requires the support of Device Tree.
507a1222502SRaymond MaoCFG_TRANSFER_LIST ?= n
508a1222502SRaymond Maoifeq ($(CFG_TRANSFER_LIST),y)
509a1222502SRaymond Mao$(call force,CFG_DT,y)
510a1222502SRaymond Mao$(call force,CFG_EXTERNAL_DT,y)
511a1222502SRaymond Mao$(call force,CFG_MAP_EXT_DT_SECURE,y)
512a1222502SRaymond Maoendif
513a1222502SRaymond Mao
51476358becSJens Wiklander# Maximum size of the Device Tree Blob, has to be large enough to allow
51576358becSJens Wiklander# editing of the supplied DTB.
51676358becSJens WiklanderCFG_DTB_MAX_SIZE ?= 0x10000
5174d62e91aSVictor Chong
518c36d2192SBalint Dobszay# Maximum size of the init info data passed to Secure Partitions.
519c36d2192SBalint DobszayCFG_SP_INIT_INFO_MAX_SIZE ?= 0x1000
520c36d2192SBalint Dobszay
5210a3ad9b6SBryan O'Donoghue# Device Tree Overlay support.
522c4544143SClément Léger# CFG_EXTERNAL_DTB_OVERLAY allows to append a DTB overlay into an existing
523c4544143SClément Léger# external DTB. The overlay is created when no valid DTB overlay is found.
524c4544143SClément Léger# CFG_GENERATE_DTB_OVERLAY allows to create a DTB overlay at external
525c4544143SClément Léger# DTB location.
526c4544143SClément Léger# External DTB location (physical address) is provided either by boot
527c4544143SClément Léger# argument arg2 or from CFG_DT_ADDR if defined.
528c4544143SClément Léger# A subsequent boot stage can then merge the generated overlay DTB into a main
5290a3ad9b6SBryan O'Donoghue# DTB using the standard fdt_overlay_apply() method.
5300a3ad9b6SBryan O'DonoghueCFG_EXTERNAL_DTB_OVERLAY ?= n
531c4544143SClément LégerCFG_GENERATE_DTB_OVERLAY ?= n
532c4544143SClément Léger
533c4544143SClément Légerifeq (y-y,$(CFG_EXTERNAL_DTB_OVERLAY)-$(CFG_GENERATE_DTB_OVERLAY))
534c4544143SClément Léger$(error CFG_EXTERNAL_DTB_OVERLAY and CFG_GENERATE_DTB_OVERLAY are exclusive)
535c4544143SClément Légerendif
536c4544143SClément Léger_CFG_USE_DTB_OVERLAY := $(call cfg-one-enabled,CFG_EXTERNAL_DTB_OVERLAY \
537c4544143SClément Léger			  CFG_GENERATE_DTB_OVERLAY)
5380a3ad9b6SBryan O'Donoghue
539313aa2a4SJens Wiklander# All embedded tests are supposed to be disabled by default, this flag
540313aa2a4SJens Wiklander# is used to control the default value of all other embedded tests
541313aa2a4SJens WiklanderCFG_ENABLE_EMBEDDED_TESTS ?= n
542313aa2a4SJens Wiklander
54335964dc9SEtienne Carriere# Enable core self tests and related pseudo TAs
544313aa2a4SJens WiklanderCFG_TEE_CORE_EMBED_INTERNAL_TESTS ?= $(CFG_ENABLE_EMBEDDED_TESTS)
5456d96f208Syanyan-wrs
54627e8d08dSJens Wiklander# Compiles bget_main_test() to be called from a test TA
54727e8d08dSJens WiklanderCFG_TA_BGET_TEST ?= $(CFG_ENABLE_EMBEDDED_TESTS)
54827e8d08dSJens Wiklander
5492c8bb257SThomas Perrot# CFG_DT_DRIVER_EMBEDDED_TEST when enabled embedded DT driver probing tests.
5502c8bb257SThomas Perrot# This also requires embedding a DTB with expected content.
5512c8bb257SThomas Perrot# Default disable CFG_DRIVERS_CLK_EARLY_PROBE to probe clocks as other drivers.
552d783b681SEtienne Carriere# A probe deferral test mandates CFG_DRIVERS_DT_RECURSIVE_PROBE=n.
553d783b681SEtienne CarriereCFG_DT_DRIVER_EMBEDDED_TEST ?= n
554d783b681SEtienne Carriereifeq ($(CFG_DT_DRIVER_EMBEDDED_TEST),y)
555d783b681SEtienne CarriereCFG_DRIVERS_CLK ?= y
5566e2fe64aSClément LégerCFG_DRIVERS_GPIO ?= y
557d783b681SEtienne CarriereCFG_DRIVERS_RSTCTRL ?= y
558d783b681SEtienne CarriereCFG_DRIVERS_CLK_EARLY_PROBE ?= n
559d783b681SEtienne Carriere$(call force,CFG_DRIVERS_DT_RECURSIVE_PROBE,n,Mandated by CFG_DT_DRIVER_EMBEDDED_TEST)
560d783b681SEtienne Carriereendif
561d783b681SEtienne Carriere
56249d026a9SEtienne Carriere# CFG_WITH_STATS when enabled embeds PTA statistics service to allow non-secure
56349d026a9SEtienne Carriere# clients to retrieve debug and statistics information on core and loaded TAs.
56449d026a9SEtienne CarriereCFG_WITH_STATS ?= n
56549d026a9SEtienne Carriere
5664101c34aSEtienne Carriere# CFG_DRIVERS_DT_RECURSIVE_PROBE when enabled forces a recursive subnode
5674101c34aSEtienne Carriere# parsing in the embedded DTB for driver probing. The alternative is
5684101c34aSEtienne Carriere# an exploration based on compatible drivers found. It is default disabled.
5694101c34aSEtienne CarriereCFG_DRIVERS_DT_RECURSIVE_PROBE ?= n
5704101c34aSEtienne Carriere
5716d96f208Syanyan-wrs# This option enables OP-TEE to respond to SMP boot request: the Rich OS
5726d96f208Syanyan-wrs# issues this to request OP-TEE to release secondaries cores out of reset,
5736d96f208Syanyan-wrs# with specific core number and non-secure entry address.
5746d96f208Syanyan-wrsCFG_BOOT_SECONDARY_REQUEST ?= n
5756d96f208Syanyan-wrs
576f5f914aaSJens Wiklander# Default heap size for Core, 64 kB
577f5f914aaSJens WiklanderCFG_CORE_HEAP_SIZE ?= 65536
578f3bb2312SJerome Forissier
579b76b2296SJerome Forissier# Default size of nexus heap. 16 kB. Used only if CFG_NS_VIRTUALIZATION
580386fc264SVolodymyr Babchuk# is enabled
581386fc264SVolodymyr BabchukCFG_CORE_NEX_HEAP_SIZE ?= 16384
582386fc264SVolodymyr Babchuk
583883c4be3SJerome Forissier# TA profiling.
584883c4be3SJerome Forissier# When this option is enabled, OP-TEE can execute Trusted Applications
585883c4be3SJerome Forissier# instrumented with GCC's -pg flag and will output profiling information
586883c4be3SJerome Forissier# in gmon.out format to /tmp/gmon-<ta_uuid>.out (path is defined in
587883c4be3SJerome Forissier# tee-supplicant)
5888800b01dSJerome Forissier# Note: this does not work well with shared libraries at the moment for a
5898800b01dSJerome Forissier# couple of reasons:
5908800b01dSJerome Forissier# 1. The profiling code assumes a unique executable section in the TA VA space.
5918800b01dSJerome Forissier# 2. The code used to detect at run time if the TA is intrumented assumes that
5928800b01dSJerome Forissier# the TA is linked statically.
593883c4be3SJerome ForissierCFG_TA_GPROF_SUPPORT ?= n
594f3bb2312SJerome Forissier
595b02ae382SSumit Garg# TA function tracing.
596b02ae382SSumit Garg# When this option is enabled, OP-TEE can execute Trusted Applications
597b02ae382SSumit Garg# instrumented with GCC's -pg flag and will output function tracing
5985c2c0fb3SJerome Forissier# information for all functions compiled with -pg to
5995c2c0fb3SJerome Forissier# /tmp/ftrace-<ta_uuid>.out (path is defined in tee-supplicant).
600099918f6SSumit GargCFG_FTRACE_SUPPORT ?= n
601b02ae382SSumit Garg
602099918f6SSumit Garg# Core syscall function tracing.
603099918f6SSumit Garg# When this option is enabled, OP-TEE core is instrumented with GCC's
604099918f6SSumit Garg# -pg flag and will output syscall function graph in user TA ftrace
605099918f6SSumit Garg# buffer
606099918f6SSumit GargCFG_SYSCALL_FTRACE ?= n
607099918f6SSumit Garg$(call cfg-depends-all,CFG_SYSCALL_FTRACE,CFG_FTRACE_SUPPORT)
608099918f6SSumit Garg
609883c4be3SJerome Forissier# Enable to compile user TA libraries with profiling (-pg).
610099918f6SSumit Garg# Depends on CFG_TA_GPROF_SUPPORT or CFG_FTRACE_SUPPORT.
611735565dbSSumit GargCFG_ULIBS_MCOUNT ?= n
6120f8adafeSJerome Forissier# Profiling/tracing of syscall wrapper (utee_*)
6130f8adafeSJerome ForissierCFG_SYSCALL_WRAPPERS_MCOUNT ?= $(CFG_ULIBS_MCOUNT)
614883c4be3SJerome Forissier
6150f8adafeSJerome Forissierifeq (y,$(filter y,$(CFG_ULIBS_MCOUNT) $(CFG_SYSCALL_WRAPPERS_MCOUNT)))
616099918f6SSumit Gargifeq (,$(filter y,$(CFG_TA_GPROF_SUPPORT) $(CFG_FTRACE_SUPPORT)))
617883c4be3SJerome Forissier$(error Cannot instrument user libraries if user mode profiling is disabled)
618f3bb2312SJerome Forissierendif
619f3bb2312SJerome Forissierendif
620cb0b5954SJens Wiklander
6217fb525f1SJerome Forissier# Build libutee, libutils, libmbedtls as shared libraries.
62264718c93SJerome Forissier# - Static libraries are still generated when this is enabled, but TAs will use
62364718c93SJerome Forissier# the shared libraries unless explicitly linked with the -static flag.
62464718c93SJerome Forissier# - Shared libraries are made of two files: for example, libutee is
62564718c93SJerome Forissier#   libutee.so and 527f1a47-b92c-4a74-95bd-72f19f4a6f74.ta. The '.so' file
62664718c93SJerome Forissier#   is a totally standard shared object, and should be used to link against.
62764718c93SJerome Forissier#   The '.ta' file is a signed version of the '.so' and should be installed
62864718c93SJerome Forissier#   in the same way as TAs so that they can be found at runtime.
62964718c93SJerome ForissierCFG_ULIBS_SHARED ?= n
63064718c93SJerome Forissier
63139ef71afSEtienne Carriereifeq (y-y,$(CFG_TA_GPROF_SUPPORT)-$(CFG_ULIBS_SHARED))
63270aa7511SJerome Forissier$(error CFG_TA_GPROF_SUPPORT and CFG_ULIBS_SHARED are currently incompatible)
63370aa7511SJerome Forissierendif
63470aa7511SJerome Forissier
635cb0b5954SJens Wiklander# CFG_GP_SOCKETS
636cb0b5954SJens Wiklander# Enable Global Platform Sockets support
637cb0b5954SJens WiklanderCFG_GP_SOCKETS ?= y
63880a4e51dSEtienne Carriere
63980a4e51dSEtienne Carriere# Enable Secure Data Path support in OP-TEE core (TA may be invoked with
64080a4e51dSEtienne Carriere# invocation parameters referring to specific secure memories).
64180a4e51dSEtienne CarriereCFG_SECURE_DATA_PATH ?= n
64200da26ecSAndrew F. Davis
643c9720143SJens Wiklander# Enable storage for TAs in secure storage, depends on CFG_REE_FS=y
644c9720143SJens Wiklander# TA binaries are stored encrypted in the REE FS and are protected by
645c9720143SJens Wiklander# metadata in secure storage.
646c9720143SJens WiklanderCFG_SECSTOR_TA ?= $(call cfg-all-enabled,CFG_REE_FS CFG_WITH_USER_TA)
647c9720143SJens Wiklander$(eval $(call cfg-depends-all,CFG_SECSTOR_TA,CFG_REE_FS CFG_WITH_USER_TA))
648c9720143SJens Wiklander
64930668b28SJens Wiklander# Enable the pseudo TA that managages TA storage in secure storage
65030668b28SJens WiklanderCFG_SECSTOR_TA_MGMT_PTA ?= $(call cfg-all-enabled,CFG_SECSTOR_TA)
65130668b28SJens Wiklander$(eval $(call cfg-depends-all,CFG_SECSTOR_TA_MGMT_PTA,CFG_SECSTOR_TA))
652c9720143SJens Wiklander
6534bca302aSIgor Opaniuk# Enable the pseudo TA for misc. auxilary services, extending existing
65457e642f1SEtienne Carriere# GlobalPlatform TEE Internal Core API (for example, re-seeding RNG entropy
65557e642f1SEtienne Carriere# pool etc...)
65657e642f1SEtienne CarriereCFG_SYSTEM_PTA ?= $(CFG_WITH_USER_TA)
65757e642f1SEtienne Carriere$(eval $(call cfg-depends-all,CFG_SYSTEM_PTA,CFG_WITH_USER_TA))
6584bca302aSIgor Opaniuk
6590b611081SSumit Garg# Enable the pseudo TA for enumeration of TEE based devices for the normal
6600b611081SSumit Garg# world OS.
6610b611081SSumit GargCFG_DEVICE_ENUM_PTA ?= y
6620b611081SSumit Garg
6637e05ec25SJerome Forissier# The attestation pseudo TA provides an interface to request measurements of
6647e05ec25SJerome Forissier# a TA or the TEE binary.
6657e05ec25SJerome ForissierCFG_ATTESTATION_PTA ?= n
6667e05ec25SJerome Forissier$(eval $(call cfg-depends-all,CFG_ATTESTATION_PTA,_CFG_WITH_SECURE_STORAGE))
6677e05ec25SJerome Forissier
6687e05ec25SJerome Forissier# RSA key size (in bits) for the attestation PTA. Must be at least 528 given
6697e05ec25SJerome Forissier# other algorithm parameters (RSA PSS with SHA-256 and 32-byte salt), but
6707e05ec25SJerome Forissier# note that such a low value is not secure.
6717e05ec25SJerome Forissier# See https://tools.ietf.org/html/rfc8017#section-8.1.1 and
6727e05ec25SJerome Forissier# https://tools.ietf.org/html/rfc8017#section-9.1.1
6737e05ec25SJerome Forissier#  emLen >= hlen + sLen + 2 = 32 + 32 + 2 = 66
6747e05ec25SJerome Forissier#  emLen = ceil((modBits - 1) / 8) => emLen is the key size in bytes
6757e05ec25SJerome ForissierCFG_ATTESTATION_PTA_KEY_SIZE ?= 3072
6767e05ec25SJerome Forissier
67700da26ecSAndrew F. Davis# Define the number of cores per cluster used in calculating core position.
67800da26ecSAndrew F. Davis# The cluster number is shifted by this value and added to the core ID,
67900da26ecSAndrew F. Davis# so its value represents log2(cores/cluster).
68000da26ecSAndrew F. Davis# Default is 2**(2) = 4 cores per cluster.
68100da26ecSAndrew F. DavisCFG_CORE_CLUSTER_SHIFT ?= 2
682d81f93a7SVolodymyr Babchuk
6838be2de1aSImre Kis# Define the number of threads per core used in calculating processing
6848be2de1aSImre Kis# element's position. The core number is shifted by this value and added to
6858be2de1aSImre Kis# the thread ID, so its value represents log2(threads/core).
6868be2de1aSImre Kis# Default is 2**(0) = 1 threads per core.
6878be2de1aSImre KisCFG_CORE_THREAD_SHIFT ?= 0
6888be2de1aSImre Kis
68937a6b717SJens Wiklander# Enable support for dynamic shared memory (shared memory anywhere in
69037a6b717SJens Wiklander# non-secure memory).
69137a6b717SJens WiklanderCFG_CORE_DYN_SHM ?= y
69237a6b717SJens Wiklander
6938aeb6c94SJens Wiklander# Enable support for reserved shared memory (shared memory in a carved out
6948aeb6c94SJens Wiklander# memory area).
6958aeb6c94SJens WiklanderCFG_CORE_RESERVED_SHM ?= y
6968aeb6c94SJens Wiklander
697dd3afbacSJens Wiklander# Enables support for larger physical addresses, that is, it will define
698dd3afbacSJens Wiklander# paddr_t as a 64-bit type.
699dd3afbacSJens WiklanderCFG_CORE_LARGE_PHYS_ADDR ?= n
700e3458e03SJerome Forissier
701e3458e03SJerome Forissier# Define the maximum size, in bits, for big numbers in the Internal Core API
702e3458e03SJerome Forissier# Arithmetical functions. This does *not* influence the key size that may be
703e3458e03SJerome Forissier# manipulated through the Cryptographic API.
704e3458e03SJerome Forissier# Set this to a lower value to reduce the TA memory footprint.
705e3458e03SJerome ForissierCFG_TA_BIGNUM_MAX_BITS ?= 2048
706409d2ff0SJerome Forissier
7077fb525f1SJerome Forissier# Not used since libmpa was removed. Force the values to catch build scripts
7087fb525f1SJerome Forissier# that would set = n.
7097fb525f1SJerome Forissier$(call force,CFG_TA_MBEDTLS_MPI,y)
7107fb525f1SJerome Forissier$(call force,CFG_TA_MBEDTLS,y)
711a97bc4a0SJens Wiklander
712a97bc4a0SJens Wiklander# Compile the TA library mbedTLS with self test functions, the functions
713a97bc4a0SJens Wiklander# need to be called to test anything
714a97bc4a0SJens WiklanderCFG_TA_MBEDTLS_SELF_TEST ?= y
715017dfaf8SGabor Szekely
71668689d86SJens Wiklander# By default use tomcrypt as the main crypto lib providing an implementation
71768689d86SJens Wiklander# for the API in <crypto/crypto.h>
71868689d86SJens Wiklander# CFG_CRYPTOLIB_NAME is used as libname and
71968689d86SJens Wiklander# CFG_CRYPTOLIB_DIR is used as libdir when compiling the library
72077327d7aSEdison Ai#
72177327d7aSEdison Ai# It's also possible to configure to use mbedtls instead of tomcrypt.
72277327d7aSEdison Ai# Then the variables should be assigned as "CFG_CRYPTOLIB_NAME=mbedtls" and
72377327d7aSEdison Ai# "CFG_CRYPTOLIB_DIR=lib/libmbedtls" respectively.
72468689d86SJens WiklanderCFG_CRYPTOLIB_NAME ?= tomcrypt
72568689d86SJens WiklanderCFG_CRYPTOLIB_DIR ?= core/lib/libtomcrypt
72668689d86SJens Wiklander
7277fb525f1SJerome Forissier# Not used since libmpa was removed. Force the value to catch build scripts
7287fb525f1SJerome Forissier# that would set = n.
7297fb525f1SJerome Forissier$(call force,CFG_CORE_MBEDTLS_MPI,y)
7307fb525f1SJerome Forissier
7319bc42f66SEtienne Carriere# When enabled, CFG_NS_VIRTUALIZATION embeds support for virtualization in
7329bc42f66SEtienne Carriere# the non-secure world. OP-TEE will not work without a compatible hypervisor
7339bc42f66SEtienne Carriere# in the non-secure world if this option is enabled.
7349bc42f66SEtienne Carriere#
7359bc42f66SEtienne Carriere# CFG_VIRTUALIZATION served the same purpose as CFG_NS_VIRTUALIZATION but is
7369bc42f66SEtienne Carriere# deprecated as the configuration switch name was ambiguous regarding which
7379bc42f66SEtienne Carriere# world has virtualization enabled.
7389bc42f66SEtienne Carriereifneq (undefined,$(flavor CFG_VIRTUALIZATION))
7399bc42f66SEtienne Carriere$(info WARNING: CFG_VIRTUALIZATION is deprecated, use CFG_NS_VIRTUALIZATION instead)
740b76b2296SJerome ForissierCFG_NS_VIRTUALIZATION ?= $(CFG_VIRTUALIZATION)
7419bc42f66SEtienne Carriereifneq ($(CFG_NS_VIRTUALIZATION),$(CFG_VIRTUALIZATION))
7429bc42f66SEtienne Carriere$(error Inconsistent CFG_NS_VIRTUALIZATION=$(CFG_NS_VIRTUALIZATION) and CFG_VIRTUALIZATION=$(CFG_VIRTUALIZATION))
7439bc42f66SEtienne Carriereendif
7449bc42f66SEtienne Carriereendif # CFG_VIRTUALIZATION defined
745b76b2296SJerome ForissierCFG_NS_VIRTUALIZATION ?= n
74615216d4dSVolodymyr Babchuk
747b76b2296SJerome Forissierifeq ($(CFG_NS_VIRTUALIZATION),y)
74815216d4dSVolodymyr Babchuk$(call force,CFG_CORE_RODATA_NOEXEC,y)
74915216d4dSVolodymyr Babchuk$(call force,CFG_CORE_RWDATA_NOEXEC,y)
750c4e8be26SVolodymyr Babchuk
751c4e8be26SVolodymyr Babchuk# Default number of virtual guests
752c4e8be26SVolodymyr BabchukCFG_VIRT_GUEST_COUNT ?= 2
75315216d4dSVolodymyr Babchukendif
75415216d4dSVolodymyr Babchuk
75517888736SJens Wiklander# Enables backwards compatible derivation of RPMB and SSK keys
75617888736SJens WiklanderCFG_CORE_HUK_SUBKEY_COMPAT ?= y
757a2087649SJerome Forissier
75833b38f8cSRuslan Piasetskyi# Use SoC specific tee_otp_get_die_id() implementation for SSK key generation.
75933b38f8cSRuslan Piasetskyi# This option depends on CFG_CORE_HUK_SUBKEY_COMPAT=y.
76033b38f8cSRuslan PiasetskyiCFG_CORE_HUK_SUBKEY_COMPAT_USE_OTP_DIE_ID ?= n
76133b38f8cSRuslan Piasetskyi
762a2087649SJerome Forissier# Compress and encode conf.mk into the TEE core, and show the encoded string on
763a2087649SJerome Forissier# boot (with severity TRACE_INFO).
764a2087649SJerome ForissierCFG_SHOW_CONF_ON_BOOT ?= n
765dd333f03SJavier Almansa Sobrino
766dd333f03SJavier Almansa Sobrino# Enables support for passing a TPM Event Log stored in secure memory
767145035ffSImre Kis# to a TA or FF-A SP, so a TPM Service could use it to extend any measurement
768dd333f03SJavier Almansa Sobrino# taken before the service was up and running.
769dd333f03SJavier Almansa SobrinoCFG_CORE_TPM_EVENT_LOG ?= n
770ae8c8068SEtienne Carriere
771ae8c8068SEtienne Carriere# When enabled, CFG_SCMI_MSG_DRIVERS embeds SCMI message drivers in the core.
772ae8c8068SEtienne Carriere# Refer to the supported SCMI features embedded upon CFG_SCMI_MSG_*
77328e51326SEtienne Carriere#
774a7a9e3baSEtienne Carriere# CFG_SCMI_MSG_CLOCK embeds SCMI clock protocol support.
77556a1f10eSEtienne Carriere# CFG_SCMI_MSG_RESET_DOMAIN embeds SCMI reset domain protocol support.
77628e51326SEtienne Carriere# CFG_SCMI_MSG_SMT embeds a SMT header in shared device memory buffers
777f37af03eSEtienne Carriere# CFG_SCMI_MSG_VOLTAGE_DOMAIN embeds SCMI voltage domain protocol support.
77828e51326SEtienne Carriere# CFG_SCMI_MSG_SMT_FASTCALL_ENTRY embeds fastcall SMC entry with SMT memory
77928e51326SEtienne Carriere# CFG_SCMI_MSG_SMT_INTERRUPT_ENTRY embeds interrupt entry with SMT memory
78028e51326SEtienne Carriere# CFG_SCMI_MSG_SMT_THREAD_ENTRY embeds threaded entry with SMT memory
781916cc52aSEtienne Carriere# CFG_SCMI_MSG_SHM_MSG embeds a MSG header in cached shared memory buffer
782ae8c8068SEtienne CarriereCFG_SCMI_MSG_DRIVERS ?= n
78328e51326SEtienne Carriereifeq ($(CFG_SCMI_MSG_DRIVERS),y)
784a7a9e3baSEtienne CarriereCFG_SCMI_MSG_CLOCK ?= n
78556a1f10eSEtienne CarriereCFG_SCMI_MSG_RESET_DOMAIN ?= n
786916cc52aSEtienne CarriereCFG_SCMI_MSG_SHM_MSG ?= n
787a58c4d70SEtienne CarriereCFG_SCMI_MSG_SMT ?= n
78828e51326SEtienne CarriereCFG_SCMI_MSG_SMT_FASTCALL_ENTRY ?= n
78928e51326SEtienne CarriereCFG_SCMI_MSG_SMT_INTERRUPT_ENTRY ?= n
79028e51326SEtienne CarriereCFG_SCMI_MSG_SMT_THREAD_ENTRY ?= n
79128e51326SEtienne CarriereCFG_SCMI_MSG_THREAD_ENTRY ?= n
792f37af03eSEtienne CarriereCFG_SCMI_MSG_VOLTAGE_DOMAIN ?= n
79328e51326SEtienne Carriere$(eval $(call cfg-depends-all,CFG_SCMI_MSG_SMT_FASTCALL_ENTRY,CFG_SCMI_MSG_SMT))
79428e51326SEtienne Carriere$(eval $(call cfg-depends-all,CFG_SCMI_MSG_SMT_INTERRUPT_ENTRY,CFG_SCMI_MSG_SMT))
795916cc52aSEtienne Carriere$(eval $(call cfg-depends-one,CFG_SCMI_MSG_SMT_THREAD_ENTRY,CFG_SCMI_MSG_SMT CFG_SCMI_MSG_SHM_MSG))
79616a5030fSEtienne Carriereifeq ($(CFG_SCMI_MSG_SMT),y)
79716a5030fSEtienne Carriere_CFG_SCMI_PTA_SMT_HEADER := y
79816a5030fSEtienne Carriereendif
79916a5030fSEtienne Carriereifeq ($(CFG_SCMI_MSG_SHM_MSG),y)
80016a5030fSEtienne Carriere_CFG_SCMI_PTA_MSG_HEADER := y
80116a5030fSEtienne Carriereendif
80228e51326SEtienne Carriereendif
80342471ecfSJens Wiklander
8044c4212e9SVincent Guittot# CFG_SCMI_SCPFW, when enabled, embeds the reference SCMI server implementation
8054c4212e9SVincent Guittot# from SCP-firmware package as an built-in SCMI stack in core. This
8064c4212e9SVincent Guittot# configuration mandates target product identifier is configured with
8074c4212e9SVincent Guittot# CFG_SCMI_SCPFW_PRODUCT and the SCP-firmware source tree path with
8084c4212e9SVincent Guittot# CFG_SCP_FIRMWARE.
8094c4212e9SVincent GuittotCFG_SCMI_SCPFW ?= n
8104c4212e9SVincent Guittot
8114c4212e9SVincent Guittotifeq ($(CFG_SCMI_SCPFW),y)
8124c4212e9SVincent Guittot$(call force,CFG_SCMI_PTA,y,Required by CFG_SCMI_SCPFW)
8134c4212e9SVincent Guittotifeq (,$(CFG_SCMI_SCPFW_PRODUCT))
8144c4212e9SVincent Guittot$(error CFG_SCMI_SCPFW=y requires CFG_SCMI_SCPFW_PRODUCT configuration)
8154c4212e9SVincent Guittotendif
8164c4212e9SVincent Guittotifeq (,$(wildcard $(CFG_SCP_FIRMWARE)/CMakeLists.txt))
8174c4212e9SVincent Guittot$(error CFG_SCMI_SCPFW=y requires CFG_SCP_FIRMWARE configuration)
8184c4212e9SVincent Guittotendif
8194c4212e9SVincent Guittotendif #CFG_SCMI_SCPFW
8204c4212e9SVincent Guittot
8214c4212e9SVincent Guittotifeq ($(CFG_SCMI_MSG_DRIVERS)-$(CFG_SCMI_SCPFW),y-y)
8224c4212e9SVincent Guittot$(error CFG_SCMI_MSG_DRIVERS=y and CFG_SCMI_SCPFW=y are mutually exclusive)
8234c4212e9SVincent Guittotendif
8244c4212e9SVincent Guittot
825e80130f6SClément Léger# When enabled, CFG_SCMI_MSG_USE_CLK embeds SCMI clocks registering services for
826e80130f6SClément Léger# the platform SCMI server and implements the platform plat_scmi_clock_*()
827e80130f6SClément Léger# functions.
828e80130f6SClément LégerCFG_SCMI_MSG_USE_CLK ?= n
829e80130f6SClément Léger$(eval $(call cfg-depends-all,CFG_SCMI_MSG_USE_CLK,CFG_DRIVERS_CLK CFG_SCMI_MSG_DRIVERS))
830e80130f6SClément Léger
831b0a1c250SEtienne Carriere# Enable SCMI PTA interface for REE SCMI agents
832b0a1c250SEtienne CarriereCFG_SCMI_PTA ?= n
83316a5030fSEtienne Carriereifeq ($(CFG_SCMI_PTA),y)
83416a5030fSEtienne Carriere_CFG_SCMI_PTA_SMT_HEADER ?= n
83516a5030fSEtienne Carriere_CFG_SCMI_PTA_MSG_HEADER ?= n
83616a5030fSEtienne Carriereendif
837b0a1c250SEtienne Carriere
83842471ecfSJens Wiklanderifneq ($(CFG_STMM_PATH),)
839f9cd31c5SJelle Sels$(call force,CFG_WITH_STMM_SP,y)
84042471ecfSJens Wiklanderelse
841f9cd31c5SJelle SelsCFG_WITH_STMM_SP ?= n
84242471ecfSJens Wiklanderendif
843f9cd31c5SJelle Selsifeq ($(CFG_WITH_STMM_SP),y)
84442471ecfSJens Wiklander$(call force,CFG_ZLIB,y)
84542471ecfSJens Wiklanderendif
8466915bbbbSJens Wiklander
8476915bbbbSJens Wiklander# When enabled checks that buffers passed to the GP Internal Core API
8486915bbbbSJens Wiklander# comply with the rules added as annotations as part of the definition of
8496915bbbbSJens Wiklander# the API. For example preventing buffers in non-secure shared memory when
8506915bbbbSJens Wiklander# not allowed.
8516915bbbbSJens WiklanderCFG_TA_STRICT_ANNOTATION_CHECKS ?= y
852c56cc686SJens Wiklander
853c56cc686SJens Wiklander# When enabled accepts the DES key sizes excluding parity bits as in
854c56cc686SJens Wiklander# the GP Internal API Specification v1.0
855c56cc686SJens WiklanderCFG_COMPAT_GP10_DES ?= y
856806a85faSJens Wiklander
857806a85faSJens Wiklander# Defines a limit for many levels TAs may call each others.
858806a85faSJens WiklanderCFG_CORE_MAX_SYSCALL_RECURSION ?= 4
859f2dad489SSergiy Kibrik
860f2dad489SSergiy Kibrik# Pseudo-TA to export hardware RNG output to Normal World
861f2dad489SSergiy Kibrik# RNG characteristics are platform specific
862f2dad489SSergiy KibrikCFG_HWRNG_PTA ?= n
863f2dad489SSergiy Kibrikifeq ($(CFG_HWRNG_PTA),y)
864f2dad489SSergiy Kibrik# Output rate of hw_get_random_bytes() in bytes per second, 0: not rate-limited
865f2dad489SSergiy KibrikCFG_HWRNG_RATE ?= 0
866f2dad489SSergiy Kibrik# Quality/entropy of hw_get_random_bytes() per 1024 bits of output data, in bits
867f2dad489SSergiy Kibrikifeq (,$(CFG_HWRNG_QUALITY))
868f2dad489SSergiy Kibrik$(error CFG_HWRNG_QUALITY not defined)
869f2dad489SSergiy Kibrikendif
870f2dad489SSergiy Kibrikendif
87188876632SEtienne Carriere
87288876632SEtienne Carriere# CFG_PREALLOC_RPC_CACHE, when enabled, makes core to preallocate
87388876632SEtienne Carriere# shared memory for each secure thread. When disabled, RPC shared
87488876632SEtienne Carriere# memory is released once the secure thread has completed is execution.
87588876632SEtienne Carriereifeq ($(CFG_WITH_PAGER),y)
87688876632SEtienne CarriereCFG_PREALLOC_RPC_CACHE ?= n
87788876632SEtienne Carriereendif
87888876632SEtienne CarriereCFG_PREALLOC_RPC_CACHE ?= y
8792305544bSClément Léger
8802305544bSClément Léger# When enabled, CFG_DRIVERS_CLK embeds a clock framework in OP-TEE core.
8812305544bSClément Léger# This clock framework allows to describe clock tree and provides functions to
8822305544bSClément Léger# get and configure the clocks.
883dbe94a85SClément Léger# CFG_DRIVERS_CLK_DT embeds devicetree clock parsing support
884804e32d7SClément Léger# CFG_DRIVERS_CLK_FIXED add support for "fixed-clock" compatible clocks
88517fd9102SEtienne Carriere# CFG_DRIVERS_CLK_EARLY_PROBE makes clocks probed at early_init initcall level.
886cd04d138SEtienne Carriere# CFG_DRIVERS_CLK_PRINT_TREE embeds a helper function to print the clock tree
887c4292779SEtienne Carriere# state on OP-TEE core console with the debug trace level.
8882305544bSClément LégerCFG_DRIVERS_CLK ?= n
889dbe94a85SClément LégerCFG_DRIVERS_CLK_DT ?= $(call cfg-all-enabled,CFG_DRIVERS_CLK CFG_DT)
890804e32d7SClément LégerCFG_DRIVERS_CLK_FIXED ?= $(CFG_DRIVERS_CLK_DT)
89117fd9102SEtienne CarriereCFG_DRIVERS_CLK_EARLY_PROBE ?= $(CFG_DRIVERS_CLK_DT)
892cd04d138SEtienne CarriereCFG_DRIVERS_CLK_PRINT_TREE ?= n
893dbe94a85SClément Léger
894d547c99aSEtienne Carriere$(eval $(call cfg-depends-all,CFG_DRIVERS_CLK_DT,CFG_DRIVERS_CLK CFG_DT))
895d547c99aSEtienne Carriere$(eval $(call cfg-depends-all,CFG_DRIVERS_CLK_FIXED,CFG_DRIVERS_CLK_DT))
896d547c99aSEtienne Carriere
897c78b2c66SEtienne Carriere# When enabled, CFG_DRIVERS_RSTCTRL embeds a reset controller framework in
898c78b2c66SEtienne Carriere# OP-TEE core to provide reset controls on subsystems of the devices.
899c78b2c66SEtienne CarriereCFG_DRIVERS_RSTCTRL ?= n
900c78b2c66SEtienne Carriere
9014fc179b6SThomas Perrot# When enabled, CFG_DRIVERS_GPIO embeds a GPIO controller framework in
9024fc179b6SThomas Perrot# OP-TEE core to provide GPIO support for drivers.
9034fc179b6SThomas PerrotCFG_DRIVERS_GPIO ?= n
9044fc179b6SThomas Perrot
9058bc9c9e2SClément Léger# When enabled, CFG_DRIVERS_I2C provides I2C controller and devices support.
9068bc9c9e2SClément LégerCFG_DRIVERS_I2C ?= n
9078bc9c9e2SClément Léger
908515c1ba9SClément Léger# When enabled, CFG_DRIVERS_NVMEM provides a framework to register nvmem
909515c1ba9SClément Léger# providers and allow consumer drivers to get NVMEM cells using the Device Tree.
910515c1ba9SClément LégerCFG_DRIVERS_NVMEM ?= n
911515c1ba9SClément Léger
9129aec039eSClément Léger# When enabled, CFG_DRIVERS_PINCTRL embeds a pin muxing controller framework in
9139aec039eSClément Léger# OP-TEE core to provide drivers a way to apply pin muxing configurations based
9149aec039eSClément Léger# on device-tree.
9159aec039eSClément LégerCFG_DRIVERS_PINCTRL ?= n
9169aec039eSClément Léger
9171a3d3273SEtienne Carriere# When enabled, CFG_DRIVERS_REGULATOR embeds a voltage regulator framework in
9186558b565SEtienne Carriere# OP-TEE core to provide drivers a common regulator interface and describe
9196558b565SEtienne Carriere# the regulators dependencies using an embedded device tree.
920652d2ce7SEtienne Carriere#
921652d2ce7SEtienne Carriere# When enabled, CFG_REGULATOR_FIXED embeds a voltage regulator driver for
922652d2ce7SEtienne Carriere# DT compatible "regulator-fixed" devices.
923f164f0f8SEtienne Carriere#
924f164f0f8SEtienne Carriere# When enabled, CFG_REGULATOR_GPIO embeds a voltage regulator driver for
925f164f0f8SEtienne Carriere# DT compatible "regulator-gpio" devices.
926c4292779SEtienne Carriere#
927c4292779SEtienne Carriere# CFG_DRIVERS_REGULATOR_PRINT_TREE embeds a helper function to print the
928c4292779SEtienne Carriere# regulator tree state on OP-TEE core console with the info trace level.
9291a3d3273SEtienne CarriereCFG_DRIVERS_REGULATOR ?= n
930c4292779SEtienne CarriereCFG_DRIVERS_REGULATOR_PRINT_TREE ?= n
931652d2ce7SEtienne CarriereCFG_REGULATOR_FIXED ?= n
932f164f0f8SEtienne CarriereCFG_REGULATOR_GPIO ?= n
933652d2ce7SEtienne Carriere
934652d2ce7SEtienne Carriere$(eval $(call cfg-enable-all-depends,CFG_REGULATOR_FIXED, \
935652d2ce7SEtienne Carriere	 CFG_DRIVERS_REGULATOR CFG_DT))
936f164f0f8SEtienne Carriere$(eval $(call cfg-enable-all-depends,CFG_REGULATOR_GPIO, \
937f164f0f8SEtienne Carriere	 CFG_DRIVERS_REGULATOR CFG_DT CFG_DRIVERS_GPIO))
9381a3d3273SEtienne Carriere
9399ea709a7SEtienne Carriere# When enabled, CFG_INSECURE permits insecure configuration of OP-TEE core
9409ea709a7SEtienne Carriere# and shows a print (info level) when booting up the device that
9419ea709a7SEtienne Carriere# indicates that the board runs a standard developer configuration.
9429ea709a7SEtienne Carriere#
9439ea709a7SEtienne Carriere# A developer configuration doesn't necessarily have to be secure. The intention
9449e42008dSJoakim Bech# is that the one making products based on OP-TEE should override this flag in
9459e42008dSJoakim Bech# plat-xxx/conf.mk for the platform they're basing their products on after
9469e42008dSJoakim Bech# they've finalized implementing stubbed functionality (see OP-TEE
9479e42008dSJoakim Bech# documentation/Porting guidelines) as well as vendor specific security
9489e42008dSJoakim Bech# configuration.
9499ea709a7SEtienne Carriere#
9509ea709a7SEtienne Carriere# CFG_WARN_INSECURE served the same purpose as CFG_INSECURE but is deprecated.
9519ea709a7SEtienne Carriereifneq (undefined,$(flavor CFG_WARN_INSECURE))
9529ea709a7SEtienne Carriere$(info WARNING: CFG_WARN_INSECURE is deprecated, use CFG_INSECURE instead)
9539ea709a7SEtienne CarriereCFG_INSECURE ?= $(CFG_WARN_INSECURE)
9549ea709a7SEtienne Carriereifneq ($(CFG_INSECURE),$(CFG_WARN_INSECURE))
9559ea709a7SEtienne Carriere$(error Inconsistent CFG_INSECURE=$(CFG_INSECURE) and CFG_WARN_INSECURE=$(CFG_WARN_INSECURE))
9569ea709a7SEtienne Carriereendif
9579ea709a7SEtienne Carriereendif # CFG_WARN_INSECURE defined
9589ea709a7SEtienne CarriereCFG_INSECURE ?= y
9599e42008dSJoakim Bech
960a748f9edSJens Wiklander# Enables warnings for declarations mixed with statements
961a748f9edSJens WiklanderCFG_WARN_DECL_AFTER_STATEMENT ?= y
962b7a623f8SRuchika Gupta
963b7a623f8SRuchika Gupta# Branch Target Identification (part of the ARMv8.5 Extensions) provides a
964b7a623f8SRuchika Gupta# mechanism to limit the set of locations to which computed branch instructions
965b7a623f8SRuchika Gupta# such as BR or BLR can jump. To make use of BTI in TEE core and ldelf on CPU's
966b7a623f8SRuchika Gupta# that support it, enable this option. A GCC toolchain built with
967b7a623f8SRuchika Gupta# --enable-standard-branch-protection is needed to use this option.
968b7a623f8SRuchika GuptaCFG_CORE_BTI ?= n
969b7a623f8SRuchika Gupta
970b7a623f8SRuchika Gupta$(eval $(call cfg-depends-all,CFG_CORE_BTI,CFG_ARM64_core))
971b7a623f8SRuchika Gupta
972b7a623f8SRuchika Gupta# To make use of BTI in user space libraries and TA's on CPU's that support it,
973b7a623f8SRuchika Gupta# enable this option.
974b7a623f8SRuchika GuptaCFG_TA_BTI ?= $(CFG_CORE_BTI)
975b7a623f8SRuchika Gupta
976b7a623f8SRuchika Gupta$(eval $(call cfg-depends-all,CFG_TA_BTI,CFG_ARM64_core))
977b7a623f8SRuchika Gupta
978b76b2296SJerome Forissierifeq (y-y,$(CFG_NS_VIRTUALIZATION)-$(call cfg-one-enabled, CFG_TA_BTI CFG_CORE_BTI))
979b76b2296SJerome Forissier$(error CFG_NS_VIRTUALIZATION and BTI are currently incompatible)
980b7a623f8SRuchika Guptaendif
981b7a623f8SRuchika Gupta
982b7a623f8SRuchika Guptaifeq (y-y,$(CFG_PAGED_USER_TA)-$(CFG_TA_BTI))
983b7a623f8SRuchika Gupta$(error CFG_PAGED_USER_TA and CFG_TA_BTI are currently incompatible)
984b7a623f8SRuchika Guptaendif
985c2d44948SJens Wiklander
986a0e8ffe9SJens Wiklander# Memory Tagging Extension (part of the ARMv8.5 Extensions) implements lock
987a0e8ffe9SJens Wiklander# and key access to memory. This is a hardware supported alternative to
988a0e8ffe9SJens Wiklander# CFG_CORE_SANITIZE_KADDRESS which covers both S-EL1 and S-EL0.
989a0e8ffe9SJens WiklanderCFG_MEMTAG ?= n
990a0e8ffe9SJens Wiklander
991a0e8ffe9SJens Wiklander$(eval $(call cfg-depends-all,CFG_MEMTAG,CFG_ARM64_core))
992a0e8ffe9SJens Wiklanderifeq (y-y,$(CFG_CORE_SANITIZE_KADDRESS)-$(CFG_MEMTAG))
993a0e8ffe9SJens Wiklander$(error CFG_CORE_SANITIZE_KADDRESS and CFG_MEMTAG are not compatible)
994a0e8ffe9SJens Wiklanderendif
995a0e8ffe9SJens Wiklanderifeq (y-y,$(CFG_WITH_PAGER)-$(CFG_MEMTAG))
996a0e8ffe9SJens Wiklander$(error CFG_WITH_PAGER and CFG_MEMTAG are not compatible)
997a0e8ffe9SJens Wiklanderendif
998a0e8ffe9SJens Wiklander
9996fa59c9aSSeonghyun Park# Privileged Access Never (PAN, part of the ARMv8.1 Extensions) can be
10006fa59c9aSSeonghyun Park# used to restrict accesses to unprivileged memory from privileged mode.
10013db1b3e3SAlvin Chang# For RISC-V architecture, CSR {m|s}status.SUM bit is used to implement PAN.
10026fa59c9aSSeonghyun ParkCFG_PAN ?= n
10036fa59c9aSSeonghyun Park
10043db1b3e3SAlvin Chang$(eval $(call cfg-depends-one,CFG_PAN,CFG_ARM64_core CFG_RV64_core CFG_RV32_core))
10056fa59c9aSSeonghyun Park
10062e02a737SJens Wiklanderifeq ($(filter y, $(CFG_CORE_SEL1_SPMC) $(CFG_CORE_SEL2_SPMC) \
10072e02a737SJens Wiklander		  $(CFG_CORE_EL3_SPMC)),y)
10082e02a737SJens Wiklander# FF-A case, handled via the FF-A ABI
10092e02a737SJens WiklanderCFG_CORE_ASYNC_NOTIF ?= y
10102e02a737SJens Wiklander$(call force,_CFG_CORE_ASYNC_NOTIF_DEFAULT_IMPL,n)
10112e02a737SJens Wiklanderelse
101223419643SEtienne Carriere# CFG_CORE_ASYNC_NOTIF is defined by the platform to enable support
10132e02a737SJens Wiklander# for sending asynchronous notifications to normal world.
10142e02a737SJens Wiklander# Interrupt ID must be configurged by the platform too. Currently is only
1015c2d44948SJens Wiklander# CFG_CORE_ASYNC_NOTIF_GIC_INTID defined.
1016c2d44948SJens WiklanderCFG_CORE_ASYNC_NOTIF ?= n
10172e02a737SJens Wiklander$(call force,_CFG_CORE_ASYNC_NOTIF_DEFAULT_IMPL,$(CFG_CORE_ASYNC_NOTIF))
10182e02a737SJens Wiklanderendif
1019a51d45b5SJens Wiklander
102082631bd4SJens Wiklander# Enable callout service
102182631bd4SJens WiklanderCFG_CALLOUT ?= $(CFG_CORE_ASYNC_NOTIF)
102282631bd4SJens Wiklander
10233844bc98SJens Wiklander# Enable notification based test watchdog
10243844bc98SJens WiklanderCFG_NOTIF_TEST_WD ?= $(CFG_ENABLE_EMBEDDED_TESTS)
10253844bc98SJens Wiklander$(eval $(call cfg-depends-all,CFG_NOTIF_TEST_WD,CFG_CALLOUT \
10263844bc98SJens Wiklander	 CFG_CORE_ASYNC_NOTIF))
10273844bc98SJens Wiklander
1028a51d45b5SJens Wiklander$(eval $(call cfg-enable-all-depends,CFG_MEMPOOL_REPORT_LAST_OFFSET, \
1029a51d45b5SJens Wiklander	 CFG_WITH_STATS))
1030bb329115SRuchika Gupta
103193dc6b29SJens Wiklander# Pointer Authentication (part of ARMv8.3 Extensions) provides instructions
103293dc6b29SJens Wiklander# for signing and authenticating pointers against secret keys. These can
103393dc6b29SJens Wiklander# be used to mitigate ROP (Return oriented programming) attacks. This is
103493dc6b29SJens Wiklander# currently done by instructing the compiler to add paciasp/autiasp at the
103593dc6b29SJens Wiklander# begging and end of functions to sign and verify ELR.
103693dc6b29SJens Wiklander#
103793dc6b29SJens Wiklander# The CFG_CORE_PAUTH enables these instructions for the core parts
103893dc6b29SJens Wiklander# executing at EL1, with one secret key per thread and one secret key per
103993dc6b29SJens Wiklander# physical CPU.
104093dc6b29SJens Wiklander#
104193dc6b29SJens Wiklander# The CFG_TA_PAUTH option enables these instructions for TA's at EL0. When
104293dc6b29SJens Wiklander# this option is enabled, TEE core will initialize secret keys per TA.
104393dc6b29SJens WiklanderCFG_CORE_PAUTH ?= n
104493dc6b29SJens WiklanderCFG_TA_PAUTH ?= $(CFG_CORE_PAUTH)
1045bb329115SRuchika Gupta
104693dc6b29SJens Wiklander$(eval $(call cfg-depends-all,CFG_CORE_PAUTH,CFG_ARM64_core))
1047bb329115SRuchika Gupta$(eval $(call cfg-depends-all,CFG_TA_PAUTH,CFG_ARM64_core))
10486b35a0abSRuchika Gupta
1049b76b2296SJerome Forissierifeq (y-y,$(CFG_NS_VIRTUALIZATION)-$(CFG_CORE_PAUTH))
1050b76b2296SJerome Forissier$(error CFG_NS_VIRTUALIZATION and CFG_CORE_PAUTH are currently incompatible)
105193dc6b29SJens Wiklanderendif
1052b76b2296SJerome Forissierifeq (y-y,$(CFG_NS_VIRTUALIZATION)-$(CFG_TA_PAUTH))
1053b76b2296SJerome Forissier$(error CFG_NS_VIRTUALIZATION and CFG_TA_PAUTH are currently incompatible)
10546b35a0abSRuchika Guptaendif
10556b35a0abSRuchika Gupta
10566b35a0abSRuchika Guptaifeq (y-y,$(CFG_TA_GPROF_SUPPORT)-$(CFG_TA_PAUTH))
10576b35a0abSRuchika Gupta$(error CFG_TA_GPROF_SUPPORT and CFG_TA_PAUTH are currently incompatible)
10586b35a0abSRuchika Guptaendif
10596b35a0abSRuchika Gupta
10606b35a0abSRuchika Guptaifeq (y-y,$(CFG_FTRACE_SUPPORT)-$(CFG_TA_PAUTH))
10616b35a0abSRuchika Gupta$(error CFG_FTRACE_SUPPORT and CFG_TA_PAUTH are currently incompatible)
10626b35a0abSRuchika Guptaendif
1063011a8f96SClément Léger
1064011a8f96SClément Léger# Enable support for generic watchdog registration
1065011a8f96SClément Léger# This watchdog will then be usable by non-secure world through SMC calls.
1066011a8f96SClément LégerCFG_WDT ?= n
1067cb60bce4SClément Léger
1068cb60bce4SClément Léger# Enable watchdog SMC handling compatible with arm-smc-wdt Linux driver
1069cb60bce4SClément LégerCFG_WDT_SM_HANDLER ?= n
1070cb60bce4SClément Léger
1071cb60bce4SClément Léger$(eval $(call cfg-enable-all-depends,CFG_WDT_SM_HANDLER,CFG_WDT))
10727d3ac186SLionel Debieve
10737d3ac186SLionel Debieve# When CFG_WDT_SM_HANDLER=y, SMC function ID 0x82003D06 default implements
10747d3ac186SLionel Debieve# arm-smc-wdt service. Platform can also override this ID with a platform
10757d3ac186SLionel Debieve# specific SMC function ID to access arm-smc-wdt service thanks to
10767d3ac186SLionel Debieve# optional config switch CFG_WDT_SM_HANDLER_ID.
10777d3ac186SLionel DebieveCFG_WDT_SM_HANDLER_ID ?= 0x82003D06
107834d244bfSClément Léger
107934d244bfSClément Léger# Allow using the udelay/mdelay function for platforms without ARM generic timer
108034d244bfSClément Léger# extension. When set to 'n', the plat_get_freq() function must be defined by
108134d244bfSClément Léger# the platform code
108234d244bfSClément LégerCFG_CORE_HAS_GENERIC_TIMER ?= y
1083f3f9432fSClément Léger
1084f3f9432fSClément Léger# Enable RTC API
1085f3f9432fSClément LégerCFG_DRIVERS_RTC ?= n
1086cea1eb0bSClément Léger
1087cea1eb0bSClément Léger# Enable PTA for RTC access from non-secure world
1088cea1eb0bSClément LégerCFG_RTC_PTA ?= n
1089952f5260SRuchika Gupta
10901fdb1c4fSJelle Sels# Enable the FF-A SPMC tests in xtests
10911fdb1c4fSJelle SelsCFG_SPMC_TESTS ?= n
1092bfdeae23SJens Wiklander
1093bfdeae23SJens Wiklander# Allocate the translation tables needed to map the S-EL0 application
1094bfdeae23SJens Wiklander# loaded
1095bfdeae23SJens WiklanderCFG_CORE_PREALLOC_EL0_TBLS ?= n
1096bfdeae23SJens Wiklanderifeq (y-y,$(CFG_CORE_PREALLOC_EL0_TBLS)-$(CFG_WITH_PAGER))
1097bfdeae23SJens Wiklander$(error "CFG_WITH_PAGER can't support CFG_CORE_PREALLOC_EL0_TBLS")
1098bfdeae23SJens Wiklanderendif
1099cb94c145SWeizhao Jiang
1100cb94c145SWeizhao Jiang# User TA runtime context dump.
1101cb94c145SWeizhao Jiang# When this option is enabled, OP-TEE provides a debug method for
1102cb94c145SWeizhao Jiang# developer to dump user TA's runtime context, including TA's heap stats.
1103cb94c145SWeizhao Jiang# Developer can open a stats PTA session and then invoke command
1104cb94c145SWeizhao Jiang# STATS_CMD_TA_STATS to get the context of loaded TAs.
1105cb94c145SWeizhao JiangCFG_TA_STATS ?= n
11067e75ca54SJens Wiklander
11077e75ca54SJens Wiklander# Enables best effort mitigations against fault injected when the hardware
11087e75ca54SJens Wiklander# is tampered with. Details in lib/libutils/ext/include/fault_mitigation.h
11097e75ca54SJens WiklanderCFG_FAULT_MITIGATION ?= y
11108bbc2e9cSJens Wiklander
1111c7f1b4f7SJens Wiklander# Enables TEE Internal Core API v1.1 compatibility for in-tree TAs. Note
1112c7f1b4f7SJens Wiklander# that this doesn't affect libutee itself, it's only the TAs compiled with
1113c7f1b4f7SJens Wiklander# this set that are affected. Each out-of-tree must set this if to enable
1114c7f1b4f7SJens Wiklander# compatibility with version v1.1 as the value of this variable is not
1115c7f1b4f7SJens Wiklander# preserved in the TA dev-kit.
1116c7f1b4f7SJens WiklanderCFG_TA_OPTEE_CORE_API_COMPAT_1_1 ?= n
11173d70a974SIgor Opaniuk
11183d70a974SIgor Opaniuk# Change supported HMAC key size range, from 64 to 1024.
11193d70a974SIgor Opaniuk# This is needed to pass AOSP Keymaster VTS tests:
11203d70a974SIgor Opaniuk#   Link to tests : https://android.googlesource.com/platform/hardware/interfaces/+/master/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp
11213d70a974SIgor Opaniuk#   Module: VtsHalKeymasterV3_0TargetTest
11223d70a974SIgor Opaniuk#   Testcases: - PerInstance/SigningOperationsTest#
11233d70a974SIgor Opaniuk#              - PerInstance/NewKeyGenerationTest#
11243d70a974SIgor Opaniuk#              - PerInstance/ImportKeyTest#
11253d70a974SIgor Opaniuk#              - PerInstance/EncryptionOperationsTest#
11263d70a974SIgor Opaniuk#              - PerInstance/AttestationTest#
11273d70a974SIgor Opaniuk# Note that this violates GP requirements of HMAC size range.
11283d70a974SIgor OpaniukCFG_HMAC_64_1024_RANGE ?= n
1129aae97333Sloubaihui
113068ac62efSSami Tolvanen# CFG_RSA_PUB_EXPONENT_3, when enabled, allows RSA public exponents in the
113168ac62efSSami Tolvanen# range 3 <= e < 2^256. This is needed to pass AOSP KeyMint VTS tests:
113268ac62efSSami Tolvanen#    Link to tests: https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/main/security/keymint/aidl/vts/functional/KeyMintTest.cpp
113368ac62efSSami Tolvanen#    Module: VtsAidlKeyMintTargetTest
113468ac62efSSami Tolvanen#    Testcases: - PerInstance/EncryptionOperationsTest.RsaNoPaddingSuccess
113568ac62efSSami Tolvanen# When CFG_RSA_PUB_EXPONENT_3 is disabled, RSA public exponents must conform
113668ac62efSSami Tolvanen# to NIST SP800-56B recommendation and be in the range 65537 <= e < 2^256.
113768ac62efSSami TolvanenCFG_RSA_PUB_EXPONENT_3 ?= n
113868ac62efSSami Tolvanen
1139aae97333Sloubaihui# Enable a hardware pbkdf2 function
1140aae97333Sloubaihui# By default use standard pbkdf2 implementation
1141aae97333SloubaihuiCFG_CRYPTO_HW_PBKDF2 ?= n
1142aae97333Sloubaihui$(eval $(call cfg-depends-all,CFG_CRYPTO_HW_PBKDF2,CFG_CRYPTO_PBKDF2))
11432b719df0SGatien Chevallier
11442b719df0SGatien Chevallier# CFG_HALT_CORES_ON_PANIC, when enabled, makes any call to panic() halt the
11452b719df0SGatien Chevallier# other cores. The feature currently relies on GIC device to trap the other
11462b719df0SGatien Chevallier# cores using an SGI interrupt specified by CFG_HALT_CORES_ON_PANIC_SGI.
11472b719df0SGatien ChevallierCFG_HALT_CORES_ON_PANIC ?= n
11482b719df0SGatien ChevallierCFG_HALT_CORES_ON_PANIC_SGI ?= 15
11492b719df0SGatien Chevallier$(eval $(call cfg-depends-all,CFG_HALT_CORES_ON_PANIC,CFG_GIC))
11501d129697SJens Wiklander
11511d129697SJens Wiklander# Enable automatic discovery of maximal PA supported by the hardware and
11521d129697SJens Wiklander# use that. Provides easier configuration of virtual platforms where the
11531d129697SJens Wiklander# maximal PA can vary.
11541d129697SJens WiklanderCFG_AUTO_MAX_PA_BITS ?= n
11555a2d2237SArnaud Pouliquen
11565a2d2237SArnaud Pouliquen# CFG_DRIVERS_REMOTEPROC, when enabled, embeds support for remote processor
11575a2d2237SArnaud Pouliquen# management including generic DT bindings for the configuration.
11585a2d2237SArnaud PouliquenCFG_DRIVERS_REMOTEPROC ?= n
1159f6c57ea4SArnaud Pouliquen
1160f6c57ea4SArnaud Pouliquen# CFG_REMOTEPROC_PTA, when enabled, embeds remote processor management PTA
1161f6c57ea4SArnaud Pouliquen# service.
1162f6c57ea4SArnaud PouliquenCFG_REMOTEPROC_PTA ?= n
1163ad194957SYi Chou
1164ad194957SYi Chou# When enabled, CFG_WIDEVINE_HUK uses the widevine HUK provided by secure
1165ad194957SYi Chou# DTB as OP-TEE HUK.
1166ad194957SYi ChouCFG_WIDEVINE_HUK ?= n
1167ad194957SYi Chou$(eval $(call cfg-depends-all,CFG_WIDEVINE_HUK,CFG_DT))
1168ad194957SYi Chou
1169ad194957SYi Chou# When enabled, CFG_WIDEVINE_PTA embeds a PTA that exposes the keys under
1170ad194957SYi Chou# DT node "/options/op-tee/widevine" to some specific TAs.
1171ad194957SYi ChouCFG_WIDEVINE_PTA ?= n
1172ad194957SYi Chou$(eval $(call cfg-depends-all,CFG_WIDEVINE_PTA,CFG_DT CFG_WIDEVINE_HUK))
11737e2a1038SAlvin Chang
1174458ef442SAlvin Chang# CFG_SEMIHOSTING_CONSOLE, when enabled, embeds a semihosting console driver.
1175458ef442SAlvin Chang# When CFG_SEMIHOSTING_CONSOLE_FILE=NULL, OP-TEE console reads/writes
1176458ef442SAlvin Chang# trace messages from/to the debug terminal of the semihosting host computer.
1177458ef442SAlvin Chang# When CFG_SEMIHOSTING_CONSOLE_FILE="{your_log_file}", OP-TEE console
1178458ef442SAlvin Chang# outputs trace messages to that file. Output to "optee.log" by default.
1179458ef442SAlvin ChangCFG_SEMIHOSTING_CONSOLE ?= n
1180458ef442SAlvin Changifeq ($(CFG_SEMIHOSTING_CONSOLE),y)
1181458ef442SAlvin Chang$(call force,CFG_SEMIHOSTING,y)
1182458ef442SAlvin Changendif
1183458ef442SAlvin ChangCFG_SEMIHOSTING_CONSOLE_FILE ?= "optee.log"
1184458ef442SAlvin Changifeq ($(CFG_SEMIHOSTING_CONSOLE_FILE),)
1185458ef442SAlvin Chang$(error CFG_SEMIHOSTING_CONSOLE_FILE cannot be empty)
1186458ef442SAlvin Changendif
1187458ef442SAlvin Chang
11887e2a1038SAlvin Chang# Semihosting is a debugging mechanism that enables code running on an embedded
11897e2a1038SAlvin Chang# system (also called the target) to communicate with and use the I/O of the
11907e2a1038SAlvin Chang# host computer.
11917e2a1038SAlvin ChangCFG_SEMIHOSTING ?= n
1192*d4a87690SSungbae Yoo
1193*d4a87690SSungbae Yoo# CFG_FFA_CONSOLE, when enabled, embeds a FFA console driver. OP-TEE console
1194*d4a87690SSungbae Yoo# writes trace messages via FFA interface to the SPM (Secure Partition Manager)
1195*d4a87690SSungbae Yoo# like hafnium.
1196*d4a87690SSungbae YooCFG_FFA_CONSOLE ?= n
1197