SPM: Remove the IRQ priority in manifest
TF-M added a tfm_irq_priority attribute in the Partition manifest
for SPM to set IRQ priorities so that IRQ can work correctly - TF-M
requires external interrupt priorities must be higher than that of
PendSV.
However, a universal IRQ priority might not work on all platforms
because different platforms have different number of configurable
interrupt priorities. So the same value represents different
priorities on different platforms.
Besides, the attribute is not defined by FF-M.
This patch removes the IRQ priority in manifest and in the HAL API
as well so that platforms have the most flexibility to set priorities
for IRQs based on their own cases.
Note: the external interrupt priorities must be higher than PendSV.
Change-Id: Id9e544a9afffcc7d019177cf29e51f32d1600504
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/secure_fw/spm/cmsis_func/include/tfm_irq_list.h b/secure_fw/spm/cmsis_func/include/tfm_irq_list.h
index fbe01ad..bb93979 100644
--- a/secure_fw/spm/cmsis_func/include/tfm_irq_list.h
+++ b/secure_fw/spm/cmsis_func/include/tfm_irq_list.h
@@ -11,13 +11,10 @@
#include "tfm_hal_device_header.h"
#include "psa/service.h"
-#define TFM_DEFAULT_SECURE_IRQ_PRIORITY 128
-
struct tfm_core_irq_signal_data_t {
int32_t partition_id;
psa_signal_t signal_value;
uint32_t irq_line;
- uint32_t irq_priority;
};
extern const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[];
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index 047207e..c9ef011 100644
--- a/secure_fw/spm/cmsis_func/main.c
+++ b/secure_fw/spm/cmsis_func/main.c
@@ -113,8 +113,7 @@
for (i = 0; i < tfm_core_irq_signals_count; ++i) {
plat_err = tfm_spm_hal_set_secure_irq_priority(
- tfm_core_irq_signals[i].irq_line,
- tfm_core_irq_signals[i].irq_priority);
+ tfm_core_irq_signals[i].irq_line);
if (plat_err != TFM_PLAT_ERR_SUCCESS) {
FIH_RET(fih_int_encode(TFM_ERROR_GENERIC));
}
diff --git a/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc.template b/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc.template
index 51945be..08a82ea 100644
--- a/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc.template
+++ b/secure_fw/spm/cmsis_func/tfm_secure_irq_handlers.inc.template
@@ -27,9 +27,8 @@
#endif /* {{partition.attr.conditional}} */
{% endif %}
{% endfor %}
-
-{% macro _irq_record(partition_name, signal, line, priority) -%}
-{ {{ partition_name }}, {{ signal }}, {{ line }}, {{ priority }} },
+{% macro _irq_record(partition_name, signal, line) -%}
+{ {{ partition_name }}, {{ signal }}, {{ line }} },
{%- endmacro %}
/* Definitions of the signals of the IRQs */
@@ -46,12 +45,7 @@
{% 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 %}
- {% else %}
- {% set irq_data.priority = "TFM_DEFAULT_SECURE_IRQ_PRIORITY" %}
- {% endif %}
- {{ _irq_record(partition.manifest.name, handler.signal, irq_data.line, irq_data.priority) }}
+ {{ _irq_record(partition.manifest.name, handler.signal, irq_data.line) }}
{% endfor %}
{% if partition.attr.conditional %}
#endif /* {{partition.attr.conditional}} */
diff --git a/secure_fw/spm/cmsis_psa/static_load.c b/secure_fw/spm/cmsis_psa/static_load.c
index 3563dbc..c178fe1 100644
--- a/secure_fw/spm/cmsis_psa/static_load.c
+++ b/secure_fw/spm/cmsis_psa/static_load.c
@@ -180,8 +180,7 @@
for (i = 0; i < p_ldinf->nirqs; i++) {
p_partition->signals_allowed |= p_irq_info[i].signal;
- if (tfm_spm_hal_set_secure_irq_priority(p_irq_info[i].source,
- TFM_DEFAULT_SECURE_IRQ_PRIOTITY)
+ if (tfm_spm_hal_set_secure_irq_priority(p_irq_info[i].source)
!= TFM_PLAT_ERR_SUCCESS) {
tfm_core_panic();
}
diff --git a/secure_fw/spm/include/load/irq_defs.h b/secure_fw/spm/include/load/irq_defs.h
index db0abec..1540d23 100644
--- a/secure_fw/spm/include/load/irq_defs.h
+++ b/secure_fw/spm/include/load/irq_defs.h
@@ -10,8 +10,6 @@
#include "psa/service.h"
-#define TFM_DEFAULT_SECURE_IRQ_PRIOTITY 128
-
struct irq_load_info_t {
uint32_t source; /* IRQ source (number/index) */
uint32_t flih_func; /* FLIH function - 0 if SLIH */