xref: /optee_os/mk/config.mk (revision cb0b5954d71aafdc2b6de4538bfc7fb171093cbf)
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
20a75f2e14SJerome ForissierCROSS_COMPILE ?= arm-linux-gnueabihf-
21c042fbefSJerome ForissierCROSS_COMPILE32 ?= $(CROSS_COMPILE)
22c042fbefSJerome ForissierCROSS_COMPILE64 ?= aarch64-linux-gnu-
23a75f2e14SJerome ForissierCOMPILER ?= gcc
24a75f2e14SJerome Forissier
25b09cddcaSJerome Forissier# For convenience
26b09cddcaSJerome Forissierifdef CFLAGS
27b09cddcaSJerome ForissierCFLAGS32 ?= $(CFLAGS)
28b09cddcaSJerome ForissierCFLAGS64 ?= $(CFLAGS)
29b09cddcaSJerome Forissierendif
30b09cddcaSJerome Forissier
31120c43adSJerome Forissier# Compiler warning level.
32120c43adSJerome Forissier# Supported values: undefined, 1, 2 and 3. 3 gives more warnings.
33b0104773SPascal BrandWARNS ?= 3
34b0104773SPascal Brand
35b0104773SPascal Brand# Define NOWERROR=1 so that warnings are not treated as errors
36b0104773SPascal Brand# NOWERROR=1
37b0104773SPascal Brand
383f17b838SEtienne Carriere# Define DEBUG=1 to compile without optimization (forces -O0)
39b0104773SPascal Brand# DEBUG=1
40b0104773SPascal Brand
413f17b838SEtienne Carriere# If y, enable debug mode of the tee firmware (CPU restart, Core Status
423f17b838SEtienne Carriere# verbose, panic & assert verbose). When disable, NDEBUG directive is defined.
433f17b838SEtienne CarriereCFG_TEE_CORE_DEBUG ?= n
44b0104773SPascal Brand
45e0042c88SPascal Brand# Max level of the tee core traces. 0 means disable, 4 is max.
46e0042c88SPascal Brand# Supported values: 0 (no traces) to 4 (all traces)
47b0104773SPascal Brand# If CFG_TEE_DRV_DEBUGFS is set, the level of traces to print can be
48b0104773SPascal Brand# dynamically changes via debugfs in the range 1 => CFG_TEE_CORE_LOG_LEVEL
49e0042c88SPascal BrandCFG_TEE_CORE_LOG_LEVEL ?= 1
50b0104773SPascal Brand
51b0104773SPascal Brand# TA and TEECore log level
52e0042c88SPascal Brand# Supported values: 0 (no traces) to 4 (all traces)
53b0104773SPascal Brand# If CFG_TEE_DRV_DEBUGFS is set, the level of traces to print can be
54b0104773SPascal Brand# dynamically changes via debugfs in the range 1 => CFG_TEE_TA_LOG_LEVEL
55e0042c88SPascal BrandCFG_TEE_TA_LOG_LEVEL ?= 1
56b0104773SPascal Brand
577c876f12SPascal Brand# TA enablement
587c876f12SPascal Brand# When defined to "y", TA traces are output according to
597c876f12SPascal Brand# CFG_TEE_TA_LOG_LEVEL. Otherwise, they are not output at all
607c876f12SPascal BrandCFG_TEE_CORE_TA_TRACE ?= y
61b0104773SPascal Brand
6294e8a4fcSJens Wiklander# Define TEE_Panic as a macro to help debugging panics caused by calls to
6394e8a4fcSJens Wiklander# TEE_Panic. This flag can have a different value when later compiling the
6494e8a4fcSJens Wiklander# TA
6594e8a4fcSJens WiklanderCFG_TEE_PANIC_DEBUG ?= y
6694e8a4fcSJens Wiklander
67120c43adSJerome Forissier# If 1, enable debug features in TA memory allocation.
68120c43adSJerome Forissier# Debug features include check of buffer overflow, statistics, mark/check heap
69120c43adSJerome Forissier# feature.
70b0104773SPascal BrandCFG_TEE_CORE_USER_MEM_DEBUG ?= 1
717018ae01SSY Chiu
720fcbddd4SSY Chiu# If y, enable memory leak detection feature in bget memory allocator.
730fcbddd4SSY ChiuCFG_TEE_CORE_MALLOC_DEBUG ?= n
740fcbddd4SSY ChiuCFG_TEE_TA_MALLOC_DEBUG ?= n
750fcbddd4SSY Chiu
76f4aa5b11SJerome Forissier# All message with level equal or higher to the following value will be
77f4aa5b11SJerome Forissier# prefixed with long debugging information (severity, thread ID, component
78f4aa5b11SJerome Forissier# name, function name, line number). Otherwise a short prefix is used
79f4aa5b11SJerome Forissier# (severity and component name only).
80f4aa5b11SJerome Forissier# Levels: 0=none 1=error 2=info 3=debug 4=flow
81f4aa5b11SJerome ForissierCFG_MSG_LONG_PREFIX_THRESHOLD ?= 3
82f4aa5b11SJerome Forissier
83120c43adSJerome Forissier# PRNG configuration
847018ae01SSY Chiu# If CFG_WITH_SOFTWARE_PRNG is enabled, crypto provider provided
857018ae01SSY Chiu# software PRNG implementation is used.
867018ae01SSY Chiu# Otherwise, you need to implement hw_get_random_byte() for your platform
877018ae01SSY ChiuCFG_WITH_SOFTWARE_PRNG ?= y
88120c43adSJerome Forissier
89120c43adSJerome Forissier# Number of threads
90120c43adSJerome ForissierCFG_NUM_THREADS ?= 2
91ab35d7adSCedric Chaumont
92ab35d7adSCedric Chaumont# API implementation version
93ab35d7adSCedric ChaumontCFG_TEE_API_VERSION ?= GPD-1.1-dev
94ab35d7adSCedric Chaumont
95ab35d7adSCedric Chaumont# Implementation description (implementation-dependent)
96ab35d7adSCedric ChaumontCFG_TEE_IMPL_DESCR ?= OPTEE
97ab35d7adSCedric Chaumont
98ab35d7adSCedric Chaumont# Trusted OS implementation version
994bf425c1SJens WiklanderTEE_IMPL_VERSION ?= $(shell git describe --always --dirty=-dev 2>/dev/null || echo Unknown)
10035c507f2SJerome Forissier# The following values are not extracted from the "git describe" output because
10135c507f2SJerome Forissier# we might be outside of a Git environment, or the tree may have been cloned
10235c507f2SJerome Forissier# with limited depth not including any tag, so there is really no guarantee
10335c507f2SJerome Forissier# that TEE_IMPL_VERSION contains the major and minor revision numbers.
104a0cd5d60SPascal BrandCFG_OPTEE_REVISION_MAJOR ?= 2
105fb676172SJoakim BechCFG_OPTEE_REVISION_MINOR ?= 3
106ab35d7adSCedric Chaumont
107ab35d7adSCedric Chaumont# Trusted OS implementation manufacturer name
108ab35d7adSCedric ChaumontCFG_TEE_MANUFACTURER ?= LINARO
109ab35d7adSCedric Chaumont
110ab35d7adSCedric Chaumont# Trusted firmware version
111ab35d7adSCedric ChaumontCFG_TEE_FW_IMPL_VERSION ?= FW_IMPL_UNDEF
112ab35d7adSCedric Chaumont
113ab35d7adSCedric Chaumont# Trusted OS implementation manufacturer name
114ab35d7adSCedric ChaumontCFG_TEE_FW_MANUFACTURER ?= FW_MAN_UNDEF
115ab35d7adSCedric Chaumont
116b44708c1SJerome Forissier# Rich Execution Environment (REE) file system support: normal world OS
117b44708c1SJerome Forissier# provides the actual storage.
118b44708c1SJerome Forissier# This is the default FS when enabled (i.e., the one used when
119b44708c1SJerome Forissier# TEE_STORAGE_PRIVATE is passed to the trusted storage API)
120b44708c1SJerome ForissierCFG_REE_FS ?= y
121bc420748SJens Wiklander
122b44708c1SJerome Forissier# REE filesystem block cache support
123b44708c1SJerome ForissierCFG_REE_FS_BLOCK_CACHE ?= n
1242ab7da0fSSY Chiu
12588e6e089SJerome Forissier# RPMB file system support
12688e6e089SJerome ForissierCFG_RPMB_FS ?= n
12788e6e089SJerome Forissier
12888e6e089SJerome Forissier# Device identifier used when CFG_RPMB_FS = y.
12988e6e089SJerome Forissier# The exact meaning of this value is platform-dependent. On Linux, the
13088e6e089SJerome Forissier# tee-supplicant process will open /dev/mmcblk<id>rpmb
13188e6e089SJerome ForissierCFG_RPMB_FS_DEV_ID ?= 0
13288e6e089SJerome Forissier
133ed1993b7SJerome Forissier# Enables RPMB key programming by the TEE, in case the RPMB partition has not
134ed1993b7SJerome Forissier# been configured yet.
135ed1993b7SJerome Forissier# !!! Security warning !!!
136ed1993b7SJerome Forissier# Do *NOT* enable this in product builds, as doing so would allow the TEE to
137ed1993b7SJerome Forissier# leak the RPMB key.
138ed1993b7SJerome Forissier# This option is useful in the following situations:
139ed1993b7SJerome Forissier# - Testing
140ed1993b7SJerome Forissier# - RPMB key provisioning in a controlled environment (factory setup)
141ed1993b7SJerome ForissierCFG_RPMB_WRITE_KEY ?= n
142ed1993b7SJerome Forissier
1432ef14de1SJerome Forissier# SQL FS stores its data in a SQLite database, accessed by normal world
1442ef14de1SJerome ForissierCFG_SQL_FS ?= n
145b44708c1SJerome Forissier
146bc420748SJens Wiklander# Embed public part of this key in OP-TEE OS
147bc420748SJens WiklanderTA_SIGN_KEY ?= keys/default_ta.pem
148c4553de7SJerome Forissier
149c4553de7SJerome Forissier# Include lib/libutils/isoc in the build? Most platforms need this, but some
150c4553de7SJerome Forissier# may not because they obtain the isoc functions from elsewhere
151c4553de7SJerome ForissierCFG_LIBUTILS_WITH_ISOC ?= y
152fce4cfa1SJens Wiklander
1530de9a5fbSJens Wiklander# Enables floating point support for user TAs
1540de9a5fbSJens Wiklander# ARM32: EABI defines both a soft-float ABI and a hard-float ABI,
1550de9a5fbSJens Wiklander#	 hard-float is basically a super set of soft-float. Hard-float
1560de9a5fbSJens Wiklander#	 requires all the support routines provided for soft-float, but the
1570de9a5fbSJens Wiklander#	 compiler may choose to optimize to not use some of them and use
1580de9a5fbSJens Wiklander#	 the floating-point registers instead.
1590de9a5fbSJens Wiklander# ARM64: EABI doesn't define a soft-float ABI, everything is hard-float (or
1600de9a5fbSJens Wiklander#	 nothing with ` -mgeneral-regs-only`)
1610de9a5fbSJens Wiklander# With CFG_TA_FLOAT_SUPPORT enabled TA code is free use floating point types
1620de9a5fbSJens WiklanderCFG_TA_FLOAT_SUPPORT ?= y
163923c1f34SJens Wiklander
164923c1f34SJens Wiklander# Enable stack unwinding for aborts from kernel mode if CFG_TEE_CORE_DEBUG
165923c1f34SJens Wiklander# is enabled
1663f17b838SEtienne Carriereifeq ($(CFG_TEE_CORE_DEBUG),y)
167923c1f34SJens WiklanderCFG_CORE_UNWIND ?= y
168923c1f34SJens Wiklanderendif
1696fbac37eSJens Wiklander
1706fbac37eSJens Wiklander# Enable support for dynamically loaded user TAs
1716fbac37eSJens WiklanderCFG_WITH_USER_TA ?= y
1722a142248SJens Wiklander
1732a142248SJens Wiklander# Use small pages to map user TAs
1742a142248SJens WiklanderCFG_SMALL_PAGE_USER_TA ?= y
175be715239SJens Wiklander
176a884c935SJens Wiklander# Enable paging, requires SRAM, can't be enabled by default
177a884c935SJens WiklanderCFG_WITH_PAGER ?= n
178a884c935SJens Wiklander
179a884c935SJens Wiklander# Use the pager for user TAs
180a884c935SJens WiklanderCFG_PAGED_USER_TA ?= $(CFG_WITH_PAGER)
181a884c935SJens Wiklander
182be715239SJens Wiklander# Enable support for detected undefined behavior in C
1831d171f95SJens Wiklander# Uses a lot of memory, can't be enabled by default
184be715239SJens WiklanderCFG_CORE_SANITIZE_UNDEFINED ?= n
185b908c675SJens Wiklander
1861d171f95SJens Wiklander# Enable Kernel Address sanitizer, has a huge performance impact, uses a
1871d171f95SJens Wiklander# lot of memory and need platform specific adaptations, can't be enabled by
1881d171f95SJens Wiklander# default
1891d171f95SJens WiklanderCFG_CORE_SANITIZE_KADDRESS ?= n
1901d171f95SJens Wiklander
191b908c675SJens Wiklander# Device Tree support
192b908c675SJens Wiklander# When enabled, the TEE _start function expects to find the address of a
193b908c675SJens Wiklander# Device Tree Blob (DTB) in register r2. The DT parsing code relies on
194b908c675SJens Wiklander# libfdt.  Currently only used to add the optee node and a reserved-memory
195b908c675SJens Wiklander# node for shared memory.
196b908c675SJens WiklanderCFG_DT ?= n
19776358becSJens Wiklander
19876358becSJens Wiklander# Maximum size of the Device Tree Blob, has to be large enough to allow
19976358becSJens Wiklander# editing of the supplied DTB.
20076358becSJens WiklanderCFG_DTB_MAX_SIZE ?= 0x10000
2014d62e91aSVictor Chong
2024d62e91aSVictor Chong# Enable static TA and core self tests
2034d62e91aSVictor ChongCFG_TEE_CORE_EMBED_INTERNAL_TESTS ?= y
2046d96f208Syanyan-wrs
2056d96f208Syanyan-wrs# This option enables OP-TEE to respond to SMP boot request: the Rich OS
2066d96f208Syanyan-wrs# issues this to request OP-TEE to release secondaries cores out of reset,
2076d96f208Syanyan-wrs# with specific core number and non-secure entry address.
2086d96f208Syanyan-wrsCFG_BOOT_SECONDARY_REQUEST ?= n
2096d96f208Syanyan-wrs
210f5f914aaSJens Wiklander# Default heap size for Core, 64 kB
211f5f914aaSJens WiklanderCFG_CORE_HEAP_SIZE ?= 65536
212f3bb2312SJerome Forissier
213883c4be3SJerome Forissier# TA profiling.
214883c4be3SJerome Forissier# When this option is enabled, OP-TEE can execute Trusted Applications
215883c4be3SJerome Forissier# instrumented with GCC's -pg flag and will output profiling information
216883c4be3SJerome Forissier# in gmon.out format to /tmp/gmon-<ta_uuid>.out (path is defined in
217883c4be3SJerome Forissier# tee-supplicant)
218883c4be3SJerome ForissierCFG_TA_GPROF_SUPPORT ?= n
219f3bb2312SJerome Forissier
220883c4be3SJerome Forissier# Enable to compile user TA libraries with profiling (-pg).
221883c4be3SJerome Forissier# Depends on CFG_TA_GPROF_SUPPORT.
222883c4be3SJerome ForissierCFG_ULIBS_GPROF ?= n
223883c4be3SJerome Forissier
224883c4be3SJerome Forissierifeq ($(CFG_ULIBS_GPROF),y)
225f3bb2312SJerome Forissierifneq ($(CFG_TA_GPROF_SUPPORT),y)
226883c4be3SJerome Forissier$(error Cannot instrument user libraries if user mode profiling is disabled)
227f3bb2312SJerome Forissierendif
228f3bb2312SJerome Forissierendif
229*cb0b5954SJens Wiklander
230*cb0b5954SJens Wiklander# CFG_GP_SOCKETS
231*cb0b5954SJens Wiklander# Enable Global Platform Sockets support
232*cb0b5954SJens WiklanderCFG_GP_SOCKETS ?= y
233