diff options
| author | Samuel Holland <[email protected]> | 2024-10-25 11:59:48 -0700 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-11-11 18:21:04 +0530 |
| commit | 86d2c1797a44975e628bcf77e30e687fd6738e81 (patch) | |
| tree | 655d5be8fb89fadf22932bea881cd4c8f617d7dd /lib | |
| parent | 693afc818feecdbddb75f5c9ec4b436d56f64208 (diff) | |
platform: Drop IPI warm init and exit hooks
Now that the SBI IPI core clears IPIs at warm boot in a generic way,
none of the drivers or platforms use these hooks, and we can remove
them. Platforms need only to initialize the driver once during cold
init. If other hooks are needed in the future, they can be added to
struct sbi_ipi_device.
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi/sbi_ipi.c | 13 | ||||
| -rw-r--r-- | lib/utils/ipi/fdt_ipi.c | 31 | ||||
| -rw-r--r-- | lib/utils/ipi/fdt_ipi_mswi.c | 2 | ||||
| -rw-r--r-- | lib/utils/ipi/fdt_ipi_plicsw.c | 2 |
4 files changed, 6 insertions, 42 deletions
diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c index b39f03e0..52898d30 100644 --- a/lib/sbi/sbi_ipi.c +++ b/lib/sbi/sbi_ipi.c @@ -321,6 +321,11 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) if (ret < 0) return ret; ipi_halt_event = ret; + + /* Initialize platform IPI support */ + ret = sbi_platform_ipi_init(sbi_platform_ptr(scratch)); + if (ret) + return ret; } else { if (!ipi_data_off) return SBI_ENOMEM; @@ -332,11 +337,6 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot) ipi_data = sbi_scratch_offset_ptr(scratch, ipi_data_off); ipi_data->ipi_type = 0x00; - /* Initialize platform IPI support */ - ret = sbi_platform_ipi_init(sbi_platform_ptr(scratch), cold_boot); - if (ret) - return ret; - /* Clear any pending IPIs for the current hart */ sbi_ipi_raw_clear(); @@ -353,7 +353,4 @@ void sbi_ipi_exit(struct sbi_scratch *scratch) /* Process pending IPIs */ sbi_ipi_process(); - - /* Platform exit */ - sbi_platform_ipi_exit(sbi_platform_ptr(scratch)); } diff --git a/lib/utils/ipi/fdt_ipi.c b/lib/utils/ipi/fdt_ipi.c index 959cf57d..c2ff9cfa 100644 --- a/lib/utils/ipi/fdt_ipi.c +++ b/lib/utils/ipi/fdt_ipi.c @@ -16,22 +16,7 @@ extern struct fdt_ipi *fdt_ipi_drivers[]; extern unsigned long fdt_ipi_drivers_size; -static struct fdt_ipi *current_driver = NULL; - -void fdt_ipi_exit(void) -{ - if (current_driver && current_driver->exit) - current_driver->exit(); -} - -static int fdt_ipi_warm_init(void) -{ - if (current_driver && current_driver->warm_init) - return current_driver->warm_init(); - return 0; -} - -static int fdt_ipi_cold_init(void) +int fdt_ipi_init(void) { int pos, noff, rc; struct fdt_ipi *drv; @@ -56,7 +41,6 @@ static int fdt_ipi_cold_init(void) continue; if (rc) return rc; - current_driver = drv; /* * We will have multiple IPI devices on multi-die or @@ -71,16 +55,3 @@ static int fdt_ipi_cold_init(void) */ return 0; } - -int fdt_ipi_init(bool cold_boot) -{ - int rc; - - if (cold_boot) { - rc = fdt_ipi_cold_init(); - if (rc) - return rc; - } - - return fdt_ipi_warm_init(); -} diff --git a/lib/utils/ipi/fdt_ipi_mswi.c b/lib/utils/ipi/fdt_ipi_mswi.c index 01331970..c58d7722 100644 --- a/lib/utils/ipi/fdt_ipi_mswi.c +++ b/lib/utils/ipi/fdt_ipi_mswi.c @@ -64,6 +64,4 @@ static const struct fdt_match ipi_mswi_match[] = { struct fdt_ipi fdt_ipi_mswi = { .match_table = ipi_mswi_match, .cold_init = ipi_mswi_cold_init, - .warm_init = NULL, - .exit = NULL, }; diff --git a/lib/utils/ipi/fdt_ipi_plicsw.c b/lib/utils/ipi/fdt_ipi_plicsw.c index 1fd6ba1d..a178db1b 100644 --- a/lib/utils/ipi/fdt_ipi_plicsw.c +++ b/lib/utils/ipi/fdt_ipi_plicsw.c @@ -42,6 +42,4 @@ static const struct fdt_match ipi_plicsw_match[] = { struct fdt_ipi fdt_ipi_plicsw = { .match_table = ipi_plicsw_match, .cold_init = fdt_plicsw_cold_ipi_init, - .warm_init = NULL, - .exit = NULL, }; |
