Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Tamas Ban | abea89d | 2020-01-15 13:29:25 +0000 | [diff] [blame] | 2 | # Copyright (c) 2018-2020, Arm Limited. All rights reserved. |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | if(NOT DEFINED REGRESSION) |
| 9 | message(FATAL_ERROR "ERROR: Incomplete Configuration: REGRESSION not defined, Include this file from a Config*.cmake") |
| 10 | elseif(NOT DEFINED CORE_TEST) |
| 11 | message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_TEST not defined, Include this file from a Config*.cmake") |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 12 | elseif(NOT DEFINED TFM_LVL) |
| 13 | message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_LVL not defined, Include this file from a Config*.cmake") |
David Hu | f2cfa12 | 2019-08-27 15:32:38 +0800 | [diff] [blame] | 14 | elseif(NOT DEFINED CORE_IPC) |
Tamas Ban | abea89d | 2020-01-15 13:29:25 +0000 | [diff] [blame] | 15 | message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_IPC not defined. Include this file from a Config*.cmake") |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 16 | endif() |
| 17 | |
Mate Toth-Pal | ee551bc | 2018-06-12 16:40:45 +0200 | [diff] [blame] | 18 | if(NOT DEFINED COMPILER) |
| 19 | message(FATAL_ERROR "ERROR: COMPILER is not set in command line") |
TTornblom | 99f0be2 | 2019-12-17 16:22:38 +0100 | [diff] [blame] | 20 | elseif((NOT ${COMPILER} STREQUAL "ARMCLANG") AND (NOT ${COMPILER} STREQUAL "GNUARM") AND (NOT ${COMPILER} STREQUAL "IARARM")) |
Mate Toth-Pal | ee551bc | 2018-06-12 16:40:45 +0200 | [diff] [blame] | 21 | message(FATAL_ERROR "ERROR: Compiler \"${COMPILER}\" is not supported.") |
| 22 | endif() |
| 23 | |
Tamas Ban | dd10fe5 | 2019-09-18 11:52:32 +0100 | [diff] [blame] | 24 | #Configure the default build type |
| 25 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (i.e. Debug)") |
| 26 | |
Raef Coles | b321c0b | 2019-10-15 08:49:17 +0100 | [diff] [blame] | 27 | #Ignore case on the cmake build types |
| 28 | string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) |
| 29 | |
Edison Ai | cb0ecf6 | 2019-07-10 18:43:51 +0800 | [diff] [blame] | 30 | if(CORE_IPC) |
| 31 | if (TFM_LVL EQUAL 3) |
| 32 | message(FATAL_ERROR "ERROR: Invalid isolation level!") |
| 33 | endif() |
| 34 | else() |
| 35 | if(NOT TFM_LVL EQUAL 1) |
| 36 | message(FATAL_ERROR "ERROR: Invalid isolation level!") |
| 37 | endif() |
| 38 | endif() |
| 39 | |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 40 | #BL2 bootloader (MCUBoot) related settings |
David Vincze | 54d0555 | 2019-08-05 12:58:47 +0200 | [diff] [blame] | 41 | include(${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/MCUBootConfig.cmake) |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 42 | |
Mate Toth-Pal | 48fc6a0 | 2018-01-24 09:50:14 +0100 | [diff] [blame] | 43 | set(BUILD_CMSIS_CORE Off) |
| 44 | set(BUILD_RETARGET Off) |
| 45 | set(BUILD_NATIVE_DRIVERS Off) |
| 46 | set(BUILD_TIME Off) |
| 47 | set(BUILD_STARTUP Off) |
| 48 | set(BUILD_TARGET_CFG Off) |
| 49 | set(BUILD_TARGET_HARDWARE_KEYS Off) |
Marc Moreno Berengue | 4cc81fc | 2018-08-10 14:32:01 +0100 | [diff] [blame] | 50 | set(BUILD_TARGET_NV_COUNTERS Off) |
Mate Toth-Pal | 48fc6a0 | 2018-01-24 09:50:14 +0100 | [diff] [blame] | 51 | set(BUILD_CMSIS_DRIVERS Off) |
| 52 | set(BUILD_UART_STDOUT Off) |
| 53 | set(BUILD_FLASH Off) |
Mate Toth-Pal | d3c7766 | 2019-02-20 16:23:00 +0100 | [diff] [blame] | 54 | set(BUILD_PLAT_TEST Off) |
Tamas Ban | d4bf347 | 2019-09-06 12:59:56 +0100 | [diff] [blame] | 55 | set(BUILD_BOOT_HAL Off) |
Mate Toth-Pal | 48fc6a0 | 2018-01-24 09:50:14 +0100 | [diff] [blame] | 56 | if(NOT DEFINED PLATFORM_CMAKE_FILE) |
| 57 | message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.") |
| 58 | elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE}) |
| 59 | message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.") |
| 60 | else() |
| 61 | include(${PLATFORM_CMAKE_FILE}) |
| 62 | endif() |
| 63 | |
David Hu | 857bfa5 | 2019-05-21 13:54:50 +0800 | [diff] [blame] | 64 | # Select the corresponding CPU type and configuration according to current |
| 65 | # building status in multi-core scenario. |
| 66 | # The updated configuration will be used in following compiler setting. |
| 67 | if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY) |
David Hu | 104388f | 2019-11-18 14:37:32 +0800 | [diff] [blame] | 68 | if (NOT CORE_IPC) |
| 69 | message(FATAL_ERROR "CORE_IPC is OFF. Multi-core topology should work in IPC model.") |
| 70 | endif() |
| 71 | |
David Hu | 857bfa5 | 2019-05-21 13:54:50 +0800 | [diff] [blame] | 72 | include("Common/MultiCore") |
| 73 | |
| 74 | if (NOT DEFINED TFM_BUILD_IN_SPE) |
| 75 | message(FATAL_ERROR "Flag of building in SPE is not specified. Please set TFM_BUILD_IN_SPE.") |
| 76 | else() |
| 77 | select_arm_cpu_type(${TFM_BUILD_IN_SPE}) |
| 78 | endif() |
David Hu | 857bfa5 | 2019-05-21 13:54:50 +0800 | [diff] [blame] | 79 | |
David Hu | feae0f9 | 2019-06-17 13:42:20 +0800 | [diff] [blame] | 80 | # CMSE is unnecessary in multi-core scenarios. |
| 81 | # TODO: Need further discussion about if CMSE is required when an Armv8-M |
| 82 | # core acts as secure core in multi-core scenario. |
Mate Toth-Pal | 8f17a71 | 2020-03-02 16:22:19 +0100 | [diff] [blame] | 83 | # leave CMSE_FLAGS undefined |
David Hu | feae0f9 | 2019-06-17 13:42:20 +0800 | [diff] [blame] | 84 | else() |
TTornblom | 99f0be2 | 2019-12-17 16:22:38 +0100 | [diff] [blame] | 85 | if(${COMPILER} STREQUAL "IARARM") |
| 86 | set (CMSE_FLAGS "--cmse") |
| 87 | else() |
| 88 | set (CMSE_FLAGS "-mcmse") |
| 89 | endif() |
David Hu | aeaf273 | 2019-10-10 14:32:53 +0800 | [diff] [blame] | 90 | |
| 91 | # Clear multi-core test setting |
| 92 | set (TFM_MULTI_CORE_TEST OFF) |
David Hu | feae0f9 | 2019-06-17 13:42:20 +0800 | [diff] [blame] | 93 | endif() |
| 94 | |
Mate Toth-Pal | ee551bc | 2018-06-12 16:40:45 +0200 | [diff] [blame] | 95 | if(${COMPILER} STREQUAL "ARMCLANG") |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 96 | #Use any ARMCLANG version found on PATH. Note: Only versions supported by the |
| 97 | #build system will work. A file cmake/Common/CompilerArmClangXY.cmake |
| 98 | #must be present with a matching version. |
| 99 | include("Common/FindArmClang") |
| 100 | include("Common/${ARMCLANG_MODULE}") |
Mate Toth-Pal | 48fc6a0 | 2018-01-24 09:50:14 +0100 | [diff] [blame] | 101 | |
Ken Liu | 8e7622b | 2020-04-16 17:05:56 +0800 | [diff] [blame] | 102 | set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -mfpu=none -ffunction-sections -fdata-sections -fno-builtin -nostdlib) |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 103 | ##Shared compiler settings. |
| 104 | function(config_setting_shared_compiler_flags tgt) |
Mate Toth-Pal | 8f17a71 | 2020-03-02 16:22:19 +0100 | [diff] [blame] | 105 | embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C APPEND FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror) |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 106 | endfunction() |
| 107 | |
| 108 | ##Shared linker settings. |
| 109 | function(config_setting_shared_linker_flags tgt) |
Antonio de Angelis | 3302f45 | 2019-07-19 10:36:33 +0100 | [diff] [blame] | 110 | embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --remove --info=summarysizes,sizes,totals,unused,veneers) |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 111 | endfunction() |
| 112 | elseif(${COMPILER} STREQUAL "GNUARM") |
| 113 | #Use any GNUARM version found on PATH. Note: Only versions supported by the |
| 114 | #build system will work. A file cmake/Common/CompilerGNUARMXY.cmake |
| 115 | #must be present with a matching version. |
| 116 | include("Common/FindGNUARM") |
| 117 | include("Common/${GNUARM_MODULE}") |
Mate Toth-Pal | 48fc6a0 | 2018-01-24 09:50:14 +0100 | [diff] [blame] | 118 | |
Ken Liu | 8e7622b | 2020-04-16 17:05:56 +0800 | [diff] [blame] | 119 | set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -msoft-float -ffunction-sections -fdata-sections --specs=nano.specs -fno-builtin) |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 120 | ##Shared compiler and linker settings. |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 121 | function(config_setting_shared_compiler_flags tgt) |
Mate Toth-Pal | 8f17a71 | 2020-03-02 16:22:19 +0100 | [diff] [blame] | 122 | embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C APPEND FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror -Wno-format -Wno-return-type -Wno-unused-but-set-variable) |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 123 | endfunction() |
| 124 | |
| 125 | ##Shared linker settings. |
| 126 | function(config_setting_shared_linker_flags tgt) |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 127 | #--no-wchar-size-warning flag is added because TF-M sources are compiled |
| 128 | #with short wchars, however the standard library is compiled with normal |
| 129 | #wchar, and this generates linker time warnings. TF-M code does not use |
| 130 | #wchar, so the warning can be suppressed. |
Antonio de Angelis | 3302f45 | 2019-07-19 10:36:33 +0100 | [diff] [blame] | 131 | embedded_set_target_link_flags(TARGET ${tgt} FLAGS -Wl,-check-sections,-fatal-warnings,--gc-sections,--no-wchar-size-warning,--print-memory-usage --entry=Reset_Handler --specs=nano.specs) |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 132 | endfunction() |
TTornblom | 99f0be2 | 2019-12-17 16:22:38 +0100 | [diff] [blame] | 133 | elseif(${COMPILER} STREQUAL "IARARM") |
| 134 | #Use any IARARM version found on PATH. Note: Only versions supported by the |
| 135 | #build system will work. A file cmake/Common/CompilerIARARMXY.cmake |
| 136 | #must be present with a matching version. |
| 137 | include("Common/FindIARARM") |
| 138 | include("Common/${IARARM_MODULE}") |
| 139 | |
TTornblom | faf74f5 | 2020-03-04 17:56:27 +0100 | [diff] [blame] | 140 | set (COMMON_COMPILE_FLAGS -e --dlib_config=full --vla --silent -DNO_TYPEOF ${CMSE_FLAGS} --diag_suppress Pe546,Pe940) |
TTornblom | 99f0be2 | 2019-12-17 16:22:38 +0100 | [diff] [blame] | 141 | ##Shared compiler and linker settings. |
| 142 | function(config_setting_shared_compiler_flags tgt) |
| 143 | embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS ${COMMON_COMPILE_FLAGS} "-DImage$$= " "-DLoad$$LR$$= " "-D$$ZI$$Base=$$Base" "-D$$ZI$$Limit=$$Limit" "-D$$RO$$Base=$$Base" "-D$$RO$$Limit=$$Limit" "-D$$RW$$Base=$$Base" "-D$$RW$$Limit=$$Limit" "-D_DATA$$RW$$Base=_DATA$$Base" "-D_DATA$$RW$$Limit=_DATA$$Limit" "-D_DATA$$ZI$$Base=_DATA$$Base" "-D_DATA$$ZI$$Limit=_DATA$$Limit" "-D_STACK$$ZI$$Base=_STACK$$Base" "-D_STACK$$ZI$$Limit=_STACK$$Limit" ) |
| 144 | endfunction() |
| 145 | |
| 146 | ##Shared linker settings. |
| 147 | function(config_setting_shared_linker_flags tgt) |
| 148 | #--no-wchar-size-warning flag is added because TF-M sources are compiled |
| 149 | #with short wchars, however the standard library is compiled with normal |
| 150 | #wchar, and this generates linker time warnings. TF-M code does not use |
| 151 | #wchar, so the warning can be suppressed. |
| 152 | embedded_set_target_link_flags(TARGET ${tgt} FLAGS --silent --semihosting --redirect __write=__write_buffered) |
| 153 | endfunction() |
Mate Toth-Pal | 7686726 | 2018-03-09 13:15:36 +0100 | [diff] [blame] | 154 | endif() |
| 155 | |
| 156 | #Create a string from the compile flags list, so that it can be used later |
| 157 | #in this file to set mbedtls and BL2 flags |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 158 | list_to_string(COMMON_COMPILE_FLAGS_STR ${COMMON_COMPILE_FLAGS}) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 159 | |
| 160 | #Settings which shall be set for all projects the same way based |
| 161 | # on the variables above. |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 162 | set (TFM_PARTITION_TEST_CORE OFF) |
Jamie Fox | adf0255 | 2019-05-16 17:44:52 +0100 | [diff] [blame] | 163 | set (TFM_PARTITION_TEST_CORE_IPC OFF) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 164 | set (CORE_TEST_POSITIVE OFF) |
| 165 | set (CORE_TEST_INTERACTIVE OFF) |
Miklos Balint | f13ec02 | 2018-04-06 17:21:22 +0200 | [diff] [blame] | 166 | set (REFERENCE_PLATFORM OFF) |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 167 | set (TFM_PARTITION_TEST_SECURE_SERVICES OFF) |
Jamie Fox | 0e823a0 | 2019-10-28 17:28:19 +0000 | [diff] [blame] | 168 | set (TFM_PARTITION_TEST_SST OFF) |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 169 | set (SERVICES_TEST_ENABLED OFF) |
Marc Moreno Berengue | cae2c53 | 2018-10-09 12:58:46 +0100 | [diff] [blame] | 170 | set (TEST_FRAMEWORK_S OFF) |
| 171 | set (TEST_FRAMEWORK_NS OFF) |
Edison Ai | ec109cd | 2018-07-17 16:04:14 +0800 | [diff] [blame] | 172 | set (TFM_PSA_API OFF) |
Miklos Balint | f13ec02 | 2018-04-06 17:21:22 +0200 | [diff] [blame] | 173 | |
David Hu | 6010538 | 2019-12-25 13:37:05 +0800 | [diff] [blame] | 174 | if (NOT DEFINED TFM_PARTITION_AUDIT_LOG) |
| 175 | # Enable the TF-M Audit Log partition |
| 176 | set(TFM_PARTITION_AUDIT_LOG ON) |
| 177 | endif() |
| 178 | if (NOT DEFINED TFM_PARTITION_PLATFORM) |
| 179 | # Enable the TF-M Platform partition |
| 180 | set(TFM_PARTITION_PLATFORM ON) |
| 181 | endif() |
| 182 | if (NOT DEFINED TFM_PARTITION_SECURE_STORAGE) |
| 183 | # Enable the TF-M secure storage partition |
| 184 | set(TFM_PARTITION_SECURE_STORAGE ON) |
| 185 | endif() |
| 186 | if (NOT DEFINED TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
| 187 | # Enable the TF-M internal trusted storage partition |
| 188 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON) |
| 189 | endif() |
| 190 | if (NOT DEFINED TFM_PARTITION_CRYPTO) |
| 191 | # Enable the TF-M crypto partition |
| 192 | set(TFM_PARTITION_CRYPTO ON) |
| 193 | endif() |
| 194 | if (NOT DEFINED TFM_PARTITION_INITIAL_ATTESTATION) |
| 195 | # Enable the TF-M initial attestation partition |
| 196 | set(TFM_PARTITION_INITIAL_ATTESTATION ON) |
| 197 | endif() |
Kevin Peng | c73130f | 2019-10-22 17:27:18 +0800 | [diff] [blame] | 198 | |
Edison Ai | 1dfd7b1 | 2020-02-23 14:16:08 +0800 | [diff] [blame] | 199 | if (NOT TFM_LVL EQUAL 1 AND NOT DEFINED CONFIG_TFM_ENABLE_MEMORY_PROTECT) |
| 200 | set (CONFIG_TFM_ENABLE_MEMORY_PROTECT ON) |
| 201 | endif() |
| 202 | |
Kevin Peng | c73130f | 2019-10-22 17:27:18 +0800 | [diff] [blame] | 203 | if (TFM_PARTITION_INITIAL_ATTESTATION OR TFM_PARTITION_SECURE_STORAGE) |
| 204 | #PSA Initial Attestation and Protected storage rely on Cryptography API |
| 205 | set(TFM_PARTITION_CRYPTO ON) |
| 206 | endif() |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 207 | |
Kevin Peng | 0b5acd3 | 2020-03-03 15:17:58 +0800 | [diff] [blame] | 208 | if (TFM_PARTITION_SECURE_STORAGE) |
| 209 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON) |
| 210 | endif() |
| 211 | |
Marton Berke | 6fd21f1 | 2019-07-02 13:43:07 +0200 | [diff] [blame] | 212 | if(${TARGET_PLATFORM} STREQUAL "AN521" OR ${TARGET_PLATFORM} STREQUAL "AN519" OR ${TARGET_PLATFORM} STREQUAL "AN539") |
Miklos Balint | f13ec02 | 2018-04-06 17:21:22 +0200 | [diff] [blame] | 213 | set (REFERENCE_PLATFORM ON) |
| 214 | endif() |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 215 | |
Miklos Balint | 6cbeba6 | 2018-04-12 17:31:34 +0200 | [diff] [blame] | 216 | # Option to demonstrate usage of secure-only peripheral |
| 217 | set (SECURE_UART1 OFF) |
| 218 | |
Alan DeMars | 6184469 | 2019-10-22 08:23:29 -0700 | [diff] [blame] | 219 | if (PLATFORM_SVC_HANDLERS) |
| 220 | add_definitions(-DPLATFORM_SVC_HANDLERS) |
| 221 | endif() |
| 222 | |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 223 | if (REGRESSION) |
| 224 | set(SERVICES_TEST_ENABLED ON) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 225 | endif() |
| 226 | |
Edison Ai | ec109cd | 2018-07-17 16:04:14 +0800 | [diff] [blame] | 227 | if (CORE_IPC) |
| 228 | set(TFM_PSA_API ON) |
David Hu | f2cfa12 | 2019-08-27 15:32:38 +0800 | [diff] [blame] | 229 | |
| 230 | # Disable IPC Test by default if the config or platform doesn't explicitly |
| 231 | # require it |
| 232 | if (NOT DEFINED IPC_TEST) |
| 233 | set(IPC_TEST OFF) |
| 234 | endif() |
| 235 | else() |
| 236 | set(IPC_TEST OFF) |
Edison Ai | ec109cd | 2018-07-17 16:04:14 +0800 | [diff] [blame] | 237 | endif() |
| 238 | |
Miklos Balint | 87da251 | 2018-04-19 13:45:50 +0200 | [diff] [blame] | 239 | if (TFM_PSA_API) |
| 240 | add_definitions(-DTFM_PSA_API) |
| 241 | endif() |
| 242 | |
David Hu | 104388f | 2019-11-18 14:37:32 +0800 | [diff] [blame] | 243 | if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY) |
| 244 | add_definitions(-DTFM_MULTI_CORE_TOPOLOGY) |
David Hu | aeaf273 | 2019-10-10 14:32:53 +0800 | [diff] [blame] | 245 | |
| 246 | # Skip multi-core test cases if regression test is disabled |
| 247 | if (NOT REGRESSION) |
| 248 | set(TFM_MULTI_CORE_TEST OFF) |
| 249 | endif() |
David Hu | 104388f | 2019-11-18 14:37:32 +0800 | [diff] [blame] | 250 | endif() |
| 251 | |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 252 | if (SERVICES_TEST_ENABLED) |
| 253 | set(SERVICE_TEST_S ON) |
| 254 | set(SERVICE_TEST_NS ON) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 255 | endif() |
| 256 | |
| 257 | if (CORE_TEST) |
Kevin Peng | 726ad7a | 2020-01-22 15:49:29 +0800 | [diff] [blame] | 258 | if (NOT CORE_IPC OR TFM_LVL EQUAL 1) |
| 259 | set(CORE_TEST_POSITIVE ON) |
| 260 | endif() |
Mate Toth-Pal | 6569a59 | 2019-06-07 12:09:50 +0200 | [diff] [blame] | 261 | set(CORE_TEST_INTERACTIVE OFF) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 262 | endif() |
| 263 | |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 264 | if (CORE_TEST_INTERACTIVE) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 265 | add_definitions(-DCORE_TEST_INTERACTIVE) |
| 266 | set(TEST_FRAMEWORK_NS ON) |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 267 | set(TFM_PARTITION_TEST_CORE ON) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 268 | endif() |
| 269 | |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 270 | if (CORE_TEST_POSITIVE) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 271 | add_definitions(-DCORE_TEST_POSITIVE) |
| 272 | set(TEST_FRAMEWORK_NS ON) |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 273 | set(TFM_PARTITION_TEST_CORE ON) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 274 | endif() |
| 275 | |
David Hu | 33f2fd2 | 2019-08-16 15:32:39 +0800 | [diff] [blame] | 276 | if (TFM_PARTITION_TEST_CORE) |
| 277 | # If the platform or the topology doesn't specify whether IRQ test is |
| 278 | # supported, enable it by default. |
| 279 | if (NOT DEFINED TFM_ENABLE_IRQ_TEST) |
| 280 | set(TFM_ENABLE_IRQ_TEST ON) |
| 281 | endif() |
| 282 | |
| 283 | if (TFM_ENABLE_IRQ_TEST) |
| 284 | add_definitions(-DTFM_ENABLE_IRQ_TEST) |
| 285 | endif() |
| 286 | else() |
| 287 | set(TFM_ENABLE_IRQ_TEST OFF) |
| 288 | endif() |
| 289 | |
David Hu | f2cfa12 | 2019-08-27 15:32:38 +0800 | [diff] [blame] | 290 | if (IPC_TEST) |
| 291 | add_definitions(-DENABLE_IPC_TEST) |
Jamie Fox | adf0255 | 2019-05-16 17:44:52 +0100 | [diff] [blame] | 292 | set(TEST_FRAMEWORK_NS ON) |
| 293 | set(TFM_PARTITION_TEST_CORE_IPC ON) |
Edison Ai | ec109cd | 2018-07-17 16:04:14 +0800 | [diff] [blame] | 294 | endif() |
| 295 | |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 296 | if (SERVICE_TEST_S) |
| 297 | add_definitions(-DSERVICES_TEST_S) |
| 298 | set(TEST_FRAMEWORK_S ON) |
| 299 | endif() |
| 300 | |
| 301 | if (SERVICE_TEST_NS) |
| 302 | add_definitions(-DSERVICES_TEST_NS) |
| 303 | set(TEST_FRAMEWORK_NS ON) |
| 304 | endif() |
| 305 | |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 306 | if (TEST_FRAMEWORK_S) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 307 | add_definitions(-DTEST_FRAMEWORK_S) |
Jamie Fox | 56da099 | 2019-05-28 14:35:06 +0100 | [diff] [blame] | 308 | # The secure client partition is required to run secure tests |
| 309 | set(TFM_PARTITION_TEST_SECURE_SERVICES ON) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 310 | endif() |
| 311 | |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 312 | if (TEST_FRAMEWORK_NS) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 313 | add_definitions(-DTEST_FRAMEWORK_NS) |
| 314 | endif() |
| 315 | |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 316 | if (CORE_IPC) |
| 317 | set(TFM_PARTITION_AUDIT_LOG OFF) |
| 318 | endif() |
| 319 | |
Kevin Peng | edde1de | 2019-10-25 17:12:45 +0800 | [diff] [blame] | 320 | include(${CMAKE_CURRENT_LIST_DIR}/test/TestConfig.cmake) |
| 321 | |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 322 | if (TFM_PARTITION_AUDIT_LOG) |
| 323 | add_definitions(-DTFM_PARTITION_AUDIT_LOG) |
| 324 | endif() |
| 325 | |
Mingyang Sun | 9511e5e | 2019-05-29 18:18:44 +0800 | [diff] [blame] | 326 | if (TFM_PARTITION_PLATFORM) |
| 327 | add_definitions(-DTFM_PARTITION_PLATFORM) |
| 328 | endif() |
| 329 | |
Kevin Peng | c73130f | 2019-10-22 17:27:18 +0800 | [diff] [blame] | 330 | if (TFM_PARTITION_SECURE_STORAGE) |
| 331 | add_definitions(-DTFM_PARTITION_SECURE_STORAGE) |
| 332 | endif() |
| 333 | |
| 334 | if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
| 335 | add_definitions(-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
| 336 | endif() |
| 337 | |
| 338 | if (TFM_PARTITION_CRYPTO) |
| 339 | add_definitions(-DTFM_PARTITION_CRYPTO) |
| 340 | endif() |
| 341 | |
| 342 | if (TFM_PARTITION_INITIAL_ATTESTATION) |
| 343 | add_definitions(-DTFM_PARTITION_INITIAL_ATTESTATION) |
| 344 | endif() |
| 345 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 346 | if (TFM_PARTITION_TEST_CORE) |
| 347 | add_definitions(-DTFM_PARTITION_TEST_CORE) |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 348 | endif() |
| 349 | |
Jamie Fox | adf0255 | 2019-05-16 17:44:52 +0100 | [diff] [blame] | 350 | if (TFM_PARTITION_TEST_CORE_IPC) |
| 351 | add_definitions(-DTFM_PARTITION_TEST_CORE_IPC) |
| 352 | endif() |
| 353 | |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 354 | if (TFM_PARTITION_TEST_SECURE_SERVICES) |
| 355 | add_definitions(-DTFM_PARTITION_TEST_SECURE_SERVICES) |
| 356 | endif() |
| 357 | |
Edison Ai | 1dfd7b1 | 2020-02-23 14:16:08 +0800 | [diff] [blame] | 358 | if (CONFIG_TFM_ENABLE_MEMORY_PROTECT) |
| 359 | add_definitions(-DCONFIG_TFM_ENABLE_MEMORY_PROTECT) |
| 360 | endif() |
| 361 | |
Jamie Fox | 17c30bb | 2019-01-10 13:39:33 +0000 | [diff] [blame] | 362 | if (PSA_API_TEST) |
| 363 | add_definitions(-DPSA_API_TEST_NS) |
| 364 | set(PSA_API_TEST_NS ON) |
| 365 | if (NOT DEFINED PSA_API_TEST_CRYPTO) |
| 366 | set(PSA_API_TEST_CRYPTO OFF) |
| 367 | endif() |
Vinay Kumar Kotegowder | 7564106 | 2020-04-24 16:44:12 +0530 | [diff] [blame] | 368 | if (NOT DEFINED PSA_API_TEST_STORAGE) |
| 369 | set(PSA_API_TEST_STORAGE OFF) |
| 370 | endif() |
Jamie Fox | 6b6a19b | 2019-09-30 16:54:17 +0100 | [diff] [blame] | 371 | if (NOT DEFINED PSA_API_TEST_INTERNAL_TRUSTED_STORAGE) |
| 372 | set(PSA_API_TEST_INTERNAL_TRUSTED_STORAGE OFF) |
| 373 | endif() |
Karl Zhang | 1895a2c | 2020-03-08 18:27:32 +0800 | [diff] [blame] | 374 | if (NOT DEFINED PSA_API_TEST_PROTECTED_STORAGE) |
| 375 | set(PSA_API_TEST_PROTECTED_STORAGE OFF) |
Jamie Fox | 17c30bb | 2019-01-10 13:39:33 +0000 | [diff] [blame] | 376 | endif() |
Karl Zhang | 1895a2c | 2020-03-08 18:27:32 +0800 | [diff] [blame] | 377 | if (NOT DEFINED PSA_API_TEST_INITIAL_ATTESTATION) |
| 378 | set(PSA_API_TEST_INITIAL_ATTESTATION OFF) |
Jamie Fox | 17c30bb | 2019-01-10 13:39:33 +0000 | [diff] [blame] | 379 | endif() |
Jaykumar Pitambarbhai Patel | 38e6db5 | 2020-01-09 16:35:41 +0530 | [diff] [blame] | 380 | if (NOT DEFINED PSA_API_TEST_IPC) |
| 381 | set(PSA_API_TEST_IPC OFF) |
| 382 | endif() |
| 383 | |
| 384 | #Set PSA API compliance test build path |
| 385 | if(NOT DEFINED PSA_API_TEST_BUILD_PATH) |
| 386 | #If not specified, assume it's the default build folder checked out at the same level of TFM root dir |
| 387 | set(PSA_API_TEST_BUILD_PATH "${TFM_ROOT_DIR}/../psa-arch-tests/api-tests/BUILD") |
| 388 | endif() |
Jamie Fox | 17c30bb | 2019-01-10 13:39:33 +0000 | [diff] [blame] | 389 | endif() |
| 390 | |
Kevin Peng | e9b61a7 | 2020-01-06 17:01:44 +0800 | [diff] [blame] | 391 | # The config for enable secure context management in TF-M |
| 392 | if (NOT DEFINED CONFIG_TFM_ENABLE_CTX_MGMT) |
| 393 | set(CONFIG_TFM_ENABLE_CTX_MGMT ON) |
| 394 | endif() |
| 395 | |
| 396 | if (CONFIG_TFM_ENABLE_CTX_MGMT) |
| 397 | add_definitions(-DCONFIG_TFM_ENABLE_CTX_MGMT) |
| 398 | endif() |
| 399 | |
Marc Moreno Berengue | c2e4db8 | 2018-09-14 16:32:24 +0100 | [diff] [blame] | 400 | # This flag indicates if the non-secure OS is capable of identify the non-secure clients |
Mingyang Sun | 9ac0237 | 2019-08-26 15:59:14 +0800 | [diff] [blame] | 401 | # which call the secure services. It is diabled in IPC model. |
Marc Moreno Berengue | c2e4db8 | 2018-09-14 16:32:24 +0100 | [diff] [blame] | 402 | if (NOT DEFINED TFM_NS_CLIENT_IDENTIFICATION) |
Mingyang Sun | 9ac0237 | 2019-08-26 15:59:14 +0800 | [diff] [blame] | 403 | if (TFM_PSA_API) |
| 404 | set(TFM_NS_CLIENT_IDENTIFICATION OFF) |
| 405 | else() |
Kevin Peng | e9b61a7 | 2020-01-06 17:01:44 +0800 | [diff] [blame] | 406 | if (CONFIG_TFM_ENABLE_CTX_MGMT) |
| 407 | set(TFM_NS_CLIENT_IDENTIFICATION ON) |
| 408 | else() |
| 409 | set(TFM_NS_CLIENT_IDENTIFICATION OFF) |
| 410 | endif() |
Mingyang Sun | 9ac0237 | 2019-08-26 15:59:14 +0800 | [diff] [blame] | 411 | endif() |
Marc Moreno Berengue | c2e4db8 | 2018-09-14 16:32:24 +0100 | [diff] [blame] | 412 | endif() |
| 413 | |
Kevin Peng | e9b61a7 | 2020-01-06 17:01:44 +0800 | [diff] [blame] | 414 | if (NOT CONFIG_TFM_ENABLE_CTX_MGMT AND TFM_NS_CLIENT_IDENTIFICATION) |
| 415 | # NS client ID is part of context management. |
| 416 | message(FATAL_ERROR "TFM_NS_CLIENT_IDENTIFICATION cannot be ON when CONFIG_TFM_ENABLE_CTX_MGMT is OFF") |
| 417 | endif() |
| 418 | |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 419 | if (BL2) |
David Vincze | 63eda7a | 2019-08-09 17:42:51 +0200 | [diff] [blame] | 420 | # Add MCUBOOT_IMAGE_NUMBER definition to the compiler command line. |
| 421 | add_definitions(-DMCUBOOT_IMAGE_NUMBER=${MCUBOOT_IMAGE_NUMBER}) |
| 422 | |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 423 | if (${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "NO_SWAP") |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 424 | set(LINK_TO_BOTH_MEMORY_REGION ON) |
| 425 | endif() |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 426 | endif() |
| 427 | |
Raef Coles | 1bb168e | 2019-10-17 09:04:55 +0100 | [diff] [blame] | 428 | ##Set Mbed Crypto compiler flags and variables for crypto service |
Mate Toth-Pal | 8f17a71 | 2020-03-02 16:22:19 +0100 | [diff] [blame] | 429 | set(MBEDCRYPTO_C_FLAGS_SERVICES "${CMSE_FLAGS} -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -I${CMAKE_CURRENT_LIST_DIR}/platform/ext/common") |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 430 | |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 431 | #Default TF-M secure storage flags. |
| 432 | #These flags values can be overwritten by setting them in platform/ext/<TARGET_NAME>.cmake |
Tamas Ban | 01f64c5 | 2019-08-26 13:46:21 +0100 | [diff] [blame] | 433 | #Documentation about these flags can be found in docs/user_guides/services/tfm_sst_integration_guide.rst |
Marc Moreno Berengue | 8385e8e | 2019-01-21 11:49:50 +0000 | [diff] [blame] | 434 | if (NOT DEFINED SST_ENCRYPTION) |
| 435 | set (SST_ENCRYPTION ON) |
| 436 | endif() |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 437 | |
Marc Moreno Berengue | 8385e8e | 2019-01-21 11:49:50 +0000 | [diff] [blame] | 438 | if (NOT DEFINED SST_ROLLBACK_PROTECTION) |
| 439 | set (SST_ROLLBACK_PROTECTION OFF) |
| 440 | endif() |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 441 | |
Marc Moreno Berengue | 8385e8e | 2019-01-21 11:49:50 +0000 | [diff] [blame] | 442 | if (NOT DEFINED SST_CREATE_FLASH_LAYOUT) |
| 443 | set (SST_CREATE_FLASH_LAYOUT OFF) |
| 444 | endif() |
Marc Moreno Berengue | 184d203 | 2018-08-14 12:51:43 +0100 | [diff] [blame] | 445 | |
Marc Moreno Berengue | 8385e8e | 2019-01-21 11:49:50 +0000 | [diff] [blame] | 446 | if (NOT DEFINED SST_VALIDATE_METADATA_FROM_FLASH) |
| 447 | set (SST_VALIDATE_METADATA_FROM_FLASH ON) |
| 448 | endif() |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 449 | |
Marc Moreno Berengue | 8385e8e | 2019-01-21 11:49:50 +0000 | [diff] [blame] | 450 | if (NOT DEFINED SST_RAM_FS) |
| 451 | if (REGRESSION) |
| 452 | set (SST_RAM_FS ON) |
| 453 | else() |
| 454 | set (SST_RAM_FS OFF) |
Marc Moreno Berengue | 02a2344 | 2018-08-15 14:28:45 +0100 | [diff] [blame] | 455 | endif() |
Marc Moreno Berengue | 792fc68 | 2018-02-20 11:53:30 +0000 | [diff] [blame] | 456 | endif() |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 457 | |
Jamie Fox | 95bacd4 | 2019-03-21 18:14:15 +0000 | [diff] [blame] | 458 | if (NOT DEFINED SST_TEST_NV_COUNTERS) |
Kevin Peng | edde1de | 2019-10-25 17:12:45 +0800 | [diff] [blame] | 459 | if (REGRESSION AND ENABLE_SECURE_STORAGE_SERVICE_TESTS) |
Jamie Fox | 95bacd4 | 2019-03-21 18:14:15 +0000 | [diff] [blame] | 460 | set(SST_TEST_NV_COUNTERS ON) |
| 461 | else() |
| 462 | set(SST_TEST_NV_COUNTERS OFF) |
| 463 | endif() |
| 464 | endif() |
| 465 | |
Jamie Fox | 0e823a0 | 2019-10-28 17:28:19 +0000 | [diff] [blame] | 466 | # The SST NV counter tests depend on the SST test partition to call |
| 467 | # sst_system_prepare(). |
| 468 | if (SST_TEST_NV_COUNTERS) |
| 469 | set(TFM_PARTITION_TEST_SST ON) |
| 470 | add_definitions(-DTFM_PARTITION_TEST_SST) |
| 471 | endif() |
| 472 | |
TudorCretu | fb182bc | 2019-07-05 17:34:12 +0100 | [diff] [blame] | 473 | #Default TF-M internal trusted storage flags. |
| 474 | #These flags values can be overwritten by setting them in platform/ext/<TARGET_NAME>.cmake |
| 475 | #Documentation about these flags can be found in the TF-M ITS integration guide |
| 476 | option(ITS_CREATE_FLASH_LAYOUT "Create an empty ITS Flash Layout" OFF) |
| 477 | |
| 478 | if (NOT DEFINED ITS_VALIDATE_METADATA_FROM_FLASH) |
| 479 | set (ITS_VALIDATE_METADATA_FROM_FLASH ON) |
| 480 | endif() |
| 481 | |
| 482 | if (NOT DEFINED ITS_RAM_FS) |
| 483 | if (REGRESSION) |
| 484 | set (ITS_RAM_FS ON) |
| 485 | else() |
| 486 | set (ITS_RAM_FS OFF) |
| 487 | endif() |
| 488 | endif() |
| 489 | |
Raef Coles | 1bb168e | 2019-10-17 09:04:55 +0100 | [diff] [blame] | 490 | if (NOT DEFINED MBEDCRYPTO_DEBUG) |
| 491 | set(MBEDCRYPTO_DEBUG OFF) |
Marc Moreno Berengue | 6ffb22f | 2018-02-20 13:46:30 +0000 | [diff] [blame] | 492 | endif() |
Mate Toth-Pal | 65c935e | 2018-01-17 18:42:13 +0100 | [diff] [blame] | 493 | |
Tamas Ban | 01f64c5 | 2019-08-26 13:46:21 +0100 | [diff] [blame] | 494 | #Default TF-M initial-attestation service flags. |
| 495 | #Documentation about these flags can be found in docs/user_guides/services/tfm_attestation_integration_guide.rst |
| 496 | if (NOT DEFINED ATTEST_INCLUDE_OPTIONAL_CLAIMS) |
| 497 | set(ATTEST_INCLUDE_OPTIONAL_CLAIMS ON) |
| 498 | endif() |
| 499 | |
Tamas Ban | abea89d | 2020-01-15 13:29:25 +0000 | [diff] [blame] | 500 | if (NOT DEFINED ATTEST_INCLUDE_COSE_KEY_ID) |
| 501 | set(ATTEST_INCLUDE_COSE_KEY_ID OFF) |
| 502 | endif() |
| 503 | |
| 504 | if (NOT DEFINED ATTEST_INCLUDE_TEST_CODE) |
| 505 | if (CMAKE_BUILD_TYPE STREQUAL "debug") |
| 506 | set(ATTEST_INCLUDE_TEST_CODE ON) |
| 507 | else() |
| 508 | set(ATTEST_INCLUDE_TEST_CODE OFF) |
| 509 | endif() |
Tamas Ban | 303dd08 | 2019-08-27 10:43:03 +0100 | [diff] [blame] | 510 | endif() |
| 511 | |
David Vincze | e13a48b | 2020-01-08 17:42:30 +0100 | [diff] [blame] | 512 | if (NOT DEFINED BOOT_DATA_AVAILABLE) |
David Vincze | c3e313a | 2020-01-06 17:31:11 +0100 | [diff] [blame] | 513 | if (BL2 AND (NOT MCUBOOT_REPO STREQUAL "UPSTREAM")) |
David Vincze | e13a48b | 2020-01-08 17:42:30 +0100 | [diff] [blame] | 514 | set(BOOT_DATA_AVAILABLE ON) |
| 515 | else() |
| 516 | set(BOOT_DATA_AVAILABLE OFF) |
| 517 | endif() |
| 518 | endif() |
| 519 | |
Balint Matyi | 95f58eb | 2020-05-22 08:52:32 +0100 | [diff] [blame] | 520 | if (NOT DEFINED ATTEST_CLAIM_VALUE_CHECK) |
| 521 | set(ATTEST_CLAIM_VALUE_CHECK OFF) |
| 522 | endif() |
| 523 | |
Tamas Ban | db69d52 | 2018-03-01 10:04:41 +0000 | [diff] [blame] | 524 | ##Set mbedTLS compiler flags for BL2 bootloader |
Mate Toth-Pal | 8f17a71 | 2020-03-02 16:22:19 +0100 | [diff] [blame] | 525 | set(MBEDCRYPTO_C_FLAGS_BL2 "${CMSE_FLAGS} -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -DMBEDTLS_CONFIG_FILE=\\\\\\\"config-rsa.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/include") |
Tamas Ban | 7801ed4 | 2019-05-20 13:21:53 +0100 | [diff] [blame] | 526 | if (MCUBOOT_SIGNATURE_TYPE STREQUAL "RSA-3072") |
Raef Coles | 1bb168e | 2019-10-17 09:04:55 +0100 | [diff] [blame] | 527 | string(APPEND MBEDCRYPTO_C_FLAGS_BL2 " -DMCUBOOT_SIGN_RSA_LEN=3072") |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 528 | endif() |