summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2025-09-04 10:54:08 +0530
committerAnup Patel <[email protected]>2025-09-16 09:56:31 +0530
commitee92afa63892cd6c536b623570d8ddde14760c0b (patch)
treec1eef4d7e6cdeeb80a842fb0cb9b05f3673af7a5 /include
parent17b8d1900d56df1e14edd8829acf22686fa08eac (diff)
lib: sbi: Introduce IPI device rating
A platform can have multiple IPI devices (such as ACLINT MSWI, AIA IMSIC, etc). Currently, OpenSBI rely on platform calling the sbi_ipi_set_device() function in correct order and prefer the first avaiable IPI device which is fragile. Instead of the above, introduce IPI device rating and prefer the highest rated IPI device. This further allows extending the sbi_ipi_raw_clear() to clear all available IPI devices. Signed-off-by: Anup Patel <[email protected]> Tested-by: Nick Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_ipi.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/sbi/sbi_ipi.h b/include/sbi/sbi_ipi.h
index 62d61304..26d1b66b 100644
--- a/include/sbi/sbi_ipi.h
+++ b/include/sbi/sbi_ipi.h
@@ -23,6 +23,9 @@ struct sbi_ipi_device {
/** Name of the IPI device */
char name[32];
+ /** Ratings of the IPI device (higher is better) */
+ unsigned long rating;
+
/** Send IPI to a target HART index */
void (*ipi_send)(u32 hart_index);
@@ -87,11 +90,11 @@ void sbi_ipi_process(void);
int sbi_ipi_raw_send(u32 hartindex);
-void sbi_ipi_raw_clear(void);
+void sbi_ipi_raw_clear(bool all_devices);
const struct sbi_ipi_device *sbi_ipi_get_device(void);
-void sbi_ipi_set_device(const struct sbi_ipi_device *dev);
+void sbi_ipi_add_device(const struct sbi_ipi_device *dev);
int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot);