aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-06-08 16:59:38 -0500
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-09-02 11:54:08 -0500
commit9473007967d34fede067dcb55849e0901da44688 (patch)
treee131a3f937af72a759d1afa4ce73cb913b6d6fa8 /drivers
parentaaca1c848767e2bb7935887dca3d540bdc9e6d77 (diff)
downloadtf-a-tests-9473007967d34fede067dcb55849e0901da44688.tar.gz
Minor bug fixes in multicore IRQ spurious test
Program the memory mapped GIC_ITARGETSR register with appropriate cpu mask and assert the expected value is returned upon reading the register. Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com> Change-Id: I356111d763569c229d7f4c9ea3cd4899305a4954
Diffstat (limited to 'drivers')
-rw-r--r--drivers/arm/gic/gic_v2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/arm/gic/gic_v2.c b/drivers/arm/gic/gic_v2.c
index 7904ed12..ef930074 100644
--- a/drivers/arm/gic/gic_v2.c
+++ b/drivers/arm/gic/gic_v2.c
@@ -44,6 +44,11 @@ static unsigned int core_pos_to_gic_id(unsigned int core_pos)
/*******************************************************************************
* GIC Distributor interface accessors for reading entire registers
******************************************************************************/
+uint8_t gicd_read_itargetsr_byte(unsigned int base, unsigned int interrupt_id)
+{
+ return mmio_read_8(base + GICD_ITARGETSR + interrupt_id);
+}
+
unsigned int gicd_read_itargetsr(unsigned int base, unsigned int interrupt_id)
{
unsigned n = interrupt_id >> ITARGETSR_SHIFT;
@@ -266,12 +271,19 @@ void gicv2_set_itargetsr(unsigned int num, unsigned int core_pos)
gicd_set_itargetsr(gicd_base_addr, num, gic_cpu_id);
}
+uint8_t gicv2_read_itargetsr_value(unsigned int num)
+{
+ return gicd_read_itargetsr_byte(gicd_base_addr, num);
+}
+
void gicv2_set_itargetsr_value(unsigned int num, unsigned int val)
{
assert(gicd_base_addr);
assert(IS_SPI(num));
gicd_write_itargetsr_byte(gicd_base_addr, num, val);
+
+ assert(gicv2_read_itargetsr_value(num) == val);
}
unsigned int gicv2_gicd_get_isenabler(unsigned int num)