diff options
author | Jeenu Viswambharan <jeenu.viswambharan@arm.com> | 2017-09-22 08:32:09 +0100 |
---|---|---|
committer | Jeenu Viswambharan <jeenu.viswambharan@arm.com> | 2017-10-16 16:50:02 +0100 |
commit | fc529fee720de5fef8388c52bfefcb807ac764b0 (patch) | |
tree | 01378c294cf169c5fdf84e3bcab1295ce0bb4068 /plat/common/plat_gicv3.c | |
parent | 8db978b5a8606a658c65b16fab7edd7a17c7c940 (diff) | |
download | arm-trusted-firmware-fc529fee720de5fef8388c52bfefcb807ac764b0.tar.gz |
GIC: Add API to set interrupt routing
SPIs can be routed to either a specific PE, or to any one of all
available PEs.
API documentation updated.
Change-Id: I28675f634568aaf4ea1aa8aa7ebf25b419a963ed
Co-authored-by: Yousuf A <yousuf.sait@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'plat/common/plat_gicv3.c')
-rw-r--r-- | plat/common/plat_gicv3.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plat/common/plat_gicv3.c b/plat/common/plat_gicv3.c index 819ca4513..7b3ea337e 100644 --- a/plat/common/plat_gicv3.c +++ b/plat/common/plat_gicv3.c @@ -36,6 +36,7 @@ #pragma weak plat_ic_set_interrupt_priority #pragma weak plat_ic_set_interrupt_type #pragma weak plat_ic_raise_el3_sgi +#pragma weak plat_ic_set_spi_routing CASSERT((INTR_TYPE_S_EL1 == INTR_GROUP1S) && (INTR_TYPE_NS == INTR_GROUP1NS) && @@ -229,6 +230,26 @@ void plat_ic_raise_el3_sgi(int sgi_num, u_register_t target) gicv3_raise_secure_g0_sgi(sgi_num, target); } + +void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode, + u_register_t mpidr) +{ + unsigned int irm = 0; + + switch (routing_mode) { + case INTR_ROUTING_MODE_PE: + assert(plat_core_pos_by_mpidr(mpidr) >= 0); + irm = GICV3_IRM_PE; + break; + case INTR_ROUTING_MODE_ANY: + irm = GICV3_IRM_ANY; + break; + default: + assert(0); + } + + gicv3_set_spi_routing(id, irm, mpidr); +} #endif #ifdef IMAGE_BL32 |