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__ */
diff --git a/interface/include/psa_interface_redirect.h b/interface/include/psa_interface_redirect.h
index 60915ef..1514f93 100644
--- a/interface/include/psa_interface_redirect.h
+++ b/interface/include/psa_interface_redirect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -82,10 +82,6 @@
#define psa_unmap_outvec psa_unmap_outvec_sfn
#endif /* PSA_FRAMEWORK_HAS_MM_IOVEC */
-#else
-
-#error "NO ABI is chosen, check configurations."
-
#endif
#endif /* __PSA_INTERFACE_REDIRECT_H__ */
diff --git a/interface/include/psa_manifest/pid.h.template b/interface/include/psa_manifest/pid.h.template
index 4fba682..faf52d6 100644
--- a/interface/include/psa_manifest/pid.h.template
+++ b/interface/include/psa_manifest/pid.h.template
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
* Copyright (c) 2021, Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-{{utilities.donotedit_warning}}
+/***********{{utilities.donotedit_warning}}***********/
#ifndef __PSA_MANIFEST_PID_H__
#define __PSA_MANIFEST_PID_H__
diff --git a/interface/include/psa_manifest/sid.h.template b/interface/include/psa_manifest/sid.h.template
index 8a53a71..e754bd7 100644
--- a/interface/include/psa_manifest/sid.h.template
+++ b/interface/include/psa_manifest/sid.h.template
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-{{utilities.donotedit_warning}}
+/***********{{utilities.donotedit_warning}}***********/
#ifndef __PSA_MANIFEST_SID_H__
#define __PSA_MANIFEST_SID_H__
diff --git a/interface/include/tfm_veneers.h.template b/interface/include/tfm_veneers.h.template
index 0e9e993..68c23e8 100644
--- a/interface/include/tfm_veneers.h.template
+++ b/interface/include/tfm_veneers.h.template
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
-{{utilities.donotedit_warning}}
+/***********{{utilities.donotedit_warning}}***********/
#ifndef __TFM_VENEERS_H__
#define __TFM_VENEERS_H__