diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-04-22 10:27:15 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-04-28 17:03:31 +0530 |
commit | dc39c7b630a607b96c25f8ea50f0bb1af619928a (patch) | |
tree | f0c1d9ae8c5a68cc38e4ffba772f50f43111e715 /platform | |
parent | 559a8f1d3be3210d4903c0db54c2d36e2f8d6ad4 (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 'platform')
-rw-r--r-- | platform/andes/ae350/platform.c | 11 | ||||
-rw-r--r-- | platform/fpga/ariane/platform.c | 2 | ||||
-rw-r--r-- | platform/fpga/openpiton/platform.c | 2 | ||||
-rw-r--r-- | platform/generic/platform.c | 2 | ||||
-rw-r--r-- | platform/kendryte/k210/platform.c | 2 | ||||
-rw-r--r-- | platform/nuclei/ux600/platform.c | 2 | ||||
-rw-r--r-- | platform/sifive/fu540/platform.c | 2 | ||||
-rw-r--r-- | platform/template/platform.c | 20 |
8 files changed, 9 insertions, 34 deletions
diff --git a/platform/andes/ae350/platform.c b/platform/andes/ae350/platform.c index 17a4e48..ae4ef71 100644 --- a/platform/andes/ae350/platform.c +++ b/platform/andes/ae350/platform.c @@ -12,6 +12,7 @@ #include <sbi/riscv_encoding.h> #include <sbi/sbi_console.h> #include <sbi/sbi_const.h> +#include <sbi/sbi_ipi.h> #include <sbi/sbi_platform.h> #include <sbi/sbi_trap.h> #include <sbi_utils/fdt/fdt_fixup.h> @@ -85,6 +86,12 @@ static int ae350_irqchip_init(bool cold_boot) return plic_warm_irqchip_init(&plic, 2 * hartid, 2 * hartid + 1); } +static struct sbi_ipi_device plicsw_ipi = { + .name = "ae350_plicsw", + .ipi_send = plicsw_ipi_send, + .ipi_clear = plicsw_ipi_clear +}; + /* Initialize IPI for current HART. */ static int ae350_ipi_init(bool cold_boot) { @@ -95,6 +102,8 @@ static int ae350_ipi_init(bool cold_boot) AE350_HART_COUNT); if (ret) return ret; + + sbi_ipi_set_device(&plicsw_ipi); } return plicsw_warm_ipi_init(); @@ -168,8 +177,6 @@ const struct sbi_platform_operations platform_ops = { .irqchip_init = ae350_irqchip_init, .ipi_init = ae350_ipi_init, - .ipi_send = plicsw_ipi_send, - .ipi_clear = plicsw_ipi_clear, .timer_init = ae350_timer_init, diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c index 73c8b9c..42e43fa 100644 --- a/platform/fpga/ariane/platform.c +++ b/platform/fpga/ariane/platform.c @@ -156,8 +156,6 @@ const struct sbi_platform_operations platform_ops = { .console_init = ariane_console_init, .irqchip_init = ariane_irqchip_init, .ipi_init = ariane_ipi_init, - .ipi_send = clint_ipi_send, - .ipi_clear = clint_ipi_clear, .timer_init = ariane_timer_init, }; diff --git a/platform/fpga/openpiton/platform.c b/platform/fpga/openpiton/platform.c index 4d876c9..894bfdc 100644 --- a/platform/fpga/openpiton/platform.c +++ b/platform/fpga/openpiton/platform.c @@ -182,8 +182,6 @@ const struct sbi_platform_operations platform_ops = { .console_init = openpiton_console_init, .irqchip_init = openpiton_irqchip_init, .ipi_init = openpiton_ipi_init, - .ipi_send = clint_ipi_send, - .ipi_clear = clint_ipi_clear, .timer_init = openpiton_timer_init, }; diff --git a/platform/generic/platform.c b/platform/generic/platform.c index cf18a1b..4ae8b88 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -213,8 +213,6 @@ const struct sbi_platform_operations platform_ops = { .console_init = fdt_serial_init, .irqchip_init = fdt_irqchip_init, .irqchip_exit = fdt_irqchip_exit, - .ipi_send = fdt_ipi_send, - .ipi_clear = fdt_ipi_clear, .ipi_init = fdt_ipi_init, .ipi_exit = fdt_ipi_exit, .get_tlbr_flush_limit = generic_tlbr_flush_limit, diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c index c8fd45e..4b89939 100644 --- a/platform/kendryte/k210/platform.c +++ b/platform/kendryte/k210/platform.c @@ -153,8 +153,6 @@ const struct sbi_platform_operations platform_ops = { .irqchip_init = k210_irqchip_init, .ipi_init = k210_ipi_init, - .ipi_send = clint_ipi_send, - .ipi_clear = clint_ipi_clear, .system_reset_check = k210_system_reset_check, .system_reset = k210_system_reset, diff --git a/platform/nuclei/ux600/platform.c b/platform/nuclei/ux600/platform.c index 86130c8..ac81d03 100644 --- a/platform/nuclei/ux600/platform.c +++ b/platform/nuclei/ux600/platform.c @@ -204,8 +204,6 @@ const struct sbi_platform_operations platform_ops = { .final_init = ux600_final_init, .console_init = ux600_console_init, .irqchip_init = ux600_irqchip_init, - .ipi_send = clint_ipi_send, - .ipi_clear = clint_ipi_clear, .ipi_init = ux600_ipi_init, .timer_init = ux600_timer_init, .system_reset_check = ux600_system_reset_check, diff --git a/platform/sifive/fu540/platform.c b/platform/sifive/fu540/platform.c index 78de30d..a17034d 100644 --- a/platform/sifive/fu540/platform.c +++ b/platform/sifive/fu540/platform.c @@ -158,8 +158,6 @@ const struct sbi_platform_operations platform_ops = { .final_init = fu540_final_init, .console_init = fu540_console_init, .irqchip_init = fu540_irqchip_init, - .ipi_send = clint_ipi_send, - .ipi_clear = clint_ipi_clear, .ipi_init = fu540_ipi_init, .get_tlbr_flush_limit = fu540_get_tlbr_flush_limit, .timer_init = fu540_timer_init, diff --git a/platform/template/platform.c b/platform/template/platform.c index 1691652..04334b2 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -99,24 +99,6 @@ static int platform_ipi_init(bool cold_boot) } /* - * Send IPI to a target HART - */ -static void platform_ipi_send(u32 target_hart) -{ - /* Example if the generic CLINT driver is used */ - clint_ipi_send(target_hart); -} - -/* - * Clear IPI for a target HART. - */ -static void platform_ipi_clear(u32 target_hart) -{ - /* Example if the generic CLINT driver is used */ - clint_ipi_clear(target_hart); -} - -/* * Initialize platform timer for current HART. */ static int platform_timer_init(bool cold_boot) @@ -156,8 +138,6 @@ const struct sbi_platform_operations platform_ops = { .final_init = platform_final_init, .console_init = platform_console_init, .irqchip_init = platform_irqchip_init, - .ipi_send = platform_ipi_send, - .ipi_clear = platform_ipi_clear, .ipi_init = platform_ipi_init, .timer_init = platform_timer_init, .system_reset_check = platform_system_reset_check, |