aboutsummaryrefslogtreecommitdiff
path: root/secure_fw
diff options
context:
space:
mode:
authorShawn Shan <Shawn.Shan@arm.com>2021-01-22 15:41:59 +0800
committerKevin Peng <kevin.peng@arm.com>2021-05-20 09:57:52 +0200
commita0165475447de055b00b7655f2fc573b24173101 (patch)
treebcc2d5592dc41f11aca0f09680080264f7c29f60 /secure_fw
parent4520ce3242106d0a149f35ce97e8f524d5b3182e (diff)
downloadtrusted-firmware-m-a0165475447de055b00b7655f2fc573b24173101.tar.gz
Tools: Update manifest parse tools for interrupt part
There are some changes in the manifest in FF-M v1.1 on interrupt handling part. The corresponding manifest parsing part needs an update as well. Change-Id: I70683b7cdf839b81d23d567596c732232bd023d8 Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
Diffstat (limited to 'secure_fw')
-rw-r--r--secure_fw/partitions/manifestfilename.template17
-rw-r--r--secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc.template43
2 files changed, 44 insertions, 16 deletions
diff --git a/secure_fw/partitions/manifestfilename.template b/secure_fw/partitions/manifestfilename.template
index 8d2f9820a..5c24e7abf 100644
--- a/secure_fw/partitions/manifestfilename.template
+++ b/secure_fw/partitions/manifestfilename.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -31,7 +31,13 @@ extern "C" {
{% set irq_ns = namespace(irq_iterator_counter=27) %}
{% for irq in manifest.irqs %}
-#define {{"%-55s"|format(irq.signal)}} (1U << ({{"%d"|format(irq_ns.irq_iterator_counter)}} + 4))
+ {% set irq_data = namespace() %}
+ {% if manifest.psa_framework_version == 1.0 %}
+ {% set irq_data.signal = irq.signal %}
+ {% 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 %}
{% endfor %}
{% if attr.tfm_partition_ipc %}
@@ -45,6 +51,13 @@ extern "C" {
#error "Too many IRQ signals!"
{% endif %}
{% endif %}
+ {% if manifest.psa_framework_version == 1.1 %}
+ {% for irq in manifest.irqs %}
+ {% if irq.handling == "FLIH" %}
+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 %}
diff --git a/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc.template b/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc.template
index 8bf02a57c..146ff7220 100644
--- a/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc.template
+++ b/secure_fw/spm/cmsis_psa/tfm_secure_irq_handlers_ipc.inc.template
@@ -26,19 +26,24 @@ const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[] = {
{% if partition.attr.conditional %}
#ifdef {{partition.attr.conditional}}
{% endif %}
- {% for handler in partition.manifest.irqs %}
+ {% for irq in partition.manifest.irqs %}
{% set irq_data = namespace() %}
- {% if handler.source %}
- {% set irq_data.line = handler.source %}
+ {% if irq.source %}
+ {% set irq_data.line = irq.source %}
{% else %}
#error "Interrupt source isn't provided for 'irqs' in partition {{partition.manifest.name}}"
{% endif %}
- {% if handler.tfm_irq_priority %}
- {% set irq_data.priority = handler.tfm_irq_priority %}
+ {% if partition.manifest.psa_framework_version == 1.0 %}
+ {% set irq_data.signal = irq.signal %}
{% else %}
- {% set irq_data.priority = "TFM_DEFAULT_SECURE_IRQ_PRIOTITY" %}
+ {% set irq_data.signal = irq.name + "_SIGNAL" %}
{% endif %}
- {{ _irq_record(partition.manifest.name, handler.signal, irq_data.line, irq_data.priority) }}
+ {% if irq.tfm_irq_priority %}
+ {% set irq_data.priority = irq.tfm_irq_priority %}
+ {% else %}
+ {% set irq_data.priority = "TFM_DEFAULT_SECURE_IRQ_PRIORITY" %}
+ {% endif %}
+ {{ _irq_record(partition.manifest.name, irq_data.signal, irq_data.line, irq_data.priority) }}
{% endfor %}
{% if partition.attr.conditional %}
#endif /* {{partition.attr.conditional}} */
@@ -57,17 +62,27 @@ const size_t tfm_core_irq_signals_count = (sizeof(tfm_core_irq_signals) /
{% if partition.attr.conditional %}
#ifdef {{partition.attr.conditional}}
{% endif %}
- {% for handler in partition.manifest.irqs %}
- {% if handler.source is number %}
-void irq_{{handler.source}}_Handler(void)
- {% elif handler.source %}
-void {{handler.source}}_Handler(void)
+ {% for irq in partition.manifest.irqs %}
+ {% set irq_data = namespace() %}
+ {% if partition.manifest.psa_framework_version == 1.0 %}
+ {% set irq_data.signal = irq.signal %}
+ {% else %}
+ {% set irq_data.signal = irq.name + "_SIGNAL" %}
+ {% endif %}
+ {% if irq.source is number %}
+void irq_{{irq.source}}_Handler(void)
+ {% elif irq.source %}
+void {{irq.source}}_Handler(void)
{% else %}
#error "Interrupt source isn't provided for 'irqs' in partition {{partition.manifest.name}}"
{% endif %}
{
- {% if handler.source %}
- tfm_set_irq_signal({{partition.manifest.name}}, {{handler.signal}}, {{handler.source}});
+ {% if irq.source %}
+ {% if partition.manifest.psa_framework_version == 1.1 and irq.handling == "FLIH" %}
+#error "FLIH is not supported yet!"
+ {% else %}
+ tfm_set_irq_signal({{partition.manifest.name}}, {{irq_data.signal}}, {{irq.source}});
+ {% endif %}
{% else %}
#error "Interrupt source isn't provided for 'irqs' in partition {{partition.manifest.name}}"
{% endif %}