aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Shan <Shawn.Shan@arm.com>2021-06-16 17:18:33 +0800
committerDavid Hu <david.hu@arm.com>2021-07-07 05:16:08 +0200
commit6a92631917fcd30e78d68fbb2d579c8af7c18e95 (patch)
treed8a75f1331a7719cfd3b21a52966db2a21b3a818
parenta4f23f8377b857dd9c4f69f43716baa1dfc38520 (diff)
downloadtrusted-firmware-m-6a92631917fcd30e78d68fbb2d579c8af7c18e95.tar.gz
Tools: Deprecate the attribute 'tfm_partition_ipc'
'tfm_partition_ipc' was introduced to distinguish if partitions support library model only. The FF-M v1.1 introduces a new SFN Model which is an alternative of IPC Model. This attribute becomes confusing to indicate the models. Made some changes to remove the attribute 'tfm_partition_ipc'. Change-Id: Ifba5778caf87bb716993db3dc19986bbde3653c3 Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
-rw-r--r--docs/integration_guide/services/tfm_secure_partition_addition.rst3
-rw-r--r--interface/include/psa_manifest/sid.h.template24
-rw-r--r--secure_fw/partitions/manifestfilename.template70
-rw-r--r--secure_fw/spm/cmsis_func/tfm_spm_db_func.inc.template4
-rw-r--r--tools/tfm_manifest_list.yaml19
-rw-r--r--tools/tfm_parse_manifest_list.py3
-rw-r--r--tools/tfm_psa_ff_test_manifest_list.yaml3
7 files changed, 41 insertions, 85 deletions
diff --git a/docs/integration_guide/services/tfm_secure_partition_addition.rst b/docs/integration_guide/services/tfm_secure_partition_addition.rst
index 4393ce028a..534d4bc5db 100644
--- a/docs/integration_guide/services/tfm_secure_partition_addition.rst
+++ b/docs/integration_guide/services/tfm_secure_partition_addition.rst
@@ -280,8 +280,6 @@ necessary information of secure partition.
- ``short_name``: should be the same as the ``name`` in the secure partition
manifest file.
- ``manifest``: the relative path of the manifest file to TF-M root.
-- ``tfm_partition_ipc``: indicate if this partition is compatible with the IPC
- model.
- ``conditional``: Optional. Configure control macro for this partition.
- ``version_major``: major version the partition manifest.
- ``version_minor``: minor version the partition manifest.
@@ -296,7 +294,6 @@ Reference configuration example:
"name": "Example Service",
"short_name": "TFM_SP_EXAMPLE",
"manifest": "secure_fw/partitions/EXAMPLE/tfm_example.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_EXAMPLE",
"version_major": 0,
"version_minor": 1,
diff --git a/interface/include/psa_manifest/sid.h.template b/interface/include/psa_manifest/sid.h.template
index 1fe128cbab..8a53a71945 100644
--- a/interface/include/psa_manifest/sid.h.template
+++ b/interface/include/psa_manifest/sid.h.template
@@ -15,24 +15,22 @@ extern "C" {
#endif
{% for partition in partitions %}
- {% if partition.attr.tfm_partition_ipc %}
+ {% if partition.manifest.services %}
/******** {{partition.manifest.name}} ********/
- {% if partition.manifest.services %}
- {% for service in partition.manifest.services %}
- {% set str = service.name + "_SID" %}
+ {% for service in partition.manifest.services %}
+ {% set str = service.name + "_SID" %}
#define {{"%-58s"|format(str)}} ({{"%10s"|format(service.sid)}}U)
- {% set str = service.name + "_VERSION" %}
- {% if service.version %}
+ {% set str = service.name + "_VERSION" %}
+ {% if service.version %}
#define {{"%-58s"|format(str)}} ({{"%d"|format(service.version)}}U)
- {% else %}
+ {% else %}
#define {{"%-58s"|format(str)}} (1U)
- {% endif %}
- {% if partition.manifest.psa_framework_version > 1.0 and service.connection_based == false %}
- {% set str = service.name + "_HANDLE" %}
+ {% endif %}
+ {% if partition.manifest.psa_framework_version > 1.0 and service.connection_based == false %}
+ {% set str = service.name + "_HANDLE" %}
#define {{"%-58s"|format(str)}} ({{"%s"|format(service.stateless_handle_value)}}U)
- {% endif %}
- {% endfor %}
- {% endif %}
+ {% endif %}
+ {% endfor %}
{% endif %}
{% endfor %}
diff --git a/secure_fw/partitions/manifestfilename.template b/secure_fw/partitions/manifestfilename.template
index a1a5f1510e..6211ef34e6 100644
--- a/secure_fw/partitions/manifestfilename.template
+++ b/secure_fw/partitions/manifestfilename.template
@@ -14,34 +14,36 @@
extern "C" {
#endif
-{% if attr.tfm_partition_ipc %}
- {% set ns = namespace(iterator_counter=0) %}
- {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %}
+{% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %}
#define {{"%-55s"|format(manifest.name + "_MODEL_IPC")}} 0
#define {{"%-55s"|format(manifest.name + "_MODEL_SFN")}} 1
- {% else %}
+{% else %}
#define {{"%-55s"|format(manifest.name + "_MODEL_IPC")}} 1
#define {{"%-55s"|format(manifest.name + "_MODEL_SFN")}} 0
- {% endif %}
+{% endif %}
- {% if manifest.services %}
- {% for service in manifest.services %}
- {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %}
-psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg);
- {% else %}
-#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << ({{"%d"|format(ns.iterator_counter)}} + 4))
- {% set ns.iterator_counter = ns.iterator_counter + 1 %}
- {% endif %}
- {% endfor %}
- {% endif %}
- {% if ns.iterator_counter > 28 %}
+{# Service and IRQ at least one must be declared. #}
+{% if (manifest.services | length) == 0 and (manifest.irqs | length) == 0 %}
+#error "Service and IRQ at least one must be declared!"
+{% endif %}
-#error "Too many signals!"
- {% endif %}
+{% set service_signal = namespace(bit=4) %}
+{% if manifest.services %}
+ {% for service in manifest.services %}
+ {% if manifest.psa_framework_version == 1.1 and manifest.model == "SFN" %}
+psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg);
+ {% else %}
+#define {{"%-55s"|format(service.name + "_SIGNAL")}} (1U << {{"%d"|format(service_signal.bit)}})
+ {% set service_signal.bit = service_signal.bit + 1 %}
+ {% endif %}
+ {% endfor %}
+{% endif %}
+{% if service_signal.bit > 32 %}
+#error "Too many services!"
{% endif %}
-{% if manifest.irqs %}
- {% set irq_ns = namespace(irq_iterator_counter=27) %}
+{% set irq_signal = namespace(bit=31) %}
+{% if manifest.irqs %}
{% for irq in manifest.irqs %}
{% set irq_data = namespace() %}
{% if manifest.psa_framework_version == 1.0 %}
@@ -49,20 +51,9 @@ psa_status_t {{service.name|lower}}_sfn(const psa_msg_t* msg);
{% else %}
{% set irq_data.signal = irq.name + "_SIGNAL" %}
{% endif %}
-#define {{"%-55s"|format(irq_data.signal)}} (1U << ({{"%d"|format(irq_ns.irq_iterator_counter)}} + 4))
- {% set irq_ns.irq_iterator_counter = irq_ns.irq_iterator_counter - 1 %}
+#define {{"%-55s"|format(irq_data.signal)}} (1U << {{"%d"|format(irq_signal.bit)}})
+ {% set irq_signal.bit = irq_signal.bit - 1 %}
{% endfor %}
- {% if attr.tfm_partition_ipc %}
- {% if (ns.iterator_counter - 1) >= (irq_ns.irq_iterator_counter + 1) %}
-
-#error "Secure service and IRQ signal values overlap!"
- {% endif %}
- {% else %}
- {% if (irq_ns.irq_iterator_counter + 1) < 0 %}
-
-#error "Too many IRQ signals!"
- {% endif %}
- {% endif %}
{% if manifest.psa_framework_version == 1.1 %}
{% for irq in manifest.irqs %}
{% if irq.handling == "FLIH" %}
@@ -70,13 +61,12 @@ psa_flih_result_t {{irq.name|lower}}_flih(void);
{% endif %}
{% endfor %}
{% endif %}
-{% else %}
- {# If no RoT Service is defined in the services attribute, then at least one IRQ must be declared. #}
- {% if attr.tfm_partition_ipc %}
- {% if (manifest.services is not defined) or ((manifest.services | length()) == 0) %}
-#error "At least one IRQ must be declared!"
- {% endif %}
- {% endif %}
+{% endif %}
+{% if (irq_signal.bit + 1) < 4 %}
+#error "Too many IRQ signals!"
+{% endif %}
+{% if (service_signal.bit - 1) >= (irq_signal.bit + 1) %}
+#error "Total number of services and irqs exceeds 28."
{% endif %}
#ifdef __cplusplus
diff --git a/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc.template b/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc.template
index 35dda5d582..6996111434 100644
--- a/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc.template
+++ b/secure_fw/spm/cmsis_func/tfm_spm_db_func.inc.template
@@ -143,11 +143,7 @@ const struct spm_partition_static_data_t static_data_list[] =
{% endif %}
{{'{'}}
.partition_id = {{partition.manifest.name}},
- {% if partition.attr.tfm_partition_ipc %}
- .partition_flags = SPM_PART_FLAG_IPC
- {% else %}
.partition_flags = 0
- {% endif %}
{% if partition.manifest.type == "APPLICATION-ROT" %}
| SPM_PART_FLAG_APP_ROT
{% elif partition.manifest.type == "PSA-ROT" %}
diff --git a/tools/tfm_manifest_list.yaml b/tools/tfm_manifest_list.yaml
index cb2c12934f..ae3b05c274 100644
--- a/tools/tfm_manifest_list.yaml
+++ b/tools/tfm_manifest_list.yaml
@@ -15,7 +15,6 @@
"name": "Protected Storage Service",
"short_name": "TFM_SP_PS",
"manifest": "secure_fw/partitions/protected_storage/tfm_protected_storage.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_PROTECTED_STORAGE",
"version_major": 0,
"version_minor": 1,
@@ -30,7 +29,6 @@
"name": "TF-M Internal Trusted Storage Service",
"short_name": "TFM_SP_ITS",
"manifest": "secure_fw/partitions/internal_trusted_storage/tfm_internal_trusted_storage.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_INTERNAL_TRUSTED_STORAGE",
"version_major": 0,
"version_minor": 1,
@@ -45,7 +43,6 @@
"name": "TFM Audit Log Service",
"short_name": "TFM_SP_AUDIT_LOG",
"manifest": "secure_fw/partitions/audit_logging/tfm_audit_logging.yaml",
- "tfm_partition_ipc": false,
"conditional": "TFM_PARTITION_AUDIT_LOG",
"version_major": 0,
"version_minor": 1,
@@ -60,7 +57,6 @@
"name": "TFM Crypto Service",
"short_name": "TFM_SP_CRYPTO",
"manifest": "secure_fw/partitions/crypto/tfm_crypto.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_CRYPTO",
"version_major": 0,
"version_minor": 1,
@@ -75,7 +71,6 @@
"name": "TFM Platform Service",
"short_name": "TFM_SP_PLATFORM",
"manifest": "secure_fw/partitions/platform/tfm_platform.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_PLATFORM",
"version_major": 0,
"version_minor": 1,
@@ -90,7 +85,6 @@
"name": "TFM Initial Attestation Service",
"short_name": "TFM_SP_INITIAL_ATTESTATION",
"manifest": "secure_fw/partitions/initial_attestation/tfm_initial_attestation.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_INITIAL_ATTESTATION",
"version_major": 0,
"version_minor": 1,
@@ -106,7 +100,6 @@
"short_name": "TFM_SP_CORE_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_core_test/tfm_ss_core_test.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_CORE",
"version_major": 0,
"version_minor": 1,
@@ -122,7 +115,6 @@
"short_name": "TFM_SP_CORE_TEST_2",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_core_test_2/tfm_ss_core_test_2.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_CORE",
"version_major": 0,
"version_minor": 1,
@@ -138,7 +130,6 @@
"short_name": "TFM_SP_SECURE_TEST_PARTITION",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_secure_client_service/tfm_secure_client_service.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_SECURE_SERVICES",
"version_major": 0,
"version_minor": 1,
@@ -154,7 +145,6 @@
"short_name": "TFM_SP_IPC_SERVICE_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_ipc_service/tfm_ipc_service_test.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_CORE_IPC",
"version_major": 0,
"version_minor": 1,
@@ -170,7 +160,6 @@
"short_name": "TFM_SP_IPC_CLIENT_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_ipc_client/tfm_ipc_client_test.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_CORE_IPC",
"version_major": 0,
"version_minor": 1,
@@ -186,7 +175,6 @@
"short_name": "TFM_SP_PS_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_ps_test_service/tfm_ps_test_service.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_PS",
"version_major": 0,
"version_minor": 1,
@@ -202,7 +190,6 @@
"short_name": "TFM_SP_SECURE_CLIENT_2",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_secure_client_2/tfm_secure_client_2.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_TEST_SECURE_SERVICES",
"version_major": 0,
"version_minor": 1,
@@ -218,7 +205,6 @@
"short_name": "TFM_SP_PSA_PROXY",
"manifest": "secure_fw/partitions/psa_proxy/tfm_psa_proxy.yaml",
"tfm_extensions": true,
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_PSA_PROXY",
"version_major": 0,
"version_minor": 1,
@@ -233,7 +219,6 @@
"name": "TFM Firmware Update Service",
"short_name": "TFM_SP_FWU",
"manifest": "secure_fw/partitions/firmware_update/tfm_firmware_update.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_FIRMWARE_UPDATE",
"version_major": 0,
"version_minor": 1,
@@ -248,7 +233,6 @@
"name": "TFM FFM11 Partition Service",
"short_name": "TFM_SP_FFM11",
"manifest": "secure_fw/partitions/tfm_ffm11_partition/tfm_ffm11_partition.yaml",
- "tfm_partition_ipc": true,
"conditional": "TFM_PARTITION_FFM11",
"version_major": 0,
"version_minor": 1,
@@ -264,7 +248,6 @@
"short_name": "TFM_ATTEST_TEST_SERVICE",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_attest_test_service/tfm_attest_test_service.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "ATTEST_TEST_GET_PUBLIC_KEY",
"version_major": 0,
"version_minor": 1,
@@ -280,7 +263,6 @@
"short_name": "TFM_SP_SLIH_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_slih_test_service/tfm_slih_test_service.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_ENABLE_SLIH_TEST",
"version_major": 0,
"version_minor": 1,
@@ -295,7 +277,6 @@
"short_name": "TFM_SP_FLIH_TEST",
"manifest": "${TFM_TEST_PATH}/test_services/tfm_flih_test_service/tfm_flih_test_service.yaml",
"source_path": "${TFM_TEST_PATH}",
- "tfm_partition_ipc": true,
"conditional": "TFM_ENABLE_FLIH_TEST",
"version_major": 0,
"version_minor": 1,
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index 43fca1f5d8..11c0690363 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -259,9 +259,6 @@ def process_stateless_services(partitions, stateless_index_max_num):
# Skip the FF-M 1.0 partitions
if partition['manifest']['psa_framework_version'] < 1.1:
continue
- # Skip the Non-IPC partitions
- if partition['attr']['tfm_partition_ipc'] is not True:
- continue
for service in partition['manifest']['services']:
if 'connection_based' not in service:
raise Exception("'connection_based' is mandatory in FF-M 1.1 service!")
diff --git a/tools/tfm_psa_ff_test_manifest_list.yaml b/tools/tfm_psa_ff_test_manifest_list.yaml
index bb630bd48b..bbc310e201 100644
--- a/tools/tfm_psa_ff_test_manifest_list.yaml
+++ b/tools/tfm_psa_ff_test_manifest_list.yaml
@@ -16,7 +16,6 @@
"short_name": "PSA_FF_TEST_CLIENT",
"manifest": "${PSA_ARCH_TESTS_PATH}/api-tests/platform/manifests/client_partition_psa.json",
"source_path":"${PSA_ARCH_TESTS_PATH}",
- "tfm_partition_ipc": true,
"conditional": "PSA_API_TEST_IPC",
"version_major": 0,
"version_minor": 1,
@@ -35,7 +34,6 @@
"short_name": "PSA_FF_TEST_SERVER",
"manifest": "${PSA_ARCH_TESTS_PATH}/api-tests/platform/manifests/server_partition_psa.json",
"source_path":"${PSA_ARCH_TESTS_PATH}",
- "tfm_partition_ipc": true,
"conditional": "PSA_API_TEST_IPC",
"version_major": 0,
"version_minor": 1,
@@ -54,7 +52,6 @@
"short_name": "PSA_FF_TEST_DRIVER",
"manifest": "${PSA_ARCH_TESTS_PATH}/api-tests/platform/manifests/driver_partition_psa.json",
"source_path":"${PSA_ARCH_TESTS_PATH}",
- "tfm_partition_ipc": true,
"conditional": "PSA_API_TEST_IPC",
"version_major": 0,
"version_minor": 1,