[PATCH 2/3] include: sbi: Remove platform specific IPI init
Anup Patel
apatel at ventanamicro.com
Tue Sep 2 23:50:38 PDT 2025
On Wed, Sep 3, 2025 at 5:14 AM Samuel Holland <samuel.holland at sifive.com> wrote:
>
> Hi Anup,
>
> On 2025-09-02 7:17 AM, Anup Patel wrote:
> > The platform specfic IPI init is not need anymore because using
> > IPI device rating multiple IPI devices can be registered in any
> > order as part of the platform specific early init.
> >
> > Signed-off-by: Anup Patel <apatel at ventanamicro.com>
> > ---
> > include/sbi/sbi_platform.h | 17 -----------------
> > lib/sbi/sbi_ipi.c | 5 -----
> > platform/fpga/ariane/platform.c | 15 ++++++---------
> > platform/generic/openhwgroup/openpiton.c | 13 ++++---------
> > platform/generic/platform.c | 5 ++++-
> > platform/kendryte/k210/platform.c | 13 ++++++-------
> > platform/nuclei/ux600/platform.c | 11 +++++------
> > platform/template/platform.c | 16 ++++++----------
> > 8 files changed, 31 insertions(+), 64 deletions(-)
> >
> > diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
> > index c6d30080..d75c12de 100644
> > --- a/include/sbi/sbi_platform.h
> > +++ b/include/sbi/sbi_platform.h
> > @@ -116,9 +116,6 @@ struct sbi_platform_operations {
> > /** Initialize the platform interrupt controller during cold boot */
> > int (*irqchip_init)(void);
> >
> > - /** Initialize IPI during cold boot */
> > - int (*ipi_init)(void);
> > -
> > /** Get tlb flush limit value **/
> > u64 (*get_tlbr_flush_limit)(void);
> >
> > @@ -528,20 +525,6 @@ static inline int sbi_platform_irqchip_init(const struct sbi_platform *plat)
> > return 0;
> > }
> >
> > -/**
> > - * Initialize the platform IPI support during cold boot
> > - *
> > - * @param plat pointer to struct sbi_platform
> > - *
> > - * @return 0 on success and negative error code on failure
> > - */
> > -static inline int sbi_platform_ipi_init(const struct sbi_platform *plat)
> > -{
> > - if (plat && sbi_platform_ops(plat)->ipi_init)
> > - return sbi_platform_ops(plat)->ipi_init();
> > - return 0;
> > -}
> > -
> > /**
> > * Initialize the platform timer during cold boot
> > *
> > diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c
> > index b57ec652..c9f5d1d1 100644
> > --- a/lib/sbi/sbi_ipi.c
> > +++ b/lib/sbi/sbi_ipi.c
> > @@ -342,11 +342,6 @@ 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;
> > diff --git a/platform/fpga/ariane/platform.c b/platform/fpga/ariane/platform.c
> > index 4bc1c5be..4ca9ca94 100644
> > --- a/platform/fpga/ariane/platform.c
> > +++ b/platform/fpga/ariane/platform.c
> > @@ -71,9 +71,15 @@ static struct aclint_mtimer_data mtimer = {
> > */
> > static int ariane_early_init(bool cold_boot)
> > {
> > + int rc;
> > +
> > if (!cold_boot)
> > return 0;
> >
> > + rc = aclint_mswi_cold_init(&mswi);
> > + if (rc)
> > + return rc;
> > +
> > return uart8250_init(ARIANE_UART_ADDR,
> > ARIANE_UART_FREQ,
> > ARIANE_UART_BAUDRATE,
>
> I would recommend to keep the serial device initialization first in these
> functions to help with any future debugging.
>
Sure, I will update in v2.
Regards,
Anup
More information about the opensbi
mailing list