SPM: Set features with config header file
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ie9dd99456a3ad8cb3d7601d484c0f396b201c448
diff --git a/config/config_base.cmake b/config/config_base.cmake
index ec75abf..de8e811 100755
--- a/config/config_base.cmake
+++ b/config/config_base.cmake
@@ -26,7 +26,6 @@
set(PSA_FRAMEWORK_HAS_MM_IOVEC OFF CACHE BOOL "Enable MM-IOVEC")
set(TFM_PROFILE "" CACHE STRING "Profile to use")
set(TFM_FIH_PROFILE OFF CACHE STRING "Fault injection hardening profile [OFF, LOW, MEDIUM, HIGH]")
-set(CONFIG_TFM_CONN_HANDLE_MAX_NUM 8 CACHE STRING "The maximal number of secure services that are connected or requested at the same time")
set(CONFIG_TFM_SPM_BACKEND "SFN" CACHE STRING "The SPM backend [IPC, SFN]")
# An NSPE client_id is provided by the NSPE OS via the SPM or directly by the SPM.
@@ -58,8 +57,6 @@
set(CONFIG_TFM_HALT_ON_CORE_PANIC OFF CACHE BOOL "On fatal errors in the secure firmware, halt instead of rebooting.")
-set(CONFIG_TFM_DOORBELL_API ON CACHE BOOL "Enable the doorbell APIs")
-
set(CONFIG_TFM_STACK_WATERMARKS OFF CACHE BOOL "Whether to pre-fill partition stacks with a set value to help determine stack usage")
set(PROJECT_CONFIG_HEADER_FILE "${CMAKE_SOURCE_DIR}/config/config_base.h" CACHE FILEPATH "User defined header file for TF-M config")
diff --git a/config/config_base.h b/config/config_base.h
index ea9f3bc..ebe1e21 100644
--- a/config/config_base.h
+++ b/config/config_base.h
@@ -146,4 +146,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_BASE_H__ */
diff --git a/config/profile/config_profile_large.h b/config/profile/config_profile_large.h
index 37f0ce4..73b172b 100644
--- a/config/profile/config_profile_large.h
+++ b/config/profile/config_profile_large.h
@@ -146,4 +146,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_PROFILE_LARGE_H__ */
diff --git a/config/profile/config_profile_medium.h b/config/profile/config_profile_medium.h
index 905eafe..748c847 100644
--- a/config/profile/config_profile_medium.h
+++ b/config/profile/config_profile_medium.h
@@ -143,4 +143,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_PROFILE_MEDIUM_H__ */
diff --git a/config/profile/config_profile_medium_arotless.h b/config/profile/config_profile_medium_arotless.h
index 0e6f1db..14b8803 100644
--- a/config/profile/config_profile_medium_arotless.h
+++ b/config/profile/config_profile_medium_arotless.h
@@ -143,4 +143,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_PROFILE_MEDIUM_AROTLESS_H__ */
diff --git a/config/profile/config_profile_small.h b/config/profile/config_profile_small.h
index 4178638..98a7b9f 100644
--- a/config/profile/config_profile_small.h
+++ b/config/profile/config_profile_small.h
@@ -140,4 +140,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 3
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_PROFILE_SMALL_H__ */
diff --git a/config/profile/profile_small.cmake b/config/profile/profile_small.cmake
index c8ec10e..2eeb290 100644
--- a/config/profile/profile_small.cmake
+++ b/config/profile/profile_small.cmake
@@ -26,7 +26,6 @@
################################## Advanced options #############################
set(PSA_FRAMEWORK_HAS_MM_IOVEC ON CACHE BOOL "Enable MM-IOVEC")
-set(CONFIG_TFM_CONN_HANDLE_MAX_NUM 3 CACHE STRING "The maximal number of secure services that are connected or requested at the same time")
set(MCUBOOT_IMAGE_NUMBER 1 CACHE STRING "Whether to combine S and NS into either 1 image, or sign each seperately")
################################## Dependencies ################################
diff --git a/config/tests/config_test_psa_api.h b/config/tests/config_test_psa_api.h
index f2227b5..90d2355 100644
--- a/config/tests/config_test_psa_api.h
+++ b/config/tests/config_test_psa_api.h
@@ -146,4 +146,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_TEST_PSA_API_H__ */
diff --git a/config/tests/config_test_psa_api_crypto.h b/config/tests/config_test_psa_api_crypto.h
index 8387fdb..68b2a73 100644
--- a/config/tests/config_test_psa_api_crypto.h
+++ b/config/tests/config_test_psa_api_crypto.h
@@ -150,4 +150,12 @@
/* The stack size of the Protected Storage Secure Partition */
#define PS_STACK_SIZE 0x700
+/* SPM Partition Configs */
+
+/* The maximal number of secure services that are connected or requested at the same time */
+#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
+
+/* Enable the doorbell APIs */
+#define CONFIG_TFM_DOORBELL_API 1
+
#endif /* __CONFIG_BASE_H__ */
diff --git a/config/tfm_sfn_config_default.cmake b/config/tfm_sfn_config_default.cmake
index 6a01a0f..2235d6a 100644
--- a/config/tfm_sfn_config_default.cmake
+++ b/config/tfm_sfn_config_default.cmake
@@ -10,7 +10,6 @@
############################ Partitions ########################################
set(CONFIG_TFM_SPM_BACKEND "SFN" CACHE STRING "The SPM backend [IPC, SFN]")
-set(CONFIG_TFM_DOORBELL_API OFF CACHE BOOL "Enable the doorbell APIs")
set(CONFIG_TFM_SPM_BACKEND_IPC OFF)
set(CONFIG_TFM_SPM_BACKEND_SFN ON)
set(CONFIG_TFM_PARTITION_META OFF)