blob: 406d21427aafe4a9cc3fb387e760c60f71d0a91d [file] [log] [blame]
David Vincze54d05552019-08-05 12:58:47 +02001#-------------------------------------------------------------------------------
2# Copyright (c) 2019, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8set(BL2 True CACHE BOOL "Configure TF-M to use BL2 and enable building BL2")
9
10if (BL2)
11 add_definitions(-DBL2)
12
13 set(MCUBOOT_UPGRADE_STRATEGY "OVERWRITE_ONLY" CACHE STRING "Configure BL2 which upgrade strategy to use")
14 set_property(CACHE MCUBOOT_UPGRADE_STRATEGY PROPERTY STRINGS "OVERWRITE_ONLY;SWAP;NO_SWAP;RAM_LOADING")
15 validate_cache_value(MCUBOOT_UPGRADE_STRATEGY)
16
17 set(MCUBOOT_SIGNATURE_TYPE "RSA-3072" CACHE STRING "Algorithm used by MCUBoot to validate signatures.")
18 set_property(CACHE MCUBOOT_SIGNATURE_TYPE PROPERTY STRINGS "RSA-3072;RSA-2048")
19 validate_cache_value(MCUBOOT_SIGNATURE_TYPE)
20
21else() #BL2 is turned off
22 if (DEFINED MCUBOOT_UPGRADE_STRATEGY OR
23 DEFINED MCUBOOT_SIGNATURE_TYPE)
24 message(WARNING "Ignoring the values of MCUBOOT_* variables as BL2 option is set to False.")
25 set(MCUBOOT_UPGRADE_STRATEGY "")
26 set(MCUBOOT_SIGNATURE_TYPE "")
27 endif()
28
29 if (DEFINED SECURITY_COUNTER)
30 message(WARNING "Ignoring the value of SECURITY_COUNTER variable as BL2 option is set to False.")
31 set(SECURITY_COUNTER "")
32 endif()
33endif()