mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-10-09 01:52:18 +01:00
lib: utils/ipi: Convert IPI drivers as early drivers
The fdt_ipi_init() is already called from generic_early_init() so let's convert IPI drivers as early drivers. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Nick Hu <nick.hu@sifive.com> Link: https://lore.kernel.org/r/20250904052410.546818-4-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
|
||||
*
|
||||
* Authors:
|
||||
* Anup Patel <anup.patel@wdc.com>
|
||||
*/
|
||||
|
||||
#ifndef __FDT_IPI_H__
|
||||
#define __FDT_IPI_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
#include <sbi_utils/fdt/fdt_driver.h>
|
||||
|
||||
#ifdef CONFIG_FDT_IPI
|
||||
|
||||
int fdt_ipi_init(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline int fdt_ipi_init(void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
|
||||
*
|
||||
* Authors:
|
||||
* Anup Patel <anup.patel@wdc.com>
|
||||
*/
|
||||
|
||||
#include <sbi_utils/ipi/fdt_ipi.h>
|
||||
|
||||
/* List of FDT ipi drivers generated at compile time */
|
||||
extern const struct fdt_driver *const fdt_ipi_drivers[];
|
||||
|
||||
int fdt_ipi_init(void)
|
||||
{
|
||||
/*
|
||||
* On some single-hart system there is no need for IPIs,
|
||||
* so do not return a failure if no device is found.
|
||||
*/
|
||||
return fdt_driver_init_all(fdt_get_address(), fdt_ipi_drivers);
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
HEADER: sbi_utils/ipi/fdt_ipi.h
|
||||
TYPE: const struct fdt_driver
|
||||
NAME: fdt_ipi_drivers
|
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <sbi/sbi_error.h>
|
||||
#include <sbi/sbi_heap.h>
|
||||
#include <sbi_utils/fdt/fdt_driver.h>
|
||||
#include <sbi_utils/fdt/fdt_helper.h>
|
||||
#include <sbi_utils/ipi/fdt_ipi.h>
|
||||
#include <sbi_utils/ipi/aclint_mswi.h>
|
||||
|
||||
static int ipi_mswi_cold_init(const void *fdt, int nodeoff,
|
||||
|
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
|
||||
#include <sbi/riscv_io.h>
|
||||
#include <sbi_utils/fdt/fdt_driver.h>
|
||||
#include <sbi_utils/fdt/fdt_helper.h>
|
||||
#include <sbi_utils/ipi/fdt_ipi.h>
|
||||
#include <sbi_utils/ipi/andes_plicsw.h>
|
||||
|
||||
extern struct plicsw_data plicsw;
|
||||
|
@@ -10,11 +10,8 @@
|
||||
libsbiutils-objs-$(CONFIG_IPI_MSWI) += ipi/aclint_mswi.o
|
||||
libsbiutils-objs-$(CONFIG_IPI_PLICSW) += ipi/andes_plicsw.o
|
||||
|
||||
libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi.o
|
||||
libsbiutils-objs-$(CONFIG_FDT_IPI) += ipi/fdt_ipi_drivers.carray.o
|
||||
|
||||
carray-fdt_ipi_drivers-$(CONFIG_FDT_IPI_MSWI) += fdt_ipi_mswi
|
||||
carray-fdt_early_drivers-$(CONFIG_FDT_IPI_MSWI) += fdt_ipi_mswi
|
||||
libsbiutils-objs-$(CONFIG_FDT_IPI_MSWI) += ipi/fdt_ipi_mswi.o
|
||||
|
||||
carray-fdt_ipi_drivers-$(CONFIG_FDT_IPI_PLICSW) += fdt_ipi_plicsw
|
||||
carray-fdt_early_drivers-$(CONFIG_FDT_IPI_PLICSW) += fdt_ipi_plicsw
|
||||
libsbiutils-objs-$(CONFIG_FDT_IPI_PLICSW) += ipi/fdt_ipi_plicsw.o
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <sbi_utils/fdt/fdt_fixup.h>
|
||||
#include <sbi_utils/fdt/fdt_helper.h>
|
||||
#include <sbi_utils/fdt/fdt_pmu.h>
|
||||
#include <sbi_utils/ipi/fdt_ipi.h>
|
||||
#include <sbi_utils/irqchip/fdt_irqchip.h>
|
||||
#include <sbi_utils/irqchip/imsic.h>
|
||||
#include <sbi_utils/mpxy/fdt_mpxy.h>
|
||||
@@ -229,10 +228,6 @@ int generic_early_init(bool cold_boot)
|
||||
return rc;
|
||||
|
||||
fdt_driver_init_all(fdt, fdt_early_drivers);
|
||||
|
||||
rc = fdt_ipi_init();
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user