2021-11-04 21:14:51 +08:00
|
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
|
|
|
# Copyright (c) 2016 Cadence Design Systems, Inc.
|
2023-02-03 15:13:53 +08:00
|
|
|
# Copyright (c) 2019-2023 Intel Corp.
|
2021-11-04 21:14:51 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
config RISCV_MACHINE_TIMER
|
|
|
|
bool "RISCV Machine Timer"
|
2022-09-06 23:28:25 +08:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_ANDESTECH_MACHINE_TIMER_ENABLED || \
|
|
|
|
DT_HAS_NEORV32_MACHINE_TIMER_ENABLED || \
|
|
|
|
DT_HAS_NUCLEI_SYSTIMER_ENABLED || \
|
|
|
|
DT_HAS_SIFIVE_CLINT0_ENABLED || \
|
2023-01-14 07:22:57 +08:00
|
|
|
DT_HAS_TELINK_MACHINE_TIMER_ENABLED || \
|
2023-02-03 15:13:53 +08:00
|
|
|
DT_HAS_LOWRISC_MACHINE_TIMER_ENABLED || \
|
|
|
|
DT_HAS_NIOSV_MACHINE_TIMER_ENABLED
|
2021-11-04 21:14:51 +08:00
|
|
|
select TICKLESS_CAPABLE
|
|
|
|
select TIMER_HAS_64BIT_CYCLE_COUNTER
|
|
|
|
help
|
|
|
|
This module implements a kernel device driver for the generic RISCV machine
|
|
|
|
timer driver. It provides the standard "system clock driver" interfaces.
|
2020-03-08 22:21:21 +08:00
|
|
|
|
2022-11-01 04:34:19 +08:00
|
|
|
if RISCV_MACHINE_TIMER
|
|
|
|
|
2020-03-08 22:21:21 +08:00
|
|
|
config RISCV_MACHINE_TIMER_SYSTEM_CLOCK_DIVIDER
|
|
|
|
int
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
Specifies the division ratio of the system clock supplied to the Machine Timer.
|
|
|
|
|
|
|
|
A clock obtained by dividing the system clock by a value of [2^N] is
|
|
|
|
supplied to the timer. Where N is this parameter's value.
|
|
|
|
When N=2, it is divided by 4, and when N=5, it is divided by 32.
|
|
|
|
Default case is N=0, this means use system clock as machine timer clock.
|
|
|
|
It is normal configuration for RISC-V machine clock.
|
|
|
|
|
|
|
|
This parameter usually depends on the hardware configuration.
|
|
|
|
The division ratio should define in devicetree,
|
2022-02-24 20:00:55 +08:00
|
|
|
and it is desirable usage that references it with using a function such as
|
2020-03-08 22:21:21 +08:00
|
|
|
dt_node_int_prop_int from Kconfig. (Tune in the conf file is not preferable.)
|
2022-05-10 14:25:44 +08:00
|
|
|
|
2022-11-01 04:34:19 +08:00
|
|
|
endif
|