mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-29 09:38:43 +00:00
lib: utils/timer: Use kconfig for enabling/disabling drivers
We update timer drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate timer 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
3e76a607b5
commit
013dbb3a60
10 changed files with 45 additions and 5 deletions
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
#include <sbi/sbi_types.h>
|
#include <sbi/sbi_types.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_FDT_TIMER
|
||||||
|
|
||||||
struct fdt_timer {
|
struct fdt_timer {
|
||||||
const struct fdt_match *match_table;
|
const struct fdt_match *match_table;
|
||||||
int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match);
|
int (*cold_init)(void *fdt, int nodeoff, const struct fdt_match *match);
|
||||||
|
@ -23,4 +25,11 @@ void fdt_timer_exit(void);
|
||||||
|
|
||||||
int fdt_timer_init(bool cold_boot);
|
int fdt_timer_init(bool cold_boot);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline void fdt_timer_exit(void) { }
|
||||||
|
static inline int fdt_timer_init(bool cold_boot) { return 0; }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -8,4 +8,6 @@ source "$(OPENSBI_SRC_DIR)/lib/utils/serial/Kconfig"
|
||||||
|
|
||||||
source "$(OPENSBI_SRC_DIR)/lib/utils/sys/Kconfig"
|
source "$(OPENSBI_SRC_DIR)/lib/utils/sys/Kconfig"
|
||||||
|
|
||||||
|
source "$(OPENSBI_SRC_DIR)/lib/utils/timer/Kconfig"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
22
lib/utils/timer/Kconfig
Normal file
22
lib/utils/timer/Kconfig
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
|
menu "Timer Device Support"
|
||||||
|
|
||||||
|
config FDT_TIMER
|
||||||
|
bool "FDT based timer drivers"
|
||||||
|
default n
|
||||||
|
|
||||||
|
if FDT_TIMER
|
||||||
|
|
||||||
|
config FDT_TIMER_MTIMER
|
||||||
|
bool "ACLINT MTIMER FDT driver"
|
||||||
|
select TIMER_MTIMER
|
||||||
|
default n
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
config TIMER_MTIMER
|
||||||
|
bool "ACLINT MTIMER support"
|
||||||
|
default n
|
||||||
|
|
||||||
|
endmenu
|
|
@ -7,10 +7,10 @@
|
||||||
# Anup Patel <anup.patel@wdc.com>
|
# Anup Patel <anup.patel@wdc.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
libsbiutils-objs-y += timer/aclint_mtimer.o
|
libsbiutils-objs-$(CONFIG_TIMER_MTIMER) += timer/aclint_mtimer.o
|
||||||
|
|
||||||
libsbiutils-objs-y += timer/fdt_timer.o
|
libsbiutils-objs-$(CONFIG_FDT_TIMER) += timer/fdt_timer.o
|
||||||
libsbiutils-objs-y += timer/fdt_timer_drivers.o
|
libsbiutils-objs-$(CONFIG_FDT_TIMER) += timer/fdt_timer_drivers.o
|
||||||
|
|
||||||
carray-fdt_timer_drivers-y += fdt_timer_mtimer
|
carray-fdt_timer_drivers-$(CONFIG_FDT_TIMER_MTIMER) += fdt_timer_mtimer
|
||||||
libsbiutils-objs-y += timer/fdt_timer_mtimer.o
|
libsbiutils-objs-$(CONFIG_FDT_TIMER_MTIMER) += timer/fdt_timer_mtimer.o
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
config PLATFORM_ARIANE_FPGA
|
config PLATFORM_ARIANE_FPGA
|
||||||
bool
|
bool
|
||||||
select SERIAL_UART8250
|
select SERIAL_UART8250
|
||||||
|
select TIMER_MTIMER
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
config PLATFORM_OPENPITON_FPGA
|
config PLATFORM_OPENPITON_FPGA
|
||||||
bool
|
bool
|
||||||
select SERIAL_UART8250
|
select SERIAL_UART8250
|
||||||
|
select TIMER_MTIMER
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -12,3 +12,5 @@ CONFIG_FDT_SERIAL_SIFIVE=y
|
||||||
CONFIG_FDT_SERIAL_LITEX=y
|
CONFIG_FDT_SERIAL_LITEX=y
|
||||||
CONFIG_FDT_SERIAL_UART8250=y
|
CONFIG_FDT_SERIAL_UART8250=y
|
||||||
CONFIG_FDT_SERIAL_XILINX_UARTLITE=y
|
CONFIG_FDT_SERIAL_XILINX_UARTLITE=y
|
||||||
|
CONFIG_FDT_TIMER=y
|
||||||
|
CONFIG_FDT_TIMER_MTIMER=y
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
config PLATFORM_KENDRYTE_K210
|
config PLATFORM_KENDRYTE_K210
|
||||||
bool
|
bool
|
||||||
select SERIAL_SIFIVE
|
select SERIAL_SIFIVE
|
||||||
|
select TIMER_MTIMER
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
config PLATFORM_NUCLEI_UX600
|
config PLATFORM_NUCLEI_UX600
|
||||||
bool
|
bool
|
||||||
select SERIAL_SIFIVE
|
select SERIAL_SIFIVE
|
||||||
|
select TIMER_MTIMER
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -10,4 +10,5 @@
|
||||||
config PLATFORM_TEMPLATE
|
config PLATFORM_TEMPLATE
|
||||||
bool
|
bool
|
||||||
select SERIAL_UART8250
|
select SERIAL_UART8250
|
||||||
|
select TIMER_MTIMER
|
||||||
default y
|
default y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue