diff options
author | Mark Horvath <mark.horvath@arm.com> | 2021-03-12 10:24:55 +0100 |
---|---|---|
committer | Anton Komlev <Anton.Komlev@arm.com> | 2021-08-04 18:20:13 +0200 |
commit | 8576e3800611a631620ff7910fc61aa637e46995 (patch) | |
tree | 45e333198577fc183eeb570f4f41cab7d886bce2 /bl2/CMakeLists.txt | |
parent | 7ef9178adad866d48e3af42d8a3129dfab792ed8 (diff) | |
download | trusted-firmware-m-8576e3800611a631620ff7910fc61aa637e46995.tar.gz |
Build: Make possible to overwrite BL2 sources
This commit introduces two cmake flags to let a platform overwrite BL2
related implementations created by the TF-M project.
- Setting DEFAULT_MCUBOOT_FLASH_MAP to OFF makes possible for a
platform to create custom flash map.
- Setting DEFAULT_MCUBOOT_SECURITY_COUNTER to OFF makes possible for a
platform to use custom security counter mapping.
Change-Id: Ib1955e63e78dd5a5a7dff67a49dab1d5d1a06fc1
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
Diffstat (limited to 'bl2/CMakeLists.txt')
-rw-r--r-- | bl2/CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bl2/CMakeLists.txt b/bl2/CMakeLists.txt index 18ba31b921..049d1e55a8 100644 --- a/bl2/CMakeLists.txt +++ b/bl2/CMakeLists.txt @@ -10,8 +10,9 @@ cmake_minimum_required(VERSION 3.15) project("Bootloader" VERSION 0.1.0 LANGUAGES C ASM) add_executable(bl2 - src/security_cnt.c src/flash_map.c + $<$<BOOL:${DEFAULT_MCUBOOT_SECURITY_COUNTERS}>:src/security_cnt.c> + $<$<BOOL:${DEFAULT_MCUBOOT_FLASH_MAP}>:src/default_flash_map.c> $<$<BOOL:${MCUBOOT_DATA_SHARING}>:src/shared_data.c> ) @@ -41,6 +42,11 @@ target_link_options(bl2 $<$<C_COMPILER_ID:IAR>:--map\;${CMAKE_BINARY_DIR}/bin/bl2.map> ) +target_compile_definitions(bl2 + PRIVATE + $<$<BOOL:${DEFAULT_MCUBOOT_FLASH_MAP}>:DEFAULT_MCUBOOT_FLASH_MAP> +) + add_convert_to_bin_target(bl2) ############################### BOOT HAL # ##################################### |