diff options
author | Sandeep Tripathy <sandeep.tripathy@broadcom.com> | 2020-06-05 22:04:21 +0530 |
---|---|---|
committer | Sandeep Tripathy <sandeep.tripathy@broadcom.com> | 2020-06-22 16:08:35 +0530 |
commit | 5eb16c4717ac08de7c627cb1ee47c3269f0ec363 (patch) | |
tree | f0881455450d68e705244408e423ee886699724c /drivers/arm | |
parent | 71c074c55291e38958ddcf5160dec0447f8fec73 (diff) | |
download | arm-trusted-firmware-5eb16c4717ac08de7c627cb1ee47c3269f0ec363.tar.gz |
TF-A GIC driver: Add barrier before eoi
It is desired to have the peripheral writes completed to clear the
interrupt condition and de-assert the interrupt request to GIC before
EOI write. Failing which spurious interrupt will occurred.
A barrier is needed to ensure peripheral register write transfers are
complete before EOI is done.
GICv2 memory mapped DEVICE nGnR(n)E writes are ordered from core point
of view. However these writes may pass over different interconnects,
bridges, buffers leaving some rare chances for the actual write to
complete out of order.
GICv3 ICC EOI system register writes have no ordering against nGnR(n)E
memory writes as they are over different interfaces.
Hence a dsb can ensure from core no writes are issued before the previous
writes are *complete*.
Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
Change-Id: Ie6362009e2f91955be99dca8ece14ade7b4811d6
Diffstat (limited to 'drivers/arm')
-rw-r--r-- | drivers/arm/gic/v2/gicv2_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/arm/gic/v2/gicv2_main.c b/drivers/arm/gic/v2/gicv2_main.c index c5bced00d..4b21b920a 100644 --- a/drivers/arm/gic/v2/gicv2_main.c +++ b/drivers/arm/gic/v2/gicv2_main.c @@ -247,6 +247,15 @@ void gicv2_end_of_interrupt(unsigned int id) assert(driver_data != NULL); assert(driver_data->gicc_base != 0U); + /* + * Ensure the write to peripheral registers are *complete* before the write + * to GIC_EOIR. + * + * Note: The completion gurantee depends on various factors of system design + * and the barrier is the best core can do by which execution of further + * instructions waits till the barrier is alive. + */ + dsbishst(); gicc_write_EOIR(driver_data->gicc_base, id); } |