1*e2bcf2d8SAnup Patel# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*e2bcf2d8SAnup Patel%YAML 1.2
3*e2bcf2d8SAnup Patel---
4*e2bcf2d8SAnup Patel$id: http://devicetree.org/schemas/timer/riscv,timer.yaml#
5*e2bcf2d8SAnup Patel$schema: http://devicetree.org/meta-schemas/core.yaml#
6*e2bcf2d8SAnup Patel
7*e2bcf2d8SAnup Pateltitle: RISC-V timer
8*e2bcf2d8SAnup Patel
9*e2bcf2d8SAnup Patelmaintainers:
10*e2bcf2d8SAnup Patel  - Anup Patel <anup@brainfault.org>
11*e2bcf2d8SAnup Patel
12*e2bcf2d8SAnup Pateldescription: |+
13*e2bcf2d8SAnup Patel  RISC-V platforms always have a RISC-V timer device for the supervisor-mode
14*e2bcf2d8SAnup Patel  based on the time CSR defined by the RISC-V privileged specification. The
15*e2bcf2d8SAnup Patel  timer interrupts of this device are configured using the RISC-V SBI Time
16*e2bcf2d8SAnup Patel  extension or the RISC-V Sstc extension.
17*e2bcf2d8SAnup Patel
18*e2bcf2d8SAnup Patel  The clock frequency of RISC-V timer device is specified via the
19*e2bcf2d8SAnup Patel  "timebase-frequency" DT property of "/cpus" DT node which is described
20*e2bcf2d8SAnup Patel  in Documentation/devicetree/bindings/riscv/cpus.yaml
21*e2bcf2d8SAnup Patel
22*e2bcf2d8SAnup Patelproperties:
23*e2bcf2d8SAnup Patel  compatible:
24*e2bcf2d8SAnup Patel    enum:
25*e2bcf2d8SAnup Patel      - riscv,timer
26*e2bcf2d8SAnup Patel
27*e2bcf2d8SAnup Patel  interrupts-extended:
28*e2bcf2d8SAnup Patel    minItems: 1
29*e2bcf2d8SAnup Patel    maxItems: 4096   # Should be enough?
30*e2bcf2d8SAnup Patel
31*e2bcf2d8SAnup Patel  riscv,timer-cannot-wake-cpu:
32*e2bcf2d8SAnup Patel    type: boolean
33*e2bcf2d8SAnup Patel    description:
34*e2bcf2d8SAnup Patel      If present, the timer interrupt cannot wake up the CPU from one or
35*e2bcf2d8SAnup Patel      more suspend/idle states.
36*e2bcf2d8SAnup Patel
37*e2bcf2d8SAnup PateladditionalProperties: false
38*e2bcf2d8SAnup Patel
39*e2bcf2d8SAnup Patelrequired:
40*e2bcf2d8SAnup Patel  - compatible
41*e2bcf2d8SAnup Patel  - interrupts-extended
42*e2bcf2d8SAnup Patel
43*e2bcf2d8SAnup Patelexamples:
44*e2bcf2d8SAnup Patel  - |
45*e2bcf2d8SAnup Patel    timer {
46*e2bcf2d8SAnup Patel      compatible = "riscv,timer";
47*e2bcf2d8SAnup Patel      interrupts-extended = <&cpu1intc 5>,
48*e2bcf2d8SAnup Patel                            <&cpu2intc 5>,
49*e2bcf2d8SAnup Patel                            <&cpu3intc 5>,
50*e2bcf2d8SAnup Patel                            <&cpu4intc 5>;
51*e2bcf2d8SAnup Patel    };
52*e2bcf2d8SAnup Patel...
53