summaryrefslogtreecommitdiff
path: root/plat/common/sys
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2018-12-16 11:21:16 +0300
committerAnup Patel <anup@brainfault.org>2018-12-16 11:21:16 +0300
commit8a4088c3af85f6515c9b3e371bc6c1fae2a7e9dc (patch)
tree15d3ff4e4905693b2ef8164bb41309217a50bb12 /plat/common/sys
parent385b5afe7d5e8d5d552637973955155862de2a79 (diff)
downloadopensbi-8a4088c3af85f6515c9b3e371bc6c1fae2a7e9dc.tar.xz
plat: clint: Reduce use of atomic operation on IPI registers
Currently, we aggresively use atomic operation on CLINT IPI register. This patch simplify CLINT IPI APIs by reducing use of atomic operations. In future, we will gradually increase use of atomic operations for CLINT IPI APIs. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'plat/common/sys')
-rw-r--r--plat/common/sys/clint.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/plat/common/sys/clint.c b/plat/common/sys/clint.c
index b6c6e9b..e84c382 100644
--- a/plat/common/sys/clint.c
+++ b/plat/common/sys/clint.c
@@ -22,8 +22,7 @@ void clint_ipi_inject(u32 target_hart, u32 source_hart)
return;
/* Set CLINT IPI */
- __io_bw();
- atomic_raw_xchg_uint(&clint_ipi[target_hart], 1);
+ writel(1, &clint_ipi[target_hart]);
}
void clint_ipi_sync(u32 target_hart, u32 source_hart)
@@ -41,15 +40,12 @@ void clint_ipi_sync(u32 target_hart, u32 source_hart)
if (!target_ipi)
break;
- __io_bw();
incoming_ipi |=
atomic_raw_xchg_uint(&clint_ipi[source_hart], 0);
}
- if (incoming_ipi) {
- __io_bw();
- atomic_raw_xchg_uint(&clint_ipi[source_hart], incoming_ipi);
- }
+ if (incoming_ipi)
+ writel(incoming_ipi, &clint_ipi[source_hart]);
}
void clint_ipi_clear(u32 target_hart)
@@ -58,8 +54,7 @@ void clint_ipi_clear(u32 target_hart)
return;
/* Clear CLINT IPI */
- __io_bw();
- atomic_raw_xchg_uint(&clint_ipi[target_hart], 0);
+ writel(0, &clint_ipi[target_hart]);
}
int clint_warm_ipi_init(u32 target_hart)