mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-16 03:41:24 +00:00
lib: utils/irqchip: Use kconfig for enabling/disabling drivers
We update irqchip drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate irqchip drivers for each platform. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
parent
76af9d40da
commit
0b1cf2f645
12 changed files with 83 additions and 11 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
#ifdef CONFIG_FDT_IRQCHIP
|
||||
|
||||
struct fdt_irqchip {
|
||||
const struct fdt_match *match_table;
|
||||
int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match);
|
||||
|
@ -23,4 +25,12 @@ void fdt_irqchip_exit(void);
|
|||
|
||||
int fdt_irqchip_init(bool cold_boot);
|
||||
|
||||
#else
|
||||
|
||||
static inline void fdt_irqchip_exit(void) { }
|
||||
|
||||
static inline int fdt_irqchip_init(bool cold_boot) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -33,6 +33,8 @@ struct imsic_data {
|
|||
struct imsic_regs regs[IMSIC_MAX_REGS];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_IRQCHIP_IMSIC
|
||||
|
||||
int imsic_map_hartid_to_data(u32 hartid, struct imsic_data *imsic, int file);
|
||||
|
||||
struct imsic_data *imsic_get_data(u32 hartid);
|
||||
|
@ -47,4 +49,12 @@ int imsic_data_check(struct imsic_data *imsic);
|
|||
|
||||
int imsic_cold_irqchip_init(struct imsic_data *imsic);
|
||||
|
||||
#else
|
||||
|
||||
static inline void imsic_local_irqchip_init(void) { }
|
||||
|
||||
static inline int imsic_data_check(struct imsic_data *imsic) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,8 @@ menu "Utils and Drivers Support"
|
|||
|
||||
source "$(OPENSBI_SRC_DIR)/lib/utils/ipi/Kconfig"
|
||||
|
||||
source "$(OPENSBI_SRC_DIR)/lib/utils/irqchip/Kconfig"
|
||||
|
||||
source "$(OPENSBI_SRC_DIR)/lib/utils/reset/Kconfig"
|
||||
|
||||
source "$(OPENSBI_SRC_DIR)/lib/utils/serial/Kconfig"
|
||||
|
|
40
lib/utils/irqchip/Kconfig
Normal file
40
lib/utils/irqchip/Kconfig
Normal file
|
@ -0,0 +1,40 @@
|
|||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
menu "Interrupt Controller Support"
|
||||
|
||||
config FDT_IRQCHIP
|
||||
bool "FDT based interrupt controller drivers"
|
||||
default n
|
||||
|
||||
if FDT_IRQCHIP
|
||||
|
||||
config FDT_IRQCHIP_APLIC
|
||||
bool "Advanced Platform Level Interrupt Controller (APLIC) FDT driver"
|
||||
select IRQCHIP_APLIC
|
||||
default n
|
||||
|
||||
config FDT_IRQCHIP_IMSIC
|
||||
bool "Incoming Message Signalled Interrupt Controller (IMSIC) FDT driver"
|
||||
select IRQCHIP_IMSIC
|
||||
default n
|
||||
|
||||
config FDT_IRQCHIP_PLIC
|
||||
bool "Platform Level Interrupt Controller (PLIC) FDT driver"
|
||||
select IRQCHIP_PLIC
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
config IRQCHIP_APLIC
|
||||
bool "Advanced Platform Level Interrupt Controller (APLIC) support"
|
||||
default n
|
||||
|
||||
config IRQCHIP_IMSIC
|
||||
bool "Incoming Message Signalled Interrupt Controller (IMSIC) support"
|
||||
default n
|
||||
|
||||
config IRQCHIP_PLIC
|
||||
bool "Platform Level Interrupt Controller (PLIC) support"
|
||||
default n
|
||||
|
||||
endmenu
|
|
@ -7,18 +7,18 @@
|
|||
# Anup Patel <anup.patel@wdc.com>
|
||||
#
|
||||
|
||||
libsbiutils-objs-y += irqchip/fdt_irqchip.o
|
||||
libsbiutils-objs-y += irqchip/fdt_irqchip_drivers.o
|
||||
libsbiutils-objs-$(CONFIG_FDT_IRQCHIP) += irqchip/fdt_irqchip.o
|
||||
libsbiutils-objs-$(CONFIG_FDT_IRQCHIP) += irqchip/fdt_irqchip_drivers.o
|
||||
|
||||
carray-fdt_irqchip_drivers-y += fdt_irqchip_aplic
|
||||
libsbiutils-objs-y += irqchip/fdt_irqchip_aplic.o
|
||||
carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_APLIC) += fdt_irqchip_aplic
|
||||
libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_APLIC) += irqchip/fdt_irqchip_aplic.o
|
||||
|
||||
carray-fdt_irqchip_drivers-y += fdt_irqchip_imsic
|
||||
libsbiutils-objs-y += irqchip/fdt_irqchip_imsic.o
|
||||
carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_IMSIC) += fdt_irqchip_imsic
|
||||
libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_IMSIC) += irqchip/fdt_irqchip_imsic.o
|
||||
|
||||
carray-fdt_irqchip_drivers-y += fdt_irqchip_plic
|
||||
libsbiutils-objs-y += irqchip/fdt_irqchip_plic.o
|
||||
carray-fdt_irqchip_drivers-$(CONFIG_FDT_IRQCHIP_PLIC) += fdt_irqchip_plic
|
||||
libsbiutils-objs-$(CONFIG_FDT_IRQCHIP_PLIC) += irqchip/fdt_irqchip_plic.o
|
||||
|
||||
libsbiutils-objs-y += irqchip/aplic.o
|
||||
libsbiutils-objs-y += irqchip/imsic.o
|
||||
libsbiutils-objs-y += irqchip/plic.o
|
||||
libsbiutils-objs-$(CONFIG_IRQCHIP_APLIC) += irqchip/aplic.o
|
||||
libsbiutils-objs-$(CONFIG_IRQCHIP_IMSIC) += irqchip/imsic.o
|
||||
libsbiutils-objs-$(CONFIG_IRQCHIP_PLIC) += irqchip/plic.o
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
|
||||
config PLATFORM_ANDES_AE350
|
||||
bool
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_UART8250
|
||||
default y
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config PLATFORM_ARIANE_FPGA
|
||||
bool
|
||||
select IPI_MSWI
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_UART8250
|
||||
select TIMER_MTIMER
|
||||
default y
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config PLATFORM_OPENPITON_FPGA
|
||||
bool
|
||||
select IPI_MSWI
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_UART8250
|
||||
select TIMER_MTIMER
|
||||
default y
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
CONFIG_FDT_IPI=y
|
||||
CONFIG_FDT_IPI_MSWI=y
|
||||
CONFIG_FDT_IRQCHIP=y
|
||||
CONFIG_FDT_IRQCHIP_APLIC=y
|
||||
CONFIG_FDT_IRQCHIP_IMSIC=y
|
||||
CONFIG_FDT_IRQCHIP_PLIC=y
|
||||
CONFIG_FDT_RESET=y
|
||||
CONFIG_FDT_RESET_GPIO=y
|
||||
CONFIG_FDT_RESET_HTIF=y
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config PLATFORM_KENDRYTE_K210
|
||||
bool
|
||||
select IPI_MSWI
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_SIFIVE
|
||||
select TIMER_MTIMER
|
||||
default y
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
config PLATFORM_NUCLEI_UX600
|
||||
bool
|
||||
select IPI_MSWI
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_SIFIVE
|
||||
select TIMER_MTIMER
|
||||
default y
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
config PLATFORM_TEMPLATE
|
||||
bool
|
||||
select IPI_MSWI
|
||||
select IRQCHIP_PLIC
|
||||
select SERIAL_UART8250
|
||||
select TIMER_MTIMER
|
||||
default y
|
||||
|
|
Loading…
Add table
Reference in a new issue