# RISC-V timer

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Timer bindings_

> Device-tree binding reference for RISC-V timer.

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;timer&#47;riscv&#44;timer&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Anup Patel &#60;anup&#64;brainfault&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">RISC-V platforms always have a RISC-V timer device for the supervisor-mode
based on the time CSR defined by the RISC-V privileged specification. The
timer interrupts of this device are configured using the RISC-V SBI Time
extension or the RISC-V Sstc extension.</p>
<p style="white-space: pre-wrap">The clock frequency of RISC-V timer device is specified via the
"timebase-frequency" DT property of "/cpus" DT node which is described
in Documentation/devicetree/bindings/riscv/cpus.yaml</p>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;riscv&#44;timer&#34;</code></span>

<a id="dt-bb6bf440c9aa134fafb2"></a>

### <code>interrupts&#45;extended</code> — required here

**Minimum number of items (<code>minItems</code>):** <span id="dt-17ac127356ee8de84b32"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-0fa45bd7e7f39b9405fc"><code>4096</code></span>

<a id="dt-3f3f4db2388995d93a08"></a>

### <code>riscv&#44;timer&#45;cannot&#45;wake&#45;cpu</code> — not listed as required here

**Value type (<code>type</code>):** <span id="dt-ab8959baccfb7791d33a"><code>&#34;boolean&#34;</code></span>

<div id="dt-bf91ab8d8c1c219382ff">
<p style="white-space: pre-wrap">If present, the timer interrupt cannot wake up the CPU from one or more suspend/idle states.</p>
</div>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;interrupts&#45;extended&#34;</code></span>

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">timer {
  compatible = "riscv,timer";
  interrupts-extended = &lt;&amp;cpu1intc 5&gt;,
                        &lt;&amp;cpu2intc 5&gt;,
                        &lt;&amp;cpu3intc 5&gt;,
                        &lt;&amp;cpu4intc 5&gt;;
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

<p id="dt-comment-1"><strong>Line 29:</strong> <span> Should be enough?</span></p>

</details>
