Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 1 | # Default configuration values for OP-TEE core (all platforms). |
| 2 | # |
| 3 | # Platform-specific overrides are in core/arch/arm32/plat-*/conf.mk. |
| 4 | # Some subsystem-specific defaults are not here but rather in */sub.mk. |
| 5 | # |
| 6 | # Configuration values may be assigned from multiple sources. |
| 7 | # From higher to lower priority: |
| 8 | # |
| 9 | # 1. Make arguments ('make CFG_FOO=bar...') |
| 10 | # 2. The file specified by $(CFG_OPTEE_CONFIG) (if defined) |
| 11 | # 3. The environment ('CFG_FOO=bar make...') |
| 12 | # 4. The platform-specific configuration file: core/arch/arm32/plat-*/conf.mk |
| 13 | # 5. This file |
| 14 | # 6. Subsystem-specific makefiles (*/sub.mk) |
| 15 | # |
Pascal Brand | b5569a6 | 2016-01-08 15:14:30 +0100 | [diff] [blame] | 16 | # Actual values used during the build are output to $(out-dir)/conf.mk |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 17 | # (CFG_* variables only). |
| 18 | |
Jerome Forissier | a75f2e1 | 2015-07-07 19:07:50 +0200 | [diff] [blame] | 19 | # Cross-compiler prefix and suffix |
| 20 | CROSS_COMPILE ?= arm-linux-gnueabihf- |
Jerome Forissier | c042fbe | 2016-02-05 10:48:36 +0100 | [diff] [blame] | 21 | CROSS_COMPILE32 ?= $(CROSS_COMPILE) |
| 22 | CROSS_COMPILE64 ?= aarch64-linux-gnu- |
Jerome Forissier | a75f2e1 | 2015-07-07 19:07:50 +0200 | [diff] [blame] | 23 | COMPILER ?= gcc |
| 24 | |
Jerome Forissier | b09cddc | 2016-02-24 13:01:45 +0100 | [diff] [blame] | 25 | # For convenience |
| 26 | ifdef CFLAGS |
| 27 | CFLAGS32 ?= $(CFLAGS) |
| 28 | CFLAGS64 ?= $(CFLAGS) |
| 29 | endif |
| 30 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 31 | # Compiler warning level. |
| 32 | # Supported values: undefined, 1, 2 and 3. 3 gives more warnings. |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 33 | WARNS ?= 3 |
| 34 | |
Pascal Brand | 7c876f1 | 2015-03-02 16:43:19 +0100 | [diff] [blame] | 35 | # Define NOWERROR=1 so that warnings are not treated as errors |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 36 | # NOWERROR=1 |
| 37 | |
| 38 | # Define DEBUG=1 to compile with -g option |
| 39 | # DEBUG=1 |
| 40 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 41 | # If 1, debug mode of the tee firmware (CPU restart, Core Status) |
Pascal Brand | 31908ae | 2015-04-28 07:55:19 +0200 | [diff] [blame] | 42 | CFG_TEE_CORE_DEBUG ?= 0 |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 43 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 44 | # Max level of the tee core traces. 0 means disable, 4 is max. |
| 45 | # Supported values: 0 (no traces) to 4 (all traces) |
| 46 | # If CFG_TEE_DRV_DEBUGFS is set, the level of traces to print can be |
| 47 | # dynamically changes via debugfs in the range 1 => CFG_TEE_CORE_LOG_LEVEL |
| 48 | CFG_TEE_CORE_LOG_LEVEL ?= 1 |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 49 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 50 | # TA and TEECore log level |
| 51 | # Supported values: 0 (no traces) to 4 (all traces) |
| 52 | # If CFG_TEE_DRV_DEBUGFS is set, the level of traces to print can be |
| 53 | # dynamically changes via debugfs in the range 1 => CFG_TEE_TA_LOG_LEVEL |
| 54 | CFG_TEE_TA_LOG_LEVEL ?= 1 |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 55 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 56 | # TA enablement |
| 57 | # When defined to "y", TA traces are output according to |
| 58 | # CFG_TEE_TA_LOG_LEVEL. Otherwise, they are not output at all |
| 59 | CFG_TEE_CORE_TA_TRACE ?= y |
Pascal Brand | b010477 | 2014-06-12 15:56:20 +0200 | [diff] [blame] | 60 | |
Jens Wiklander | 94e8a4f | 2015-10-26 14:30:32 +0100 | [diff] [blame] | 61 | # Define TEE_Panic as a macro to help debugging panics caused by calls to |
| 62 | # TEE_Panic. This flag can have a different value when later compiling the |
| 63 | # TA |
| 64 | CFG_TEE_PANIC_DEBUG ?= y |
| 65 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 66 | # If 1, enable debug features in TA memory allocation. |
| 67 | # Debug features include check of buffer overflow, statistics, mark/check heap |
| 68 | # feature. |
| 69 | CFG_TEE_CORE_USER_MEM_DEBUG ?= 1 |
SY Chiu | 7018ae0 | 2015-03-04 15:04:45 +0800 | [diff] [blame] | 70 | |
SY Chiu | 0fcbddd | 2015-11-11 19:10:42 +0800 | [diff] [blame] | 71 | # If y, enable memory leak detection feature in bget memory allocator. |
| 72 | CFG_TEE_CORE_MALLOC_DEBUG ?= n |
| 73 | CFG_TEE_TA_MALLOC_DEBUG ?= n |
| 74 | |
Jerome Forissier | f4aa5b1 | 2015-05-12 18:06:22 +0200 | [diff] [blame] | 75 | # All message with level equal or higher to the following value will be |
| 76 | # prefixed with long debugging information (severity, thread ID, component |
| 77 | # name, function name, line number). Otherwise a short prefix is used |
| 78 | # (severity and component name only). |
| 79 | # Levels: 0=none 1=error 2=info 3=debug 4=flow |
| 80 | CFG_MSG_LONG_PREFIX_THRESHOLD ?= 3 |
| 81 | |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 82 | # PRNG configuration |
SY Chiu | 7018ae0 | 2015-03-04 15:04:45 +0800 | [diff] [blame] | 83 | # If CFG_WITH_SOFTWARE_PRNG is enabled, crypto provider provided |
| 84 | # software PRNG implementation is used. |
SY Chiu | 7018ae0 | 2015-03-04 15:04:45 +0800 | [diff] [blame] | 85 | # Otherwise, you need to implement hw_get_random_byte() for your platform |
SY Chiu | 7018ae0 | 2015-03-04 15:04:45 +0800 | [diff] [blame] | 86 | CFG_WITH_SOFTWARE_PRNG ?= y |
Jerome Forissier | 120c43a | 2015-03-24 11:08:31 +0100 | [diff] [blame] | 87 | |
| 88 | # Number of threads |
| 89 | CFG_NUM_THREADS ?= 2 |
Cedric Chaumont | ab35d7a | 2015-04-28 12:19:53 +0200 | [diff] [blame] | 90 | |
| 91 | # API implementation version |
| 92 | CFG_TEE_API_VERSION ?= GPD-1.1-dev |
| 93 | |
| 94 | # Implementation description (implementation-dependent) |
| 95 | CFG_TEE_IMPL_DESCR ?= OPTEE |
| 96 | |
| 97 | # Trusted OS implementation version |
Jens Wiklander | 4bf425c | 2015-12-21 15:06:08 +0100 | [diff] [blame] | 98 | TEE_IMPL_VERSION ?= $(shell git describe --always --dirty=-dev 2>/dev/null || echo Unknown) |
Jerome Forissier | 35c507f | 2016-03-17 15:10:14 +0100 | [diff] [blame] | 99 | # The following values are not extracted from the "git describe" output because |
| 100 | # we might be outside of a Git environment, or the tree may have been cloned |
| 101 | # with limited depth not including any tag, so there is really no guarantee |
| 102 | # that TEE_IMPL_VERSION contains the major and minor revision numbers. |
Pascal Brand | a0cd5d6 | 2016-04-01 11:56:49 +0200 | [diff] [blame] | 103 | CFG_OPTEE_REVISION_MAJOR ?= 2 |
Pascal Brand | ac3cc11 | 2016-06-23 11:10:52 +0200 | [diff] [blame^] | 104 | CFG_OPTEE_REVISION_MINOR ?= 1 |
Cedric Chaumont | ab35d7a | 2015-04-28 12:19:53 +0200 | [diff] [blame] | 105 | |
| 106 | # Trusted OS implementation manufacturer name |
| 107 | CFG_TEE_MANUFACTURER ?= LINARO |
| 108 | |
| 109 | # Trusted firmware version |
| 110 | CFG_TEE_FW_IMPL_VERSION ?= FW_IMPL_UNDEF |
| 111 | |
| 112 | # Trusted OS implementation manufacturer name |
| 113 | CFG_TEE_FW_MANUFACTURER ?= FW_MAN_UNDEF |
| 114 | |
Jerome Forissier | b44708c | 2016-04-18 09:35:34 +0200 | [diff] [blame] | 115 | # Rich Execution Environment (REE) file system support: normal world OS |
| 116 | # provides the actual storage. |
| 117 | # This is the default FS when enabled (i.e., the one used when |
| 118 | # TEE_STORAGE_PRIVATE is passed to the trusted storage API) |
| 119 | CFG_REE_FS ?= y |
Jens Wiklander | bc42074 | 2015-05-05 14:59:15 +0200 | [diff] [blame] | 120 | |
Jerome Forissier | b44708c | 2016-04-18 09:35:34 +0200 | [diff] [blame] | 121 | # REE filesystem block cache support |
| 122 | CFG_REE_FS_BLOCK_CACHE ?= n |
SY Chiu | 2ab7da0 | 2015-10-27 11:00:07 +0800 | [diff] [blame] | 123 | |
Jerome Forissier | 88e6e08 | 2016-01-27 17:38:21 +0100 | [diff] [blame] | 124 | # RPMB file system support |
Jerome Forissier | 88e6e08 | 2016-01-27 17:38:21 +0100 | [diff] [blame] | 125 | CFG_RPMB_FS ?= n |
| 126 | |
| 127 | # Device identifier used when CFG_RPMB_FS = y. |
| 128 | # The exact meaning of this value is platform-dependent. On Linux, the |
| 129 | # tee-supplicant process will open /dev/mmcblk<id>rpmb |
| 130 | CFG_RPMB_FS_DEV_ID ?= 0 |
| 131 | |
Jerome Forissier | b44708c | 2016-04-18 09:35:34 +0200 | [diff] [blame] | 132 | # File encryption support |
| 133 | # Applies to both the REE and the RPMB filesystems |
| 134 | CFG_ENC_FS ?= y |
| 135 | |
| 136 | ifeq (,$(filter y,$(CFG_REE_FS) $(CFG_RPMB_FS))) |
| 137 | $(error At least one filesystem must be enabled) |
| 138 | endif |
| 139 | |
Jens Wiklander | bc42074 | 2015-05-05 14:59:15 +0200 | [diff] [blame] | 140 | # Embed public part of this key in OP-TEE OS |
| 141 | TA_SIGN_KEY ?= keys/default_ta.pem |
Jerome Forissier | c4553de | 2015-11-25 09:40:18 +0100 | [diff] [blame] | 142 | |
| 143 | # Include lib/libutils/isoc in the build? Most platforms need this, but some |
| 144 | # may not because they obtain the isoc functions from elsewhere |
| 145 | CFG_LIBUTILS_WITH_ISOC ?= y |
Jens Wiklander | fce4cfa | 2015-12-10 15:30:07 +0100 | [diff] [blame] | 146 | |
Jens Wiklander | 0de9a5f | 2015-12-11 16:35:10 +0100 | [diff] [blame] | 147 | # Enables floating point support for user TAs |
| 148 | # ARM32: EABI defines both a soft-float ABI and a hard-float ABI, |
| 149 | # hard-float is basically a super set of soft-float. Hard-float |
| 150 | # requires all the support routines provided for soft-float, but the |
| 151 | # compiler may choose to optimize to not use some of them and use |
| 152 | # the floating-point registers instead. |
| 153 | # ARM64: EABI doesn't define a soft-float ABI, everything is hard-float (or |
| 154 | # nothing with ` -mgeneral-regs-only`) |
| 155 | # With CFG_TA_FLOAT_SUPPORT enabled TA code is free use floating point types |
| 156 | CFG_TA_FLOAT_SUPPORT ?= y |
Jens Wiklander | 923c1f3 | 2015-12-06 11:01:54 +0100 | [diff] [blame] | 157 | |
| 158 | # Enable stack unwinding for aborts from kernel mode if CFG_TEE_CORE_DEBUG |
| 159 | # is enabled |
| 160 | ifeq ($(CFG_TEE_CORE_DEBUG),1) |
| 161 | CFG_CORE_UNWIND ?= y |
| 162 | endif |
Jens Wiklander | 6fbac37 | 2015-11-05 14:22:05 +0100 | [diff] [blame] | 163 | |
| 164 | # Enable support for dynamically loaded user TAs |
| 165 | CFG_WITH_USER_TA ?= y |
Jens Wiklander | 2a14224 | 2016-01-05 17:26:27 +0100 | [diff] [blame] | 166 | |
| 167 | # Use small pages to map user TAs |
| 168 | CFG_SMALL_PAGE_USER_TA ?= y |
Jens Wiklander | be71523 | 2016-05-15 14:13:52 +0200 | [diff] [blame] | 169 | |
| 170 | # Enable support for detected undefined behavior in C |
| 171 | # Uses a log of memory, can't be enabled by default |
| 172 | CFG_CORE_SANITIZE_UNDEFINED ?= n |
Jens Wiklander | b908c67 | 2016-05-25 14:01:53 +0200 | [diff] [blame] | 173 | |
| 174 | # Device Tree support |
| 175 | # When enabled, the TEE _start function expects to find the address of a |
| 176 | # Device Tree Blob (DTB) in register r2. The DT parsing code relies on |
| 177 | # libfdt. Currently only used to add the optee node and a reserved-memory |
| 178 | # node for shared memory. |
| 179 | CFG_DT ?= n |
Jens Wiklander | 76358be | 2016-05-25 21:42:02 +0200 | [diff] [blame] | 180 | |
| 181 | # Maximum size of the Device Tree Blob, has to be large enough to allow |
| 182 | # editing of the supplied DTB. |
| 183 | CFG_DTB_MAX_SIZE ?= 0x10000 |