summaryrefslogtreecommitdiff
path: root/plat
diff options
context:
space:
mode:
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-09-22 08:32:09 +0100
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-10-16 16:50:02 +0100
commit8db978b5a8606a658c65b16fab7edd7a17c7c940 (patch)
treebfef9510b0bbb1f8560a45a7ef760217d49ddab4 /plat
parent74dce7fa6e42cab3aa54a9543e4a546c1450b2ae (diff)
GIC: Add API to raise secure SGI
API documentation updated. Change-Id: I129725059299af6cc612bafa8d74817f779d7c4f Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'plat')
-rw-r--r--plat/common/plat_gicv2.c20
-rw-r--r--plat/common/plat_gicv3.c12
2 files changed, 32 insertions, 0 deletions
diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c
index c785d831..5df9c79b 100644
--- a/plat/common/plat_gicv2.c
+++ b/plat/common/plat_gicv2.c
@@ -7,6 +7,7 @@
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_mgmt.h>
+#include <platform.h>
/*
* The following platform GIC functions are weakly defined. They
@@ -29,6 +30,7 @@
#pragma weak plat_ic_disable_interrupt
#pragma weak plat_ic_set_interrupt_priority
#pragma weak plat_ic_set_interrupt_type
+#pragma weak plat_ic_raise_el3_sgi
/*
* This function returns the highest priority pending interrupt at
@@ -220,3 +222,21 @@ void plat_ic_set_interrupt_type(unsigned int id, unsigned int type)
gicv2_set_interrupt_type(id, gicv2_type);
}
+
+void plat_ic_raise_el3_sgi(int sgi_num, u_register_t target)
+{
+#if GICV2_G0_FOR_EL3
+ int id;
+
+ /* Target must be a valid MPIDR in the system */
+ id = plat_core_pos_by_mpidr(target);
+ assert(id >= 0);
+
+ /* Verify that this is a secure SGI */
+ assert(plat_ic_get_interrupt_type(sgi_num) == INTR_TYPE_EL3);
+
+ gicv2_raise_sgi(sgi_num, id);
+#else
+ assert(0);
+#endif
+}
diff --git a/plat/common/plat_gicv3.c b/plat/common/plat_gicv3.c
index f4279ec4..819ca451 100644
--- a/plat/common/plat_gicv3.c
+++ b/plat/common/plat_gicv3.c
@@ -35,6 +35,7 @@
#pragma weak plat_ic_disable_interrupt
#pragma weak plat_ic_set_interrupt_priority
#pragma weak plat_ic_set_interrupt_type
+#pragma weak plat_ic_raise_el3_sgi
CASSERT((INTR_TYPE_S_EL1 == INTR_GROUP1S) &&
(INTR_TYPE_NS == INTR_GROUP1NS) &&
@@ -217,6 +218,17 @@ void plat_ic_set_interrupt_type(unsigned int id, unsigned int type)
{
gicv3_set_interrupt_type(id, plat_my_core_pos(), type);
}
+
+void plat_ic_raise_el3_sgi(int sgi_num, u_register_t target)
+{
+ /* Target must be a valid MPIDR in the system */
+ assert(plat_core_pos_by_mpidr(target) >= 0);
+
+ /* Verify that this is a secure EL3 SGI */
+ assert(plat_ic_get_interrupt_type(sgi_num) == INTR_TYPE_EL3);
+
+ gicv3_raise_secure_g0_sgi(sgi_num, target);
+}
#endif
#ifdef IMAGE_BL32