Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Tamas Ban | 8f33623 | 2018-12-21 14:54:11 +0000 | [diff] [blame] | 2 | # Copyright (c) 2018-2019, Arm Limited. All rights reserved. |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Jamie Fox | 7a4170d | 2018-08-15 14:13:42 +0100 | [diff] [blame] | 8 | #This file gathers all Musca-A specific files in the application. |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 9 | |
Jamie Fox | 284690d | 2018-11-01 16:52:50 +0000 | [diff] [blame] | 10 | #Musca-A has a Cortex M33 CPU. |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 11 | include("Common/CpuM33") |
| 12 | |
| 13 | set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) |
| 14 | |
| 15 | #Specify the location of platform specific build dependencies. |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 16 | if(COMPILER STREQUAL "ARMCLANG") |
Miklos Balint | 8fb9100 | 2019-05-24 14:17:44 +0200 | [diff] [blame] | 17 | set (S_SCATTER_FILE_NAME "${PLATFORM_DIR}/common/armclang/tfm_common_s.sct") |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 18 | set (BL2_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/musca_a/Device/Source/armclang/musca_bl2.sct") |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 19 | set (NS_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/musca_a/Device/Source/armclang/musca_ns.sct") |
| 20 | if (DEFINED CMSIS_5_DIR) |
| 21 | # not all project defines CMSIS_5_DIR, only the ones that use it. |
| 22 | set (RTX_LIB_PATH "${CMSIS_5_DIR}/CMSIS/RTOS2/RTX/Library/ARM/RTX_V8MMN.lib") |
| 23 | endif() |
| 24 | elseif(COMPILER STREQUAL "GNUARM") |
Miklos Balint | 8fb9100 | 2019-05-24 14:17:44 +0200 | [diff] [blame] | 25 | set (S_SCATTER_FILE_NAME "${PLATFORM_DIR}/common/gcc/tfm_common_s.ld") |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 26 | set (BL2_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/musca_a/Device/Source/gcc/musca_bl2.ld") |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 27 | set (NS_SCATTER_FILE_NAME "${PLATFORM_DIR}/target/musca_a/Device/Source/gcc/musca_ns.ld") |
| 28 | if (DEFINED CMSIS_5_DIR) |
| 29 | # not all project defines CMSIS_5_DIR, only the ones that use it. |
| 30 | set (RTX_LIB_PATH "${CMSIS_5_DIR}/CMSIS/RTOS2/RTX/Library/GCC/libRTX_V8MMN.a") |
| 31 | endif() |
| 32 | else() |
| 33 | message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.") |
| 34 | endif() |
| 35 | set (FLASH_LAYOUT "${PLATFORM_DIR}/target/musca_a/partition/flash_layout.h") |
Gabor Kertesz | d7d7d74 | 2018-07-04 11:50:05 +0200 | [diff] [blame] | 36 | set (PLATFORM_LINK_INCLUDES "${PLATFORM_DIR}/target/musca_a/partition") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 37 | |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 38 | embedded_include_directories(PATH "${PLATFORM_DIR}/cmsis" ABSOLUTE) |
| 39 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a" ABSOLUTE) |
| 40 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver/Config" ABSOLUTE) |
| 41 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/Device/Config" ABSOLUTE) |
| 42 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/Device/Include" ABSOLUTE) |
| 43 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/Native_Driver" ABSOLUTE) |
| 44 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/partition" ABSOLUTE) |
Tamas Kaman | d326142 | 2019-11-17 15:34:47 +0100 | [diff] [blame] | 45 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/services/include" ABSOLUTE) |
David Vincze | 26e8c8a | 2018-08-28 16:59:41 +0200 | [diff] [blame] | 46 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/Libraries" ABSOLUTE) |
Mate Toth-Pal | d3c7766 | 2019-02-20 16:23:00 +0100 | [diff] [blame] | 47 | embedded_include_directories(PATH "${PLATFORM_DIR}/../include" ABSOLUTE) |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 48 | |
| 49 | #Gather all source files we need. |
Tamas Kaman | d326142 | 2019-11-17 15:34:47 +0100 | [diff] [blame] | 50 | if (TFM_PARTITION_PLATFORM) |
| 51 | list(APPEND ALL_SRC_C_NS "${PLATFORM_DIR}/target/musca_a/services/src/tfm_ioctl_ns_api.c") |
| 52 | endif() |
| 53 | |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 54 | if (NOT DEFINED BUILD_CMSIS_CORE) |
| 55 | message(FATAL_ERROR "Configuration variable BUILD_CMSIS_CORE (true|false) is undefined!") |
| 56 | elseif(BUILD_CMSIS_CORE) |
Kevin Peng | 8f76da9 | 2019-01-28 16:18:20 +0800 | [diff] [blame] | 57 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Device/Source/system_core_init.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 58 | endif() |
| 59 | |
| 60 | if (NOT DEFINED BUILD_RETARGET) |
| 61 | message(FATAL_ERROR "Configuration variable BUILD_RETARGET (true|false) is undefined!") |
| 62 | elseif(BUILD_RETARGET) |
Kevin Peng | 8f76da9 | 2019-01-28 16:18:20 +0800 | [diff] [blame] | 63 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Device/Source/device_definition.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 64 | endif() |
| 65 | |
| 66 | if (NOT DEFINED BUILD_UART_STDOUT) |
| 67 | message(FATAL_ERROR "Configuration variable BUILD_UART_STDOUT (true|false) is undefined!") |
| 68 | elseif(BUILD_UART_STDOUT) |
Miklos Balint | 6cbeba6 | 2018-04-12 17:31:34 +0200 | [diff] [blame] | 69 | if (NOT DEFINED SECURE_UART1) |
| 70 | message(FATAL_ERROR "Configuration variable SECURE_UART1 (true|false) is undefined!") |
| 71 | elseif(SECURE_UART1) |
| 72 | message(FATAL_ERROR "Configuration SECURE_UART1 TRUE is invalid for this target!") |
| 73 | endif() |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 74 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/common/uart_stdout.c") |
| 75 | embedded_include_directories(PATH "${PLATFORM_DIR}/common" ABSOLUTE) |
| 76 | set(BUILD_NATIVE_DRIVERS true) |
| 77 | set(BUILD_CMSIS_DRIVERS true) |
| 78 | endif() |
| 79 | |
| 80 | if (NOT DEFINED BUILD_NATIVE_DRIVERS) |
| 81 | message(FATAL_ERROR "Configuration variable BUILD_NATIVE_DRIVERS (true|false) is undefined!") |
| 82 | elseif(BUILD_NATIVE_DRIVERS) |
| 83 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/uart_pl011_drv.c") |
Gabor Kertesz | 5c1756f | 2018-07-18 12:25:12 +0200 | [diff] [blame] | 84 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/musca_a1_scc_drv.c") |
Oliver Swede | 8ee18a9 | 2018-08-24 18:18:26 +0100 | [diff] [blame] | 85 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/qspi_ip6514e_drv.c") |
Tamas Kaman | d326142 | 2019-11-17 15:34:47 +0100 | [diff] [blame] | 86 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/gpio_cmsdk_drv.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 87 | |
| 88 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/Native_Driver/mpc_sie200_drv.c" |
| 89 | "${PLATFORM_DIR}/target/musca_a/Native_Driver/ppc_sse200_drv.c") |
David Vincze | 26e8c8a | 2018-08-28 16:59:41 +0200 | [diff] [blame] | 90 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/qspi_ip6514e_drv.c") |
| 91 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Libraries/mt25ql_flash_lib.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 92 | endif() |
| 93 | |
| 94 | if (NOT DEFINED BUILD_TIME) |
| 95 | message(FATAL_ERROR "Configuration variable BUILD_TIME (true|false) is undefined!") |
| 96 | elseif(BUILD_TIME) |
Mate Toth-Pal | a9f8e9e | 2019-03-05 16:11:14 +0100 | [diff] [blame] | 97 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/Native_Driver/timer_cmsdk_drv.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 98 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/Native_Driver" ABSOLUTE) |
| 99 | endif() |
| 100 | |
| 101 | if (NOT DEFINED BUILD_STARTUP) |
| 102 | message(FATAL_ERROR "Configuration variable BUILD_STARTUP (true|false) is undefined!") |
| 103 | elseif(BUILD_STARTUP) |
| 104 | if(CMAKE_C_COMPILER_ID STREQUAL "ARMCLANG") |
| 105 | list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/musca_a/Device/Source/armclang/startup_cmsdk_musca_s.s") |
| 106 | list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/musca_a/Device/Source/armclang/startup_cmsdk_musca_ns.s") |
| 107 | list(APPEND ALL_SRC_ASM_BL2 "${PLATFORM_DIR}/target/musca_a/Device/Source/armclang/startup_cmsdk_musca_bl2.s") |
Mate Toth-Pal | f64f1eb | 2018-04-26 17:22:37 +0200 | [diff] [blame] | 108 | elseif(CMAKE_C_COMPILER_ID STREQUAL "GNUARM") |
| 109 | list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_s.S") |
| 110 | list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_ns.S") |
| 111 | list(APPEND ALL_SRC_ASM_BL2 "${PLATFORM_DIR}/target/musca_a/Device/Source/gcc/startup_cmsdk_musca_bl2.S") |
| 112 | set_property(SOURCE "${ALL_SRC_ASM_S}" "${ALL_SRC_ASM_NS}" "${ALL_SRC_ASM_BL2}" APPEND |
| 113 | PROPERTY COMPILE_DEFINITIONS "__STARTUP_CLEAR_BSS_MULTIPLE" "__STARTUP_COPY_MULTIPLE") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 114 | else() |
| 115 | message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.") |
| 116 | endif() |
| 117 | endif() |
| 118 | |
| 119 | if (NOT DEFINED BUILD_TARGET_CFG) |
| 120 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_CFG (true|false) is undefined!") |
| 121 | elseif(BUILD_TARGET_CFG) |
| 122 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/target_cfg.c") |
Mate Toth-Pal | 936c33b | 2018-04-10 14:02:07 +0200 | [diff] [blame] | 123 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/spm_hal.c") |
David Hu | a6ceeb6 | 2019-12-05 17:48:05 +0800 | [diff] [blame] | 124 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/template/attest_hal.c") |
Mate Toth-Pal | 936c33b | 2018-04-10 14:02:07 +0200 | [diff] [blame] | 125 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/Native_Driver/mpu_armv8m_drv.c") |
Andrei Narkevitch | 5bba54c | 2019-09-23 14:09:13 -0700 | [diff] [blame] | 126 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/common/tfm_platform.c") |
Mingyang Sun | 9511e5e | 2019-05-29 18:18:44 +0800 | [diff] [blame] | 127 | if (TFM_PARTITION_PLATFORM) |
Miklos Balint | c7b1b6c | 2019-04-24 12:38:36 +0200 | [diff] [blame] | 128 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/services/src/tfm_platform_system.c") |
Tamas Kaman | d326142 | 2019-11-17 15:34:47 +0100 | [diff] [blame] | 129 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/services/src/tfm_ioctl_s_api.c") |
Mingyang Sun | 9511e5e | 2019-05-29 18:18:44 +0800 | [diff] [blame] | 130 | endif() |
Mate Toth-Pal | 936c33b | 2018-04-10 14:02:07 +0200 | [diff] [blame] | 131 | embedded_include_directories(PATH "${PLATFORM_DIR}/common" ABSOLUTE) |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 132 | endif() |
| 133 | |
Mate Toth-Pal | d3c7766 | 2019-02-20 16:23:00 +0100 | [diff] [blame] | 134 | if (NOT DEFINED BUILD_PLAT_TEST) |
| 135 | message(FATAL_ERROR "Configuration variable BUILD_PLAT_TEST (true|false) is undefined!") |
| 136 | elseif(BUILD_PLAT_TEST) |
Mate Toth-Pal | a9f8e9e | 2019-03-05 16:11:14 +0100 | [diff] [blame] | 137 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/plat_test.c") |
Mate Toth-Pal | d3c7766 | 2019-02-20 16:23:00 +0100 | [diff] [blame] | 138 | endif() |
| 139 | |
Tamas Ban | d4bf347 | 2019-09-06 12:59:56 +0100 | [diff] [blame] | 140 | if (NOT DEFINED BUILD_BOOT_HAL) |
| 141 | message(FATAL_ERROR "Configuration variable BUILD_BOOT_HAL (true|false) is undefined!") |
| 142 | elseif(BUILD_BOOT_HAL) |
| 143 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/boot_hal.c") |
| 144 | endif() |
| 145 | |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 146 | if (NOT DEFINED BUILD_TARGET_HARDWARE_KEYS) |
| 147 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_HARDWARE_KEYS (true|false) is undefined!") |
| 148 | elseif(BUILD_TARGET_HARDWARE_KEYS) |
Tamas Ban | 8f33623 | 2018-12-21 14:54:11 +0000 | [diff] [blame] | 149 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/common/tfm_initial_attestation_key_material.c") |
Tamas Ban | 5db5753 | 2019-07-17 10:59:02 +0100 | [diff] [blame] | 150 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/common/tfm_rotpk.c") |
David Hu | 31c574dc | 2019-12-05 18:25:44 +0800 | [diff] [blame^] | 151 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/common/template/crypto_keys.c") |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 152 | endif() |
| 153 | |
Marc Moreno Berengue | b2c17ae | 2018-08-10 15:47:42 +0100 | [diff] [blame] | 154 | if (NOT DEFINED BUILD_TARGET_NV_COUNTERS) |
| 155 | message(FATAL_ERROR "Configuration variable BUILD_TARGET_NV_COUNTERS (true|false) is undefined!") |
| 156 | elseif(BUILD_TARGET_NV_COUNTERS) |
| 157 | # NOTE: This non-volatile counters implementation is a dummy |
| 158 | # implementation. Platform vendors have to implement the |
| 159 | # API ONLY if the target has non-volatile counters. |
| 160 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/dummy_nv_counters.c") |
| 161 | set(TARGET_NV_COUNTERS_ENABLE ON) |
Marc Moreno Berengue | 184d203 | 2018-08-14 12:51:43 +0100 | [diff] [blame] | 162 | # Sets SST_ROLLBACK_PROTECTION flag to compile in the SST services |
| 163 | # rollback protection code as the target supports nv counters. |
| 164 | set (SST_ROLLBACK_PROTECTION ON) |
Marc Moreno Berengue | b2c17ae | 2018-08-10 15:47:42 +0100 | [diff] [blame] | 165 | endif() |
| 166 | |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 167 | if (NOT DEFINED BUILD_CMSIS_DRIVERS) |
| 168 | message(FATAL_ERROR "Configuration variable BUILD_CMSIS_DRIVERS (true|false) is undefined!") |
| 169 | elseif(BUILD_CMSIS_DRIVERS) |
| 170 | list(APPEND ALL_SRC_C_S "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver/Driver_MPC.c" |
| 171 | "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver/Driver_PPC.c") |
| 172 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver/Driver_USART.c") |
| 173 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver" ABSOLUTE) |
| 174 | embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE) |
| 175 | endif() |
| 176 | |
| 177 | if (NOT DEFINED BUILD_FLASH) |
| 178 | message(FATAL_ERROR "Configuration variable BUILD_FLASH (true|false) is undefined!") |
| 179 | elseif(BUILD_FLASH) |
Kevin Peng | 8f76da9 | 2019-01-28 16:18:20 +0800 | [diff] [blame] | 180 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver/Driver_QSPI_Flash.c") |
Marc Moreno Berengue | 95d6572 | 2018-07-26 17:24:02 +0100 | [diff] [blame] | 181 | # As the SST area is going to be in RAM, it is required to set SST_CREATE_FLASH_LAYOUT |
| 182 | # to be sure the SST service knows that when it starts the SST area does not contain any |
TudorCretu | ba8a3fa | 2019-07-22 10:05:12 +0100 | [diff] [blame] | 183 | # valid SST flash layout and it needs to create one. The same for ITS. |
Marc Moreno Berengue | 95d6572 | 2018-07-26 17:24:02 +0100 | [diff] [blame] | 184 | set(SST_CREATE_FLASH_LAYOUT ON) |
TudorCretu | ba8a3fa | 2019-07-22 10:05:12 +0100 | [diff] [blame] | 185 | set(ITS_CREATE_FLASH_LAYOUT ON) |
Avinash Mehta | 2e1b9bc | 2018-05-03 12:55:50 +0100 | [diff] [blame] | 186 | embedded_include_directories(PATH "${PLATFORM_DIR}/target/musca_a/CMSIS_Driver" ABSOLUTE) |
David Vincze | 26e8c8a | 2018-08-28 16:59:41 +0200 | [diff] [blame] | 187 | embedded_include_directories(PATH "${PLATFORM_DIR}/driver" ABSOLUTE) |
Avinash Mehta | 788036c | 2018-03-15 12:38:43 +0000 | [diff] [blame] | 188 | endif() |
Oliver Swede | f998244 | 2018-08-24 18:37:44 +0100 | [diff] [blame] | 189 | |
| 190 | if (NOT BL2) |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 191 | message(WARNING "BL2 is mandatory on target '${TARGET_PLATFORM}'. Your choice was overriden.") |
David Vincze | 54d0555 | 2019-08-05 12:58:47 +0200 | [diff] [blame] | 192 | add_definitions(-DBL2) |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 193 | set(BL2 True) |
David Vincze | 63eda7a | 2019-08-09 17:42:51 +0200 | [diff] [blame] | 194 | set(MCUBOOT_IMAGE_NUMBER 1) |
| 195 | mcuboot_override_upgrade_strategy("RAM_LOADING") |
David Vincze | 54d0555 | 2019-08-05 12:58:47 +0200 | [diff] [blame] | 196 | message(STATUS "MCUBOOT_UPGRADE_STRATEGY was not set, using the mandatory value for '${TARGET_PLATFORM}': ${MCUBOOT_UPGRADE_STRATEGY}.") |
| 197 | set(MCUBOOT_SIGNATURE_TYPE "RSA-3072") |
| 198 | message(STATUS "MCUBOOT_SIGNATURE_TYPE was not set, using default value: ${MCUBOOT_SIGNATURE_TYPE}.") |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 199 | else() #BL2 is True |
| 200 | if (NOT ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "RAM_LOADING") |
| 201 | message(WARNING "RAM_LOADING upgrade strategy is mandatory on target '${TARGET_PLATFORM}'. Your choice was overriden.") |
David Vincze | 63eda7a | 2019-08-09 17:42:51 +0200 | [diff] [blame] | 202 | mcuboot_override_upgrade_strategy("RAM_LOADING") |
David Vincze | 4638b2a | 2019-05-24 10:14:23 +0200 | [diff] [blame] | 203 | endif() |
Jamie Fox | 7a4170d | 2018-08-15 14:13:42 +0100 | [diff] [blame] | 204 | endif() |
Tamas Ban | 3681ce0 | 2018-11-22 15:19:24 +0000 | [diff] [blame] | 205 | |
David Vincze | 54d0555 | 2019-08-05 12:58:47 +0200 | [diff] [blame] | 206 | if (BL2) |
| 207 | set(BL2_LINKER_CONFIG ${BL2_SCATTER_FILE_NAME}) |
Tamas Ban | 5db5753 | 2019-07-17 10:59:02 +0100 | [diff] [blame] | 208 | |
| 209 | #FixMe: MCUBOOT_SIGN_RSA_LEN can be removed when ROTPK won't be hard coded in platform/ext/common/tfm_rotpk.c |
| 210 | # instead independently loaded from secure code as a blob. |
| 211 | if (${MCUBOOT_SIGNATURE_TYPE} STREQUAL "RSA-2048") |
| 212 | add_definitions(-DMCUBOOT_SIGN_RSA_LEN=2048) |
| 213 | endif() |
| 214 | if (${MCUBOOT_SIGNATURE_TYPE} STREQUAL "RSA-3072") |
| 215 | add_definitions(-DMCUBOOT_SIGN_RSA_LEN=3072) |
| 216 | endif() |
David Vincze | 54d0555 | 2019-08-05 12:58:47 +0200 | [diff] [blame] | 217 | endif() |
| 218 | |
Tamas Ban | 38e1731 | 2018-11-22 15:26:35 +0000 | [diff] [blame] | 219 | if (NOT DEFINED BUILD_DEVICE_ID) |
| 220 | message(FATAL_ERROR "Configuration variable BUILD_DEVICE_ID (true|false) is undefined!") |
| 221 | elseif(BUILD_DEVICE_ID) |
| 222 | list(APPEND ALL_SRC_C "${PLATFORM_DIR}/target/musca_a/dummy_device_id.c") |
| 223 | endif() |