Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | cc14498 | 2023-01-16 12:24:27 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2023, Arm Limited. All rights reserved. |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 3 | # |
| 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 Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 12 | # Load extra config |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 13 | if(TFM_EXTRA_CONFIG_PATH) |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 14 | include(${TFM_EXTRA_CONFIG_PATH}) |
| 15 | endif() |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 16 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 17 | # Load PSA config, setting options not already set |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 18 | if(TEST_PSA_API) |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 19 | include(config/tests/config_test_psa_api.cmake) |
| 20 | endif() |
| 21 | |
| 22 | # Load build type config, setting options not already set |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 23 | string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE) |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 24 | if(EXISTS ${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 25 | include(${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
| 26 | endif() |
| 27 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 28 | # Load platform config, setting options not already set |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 29 | if(EXISTS ${TARGET_PLATFORM_PATH}/config.cmake) |
Kevin Peng | a2b6802 | 2023-01-13 13:54:05 +0800 | [diff] [blame] | 30 | include(${TARGET_PLATFORM_PATH}/config.cmake) |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 31 | endif() |
| 32 | |
Jianliang Shen | 7e48bef | 2022-10-31 16:15:36 +0800 | [diff] [blame] | 33 | # Load configs generated from Kconfig |
| 34 | include(${CMAKE_SOURCE_DIR}/config/kconfig.cmake) |
| 35 | |
| 36 | # Parse tf-m-tests config prior to platform specific config.cmake |
| 37 | # Some platforms select different configuration according when regression tests |
| 38 | # are enabled. |
| 39 | include(lib/ext/tf-m-tests/reg_parse.cmake) |
| 40 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 41 | # Load profile config, setting options not already set |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 42 | if(TFM_PROFILE) |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 43 | include(config/profile/${TFM_PROFILE}.cmake) |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 44 | endif() |
| 45 | |
David Hu | dcc5a4a | 2022-11-14 17:59:11 +0800 | [diff] [blame] | 46 | # Load Secure Partition settings according to regression configuration as all SPs are disabled |
| 47 | # by default |
| 48 | if(TFM_S_REG_TEST OR TFM_NS_REG_TEST) |
| 49 | include(${CMAKE_CURRENT_LIST_DIR}/tests/regression_config.cmake) |
| 50 | endif() |
| 51 | |
David Hu | 372b45c | 2022-11-16 10:06:28 +0800 | [diff] [blame] | 52 | # Load TF-M model specific default config |
David Hu | 85a92e0 | 2022-11-23 10:44:58 +0800 | [diff] [blame] | 53 | # Load IPC backend config if isolation level is explicitly specified to 2/3 or IPC backend is |
David Hu | 372b45c | 2022-11-16 10:06:28 +0800 | [diff] [blame] | 54 | # selected via build command line. Otherwise, load SFN backend config by default. |
| 55 | # If a pair of invalid settings are passed via command line, it will be captured later via config |
| 56 | # check. |
| 57 | # Also select IPC model by default for multi-core platform unless it has already selected SFN model |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 58 | if((DEFINED TFM_ISOLATION_LEVEL AND TFM_ISOLATION_LEVEL GREATER 1) OR |
David Hu | 372b45c | 2022-11-16 10:06:28 +0800 | [diff] [blame] | 59 | CONFIG_TFM_SPM_BACKEND STREQUAL "IPC" OR |
| 60 | TFM_MULTI_CORE_TOPOLOGY) |
| 61 | include(config/tfm_ipc_config_default.cmake) |
| 62 | else() |
| 63 | #The default backend is SFN |
| 64 | include(config/tfm_sfn_config_default.cmake) |
| 65 | endif() |
| 66 | |
Raef Coles | 15a37f8 | 2021-12-07 15:59:14 +0000 | [diff] [blame] | 67 | # Load bl1 config |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 68 | if(BL1 AND PLATFORM_DEFAULT_BL1) |
Raef Coles | 15a37f8 | 2021-12-07 15:59:14 +0000 | [diff] [blame] | 69 | include(${CMAKE_SOURCE_DIR}/bl1/config/bl1_config_default.cmake) |
| 70 | endif() |
| 71 | |
shejia01 | 8444011 | 2021-07-07 10:49:09 +0800 | [diff] [blame] | 72 | # Load MCUboot specific default.cmake |
Kevin Peng | d0e4971 | 2022-12-07 11:13:01 +0800 | [diff] [blame^] | 73 | if(NOT DEFINED BL2 OR BL2) |
shejia01 | 8444011 | 2021-07-07 10:49:09 +0800 | [diff] [blame] | 74 | include(${CMAKE_SOURCE_DIR}/bl2/ext/mcuboot/mcuboot_default_config.cmake) |
| 75 | endif() |
| 76 | |
Sherry Zhang | 7146895 | 2022-10-19 14:09:05 +0800 | [diff] [blame] | 77 | # Include FWU partition configs. |
| 78 | include(config/tfm_fwu_config.cmake) |
| 79 | |
Feder Liang | d4dbaa9 | 2021-09-07 15:34:46 +0800 | [diff] [blame] | 80 | # Include coprocessor configs |
| 81 | include(config/cp_config_default.cmake) |
| 82 | |
Ludovic Barre | 5319ac0 | 2021-11-02 09:51:29 +0100 | [diff] [blame] | 83 | # Load defaults, setting options not already set |
Anton Komlev | 1dfd209 | 2022-10-25 17:50:09 +0100 | [diff] [blame] | 84 | include(config/config_base.cmake) |
Ludovic Barre | 5319ac0 | 2021-11-02 09:51:29 +0100 | [diff] [blame] | 85 | |
David Hu | 52ff16f | 2021-08-20 11:39:37 +0800 | [diff] [blame] | 86 | # Set secure log configs |
| 87 | # It also depends on regression test config. |
| 88 | include(config/tfm_secure_log.cmake) |