Build: Move configurations into a specified directory
Configurations are increasing and cause root directory looks not very
clear. Move configurations into a specified directory. Related changes
in projects need to be made due to config file change. And create fake
config files with the same name under the root directory, link to the
config files under 'configs' to provide compatibility temporarily.
Change-Id: I420b7a567e96d6540b5cd9697b08575d89274fe4
Signed-off-by: Ken Liu <ken.liu@arm.com>
diff --git a/ConfigCoreIPC.cmake b/ConfigCoreIPC.cmake
index 3b41679..5070137 100644
--- a/ConfigCoreIPC.cmake
+++ b/ConfigCoreIPC.cmake
@@ -1,37 +1,14 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigCoreIPC.cmake")
diff --git a/ConfigCoreIPCTfmLevel2.cmake b/ConfigCoreIPCTfmLevel2.cmake
index 9525ecd..7de3f75 100644
--- a/ConfigCoreIPCTfmLevel2.cmake
+++ b/ConfigCoreIPCTfmLevel2.cmake
@@ -1,37 +1,14 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 2)
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigCoreIPCTfmLevel2.cmake")
diff --git a/ConfigCoreTest.cmake b/ConfigCoreTest.cmake
index b9d8a3c..eae8c5f 100644
--- a/ConfigCoreTest.cmake
+++ b/ConfigCoreTest.cmake
@@ -1,33 +1,14 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST True)
-set (CORE_IPC False)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 3)
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigCoreTest.cmake")
diff --git a/ConfigDefault.cmake b/ConfigDefault.cmake
index 02011c4..6812396 100644
--- a/ConfigDefault.cmake
+++ b/ConfigDefault.cmake
@@ -1,37 +1,14 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC False)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
diff --git a/ConfigPsaApiTest.cmake b/ConfigPsaApiTest.cmake
index 23edbd3..38805dd 100644
--- a/ConfigPsaApiTest.cmake
+++ b/ConfigPsaApiTest.cmake
@@ -5,38 +5,10 @@
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-#These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC False)
-set (PSA_API_TEST True)
-
-#TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-#Service specific configuration for the PSA API Compliance test requirements
-if(PSA_API_TEST_CRYPTO)
- set(CRYPTO_ENGINE_BUF_SIZE 20480)
-endif()
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigPsaApiTest.cmake")
diff --git a/ConfigPsaApiTestIPC.cmake b/ConfigPsaApiTestIPC.cmake
index 63cd1d7..7cdd0d7 100644
--- a/ConfigPsaApiTestIPC.cmake
+++ b/ConfigPsaApiTestIPC.cmake
@@ -5,51 +5,10 @@
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-#These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST True)
-
-#TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-#BL2 bootloader(MCUBoot) related settings
-if(NOT DEFINED BL2)
- set(BL2 True)
-endif()
-
-if(NOT DEFINED MCUBOOT_NO_SWAP)
- set(MCUBOOT_NO_SWAP False)
-endif()
-
-if(NOT DEFINED MCUBOOT_RAM_LOADING)
- set(MCUBOOT_RAM_LOADING False)
-endif()
-
-#Service specific configuration for the PSA API Compliance test requirements
-if(PSA_API_TEST_CRYPTO)
- set(CRYPTO_ENGINE_BUF_SIZE 20480)
-endif()
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigPsaApiTestIPC.cmake")
diff --git a/ConfigPsaApiTestIPCTfmLevel2.cmake b/ConfigPsaApiTestIPCTfmLevel2.cmake
index ed77ad3..ad40eba 100644
--- a/ConfigPsaApiTestIPCTfmLevel2.cmake
+++ b/ConfigPsaApiTestIPCTfmLevel2.cmake
@@ -5,49 +5,10 @@
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-#These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION False)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST True)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 2)
-
-#BL2 bootloader(MCUBoot) related settings
-if(NOT DEFINED BL2)
- set(BL2 True)
-endif()
-
-if(NOT DEFINED MCUBOOT_NO_SWAP)
- set(MCUBOOT_NO_SWAP False)
-endif()
-
-if(NOT DEFINED MCUBOOT_RAM_LOADING)
- set(MCUBOOT_RAM_LOADING False)
-endif()
-
-#Service specific configuration for the PSA API Compliance test requirements
-if(PSA_API_TEST_CRYPTO)
- set(CRYPTO_ENGINE_BUF_SIZE 20480)
-endif()
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigPsaApiTestIPCTfmLevel2.cmake")
diff --git a/ConfigRegression.cmake b/ConfigRegression.cmake
index af0eb9c..b0e066c 100644
--- a/ConfigRegression.cmake
+++ b/ConfigRegression.cmake
@@ -1,37 +1,14 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION True)
-set (CORE_TEST False)
-set (CORE_IPC False)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigRegression.cmake")
diff --git a/ConfigRegressionIPC.cmake b/ConfigRegressionIPC.cmake
index 831c88b..cf02079 100644
--- a/ConfigRegressionIPC.cmake
+++ b/ConfigRegressionIPC.cmake
@@ -5,46 +5,10 @@
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION True)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 1)
-
-#BL2 bootloader(MCUBoot) related settings
-if(NOT DEFINED BL2)
- set(BL2 True)
-endif()
-
-if(NOT DEFINED MCUBOOT_NO_SWAP)
- set(MCUBOOT_NO_SWAP False)
-endif()
-
-if(NOT DEFINED MCUBOOT_RAM_LOADING)
- set(MCUBOOT_RAM_LOADING False)
-endif()
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigRegressionIPC.cmake")
diff --git a/ConfigRegressionIPCTfmLevel2.cmake b/ConfigRegressionIPCTfmLevel2.cmake
index 650acb5..a47d4d2 100644
--- a/ConfigRegressionIPCTfmLevel2.cmake
+++ b/ConfigRegressionIPCTfmLevel2.cmake
@@ -5,46 +5,10 @@
#
#-------------------------------------------------------------------------------
-#This file holds information of a specific build configuration of this project.
+message(WARNING "Please use the configs available in the ./config sub-directory.")
-#Include board specific config (CPU, etc...), select platform specific build
-#system settings file
-if(NOT DEFINED TARGET_PLATFORM)
- message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
-elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
-else()
- message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
endif()
-##These variables select how the projects are built. Each project will set
-#various project specific settings (e.g. what files to build, macro
-#definitions) based on these.
-set (REGRESSION True)
-set (CORE_TEST False)
-set (CORE_IPC True)
-set (PSA_API_TEST False)
-
-# TF-M isolation level: 1..3
-set (TFM_LVL 2)
-
-#BL2 bootloader(MCUBoot) related settings
-if(NOT DEFINED BL2)
- set(BL2 True)
-endif()
-
-if(NOT DEFINED MCUBOOT_NO_SWAP)
- set(MCUBOOT_NO_SWAP False)
-endif()
-
-if(NOT DEFINED MCUBOOT_RAM_LOADING)
- set(MCUBOOT_RAM_LOADING False)
-endif()
-
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/configs/ConfigRegressionIPCTfmLevel2.cmake")
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 7fc564b..c05461f 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -10,19 +10,19 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
-#Include common stuff to control cmake.
-include("Common/BuildSys")
-
-#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../ConfigDefault.cmake")
-project(tfm_ns LANGUAGES ASM C)
-embedded_project_fixup()
-
set(APP_DIR ${CMAKE_CURRENT_LIST_DIR})
get_filename_component(TFM_ROOT_DIR ${APP_DIR}/.. ABSOLUTE)
set(INTERFACE_DIR ${TFM_ROOT_DIR}/interface)
set(TEST_DIR ${TFM_ROOT_DIR}/test)
+#Include common stuff to control cmake.
+include("Common/BuildSys")
+
+#Start an embedded project.
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
+project(tfm_ns LANGUAGES ASM C)
+embedded_project_fixup()
+
#Include BL2 bootloader related functions
set(MCUBOOT_DIR "${TFM_ROOT_DIR}/bl2/ext/mcuboot")
include("${MCUBOOT_DIR}/MCUBoot.cmake")
diff --git a/bl2/ext/mcuboot/CMakeLists.txt b/bl2/ext/mcuboot/CMakeLists.txt
index 19ddf3d..9efe032 100644
--- a/bl2/ext/mcuboot/CMakeLists.txt
+++ b/bl2/ext/mcuboot/CMakeLists.txt
@@ -10,11 +10,15 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+#Set variables to appropriate path
+set(MCUBOOT_DIR ${CMAKE_CURRENT_LIST_DIR})
+get_filename_component(TFM_ROOT_DIR "${MCUBOOT_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(mcuboot LANGUAGES ASM C)
embedded_project_fixup()
@@ -30,10 +34,6 @@
message(FATAL_ERROR "Incomplete build configuration: MBEDTLS_C_FLAGS_BL2 is undefined.")
endif()
-#Set variables to appropriate path
-set(MCUBOOT_DIR ${CMAKE_CURRENT_LIST_DIR})
-get_filename_component(TFM_ROOT_DIR "${MCUBOOT_DIR}/../../.." ABSOLUTE)
-
set(BUILD_CMSIS_CORE On)
set(BUILD_RETARGET On)
set(BUILD_NATIVE_DRIVERS On)
diff --git a/cmake/Common/BuildSys.cmake b/cmake/Common/BuildSys.cmake
index 370f275..4de9f3b 100644
--- a/cmake/Common/BuildSys.cmake
+++ b/cmake/Common/BuildSys.cmake
@@ -37,9 +37,9 @@
# To use global project config:
# embedded_project_start()
# To use config file relative to the top level CmakeLists.txt:
-# embedded_project_start(./ConfigDefault.cmake)
+# embedded_project_start(./configs/ConfigDefault.cmake)
# To use config file relative to the CmakeLists.txt file where this macro is used:
-# embedded_project_start(${CMAKE_CURRENT_LIST_DIR}/ConfigDefault.cmake)
+# embedded_project_start(${TFM_ROOT_DIR}/configs/ConfigDefault.cmake)
macro(embedded_project_start)
#Default project configuration file
if (DEFINED PROJ_CONFIG) #Take the global setting as default value
@@ -51,10 +51,10 @@
set( _MULTI_VALUE_ARGS ) #One list argument (e.g. LANGUAGES C ASM CXX)
cmake_parse_arguments(_MY_PARAMS "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
- #Cehck passed parameters
+ #Check passed parameters
if(NOT _MY_PARAMS_CONFIG)
if(NOT DEFINED _PROJ_CONFIG)
- set(_PROJ_CONFIG "./ConfigDefault.cmake")
+ set(_PROJ_CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
message(STATUS "embedded_project_start: no project configuration file defined, falling back to default.")
endif()
elseif(NOT DEFINED PROJ_CONFIG)
@@ -62,7 +62,7 @@
endif()
get_filename_component(_ABS_PROJ_CONFIG ${_PROJ_CONFIG} ABSOLUTE)
- message( STATUS "embedded_project_start: using project specific config file (PROJ_CONFIG = ${_ABS_PROJ_CONFIG})")
+ message(STATUS "embedded_project_start: using project specific config file (PROJ_CONFIG = ${_ABS_PROJ_CONFIG})")
include("${_PROJ_CONFIG}")
endmacro()
diff --git a/ConfigRegressionTfmLevel3.cmake b/configs/ConfigCoreIPC.cmake
similarity index 64%
copy from ConfigRegressionTfmLevel3.cmake
copy to configs/ConfigCoreIPC.cmake
index 694562a..0e943c6 100644
--- a/ConfigRegressionTfmLevel3.cmake
+++ b/configs/ConfigCoreIPC.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -7,18 +7,22 @@
#This file holds information of a specific build configuration of this project.
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
#Include board specific config (CPU, etc...), select platform specific build
#system settings file
if(NOT DEFINED TARGET_PLATFORM)
message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
else()
message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
endif()
@@ -26,12 +30,12 @@
##These variables select how the projects are built. Each project will set
#various project specific settings (e.g. what files to build, macro
#definitions) based on these.
-set (REGRESSION True)
+set (REGRESSION False)
set (CORE_TEST False)
-set (CORE_IPC False)
+set (CORE_IPC True)
set (PSA_API_TEST False)
# TF-M isolation level: 1..3
-set (TFM_LVL 3)
+set (TFM_LVL 1)
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/ConfigRegressionTfmLevel3.cmake b/configs/ConfigCoreIPCTfmLevel2.cmake
similarity index 64%
copy from ConfigRegressionTfmLevel3.cmake
copy to configs/ConfigCoreIPCTfmLevel2.cmake
index 694562a..d835cfc 100644
--- a/ConfigRegressionTfmLevel3.cmake
+++ b/configs/ConfigCoreIPCTfmLevel2.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -7,18 +7,22 @@
#This file holds information of a specific build configuration of this project.
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
#Include board specific config (CPU, etc...), select platform specific build
#system settings file
if(NOT DEFINED TARGET_PLATFORM)
message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
else()
message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
endif()
@@ -26,12 +30,12 @@
##These variables select how the projects are built. Each project will set
#various project specific settings (e.g. what files to build, macro
#definitions) based on these.
-set (REGRESSION True)
+set (REGRESSION False)
set (CORE_TEST False)
-set (CORE_IPC False)
+set (CORE_IPC True)
set (PSA_API_TEST False)
# TF-M isolation level: 1..3
-set (TFM_LVL 3)
+set (TFM_LVL 2)
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/ConfigRegressionTfmLevel3.cmake b/configs/ConfigCoreTest.cmake
similarity index 65%
copy from ConfigRegressionTfmLevel3.cmake
copy to configs/ConfigCoreTest.cmake
index 694562a..eed11d2 100644
--- a/ConfigRegressionTfmLevel3.cmake
+++ b/configs/ConfigCoreTest.cmake
@@ -7,18 +7,18 @@
#This file holds information of a specific build configuration of this project.
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
#Include board specific config (CPU, etc...), select platform specific build
#system settings file
if(NOT DEFINED TARGET_PLATFORM)
message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
-elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
+ set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
else()
message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
endif()
@@ -26,12 +26,12 @@
##These variables select how the projects are built. Each project will set
#various project specific settings (e.g. what files to build, macro
#definitions) based on these.
-set (REGRESSION True)
-set (CORE_TEST False)
+set (REGRESSION False)
+set (CORE_TEST True)
set (CORE_IPC False)
set (PSA_API_TEST False)
# TF-M isolation level: 1..3
set (TFM_LVL 3)
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/ConfigRegressionTfmLevel3.cmake b/configs/ConfigDefault.cmake
similarity index 69%
copy from ConfigRegressionTfmLevel3.cmake
copy to configs/ConfigDefault.cmake
index 694562a..3263860 100644
--- a/ConfigRegressionTfmLevel3.cmake
+++ b/configs/ConfigDefault.cmake
@@ -7,18 +7,22 @@
#This file holds information of a specific build configuration of this project.
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
#Include board specific config (CPU, etc...), select platform specific build
#system settings file
if(NOT DEFINED TARGET_PLATFORM)
message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
+ set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
else()
message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
endif()
@@ -26,12 +30,12 @@
##These variables select how the projects are built. Each project will set
#various project specific settings (e.g. what files to build, macro
#definitions) based on these.
-set (REGRESSION True)
+set (REGRESSION False)
set (CORE_TEST False)
set (CORE_IPC False)
set (PSA_API_TEST False)
# TF-M isolation level: 1..3
-set (TFM_LVL 3)
+set (TFM_LVL 1)
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/configs/ConfigPsaApiTest.cmake b/configs/ConfigPsaApiTest.cmake
new file mode 100644
index 0000000..76af7c1
--- /dev/null
+++ b/configs/ConfigPsaApiTest.cmake
@@ -0,0 +1,46 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file holds information of a specific build configuration of this project.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
+#Include board specific config (CPU, etc...), select platform specific build
+#system settings file
+if(NOT DEFINED TARGET_PLATFORM)
+ message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
+elseif(${TARGET_PLATFORM} STREQUAL "AN521")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "AN519")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
+else()
+ message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+endif()
+
+#These variables select how the projects are built. Each project will set
+#various project specific settings (e.g. what files to build, macro
+#definitions) based on these.
+set (REGRESSION False)
+set (CORE_TEST False)
+set (CORE_IPC False)
+set (PSA_API_TEST True)
+
+#TF-M isolation level: 1..3
+set (TFM_LVL 1)
+
+#Service specific configuration for the PSA API Compliance test requirements
+if(PSA_API_TEST_CRYPTO)
+ set(CRYPTO_ENGINE_BUF_SIZE 20480)
+endif()
+
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/configs/ConfigPsaApiTestIPC.cmake b/configs/ConfigPsaApiTestIPC.cmake
new file mode 100644
index 0000000..09e39dc
--- /dev/null
+++ b/configs/ConfigPsaApiTestIPC.cmake
@@ -0,0 +1,59 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file holds information of a specific build configuration of this project.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
+#Include board specific config (CPU, etc...), select platform specific build
+#system settings file
+if(NOT DEFINED TARGET_PLATFORM)
+ message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
+elseif(${TARGET_PLATFORM} STREQUAL "AN521")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "AN519")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
+else()
+ message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+endif()
+
+#These variables select how the projects are built. Each project will set
+#various project specific settings (e.g. what files to build, macro
+#definitions) based on these.
+set (REGRESSION False)
+set (CORE_TEST False)
+set (CORE_IPC True)
+set (PSA_API_TEST True)
+
+#TF-M isolation level: 1..3
+set (TFM_LVL 1)
+
+#BL2 bootloader(MCUBoot) related settings
+if(NOT DEFINED BL2)
+ set(BL2 True)
+endif()
+
+if(NOT DEFINED MCUBOOT_NO_SWAP)
+ set(MCUBOOT_NO_SWAP False)
+endif()
+
+if(NOT DEFINED MCUBOOT_RAM_LOADING)
+ set(MCUBOOT_RAM_LOADING False)
+endif()
+
+#Service specific configuration for the PSA API Compliance test requirements
+if(PSA_API_TEST_CRYPTO)
+ set(CRYPTO_ENGINE_BUF_SIZE 20480)
+endif()
+
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/configs/ConfigPsaApiTestIPCTfmLevel2.cmake b/configs/ConfigPsaApiTestIPCTfmLevel2.cmake
new file mode 100644
index 0000000..6829df9
--- /dev/null
+++ b/configs/ConfigPsaApiTestIPCTfmLevel2.cmake
@@ -0,0 +1,57 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file holds information of a specific build configuration of this project.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
+#Include board specific config (CPU, etc...), select platform specific build
+#system settings file
+if(NOT DEFINED TARGET_PLATFORM)
+ message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
+elseif(${TARGET_PLATFORM} STREQUAL "AN521")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
+else()
+ message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+endif()
+
+#These variables select how the projects are built. Each project will set
+#various project specific settings (e.g. what files to build, macro
+#definitions) based on these.
+set (REGRESSION False)
+set (CORE_TEST False)
+set (CORE_IPC True)
+set (PSA_API_TEST True)
+
+# TF-M isolation level: 1..3
+set (TFM_LVL 2)
+
+#BL2 bootloader(MCUBoot) related settings
+if(NOT DEFINED BL2)
+ set(BL2 True)
+endif()
+
+if(NOT DEFINED MCUBOOT_NO_SWAP)
+ set(MCUBOOT_NO_SWAP False)
+endif()
+
+if(NOT DEFINED MCUBOOT_RAM_LOADING)
+ set(MCUBOOT_RAM_LOADING False)
+endif()
+
+#Service specific configuration for the PSA API Compliance test requirements
+if(PSA_API_TEST_CRYPTO)
+ set(CRYPTO_ENGINE_BUF_SIZE 20480)
+endif()
+
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/ConfigRegressionTfmLevel3.cmake b/configs/ConfigRegression.cmake
similarity index 70%
rename from ConfigRegressionTfmLevel3.cmake
rename to configs/ConfigRegression.cmake
index 694562a..3f223ab 100644
--- a/ConfigRegressionTfmLevel3.cmake
+++ b/configs/ConfigRegression.cmake
@@ -7,18 +7,22 @@
#This file holds information of a specific build configuration of this project.
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
#Include board specific config (CPU, etc...), select platform specific build
#system settings file
if(NOT DEFINED TARGET_PLATFORM)
message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
elseif(${TARGET_PLATFORM} STREQUAL "AN521")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN521.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "AN519")
- set (PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/Mps2AN519.cmake")
+ set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_a.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
- set(PLATFORM_CMAKE_FILE "${CMAKE_CURRENT_LIST_DIR}/platform/ext/musca_b1.cmake")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
else()
message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
endif()
@@ -32,6 +36,6 @@
set (PSA_API_TEST False)
# TF-M isolation level: 1..3
-set (TFM_LVL 3)
+set (TFM_LVL 1)
-include ("${CMAKE_CURRENT_LIST_DIR}/CommonConfig.cmake")
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/configs/ConfigRegressionIPC.cmake b/configs/ConfigRegressionIPC.cmake
new file mode 100644
index 0000000..0eb6c11
--- /dev/null
+++ b/configs/ConfigRegressionIPC.cmake
@@ -0,0 +1,54 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file holds information of a specific build configuration of this project.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
+#Include board specific config (CPU, etc...), select platform specific build
+#system settings file
+if(NOT DEFINED TARGET_PLATFORM)
+ message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
+elseif(${TARGET_PLATFORM} STREQUAL "AN521")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "AN519")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
+else()
+ message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+endif()
+
+##These variables select how the projects are built. Each project will set
+#various project specific settings (e.g. what files to build, macro
+#definitions) based on these.
+set (REGRESSION True)
+set (CORE_TEST False)
+set (CORE_IPC True)
+set (PSA_API_TEST False)
+
+# TF-M isolation level: 1..3
+set (TFM_LVL 1)
+
+#BL2 bootloader(MCUBoot) related settings
+if(NOT DEFINED BL2)
+ set(BL2 True)
+endif()
+
+if(NOT DEFINED MCUBOOT_NO_SWAP)
+ set(MCUBOOT_NO_SWAP False)
+endif()
+
+if(NOT DEFINED MCUBOOT_RAM_LOADING)
+ set(MCUBOOT_RAM_LOADING False)
+endif()
+
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/configs/ConfigRegressionIPCTfmLevel2.cmake b/configs/ConfigRegressionIPCTfmLevel2.cmake
new file mode 100644
index 0000000..130e8ac
--- /dev/null
+++ b/configs/ConfigRegressionIPCTfmLevel2.cmake
@@ -0,0 +1,54 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#This file holds information of a specific build configuration of this project.
+
+if(NOT DEFINED TFM_ROOT_DIR)
+ message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
+endif()
+
+#Include board specific config (CPU, etc...), select platform specific build
+#system settings file
+if(NOT DEFINED TARGET_PLATFORM)
+ message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
+elseif(${TARGET_PLATFORM} STREQUAL "AN521")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "AN519")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_A")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_a.cmake")
+elseif(${TARGET_PLATFORM} STREQUAL "MUSCA_B1")
+ set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/musca_b1.cmake")
+else()
+ message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
+endif()
+
+##These variables select how the projects are built. Each project will set
+#various project specific settings (e.g. what files to build, macro
+#definitions) based on these.
+set (REGRESSION True)
+set (CORE_TEST False)
+set (CORE_IPC True)
+set (PSA_API_TEST False)
+
+# TF-M isolation level: 1..3
+set (TFM_LVL 2)
+
+#BL2 bootloader(MCUBoot) related settings
+if(NOT DEFINED BL2)
+ set(BL2 True)
+endif()
+
+if(NOT DEFINED MCUBOOT_NO_SWAP)
+ set(MCUBOOT_NO_SWAP False)
+endif()
+
+if(NOT DEFINED MCUBOOT_RAM_LOADING)
+ set(MCUBOOT_RAM_LOADING False)
+endif()
+
+include ("${TFM_ROOT_DIR}/CommonConfig.cmake")
diff --git a/docs/user_guides/tfm_build_instruction.rst b/docs/user_guides/tfm_build_instruction.rst
index 4097b71..fd21f7b 100644
--- a/docs/user_guides/tfm_build_instruction.rst
+++ b/docs/user_guides/tfm_build_instruction.rst
@@ -19,7 +19,7 @@
| <file> is the absolute path to configurations file
named as ``Config<APP_NAME>.cmake``.
| i.e. On Linux:
- ``-DPROJ_CONFIG=`readlink -f ../ConfigRegression.cmake```
+ ``-DPROJ_CONFIG=`readlink -f ../configs/ConfigRegression.cmake```
* - -DTARGET_PLATFORM=<target platform name>
- Specifies the target platform.
@@ -103,7 +103,7 @@
cd trusted-firmware-m
mkdir cmake_test
cd cmake_test
- cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
+ cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
cmake --build ./ -- install
*TF-M build regression tests on Windows*
@@ -114,7 +114,7 @@
cd trusted-firmware-m
mkdir cmake_test
cd cmake_test
- cmake -G"Unix Makefiles" -DPROJ_CONFIG=`cygpath -am ../ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
+ cmake -G"Unix Makefiles" -DPROJ_CONFIG=`cygpath -am ../configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
cmake --build ./ -- install
Build for PSA API compliance tests
@@ -138,7 +138,7 @@
cd trusted-firmware-m
mkdir cmake_psa_test
cd cmake_psa_test
- cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../ConfigPsaApiTest.cmake` -DPSA_API_TEST_CRYPTO -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
+ cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../configs/ConfigPsaApiTest.cmake` -DPSA_API_TEST_CRYPTO -DTARGET_PLATFORM=AN521 -DCOMPILER=ARMCLANG ../
cmake --build ./ -- install
Location of build artifacts
diff --git a/lib/ext/qcbor/CMakeLists.txt b/lib/ext/qcbor/CMakeLists.txt
index 060462a..3efd50c 100644
--- a/lib/ext/qcbor/CMakeLists.txt
+++ b/lib/ext/qcbor/CMakeLists.txt
@@ -10,17 +10,18 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+#Some project global settings
+set (QCBOR_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${QCBOR_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_qcbor LANGUAGES C)
embedded_project_fixup()
-#Some project global settings
-set (QCBOR_DIR "${CMAKE_CURRENT_LIST_DIR}")
-
#Append all our source files to global lists.
list(APPEND ALL_SRC_C
"${QCBOR_DIR}/src/ieee754.c"
diff --git a/lib/t_cose/CMakeLists.txt b/lib/t_cose/CMakeLists.txt
index 961571d..7113bc0 100644
--- a/lib/t_cose/CMakeLists.txt
+++ b/lib/t_cose/CMakeLists.txt
@@ -10,18 +10,19 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+#Some project global settings
+set(T_COSE_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${T_COSE_DIR}/../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_t_cose_sign LANGUAGES C)
project(tfm_t_cose_verify LANGUAGES C)
embedded_project_fixup()
-#Some project global settings
-set(T_COSE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-
#Append all our source files to global lists.
list(APPEND ALL_SRC_C_SIGN
"${T_COSE_DIR}/src/t_cose_sign1_sign.c"
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index 6b33ff5..20b3e39 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -10,6 +10,11 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
+set(SECURE_FW_DIR "${CMAKE_CURRENT_LIST_DIR}")
+set(TFM_ROOT_DIR "${SECURE_FW_DIR}/..")
+set(TEST_DIR "${TFM_ROOT_DIR}/test")
+set(INTERFACE_DIR "${TFM_ROOT_DIR}/interface")
+
#Include common stuff to control cmake.
include("Common/BuildSys")
@@ -18,15 +23,10 @@
include("Common/BuildSphinxDoc")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_s LANGUAGES ASM C)
embedded_project_fixup()
-set(SECURE_FW_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set(TFM_ROOT_DIR "${SECURE_FW_DIR}/..")
-set(TEST_DIR "${TFM_ROOT_DIR}/test")
-set(INTERFACE_DIR "${TFM_ROOT_DIR}/interface")
-
if (NOT DEFINED TFM_LVL)
message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined. ")
endif()
diff --git a/secure_fw/services/audit_logging/CMakeLists.txt b/secure_fw/services/audit_logging/CMakeLists.txt
index d67c854..695ba41 100644
--- a/secure_fw/services/audit_logging/CMakeLists.txt
+++ b/secure_fw/services/audit_logging/CMakeLists.txt
@@ -10,18 +10,18 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+###Some project global settings
+set (AUDIT_LOGGING_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${AUDIT_LOGGING_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_audit LANGUAGES ASM C)
embedded_project_fixup()
-###Some project global settings
-set (AUDIT_LOGGING_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${AUDIT_LOGGING_DIR}/../../.." ABSOLUTE)
-
###Get the definition of what files we need to build
include(CMakeLists.inc)
diff --git a/secure_fw/services/crypto/CMakeLists.txt b/secure_fw/services/crypto/CMakeLists.txt
index 5f028c7..0a68f4d 100644
--- a/secure_fw/services/crypto/CMakeLists.txt
+++ b/secure_fw/services/crypto/CMakeLists.txt
@@ -10,18 +10,18 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+#Some project global settings
+set (CRYPTO_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${CRYPTO_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_crypto LANGUAGES ASM C)
embedded_project_fixup()
-#Some project global settings
-set (CRYPTO_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${CRYPTO_DIR}/../../.." ABSOLUTE)
-
#Get the definition of what files we need to build
set (ENABLE_CRYPTO ON)
#The backend of the service is based on Mbed Crypto
diff --git a/secure_fw/services/initial_attestation/CMakeLists.txt b/secure_fw/services/initial_attestation/CMakeLists.txt
index 905d5df..4717db4 100644
--- a/secure_fw/services/initial_attestation/CMakeLists.txt
+++ b/secure_fw/services/initial_attestation/CMakeLists.txt
@@ -10,18 +10,18 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+#Some project global settings
+set (INITIAL_ATTESTATION_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${INITIAL_ATTESTATION_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_attest LANGUAGES ASM C)
embedded_project_fixup()
-#Some project global settings
-set (INITIAL_ATTESTATION_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${INITIAL_ATTESTATION_DIR}/../../.." ABSOLUTE)
-
#Get the definition of what files we need to build
set (ENABLE_INITIAL_ATTESTATION ON)
include(CMakeLists.inc)
diff --git a/secure_fw/services/platform/CMakeLists.txt b/secure_fw/services/platform/CMakeLists.txt
index 4f4f0d1..bc12c4d 100644
--- a/secure_fw/services/platform/CMakeLists.txt
+++ b/secure_fw/services/platform/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -10,18 +10,18 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+###Some project global settings
+set (PLATFORM_SP_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${PLATFORM_SP_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_platform LANGUAGES ASM C)
embedded_project_fixup()
-###Some project global settings
-set (PLATFORM_SP_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${PLATFORM_SP_DIR}/../../.." ABSOLUTE)
-
###Get the definition of what files we need to build
include(CMakeLists.inc)
diff --git a/secure_fw/services/secure_storage/CMakeLists.txt b/secure_fw/services/secure_storage/CMakeLists.txt
index 16a14da..44e916c 100644
--- a/secure_fw/services/secure_storage/CMakeLists.txt
+++ b/secure_fw/services/secure_storage/CMakeLists.txt
@@ -10,18 +10,18 @@
# Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
+###Some project global settings
+set (SECURE_STORAGE_DIR "${CMAKE_CURRENT_LIST_DIR}")
+get_filename_component(TFM_ROOT_DIR "${SECURE_STORAGE_DIR}/../../.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../../../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_storage LANGUAGES ASM C)
embedded_project_fixup()
-###Some project global settings
-set (SECURE_STORAGE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-get_filename_component(TFM_ROOT_DIR "${SECURE_STORAGE_DIR}/../../.." ABSOLUTE)
-
###Get the definition of what files we need to build
include(CMakeLists.inc)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 75ccb07..9953613 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,16 +10,17 @@
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
+#Tell TFM Root before calling sub cmake
+get_filename_component(TFM_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
+
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
-embedded_project_start(CONFIG "${CMAKE_CURRENT_LIST_DIR}/../ConfigDefault.cmake")
+embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_tests LANGUAGES ASM C)
embedded_project_fixup()
-get_filename_component(TFM_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
-
#Check incoming configuration options
if (NOT DEFINED SERVICES_TEST_ENABLED)
message(FATAL_ERROR "Incomplete build configuration: SERVICES_TEST_ENABLED is undefined. ")