blob: ee2faee682d7b0de1895bb6e601b67915084863f [file] [log] [blame]
Mate Toth-Pal65c935e2018-01-17 18:42:13 +01001#-------------------------------------------------------------------------------
Jamie Fox17c30bb2019-01-10 13:39:33 +00002# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Mate Toth-Pal65c935e2018-01-17 18:42:13 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8if(NOT DEFINED REGRESSION)
9 message(FATAL_ERROR "ERROR: Incomplete Configuration: REGRESSION not defined, Include this file from a Config*.cmake")
10elseif(NOT DEFINED CORE_TEST)
11 message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_TEST not defined, Include this file from a Config*.cmake")
Tamas Band90c81b2018-08-15 15:03:42 +010012elseif(NOT DEFINED TFM_LVL)
13 message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_LVL not defined, Include this file from a Config*.cmake")
Mate Toth-Pal65c935e2018-01-17 18:42:13 +010014endif()
15
Mate Toth-Palee551bc2018-06-12 16:40:45 +020016if(NOT DEFINED COMPILER)
17 message(FATAL_ERROR "ERROR: COMPILER is not set in command line")
18elseif((NOT ${COMPILER} STREQUAL "ARMCLANG") AND (NOT ${COMPILER} STREQUAL "GNUARM"))
19 message(FATAL_ERROR "ERROR: Compiler \"${COMPILER}\" is not supported.")
20endif()
21
Edison Aicb0ecf62019-07-10 18:43:51 +080022if(CORE_IPC)
23 if (TFM_LVL EQUAL 3)
24 message(FATAL_ERROR "ERROR: Invalid isolation level!")
25 endif()
26else()
27 if(NOT TFM_LVL EQUAL 1)
28 message(FATAL_ERROR "ERROR: Invalid isolation level!")
29 endif()
30endif()
31
David Vincze4638b2a2019-05-24 10:14:23 +020032#BL2 bootloader (MCUBoot) related settings
33if(NOT DEFINED BL2)
34 set(BL2 True CACHE BOOL "Configure TF-M to use BL2 and enable building BL2")
35endif()
36if (BL2)
37 if (NOT DEFINED MCUBOOT_UPGRADE_STRATEGY)
David Vincze8a2a4e22019-05-24 10:14:23 +020038 set (MCUBOOT_UPGRADE_STRATEGY "OVERWRITE_ONLY" CACHE STRING "Configure BL2 which upgrade strategy to use")
David Vincze4638b2a2019-05-24 10:14:23 +020039 set_property(CACHE MCUBOOT_UPGRADE_STRATEGY PROPERTY STRINGS "OVERWRITE_ONLY;SWAP;NO_SWAP;RAM_LOADING")
40 endif()
41endif()
42
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010043set(BUILD_CMSIS_CORE Off)
44set(BUILD_RETARGET Off)
45set(BUILD_NATIVE_DRIVERS Off)
46set(BUILD_TIME Off)
47set(BUILD_STARTUP Off)
48set(BUILD_TARGET_CFG Off)
49set(BUILD_TARGET_HARDWARE_KEYS Off)
Marc Moreno Berengue4cc81fc2018-08-10 14:32:01 +010050set(BUILD_TARGET_NV_COUNTERS Off)
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010051set(BUILD_CMSIS_DRIVERS Off)
52set(BUILD_UART_STDOUT Off)
53set(BUILD_FLASH Off)
Tamas Ban3681ce02018-11-22 15:19:24 +000054set(BUILD_BOOT_SEED Off)
Tamas Ban38e17312018-11-22 15:26:35 +000055set(BUILD_DEVICE_ID Off)
Mate Toth-Pald3c77662019-02-20 16:23:00 +010056set(BUILD_PLAT_TEST Off)
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010057if(NOT DEFINED PLATFORM_CMAKE_FILE)
58 message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.")
59elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE})
60 message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.")
61else()
62 include(${PLATFORM_CMAKE_FILE})
63endif()
64
Oliver Swede21440442018-07-10 09:31:32 +010065if (NOT DEFINED IMAGE_VERSION)
Jamie Fox7a4170d2018-08-15 14:13:42 +010066 set(IMAGE_VERSION 0.0.0+0)
Oliver Swede21440442018-07-10 09:31:32 +010067endif()
68
Mate Toth-Palee551bc2018-06-12 16:40:45 +020069if(${COMPILER} STREQUAL "ARMCLANG")
Mate Toth-Pal76867262018-03-09 13:15:36 +010070 #Use any ARMCLANG version found on PATH. Note: Only versions supported by the
71 #build system will work. A file cmake/Common/CompilerArmClangXY.cmake
72 #must be present with a matching version.
73 include("Common/FindArmClang")
74 include("Common/${ARMCLANG_MODULE}")
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010075
Antonio de Angelis3302f452019-07-19 10:36:33 +010076 set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -mfpu=none -mcmse -ffunction-sections -fdata-sections)
Tamas Bandb69d522018-03-01 10:04:41 +000077 ##Shared compiler settings.
78 function(config_setting_shared_compiler_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +010079 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror)
Tamas Bandb69d522018-03-01 10:04:41 +000080 endfunction()
81
82 ##Shared linker settings.
83 function(config_setting_shared_linker_flags tgt)
Antonio de Angelis3302f452019-07-19 10:36:33 +010084 embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --remove --info=summarysizes,sizes,totals,unused,veneers)
Mate Toth-Pal76867262018-03-09 13:15:36 +010085 endfunction()
86elseif(${COMPILER} STREQUAL "GNUARM")
87 #Use any GNUARM version found on PATH. Note: Only versions supported by the
88 #build system will work. A file cmake/Common/CompilerGNUARMXY.cmake
89 #must be present with a matching version.
90 include("Common/FindGNUARM")
91 include("Common/${GNUARM_MODULE}")
Mate Toth-Pal48fc6a02018-01-24 09:50:14 +010092
Antonio de Angelis3302f452019-07-19 10:36:33 +010093 set (COMMON_COMPILE_FLAGS -fshort-enums -fshort-wchar -funsigned-char -msoft-float -mcmse -ffunction-sections -fdata-sections --specs=nano.specs)
Mate Toth-Pal76867262018-03-09 13:15:36 +010094 ##Shared compiler and linker settings.
Tamas Bandb69d522018-03-01 10:04:41 +000095 function(config_setting_shared_compiler_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +010096 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 ${COMMON_COMPILE_FLAGS} -Wall -Werror -Wno-format -Wno-return-type -Wno-unused-but-set-variable)
Tamas Bandb69d522018-03-01 10:04:41 +000097 endfunction()
98
99 ##Shared linker settings.
100 function(config_setting_shared_linker_flags tgt)
Mate Toth-Pal76867262018-03-09 13:15:36 +0100101 #--no-wchar-size-warning flag is added because TF-M sources are compiled
102 #with short wchars, however the standard library is compiled with normal
103 #wchar, and this generates linker time warnings. TF-M code does not use
104 #wchar, so the warning can be suppressed.
Antonio de Angelis3302f452019-07-19 10:36:33 +0100105 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-Pal76867262018-03-09 13:15:36 +0100106 endfunction()
Mate Toth-Pal76867262018-03-09 13:15:36 +0100107endif()
108
109#Create a string from the compile flags list, so that it can be used later
110#in this file to set mbedtls and BL2 flags
Tamas Bandb69d522018-03-01 10:04:41 +0000111list_to_string(COMMON_COMPILE_FLAGS_STR ${COMMON_COMPILE_FLAGS})
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100112
113#Settings which shall be set for all projects the same way based
114# on the variables above.
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100115set (TFM_PARTITION_TEST_CORE OFF)
Jamie Foxadf02552019-05-16 17:44:52 +0100116set (TFM_PARTITION_TEST_CORE_IPC OFF)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100117set (CORE_TEST_POSITIVE OFF)
118set (CORE_TEST_INTERACTIVE OFF)
Miklos Balintf13ec022018-04-06 17:21:22 +0200119set (REFERENCE_PLATFORM OFF)
Ben Davis6d7256b2018-04-18 14:16:53 +0100120set (TFM_PARTITION_TEST_SECURE_SERVICES OFF)
Tamas Band90c81b2018-08-15 15:03:42 +0100121set (SERVICES_TEST_ENABLED OFF)
Marc Moreno Berenguecae2c532018-10-09 12:58:46 +0100122set (TEST_FRAMEWORK_S OFF)
123set (TEST_FRAMEWORK_NS OFF)
Edison Aiec109cd2018-07-17 16:04:14 +0800124set (TFM_PSA_API OFF)
Miklos Balint87da2512018-04-19 13:45:50 +0200125set (TFM_LEGACY_API ON)
Edison Aiec109cd2018-07-17 16:04:14 +0800126set (CORE_TEST_IPC OFF)
Miklos Balintf13ec022018-04-06 17:21:22 +0200127
Jamie Foxc78c62c2019-05-23 13:42:17 +0100128option(TFM_PARTITION_AUDIT_LOG "Enable the TF-M Audit Log partition" ON)
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800129option(TFM_PARTITION_PLATFORM "Enable the TF-M Platform partition" ON)
Jamie Foxc78c62c2019-05-23 13:42:17 +0100130
Miklos Balintf13ec022018-04-06 17:21:22 +0200131if(${TARGET_PLATFORM} STREQUAL "AN521" OR ${TARGET_PLATFORM} STREQUAL "AN519")
132 set (REFERENCE_PLATFORM ON)
133endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100134
Miklos Balint6cbeba62018-04-12 17:31:34 +0200135# Option to demonstrate usage of secure-only peripheral
136set (SECURE_UART1 OFF)
137
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100138if (REGRESSION)
139 set(SERVICES_TEST_ENABLED ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100140endif()
141
Edison Aiec109cd2018-07-17 16:04:14 +0800142if (CORE_IPC)
143 set(TFM_PSA_API ON)
Edison Aiec109cd2018-07-17 16:04:14 +0800144endif()
145
Miklos Balint87da2512018-04-19 13:45:50 +0200146if (TFM_PSA_API)
147 add_definitions(-DTFM_PSA_API)
148endif()
149
150if (TFM_LEGACY_API)
151 add_definitions(-DTFM_LEGACY_API)
152endif()
153
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100154if (SERVICES_TEST_ENABLED)
155 set(SERVICE_TEST_S ON)
156 set(SERVICE_TEST_NS ON)
Jamie Foxadf02552019-05-16 17:44:52 +0100157 if (CORE_IPC)
158 set(CORE_TEST_IPC ON)
Miklos Balintf13ec022018-04-06 17:21:22 +0200159 endif()
Mate Toth-Pal6569a592019-06-07 12:09:50 +0200160 set(CORE_TEST_POSITIVE ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100161endif()
162
163if (CORE_TEST)
Jamie Foxadf02552019-05-16 17:44:52 +0100164 if (CORE_IPC)
165 set(CORE_TEST_IPC ON)
Jamie Foxadf02552019-05-16 17:44:52 +0100166 endif()
Mate Toth-Pal6569a592019-06-07 12:09:50 +0200167 set(CORE_TEST_POSITIVE ON)
168 set(CORE_TEST_INTERACTIVE OFF)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100169endif()
170
Ben Davis6d7256b2018-04-18 14:16:53 +0100171if (CORE_TEST_INTERACTIVE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100172 add_definitions(-DCORE_TEST_INTERACTIVE)
173 set(TEST_FRAMEWORK_NS ON)
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100174 set(TFM_PARTITION_TEST_CORE ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100175endif()
176
Ben Davis6d7256b2018-04-18 14:16:53 +0100177if (CORE_TEST_POSITIVE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100178 add_definitions(-DCORE_TEST_POSITIVE)
179 set(TEST_FRAMEWORK_NS ON)
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100180 set(TFM_PARTITION_TEST_CORE ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100181endif()
182
David Hu33f2fd22019-08-16 15:32:39 +0800183if (TFM_PARTITION_TEST_CORE)
184 # If the platform or the topology doesn't specify whether IRQ test is
185 # supported, enable it by default.
186 if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
187 set(TFM_ENABLE_IRQ_TEST ON)
188 endif()
189
190 if (TFM_ENABLE_IRQ_TEST)
191 add_definitions(-DTFM_ENABLE_IRQ_TEST)
192 endif()
193else()
194 set(TFM_ENABLE_IRQ_TEST OFF)
195endif()
196
Edison Aiec109cd2018-07-17 16:04:14 +0800197if (CORE_TEST_IPC)
198 add_definitions(-DCORE_TEST_IPC)
Jamie Foxadf02552019-05-16 17:44:52 +0100199 set(TEST_FRAMEWORK_NS ON)
200 set(TFM_PARTITION_TEST_CORE_IPC ON)
Edison Aiec109cd2018-07-17 16:04:14 +0800201endif()
202
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100203if (SERVICE_TEST_S)
204 add_definitions(-DSERVICES_TEST_S)
205 set(TEST_FRAMEWORK_S ON)
206endif()
207
208if (SERVICE_TEST_NS)
209 add_definitions(-DSERVICES_TEST_NS)
210 set(TEST_FRAMEWORK_NS ON)
211endif()
212
Ben Davis6d7256b2018-04-18 14:16:53 +0100213if (TEST_FRAMEWORK_S)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100214 add_definitions(-DTEST_FRAMEWORK_S)
Jamie Fox56da0992019-05-28 14:35:06 +0100215 # The secure client partition is required to run secure tests
216 set(TFM_PARTITION_TEST_SECURE_SERVICES ON)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100217endif()
218
Ben Davis6d7256b2018-04-18 14:16:53 +0100219if (TEST_FRAMEWORK_NS)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100220 add_definitions(-DTEST_FRAMEWORK_NS)
221endif()
222
Jamie Foxc78c62c2019-05-23 13:42:17 +0100223if (CORE_IPC)
224 set(TFM_PARTITION_AUDIT_LOG OFF)
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800225 set(TFM_PARTITION_PLATFORM OFF)
Jamie Foxc78c62c2019-05-23 13:42:17 +0100226endif()
227
228if (TFM_PARTITION_AUDIT_LOG)
229 add_definitions(-DTFM_PARTITION_AUDIT_LOG)
230endif()
231
Mingyang Sun9511e5e2019-05-29 18:18:44 +0800232if (TFM_PARTITION_PLATFORM)
233 add_definitions(-DTFM_PARTITION_PLATFORM)
234endif()
235
Mate Toth-Pal349714a2018-02-23 15:30:24 +0100236if (TFM_PARTITION_TEST_CORE)
237 add_definitions(-DTFM_PARTITION_TEST_CORE)
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100238endif()
239
Jamie Foxadf02552019-05-16 17:44:52 +0100240if (TFM_PARTITION_TEST_CORE_IPC)
241 add_definitions(-DTFM_PARTITION_TEST_CORE_IPC)
242endif()
243
Jamie Foxc78c62c2019-05-23 13:42:17 +0100244if (TFM_PARTITION_TEST_SECURE_SERVICES)
245 add_definitions(-DTFM_PARTITION_TEST_SECURE_SERVICES)
246endif()
247
Jamie Fox17c30bb2019-01-10 13:39:33 +0000248if (PSA_API_TEST)
249 add_definitions(-DPSA_API_TEST_NS)
250 set(PSA_API_TEST_NS ON)
251 if (NOT DEFINED PSA_API_TEST_CRYPTO)
252 set(PSA_API_TEST_CRYPTO OFF)
253 endif()
254 if (NOT DEFINED PSA_API_TEST_SECURE_STORAGE)
255 set(PSA_API_TEST_SECURE_STORAGE OFF)
256 endif()
257 if (NOT DEFINED PSA_API_TEST_ATTESTATION)
258 set(PSA_API_TEST_ATTESTATION OFF)
259 endif()
260endif()
261
Marc Moreno Berenguec2e4db82018-09-14 16:32:24 +0100262# This flag indicates if the non-secure OS is capable of identify the non-secure clients
263# which call the secure services
264if (NOT DEFINED TFM_NS_CLIENT_IDENTIFICATION)
265 set (TFM_NS_CLIENT_IDENTIFICATION ON)
266endif()
267
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100268if (BL2)
269 add_definitions(-DBL2)
Tamas Ban7801ed42019-05-20 13:21:53 +0100270 if (NOT ${MCUBOOT_SIGNATURE_TYPE} STREQUAL "RSA-2048" AND NOT ${MCUBOOT_SIGNATURE_TYPE} STREQUAL "RSA-3072")
271 message(FATAL_ERROR "MCUBoot only supports RSA-2048 and RSA-3072 signature")
272 endif()
273 if (NOT DEFINED MCUBOOT_SIGNATURE_TYPE)
Tamas Ban81daed02019-05-20 15:05:22 +0100274 set(MCUBOOT_SIGNATURE_TYPE "RSA-3072")
Tamas Ban7801ed42019-05-20 13:21:53 +0100275 endif()
David Vincze4638b2a2019-05-24 10:14:23 +0200276 if (NOT ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "OVERWRITE_ONLY" AND
277 NOT ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "SWAP" AND
278 NOT ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "NO_SWAP" AND
279 NOT ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "RAM_LOADING")
280 message(FATAL_ERROR "ERROR: MCUBoot supports OVERWRITE_ONLY, SWAP, NO_SWAP and RAM_LOADING upgrade strategies only.")
281 endif()
282 if (${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "NO_SWAP")
Tamas Bandb69d522018-03-01 10:04:41 +0000283 set(LINK_TO_BOTH_MEMORY_REGION ON)
284 endif()
David Vincze4638b2a2019-05-24 10:14:23 +0200285else() #BL2 is turned off
286 if (DEFINED MCUBOOT_UPGRADE_STRATEGY)
287 message (WARNING "Ignoring value of MCUBOOT_UPGRADE_STRATEGY as BL2 option is set to False.")
288 unset (MCUBOOT_UPGRADE_STRATEGY)
Tamas Bandb69d522018-03-01 10:04:41 +0000289 endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100290endif()
291
Jamie Foxdaade492019-04-26 14:35:39 +0100292##Set Mbed TLS compiler flags and variables for audit log and crypto
Jamie Fox0e54ebc2019-04-09 14:21:04 +0100293set(MBEDTLS_C_FLAGS_SERVICES "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -I${CMAKE_CURRENT_LIST_DIR}/platform/ext/common")
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100294
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000295#Default TF-M secure storage flags.
296#These flags values can be overwritten by setting them in platform/ext/<TARGET_NAME>.cmake
Marc Moreno Berenguef6a64f72018-07-26 17:33:38 +0100297#Documentation about these flags can be found in docs/user_guides/services/tfm_sst_integration_guide.md
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000298if (NOT DEFINED SST_ENCRYPTION)
299 set (SST_ENCRYPTION ON)
300endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000301
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000302if (NOT DEFINED SST_ROLLBACK_PROTECTION)
303 set (SST_ROLLBACK_PROTECTION OFF)
304endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000305
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000306if (NOT DEFINED SST_CREATE_FLASH_LAYOUT)
307 set (SST_CREATE_FLASH_LAYOUT OFF)
308endif()
Marc Moreno Berengue184d2032018-08-14 12:51:43 +0100309
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000310if (NOT DEFINED SST_VALIDATE_METADATA_FROM_FLASH)
311 set (SST_VALIDATE_METADATA_FROM_FLASH ON)
312endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000313
Marc Moreno Berengue8385e8e2019-01-21 11:49:50 +0000314if (NOT DEFINED SST_RAM_FS)
315 if (REGRESSION)
316 set (SST_RAM_FS ON)
317 else()
318 set (SST_RAM_FS OFF)
Marc Moreno Berengue02a23442018-08-15 14:28:45 +0100319 endif()
Marc Moreno Berengue792fc682018-02-20 11:53:30 +0000320endif()
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000321
Jamie Fox95bacd42019-03-21 18:14:15 +0000322if (NOT DEFINED SST_TEST_NV_COUNTERS)
323 if (REGRESSION AND (TFM_LVL EQUAL 1))
324 set(SST_TEST_NV_COUNTERS ON)
325 else()
326 set(SST_TEST_NV_COUNTERS OFF)
327 endif()
328endif()
329
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000330if (NOT DEFINED MBEDTLS_DEBUG)
Jamie Fox287885f2018-10-24 14:09:34 +0100331 set(MBEDTLS_DEBUG OFF)
Marc Moreno Berengue6ffb22f2018-02-20 13:46:30 +0000332endif()
Mate Toth-Pal65c935e2018-01-17 18:42:13 +0100333
Tamas Bandb69d522018-03-01 10:04:41 +0000334##Set mbedTLS compiler flags for BL2 bootloader
Mate Toth-Pal76867262018-03-09 13:15:36 +0100335set(MBEDTLS_C_FLAGS_BL2 "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -DMBEDTLS_CONFIG_FILE=\\\\\\\"config-boot.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/include")
Tamas Ban7801ed42019-05-20 13:21:53 +0100336if (MCUBOOT_SIGNATURE_TYPE STREQUAL "RSA-3072")
337 string(APPEND MBEDTLS_C_FLAGS_BL2 " -DMCUBOOT_SIGN_RSA_LEN=3072")
Jamie Foxc78c62c2019-05-23 13:42:17 +0100338endif()