Build: Align Irq source to PSA FF 1.0
Replace IRQ line_num and line_name by source field
Change-Id: I382aba5d5c477b1057a9ee08d8f2be1c2c4d8df5
Signed-off-by: Jaykumar Pitambarbhai Patel <jaykumar.pitambarbhaipatel@arm.com>
diff --git a/docs/user_guides/tfm_secure_irq_handling.rst b/docs/user_guides/tfm_secure_irq_handling.rst
index 77993a3..d83ec81 100644
--- a/docs/user_guides/tfm_secure_irq_handling.rst
+++ b/docs/user_guides/tfm_secure_irq_handling.rst
@@ -26,11 +26,11 @@
"irqs": [
{
- "line_num": "5",
+ "source": "5",
"signal": "DUAL_TIMER"
},
{
- "line_name": "TFM_IRQ_LINE_TIMER_1",
+ "source": "TFM_IRQ_LINE_TIMER_1",
"signal": "TIMER_1"
"tfm_irq_priority": 64,
}
@@ -46,10 +46,9 @@
An IRQ handler is defined by the following nodes:
-- ``line_num``: The number of the IRQ.
-- ``line_name``: The name of the IRQ line. With the name of the IRQ line there
- must be defined a macro in ``tfm_peripherals_def.h`` which is substituted to
- the IRQ line num.
+- ``source``: The IRQ number or the name IRQ line. With the name of the IRQ
+ line, there must be defined a macro in ``tfm_peripherals_def.h`` which is
+ substituted to the IRQ line num.
- ``signal`` The name of the signal for this IRQ
- ``tfm_irq_priority``: The priority of the IRQ. This number must be in the
range [0-255] inclusive. Please note that some of the less significant bits of
@@ -61,27 +60,26 @@
The name of the privileged interrupt handler is derived from the node
specifying the IRQ line number.
- - In case ``line_num`` is provided, the name of the handler becomes
- ``void irq_<line_num>_Handler(void)``.
- - In case ``line_name`` is provided, the name of the handler becomes
- ``void <line_name>_Handler(void)``.
+ - In case ``source`` is IRQ number, the name of the handler becomes
+ ``void irq_<number>_Handler(void)``.
+ - In case ``source`` is defined IRQ macro, the name of the handler becomes
+ ``void <macro>_Handler(void)``.
This is important, because the derived name have to be present in the vector
table as the handler of the IRQ.
.. Note::
- ``signal`` is mandatory. Specifying the IRQ line is also mandatory, so exactly
- one of ``line_num`` and ``line_name`` must be defined.
+ ``signal`` and ``source`` are mandatory.
``tfm_irq_priority`` is optional. If ``tfm_irq_priority`` is not set for an
IRQ, the default is value is ``TFM_DEFAULT_SECURE_IRQ_PRIOTITY``.
If an IRQ handler is registered, TF-M will:
-- Set the IRQ with number ``line_num`` or ``line_name`` to target secure state
-- Set the priority of IRQ with number ``line_num`` or ``line_name`` to
- ``tfm_irq_priority`` or to the default.
+- Set the IRQ with number or macro to target secure state
+- Set the priority of IRQ with number or macro to ``tfm_irq_priority`` or to
+ the default.
TF-M configures the interrupt lines to be disabled by default. Interrupts for a
service can be enabled by the secure service by calling
@@ -93,11 +91,11 @@
*************
In Library model a function with the name derived from the value of the
-``line_num`` or ``line_name`` property is generated. This function will be put
-in the vector table by the linker (as the handlers in the startup assembly are
-defined as weak symbols). The code generated for this function will forward the
-call to the function with the name of the value of the ``signal`` property
-post-fixed with ``_isr``.
+``source`` property is generated. This function will be put in the vector table
+by the linker (as the handlers in the startup assembly are defined as weak
+symbols). The code generated for this function will forward the call to the
+function with the name of the value of the ``signal`` property post-fixed with
+``_isr``.
.. hint::
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
index c9c7cc8..18ad0cd 100644
--- a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
+++ b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc.template
@@ -24,12 +24,10 @@
{% endif %}
{% for handler in manifest.manifest.irqs %}
{% set irq_data = namespace() %}
- {% if handler.line_num %}
- {% set irq_data.line = handler.line_num %}
- {% elif handler.line_name %}
- {% set irq_data.line = handler.line_name %}
+ {% if handler.source %}
+ {% set irq_data.line = handler.source %}
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
{% if handler.tfm_irq_priority %}
{% set irq_data.priority = handler.tfm_irq_priority %}
@@ -55,24 +53,22 @@
#ifdef {{manifest.attr.conditional}}
{% endif %}
{% for handler in manifest.manifest.irqs %}
- {% if handler.line_num %}
-void irq_{{handler.line_num}}_Handler(void)
- {% elif handler.line_name %}
-void {{handler.line_name}}_Handler(void)
+ {% if handler.source is number %}
+void irq_{{handler.source}}_Handler(void)
+ {% elif handler.source %}
+void {{handler.source}}_Handler(void)
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
{
__disable_irq();
/* It is OK to call tfm_irq_handler directly from here, as we are already
* in handler mode, and we will not be pre-empted as we disabled interrupts
*/
- {% if handler.line_num %}
- tfm_irq_handler({{manifest.manifest.name}}_ID, {{handler.signal}}, {{handler.line_num}});
- {% elif handler.line_name %}
- tfm_irq_handler({{manifest.manifest.name}}_ID, {{handler.signal}}, {{handler.line_name}});
+ {% if handler.source %}
+ tfm_irq_handler({{manifest.manifest.name}}_ID, {{handler.signal}}, {{handler.source}});
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
__enable_irq();
}
diff --git a/secure_fw/core/tfm_secure_irq_handlers.inc.template b/secure_fw/core/tfm_secure_irq_handlers.inc.template
index 7dd2dcf..8633756 100644
--- a/secure_fw/core/tfm_secure_irq_handlers.inc.template
+++ b/secure_fw/core/tfm_secure_irq_handlers.inc.template
@@ -24,12 +24,10 @@
{% endif %}
{% for handler in manifest.manifest.irqs %}
{% set irq_data = namespace() %}
- {% if handler.line_num %}
- {% set irq_data.line = handler.line_num %}
- {% elif handler.line_name %}
- {% set irq_data.line = handler.line_name %}
+ {% if handler.source %}
+ {% set irq_data.line = handler.source %}
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
{% if handler.tfm_irq_priority %}
{% set irq_data.priority = handler.tfm_irq_priority %}
@@ -76,26 +74,21 @@
#ifdef {{manifest.attr.conditional}}
{% endif %}
{% for handler in manifest.manifest.irqs %}
- {% if handler.line_num %}
-void irq_{{handler.line_num}}_Handler(void)
- {% elif handler.line_name %}
-void {{handler.line_name}}_Handler(void)
+ {% if handler.source is number %}
+void irq_{{handler.source}}_Handler(void)
+ {% elif handler.source %}
+void {{handler.source}}_Handler(void)
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
{
- {% if handler.line_num %}
+ {% if handler.source %}
priv_irq_handler_main({{manifest.manifest.name}}_ID,
(uint32_t){{handler.signal}}_isr,
{{handler.signal}},
- {{handler.line_num}});
- {% elif handler.line_name %}
- priv_irq_handler_main({{manifest.manifest.name}}_ID,
- (uint32_t){{handler.signal}}_isr,
- {{handler.signal}},
- {{handler.line_name}});
+ {{handler.source}});
{% else %}
-#error "Neither line_num nor line_name is provided for 'irqs' in partition {{manifest.manifest.name}}"
+#error "Interrupt source isn't provided for 'irqs' in partition {{manifest.manifest.name}}"
{% endif %}
}
diff --git a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.yaml b/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.yaml
index c50c747..0ba3873 100644
--- a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.yaml
+++ b/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.yaml
@@ -37,7 +37,7 @@
],
"irqs": [
{
- "line_name": "TFM_TIMER0_IRQ",
+ "source": "TFM_TIMER0_IRQ",
"signal": "SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ",
"tfm_irq_priority": 64,
}