Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Kevin Peng | 3880066 | 2021-07-14 10:28:23 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2021, 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 |
| 13 | if (TFM_EXTRA_CONFIG_PATH) |
| 14 | include(${TFM_EXTRA_CONFIG_PATH}) |
| 15 | endif() |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 16 | |
Jimmy Brisson | 496d1c4 | 2021-06-23 10:33:07 -0500 | [diff] [blame] | 17 | # We usually don't need these messages, and they make it difficult to scan the |
| 18 | # build log for error and warning messages, so we disable theme here. |
| 19 | if(NOT TFM_BUILD_LOG_VERBOSE) |
| 20 | set(CMAKE_INSTALL_MESSAGE NEVER) |
| 21 | set(PARSE_MANIFEST_QUIET ON) |
| 22 | set(PARTITION_CONFIG_QUIET ON) |
| 23 | set(MEMORY_USAGE_QUIET ON) |
| 24 | endif() |
| 25 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 26 | # Load PSA config, setting options not already set |
| 27 | if (TEST_PSA_API) |
| 28 | include(config/tests/config_test_psa_api.cmake) |
| 29 | endif() |
| 30 | |
| 31 | # Load build type config, setting options not already set |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 32 | string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE) |
| 33 | if (EXISTS ${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
| 34 | include(${CMAKE_SOURCE_DIR}/config/build_type/${CMAKE_BUILD_TYPE_LOWERCASE}.cmake) |
| 35 | endif() |
| 36 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 37 | # Load platform config, setting options not already set |
Kevin Peng | 3880066 | 2021-07-14 10:28:23 +0800 | [diff] [blame] | 38 | if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/config.cmake) |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 39 | include(platform/ext/target/${TFM_PLATFORM}/config.cmake) |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 40 | endif() |
| 41 | |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 42 | # Load accelerator config, setting options not already set |
| 43 | if (CRYPTO_HW_ACCELERATOR) |
| 44 | if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake) |
| 45 | include(${CMAKE_SOURCE_DIR}/platform/ext/accelerator/${CRYPTO_HW_ACCELERATOR_TYPE}/config.cmake) |
| 46 | endif() |
| 47 | endif() |
| 48 | |
| 49 | # Load profile config, setting options not already set |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 50 | if (TFM_PROFILE) |
Tamas Ban | 6921920 | 2020-10-27 08:13:18 +0000 | [diff] [blame] | 51 | include(config/profile/${TFM_PROFILE}.cmake) |
Raef Coles | 958aeef | 2020-10-08 12:12:58 +0100 | [diff] [blame] | 52 | endif() |
| 53 | |
David Hu | 9b6a1fe | 2020-12-21 15:16:09 +0800 | [diff] [blame] | 54 | # Load TF-M model specific default config |
Kevin Peng | 23a583c | 2021-09-08 22:33:33 +0800 | [diff] [blame] | 55 | if (TFM_LIB_MODEL) |
| 56 | include(config/tfm_library_config_default.cmake) |
Kevin Peng | 76c0c16 | 2022-02-09 22:49:06 +0800 | [diff] [blame] | 57 | elseif (CONFIG_TFM_SPM_BACKEND STREQUAL "SFN") |
| 58 | include(config/tfm_sfn_config_default.cmake) |
| 59 | else() #The default backend is IPC |
David Hu | 9b6a1fe | 2020-12-21 15:16:09 +0800 | [diff] [blame] | 60 | include(config/tfm_ipc_config_default.cmake) |
| 61 | endif() |
| 62 | |
shejia01 | 8444011 | 2021-07-07 10:49:09 +0800 | [diff] [blame] | 63 | # Load MCUboot specific default.cmake |
Raef Coles | f0ba05b | 2021-11-25 09:57:17 +0000 | [diff] [blame] | 64 | if (NOT DEFINED BL2 OR BL2) |
shejia01 | 8444011 | 2021-07-07 10:49:09 +0800 | [diff] [blame] | 65 | include(${CMAKE_SOURCE_DIR}/bl2/ext/mcuboot/mcuboot_default_config.cmake) |
| 66 | endif() |
| 67 | |
Feder Liang | d4dbaa9 | 2021-09-07 15:34:46 +0800 | [diff] [blame] | 68 | # Include coprocessor configs |
| 69 | include(config/cp_config_default.cmake) |
| 70 | |
Ludovic Barre | 5319ac0 | 2021-11-02 09:51:29 +0100 | [diff] [blame] | 71 | # Load defaults, setting options not already set |
| 72 | include(config/config_default.cmake) |
| 73 | |
David Hu | 3d2121f | 2021-08-23 18:00:26 +0800 | [diff] [blame] | 74 | # Fetch tf-m-tests repo during config, if NS or regression test is required. |
| 75 | # Therefore tf-m-tests configs can be set with TF-M configs since their configs |
| 76 | # are coupled. |
| 77 | include(lib/ext/tf-m-tests/tf-m-tests.cmake) |
| 78 | |
David Hu | 12f2587 | 2021-08-23 14:55:46 +0800 | [diff] [blame] | 79 | # Load TF-M regression test suites setting |
David Hu | 12f2587 | 2021-08-23 14:55:46 +0800 | [diff] [blame] | 80 | if (TFM_NS_REG_TEST OR TFM_S_REG_TEST) |
David Hu | 3d2121f | 2021-08-23 18:00:26 +0800 | [diff] [blame] | 81 | include(${TFM_TEST_PATH}/config/set_config.cmake) |
shejia01 | bfd3712 | 2021-06-03 13:31:51 +0800 | [diff] [blame] | 82 | endif() |
David Hu | 52ff16f | 2021-08-20 11:39:37 +0800 | [diff] [blame] | 83 | |
| 84 | # Set secure log configs |
| 85 | # It also depends on regression test config. |
| 86 | include(config/tfm_secure_log.cmake) |