1# Copyright (c) 2014-2015 Wind River Systems, Inc.
2# Copyright (c) 2016 Cadence Design Systems, Inc.
3# Copyright (c) 2019-2023 Intel Corp.
4# SPDX-License-Identifier: Apache-2.0
5
6config RISCV_MACHINE_TIMER
7	bool "RISCV Machine Timer"
8	default y
9	depends on DT_HAS_RISCV_MACHINE_TIMER_ENABLED || \
10		   DT_HAS_NUCLEI_SYSTIMER_ENABLED
11	select TICKLESS_CAPABLE
12	select TIMER_HAS_64BIT_CYCLE_COUNTER
13	help
14	  This module implements a kernel device driver for the generic RISCV machine
15	  timer driver. It provides the standard "system clock driver" interfaces.
16
17if RISCV_MACHINE_TIMER
18
19config RISCV_MACHINE_TIMER_SYSTEM_CLOCK_DIVIDER
20	int
21	default 0
22	help
23	  Specifies the division ratio of the system clock supplied to the Machine Timer.
24
25	  A clock obtained by dividing the system clock by a value of [2^N] is
26	  supplied to the timer. Where N is this parameter's value.
27	  When N=2, it is divided by 4, and when N=5, it is divided by 32.
28	  Default case is N=0, this means use system clock as machine timer clock.
29	  It is normal configuration for RISC-V machine clock.
30
31	  This parameter usually depends on the hardware configuration.
32	  The division ratio should define in devicetree,
33	  and it is desirable usage that references it with using a function such as
34	  dt_node_int_prop_int from Kconfig. (Tune in the conf file is not preferable.)
35
36endif
37