blob: 3966eb49138a617d387618d2ec285f834424d120 [file] [log] [blame]
Raef Coles958aeef2020-10-08 12:12:58 +01001#-------------------------------------------------------------------------------
David Hucc144982023-01-16 12:24:27 +08002# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
Raef Coles958aeef2020-10-08 12:12:58 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8# The Configuration sequence is captured in the documentation, in
9# docs/getting_started/tfm_build_instructions.rst under Cmake Configuration. If
10# the sequence is updated here the docs must also be updated.
11
Tamas Ban69219202020-10-27 08:13:18 +000012# Load extra config
Kevin Pengd0e49712022-12-07 11:13:01 +080013if(TFM_EXTRA_CONFIG_PATH)
Tamas Ban69219202020-10-27 08:13:18 +000014 include(${TFM_EXTRA_CONFIG_PATH})
15endif()
Raef Coles958aeef2020-10-08 12:12:58 +010016
Tamas Ban69219202020-10-27 08:13:18 +000017# Load PSA config, setting options not already set
Kevin Pengd0e49712022-12-07 11:13:01 +080018if(TEST_PSA_API)
Tamas Ban69219202020-10-27 08:13:18 +000019 include(config/tests/config_test_psa_api.cmake)
20endif()
21
22# Load build type config, setting options not already set
Raef Coles958aeef2020-10-08 12:12:58 +010023string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE)
Kevin Pengd0e49712022-12-07 11:13:01 +080024if(EXISTS ${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake)
Raef Coles958aeef2020-10-08 12:12:58 +010025 include(${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake)
26endif()
27
Tamas Ban69219202020-10-27 08:13:18 +000028# Load platform config, setting options not already set
Kevin Pengd0e49712022-12-07 11:13:01 +080029if(EXISTS ${TARGET_PLATFORM_PATH}/config.cmake)
Kevin Penga2b68022023-01-13 13:54:05 +080030 include(${TARGET_PLATFORM_PATH}/config.cmake)
Raef Coles958aeef2020-10-08 12:12:58 +010031endif()
32
Jianliang Shen7e48bef2022-10-31 16:15:36 +080033# Parse tf-m-tests config prior to platform specific config.cmake
34# Some platforms select different configuration according when regression tests
35# are enabled.
36include(lib/ext/tf-m-tests/reg_parse.cmake)
37
Tamas Ban69219202020-10-27 08:13:18 +000038# Load profile config, setting options not already set
Kevin Pengd0e49712022-12-07 11:13:01 +080039if(TFM_PROFILE)
Tamas Ban69219202020-10-27 08:13:18 +000040 include(config/profile/${TFM_PROFILE}.cmake)
Raef Coles958aeef2020-10-08 12:12:58 +010041endif()
42
David Hudcc5a4a2022-11-14 17:59:11 +080043# Load Secure Partition settings according to regression configuration as all SPs are disabled
44# by default
45if(TFM_S_REG_TEST OR TFM_NS_REG_TEST)
46 include(${CMAKE_CURRENT_LIST_DIR}/tests/regression_config.cmake)
47endif()
48
David Hu372b45c2022-11-16 10:06:28 +080049# Load TF-M model specific default config
David Hu85a92e02022-11-23 10:44:58 +080050# Load IPC backend config if isolation level is explicitly specified to 2/3 or IPC backend is
David Hu372b45c2022-11-16 10:06:28 +080051# selected via build command line. Otherwise, load SFN backend config by default.
52# If a pair of invalid settings are passed via command line, it will be captured later via config
53# check.
54# Also select IPC model by default for multi-core platform unless it has already selected SFN model
Kevin Pengd0e49712022-12-07 11:13:01 +080055if((DEFINED TFM_ISOLATION_LEVEL AND TFM_ISOLATION_LEVEL GREATER 1) OR
David Hu372b45c2022-11-16 10:06:28 +080056 CONFIG_TFM_SPM_BACKEND STREQUAL "IPC" OR
57 TFM_MULTI_CORE_TOPOLOGY)
58 include(config/tfm_ipc_config_default.cmake)
59else()
60 #The default backend is SFN
61 include(config/tfm_sfn_config_default.cmake)
62endif()
63
Raef Coles15a37f82021-12-07 15:59:14 +000064# Load bl1 config
Kevin Pengd0e49712022-12-07 11:13:01 +080065if(BL1 AND PLATFORM_DEFAULT_BL1)
Raef Coles15a37f82021-12-07 15:59:14 +000066 include(${CMAKE_SOURCE_DIR}/bl1/config/bl1_config_default.cmake)
67endif()
68
shejia0184440112021-07-07 10:49:09 +080069# Load MCUboot specific default.cmake
Kevin Pengd0e49712022-12-07 11:13:01 +080070if(NOT DEFINED BL2 OR BL2)
shejia0184440112021-07-07 10:49:09 +080071 include(${CMAKE_SOURCE_DIR}/bl2/ext/mcuboot/mcuboot_default_config.cmake)
72endif()
73
Sherry Zhang71468952022-10-19 14:09:05 +080074# Include FWU partition configs.
75include(config/tfm_fwu_config.cmake)
76
Feder Liangd4dbaa92021-09-07 15:34:46 +080077# Include coprocessor configs
78include(config/cp_config_default.cmake)
79
David Hu52ff16f2021-08-20 11:39:37 +080080# Set secure log configs
81# It also depends on regression test config.
82include(config/tfm_secure_log.cmake)