aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranzhou <anzhou@nvidia.com>2021-11-18 19:18:13 +0800
committerVarun Wadekar <vwadekar@nvidia.com>2021-11-18 13:36:50 +0200
commit7f322f228e76caa5480f827af0aa6751f00fc1c4 (patch)
tree7a4e9995f6a3a02585caeef02f2a162e7452fa96
parentc0db39cefc094fffa138e81a7499f2fb030de2fd (diff)
downloadarm-trusted-firmware-7f322f228e76caa5480f827af0aa6751f00fc1c4.tar.gz
fix(drivers/gic600ae_fmu): fix timeout calculation
The previous codes were using the cntpct_el0 to check the time elapsed. But this physical timer does not seem to count for the expected time resulting in gic fmu communication failures on Tegra platforms. This patch uses the delay_timer instead to use a platform defined timer for calculating timeouts. Change-Id: Ic8646ad1662c9928ac64c4152deb27e8c86fe344 Signed-off-by: Anthony Zhou <anzhou@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
-rw-r--r--drivers/arm/gic/v3/gic600ae_fmu_helpers.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/arm/gic/v3/gic600ae_fmu_helpers.c b/drivers/arm/gic/v3/gic600ae_fmu_helpers.c
index 84f72925c..4aa0efb32 100644
--- a/drivers/arm/gic/v3/gic600ae_fmu_helpers.c
+++ b/drivers/arm/gic/v3/gic600ae_fmu_helpers.c
@@ -46,17 +46,20 @@
/* Helper function to wait until FMU is ready to accept the next command */
static void wait_until_fmu_is_idle(uintptr_t base)
{
- uint64_t timeout_ref = timeout_init_us(GICFMU_IDLE_TIMEOUT_US);
+ uint32_t timeout_count = GICFMU_IDLE_TIMEOUT_US;
uint64_t status;
/* wait until status is 'busy' */
do {
status = (gic_fmu_read_status(base) & BIT(0));
- if (timeout_elapsed(timeout_ref)) {
+ if (timeout_count-- == 0U) {
ERROR("GIC600 AE FMU is not responding\n");
panic();
}
+
+ udelay(1U);
+
} while (status == U(0));
}