# ARM sp804 Dual Timers

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

> Device-tree binding reference for ARM sp804 Dual Timers.

<!-- SPDX-License-Identifier: GPL-2.0 -->


<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;arm&#44;sp804&#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;Haojian Zhuang &#60;haojian&#46;zhuang&#64;linaro&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Arm SP804 IP implements two independent timers, configurable for
16 or 32 bit operation and capable of running in one-shot, periodic, or
free-running mode. The input clock is shared, but can be gated and prescaled
independently for each timer.</p>
<p style="white-space: pre-wrap">There is a viriant of Arm SP804: Hisilicon 64-bit SP804 timer. Some Hisilicon
SoCs, such as Hi1212, should use the dedicated compatible: "hisilicon,sp804".</p>
</div>

<a id="dt-865ef19e891fb9fe7b15"></a>

## Automatic schema selection (<code>select</code>)

> <a id="dt-54d143fae2406295c883"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-e3400bab629503b08322"></a>
>
> #### <code>compatible</code> — required here
>
> <a id="dt-2ae4f0f9580bb5b2e406"></a>
>
> **Rule for matching array elements (<code>contains</code>)**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-ce9b069a8031ff280c23"></a> <span id="dt-e79f31d4eec3cf736314"><code>&#34;arm&#44;sp804&#34;</code></span>, <span id="dt-b228f13d1a3291d89dd4"><code>&#34;hisilicon&#44;sp804&#34;</code></span>
>
> **Required in this object (<code>required</code>):** <a id="dt-c7b135d3aebb6d627788"></a> <span id="dt-7b7a89ef483af1198868"><code>&#34;compatible&#34;</code></span>

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

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

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

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

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

#### Array item rules (<code>items</code>)

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

**Item 1**

> **Allowed values (<code>enum</code>):** <a id="dt-851ace07a50c83495949"></a> <span id="dt-63b688f2ccd82724cb8f"><code>&#34;arm&#44;sp804&#34;</code></span>, <span id="dt-2d97ae0f34d14dd8e72b"><code>&#34;hisilicon&#44;sp804&#34;</code></span>

<a id="dt-0891c69625632ea817fd"></a>

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-f1f862a3cfab3ac620c8"><code>&#34;arm&#44;primecell&#34;</code></span>

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

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

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">If two interrupts are listed, those are the interrupts for timer
1 and 2, respectively. If there is only a single interrupt, it is
either a combined interrupt or the sole interrupt of one timer, as
specified by the "arm,sp804-has-irq" property.</p>
</div>

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b7823fb65b2f27642d26"><code>2</code></span>

<a id="dt-9c1635fdb65d87e33d77"></a>

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">The physical base address of the SP804 IP.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

<a id="dt-4e9a371963ac013ad39d"></a>

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

<div id="dt-853257adf43f6880d753">
<p style="white-space: pre-wrap">Clocks driving the dual timer hardware. This list should
be 1 or 3 clocks. With 3 clocks, the order is timer0 clock, timer1
clock, apb_pclk. A single clock can also be specified if the same
clock is used for all clock inputs.</p>
</div>

<a id="dt-954f270c374368256c41"></a>

#### Exactly one of these rules must match (<code>oneOf</code>)

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

**Rule 1**

> <a id="dt-cadde104828cd4c77fc1"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-6806bb878bfd3776ed34"></a>
>
> **Item 1**
>
> > <div id="dt-1ef2d1e9b8e9112fd180">
> > <p style="white-space: pre-wrap">clock for timer 1</p>
> > </div>
>
> <a id="dt-77c1e73cb4e7fa9aa940"></a>
>
> **Item 2**
>
> > <div id="dt-996a0380eaf61cc0234f">
> > <p style="white-space: pre-wrap">clock for timer 2</p>
> > </div>
>
> <a id="dt-a70353726cf6845d1276"></a>
>
> **Item 3**
>
> > <div id="dt-d62f3fa7408168546792">
> > <p style="white-space: pre-wrap">bus clock</p>
> > </div>

<a id="dt-92c60fcd076bd77a46bf"></a>

**Rule 2**

> <a id="dt-b0cc67f6201153e9681a"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-6efd56afc41ab1939e06"></a>
>
> **Item 1**
>
> > <div id="dt-324514a73c54a2b5ce01">
> > <p style="white-space: pre-wrap">unified clock for both timers and the bus</p>
> > </div>

<a id="dt-041d7cd76b652a5de06a"></a>

### <code>clock&#45;names</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

<a id="dt-839f9662b61c9f04c3de"></a>

### <code>arm&#44;sp804&#45;has&#45;irq</code> — not listed as required here

<div id="dt-26b43869457be49af889">
<p style="white-space: pre-wrap">If only one interrupt line is connected to the interrupt controller, this property specifies which timer is connected to this line.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-65dcf6dabd91a5ba3601">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Minimum value (<code>minimum</code>):** <span id="dt-cbb9a1bb1f245b3dd88d"><code>1</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-906d01abb195479b6bff"><code>2</code></span>

**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&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;reg&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;clocks&#34;</code></span>

<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.

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

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

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">timer0: timer@fc800000 {
    compatible = "arm,sp804", "arm,primecell";
    reg = &lt;0xfc800000 0x1000&gt;;
    interrupts = &lt;0 0 4&gt;, &lt;0 1 4&gt;;
    clocks = &lt;&amp;timclk1&gt;, &lt;&amp;timclk2&gt;, &lt;&amp;pclk&gt;;
    clock-names = "timer1", "timer2", "apb_pclk";
};
</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</span></p>

<p id="dt-comment-1"><strong>Line 21:</strong> <span> Need a custom select here or 'arm,primecell' will match on lots of nodes</span></p>

<p id="dt-comment-2"><strong>Line 68:</strong> <span> The original binding did not specify any clock names, and there is no</span></p>

<p id="dt-comment-3"><strong>Line 69:</strong> <span> consistent naming used in the existing DTs. The primecell binding</span></p>

<p id="dt-comment-4"><strong>Line 70:</strong> <span> requires the "apb_pclk" name, so we need this property.</span></p>

<p id="dt-comment-5"><strong>Line 71:</strong> <span> Use "timer0clk", "timer1clk", "apb_pclk" for new DTs.</span></p>

</details>
