Config: Disable Doorbell API for SFN backend
Doorbell APIs are not supported in SFN backend. Though CONFIG_TFM_DOORBELL_API
is redefined to 0 in config_spm.h when SFN backend is selected, there
will be a warning for the redefinition. To avoid this warning message,
better to disable Doorbell APIs in project config header files if SFN is
the default backend.
This patch does the following things:
1. Change CONFIG_TFM_DOORBELL_API to 0 in all project config header files
that use SFN backend.
2. Add invalid config check in config_spm.h to make sure that doorbell
APIs are disabled when SFN backend is used.
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: I46978643185fa9756f657cc8d3c780811892cab0
diff --git a/secure_fw/spm/include/config_spm.h b/secure_fw/spm/include/config_spm.h
index 69dbb27..6d7172d 100644
--- a/secure_fw/spm/include/config_spm.h
+++ b/secure_fw/spm/include/config_spm.h
@@ -17,17 +17,20 @@
#define CONFIG_TFM_CONN_HANDLE_MAX_NUM 8
#endif
-/* Enable the doorbell APIs */
+/* Set the doorbell APIs */
#ifndef CONFIG_TFM_DOORBELL_API
-#pragma message("CONFIG_TFM_DOORBELL_API is defaulted to 1. Please check and set it explicitly.")
-#define CONFIG_TFM_DOORBELL_API 1
-#endif
-
-/* Disable doorbell for SFN backend */
#if CONFIG_TFM_SPM_BACKEND_SFN == 1
-#pragma message("CONFIG_TFM_DOORBELL_API is redefined to 0.")
-#undef CONFIG_TFM_DOORBELL_API
+#pragma message("CONFIG_TFM_DOORBELL_API is defaulted to 0 for SFN backend. Please check and set it explicitly.")
#define CONFIG_TFM_DOORBELL_API 0
+#else /* CONFIG_TFM_SPM_BACKEND_SFN == 1 */
+#pragma message("CONFIG_TFM_DOORBELL_API is defaulted to 1 for IPC backend. Please check and set it explicitly.")
+#define CONFIG_TFM_DOORBELL_API 1
+#endif /* CONFIG_TFM_SPM_BACKEND_SFN == 1 */
+#endif /* !CONFIG_TFM_DOORBELL_API */
+
+/* Check invalid configs */
+#if (CONFIG_TFM_SPM_BACKEND_SFN == 1) && CONFIG_TFM_DOORBELL_API
+#error "Invalid config: CONFIG_TFM_SPM_BACKEND_SFN AND CONFIG_TFM_DOORBELL_API!"
#endif
#endif /* __CONFIG_PARTITION_SPM_H__ */