SPM: Enhance build control for IPC and SFN models

Currently, different models configuration such as
CONFIG_TFM_PSA_API_xxx_CALL are configured in generated header
file config_impl.h. CMake build system has no information on
which model should be built. As a result, files for different
models are always build in IPC model, such as psa_interface_cross.c,
psa_interface_sfn.c and psa_interface_svc.c.
This patch:
- Generate CMake variables for each model.
- Configure the build system based on generated CMake variables.

Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: If3f92b07b618b13ca596306ffd19867010de83b7
diff --git a/interface/include/config_impl.h.template b/interface/include/config_impl.h.template
index 8c79f04..bc29ac0 100644
--- a/interface/include/config_impl.h.template
+++ b/interface/include/config_impl.h.template
@@ -4,8 +4,7 @@
  * SPDX-License-Identifier: BSD-3-Clause
  *
  */
-
-{{utilities.donotedit_warning}}
+/***********{{utilities.donotedit_warning}}***********/
 
 #ifndef __CONFIG_IMPL_H__
 #define __CONFIG_IMPL_H__
@@ -13,30 +12,16 @@
 {% if partition_statistics['ipc_partition_num'] > 0
     and partition_statistics['sfn_partition_num'] == 0 %}
 /* IPC model */
-#define {{"%-56s"|format("CONFIG_TFM_SPM_BACKEND_IPC")}} 1
-
 /* Trustzone NS agent working stack size. */
 #define {{"%-56s"|format("CONFIG_TFM_NS_AGENT_TZ_STACK_SIZE")}} 1024
 
-#if TFM_LVL > 1
-#define {{"%-56s"|format("CONFIG_TFM_PSA_API_SUPERVISOR_CALL")}} 1
-#else /* TFM_LVL > 1 */
-#define {{"%-56s"|format("CONFIG_TFM_PSA_API_CROSS_CALL")}} 1
-
 /* SPM re-uses Trustzone NS agent stack. */
 #define {{"%-56s"|format("CONFIG_TFM_SPM_THREAD_STACK_SIZE")}}     \
             {{"%-56s"|format("CONFIG_TFM_NS_AGENT_TZ_STACK_SIZE")}}
-#endif /* TFM_LVL > 1 */
 
 {% elif partition_statistics['sfn_partition_num'] > 0
     and partition_statistics['ipc_partition_num'] == 0 %}
 /* SFN model */
-#define {{"%-56s"|format("CONFIG_TFM_SPM_BACKEND_SFN")}} 1
-#define {{"%-56s"|format("CONFIG_TFM_PSA_API_SFN_CALL")}} 1
-
-#if TFM_LVL > 1
-#error "High isolation level SFN model is not supported."
-#endif
 
     {% set total_stk = namespace(size=0) %}
     {% for partition in partitions %}
@@ -70,8 +55,4 @@
 #error "Invalid partition number input, check configurations."
 {% endif %}
 
-#if (CONFIG_TFM_SPE_FP > 0) && (CONFIG_TFM_SPM_BACKEND_SFN == 1)
-#error "FP is not supported for SFN model."
-#endif
-
 #endif /* __CONFIG_IMPL_H__ */