aboutsummaryrefslogtreecommitdiff
path: root/include/sbi/sbi_ipi.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-04-22 10:27:15 +0530
committerAnup Patel <anup@brainfault.org>2021-04-28 17:03:31 +0530
commitdc39c7b630a607b96c25f8ea50f0bb1af619928a (patch)
treef0c1d9ae8c5a68cc38e4ffba772f50f43111e715 /include/sbi/sbi_ipi.h
parent559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4 (diff)
lib: sbi: Simplify ipi platform operations
Instead of having ipi_send() and ipi_clear() callbacks in platform operations, it will be much simpler for ipi driver to directly register these operations as a device to sbi_ipi implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'include/sbi/sbi_ipi.h')
-rw-r--r--include/sbi/sbi_ipi.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/sbi/sbi_ipi.h b/include/sbi/sbi_ipi.h
index 617872c..fb7d658 100644
--- a/include/sbi/sbi_ipi.h
+++ b/include/sbi/sbi_ipi.h
@@ -18,6 +18,18 @@
/* clang-format on */
+/** IPI hardware device */
+struct sbi_ipi_device {
+ /** Name of the IPI device */
+ char name[32];
+
+ /** Send IPI to a target HART */
+ void (*ipi_send)(u32 target_hart);
+
+ /** Clear IPI for a target HART */
+ void (*ipi_clear)(u32 target_hart);
+};
+
struct sbi_scratch;
/** IPI event operations or callbacks */
@@ -63,6 +75,12 @@ int sbi_ipi_send_halt(ulong hmask, ulong hbase);
void sbi_ipi_process(void);
+void sbi_ipi_raw_send(u32 target_hart);
+
+const struct sbi_ipi_device *sbi_ipi_get_device(void);
+
+void sbi_ipi_set_device(const struct sbi_ipi_device *dev);
+
int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot);
void sbi_ipi_exit(struct sbi_scratch *scratch);