# Baikal-T1 Clock Control Unit Dividers

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

> Device-tree binding reference for Baikal-T1 Clock Control Unit Dividers.

<!-- 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;clock&#47;baikal&#44;bt1&#45;ccu&#45;div&#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;Serge Semin &#60;fancer&#46;lancer&#64;gmail&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<pre><code>Clocks Control Unit is the core of Baikal-T1 SoC System Controller
responsible for the chip subsystems clocking and resetting. The CCU is
connected with an external fixed rate oscillator, which signal is transformed
into clocks of various frequencies and then propagated to either individual
IP-blocks or to groups of blocks (clock domains). The transformation is done
by means of an embedded into CCU PLLs and gateable/non-gateable dividers. The
later ones are described in this binding. Each clock domain can be also
individually reset by using the domain clocks divider configuration
registers. Baikal-T1 CCU is logically divided into the next components:
1) External oscillator (normally XTAL's 25 MHz crystal oscillator, but
   in general can provide any frequency supported by the CCU PLLs).
2) PLLs clocks generators (PLLs).
3) AXI-bus clock dividers (AXI) - described in this binding file.
4) System devices reference clock dividers (SYS) - described in this binding
   file.
which are connected with each other as shown on the next figure:</code></pre>
<pre><code>        +---------------+
        | Baikal-T1 CCU |
        |   +----+------|- MIPS P5600 cores
        | +-|PLLs|------|- DDR controller
        | | +----+      |
+----+  | |  |  |       |
|XTAL|--|-+  |  | +---+-|
+----+  | |  |  +-|AXI|-|- AXI-bus
        | |  |    +---+-|
        | |  |          |
        | |  +----+---+-|- APB-bus
        | +-------|SYS|-|- Low-speed Devices
        |         +---+-|- High-speed Devices
        +---------------+</code></pre>
<p style="white-space: pre-wrap">Each sub-block is represented as a separate DT node and has an individual
driver to be bound with.</p>
<p style="white-space: pre-wrap">In order to create signals of wide range frequencies the external oscillator
output is primarily connected to a set of CCU PLLs. Some of PLLs CLKOUT are
then passed over CCU dividers to create signals required for the target clock
domain (like AXI-bus or System Device consumers). The dividers have the
following structure:</p>
<pre><code>        +--------------+
CLKIN --|-&gt;+----+ 1|\  |
SETCLK--|--|/DIV|-&gt;| | |
CLKDIV--|--|    |  | |-|-&gt;CLKLOUT
LOCK----|--+----+  | | |
        |          |/  |
        |           |  |
EN------|-----------+  |
RST-----|--------------|-&gt;RSTOUT
        +--------------+</code></pre>
<p style="white-space: pre-wrap">where CLKIN is the reference clock coming either from CCU PLLs or from an
external clock oscillator, SETCLK - a command to update the output clock in
accordance with a set divider, CLKDIV - clocks divider, LOCK - a signal of
the output clock stabilization, EN - enable/disable the divider block,
RST/RSTOUT - reset clocks domain signal. Depending on the consumer IP-core
peculiarities the dividers may lack of some functionality depicted on the
figure above (like EN, CLKDIV/LOCK/SETCLK). In this case the corresponding
clock provider just doesn't expose either switching functions, or the rate
configuration, or both of them.</p>
<p style="white-space: pre-wrap">The clock dividers, which output clock is then consumed by the SoC individual
devices, are united into a single clocks provider called System Devices CCU.
Similarly the dividers with output clocks utilized as AXI-bus reference clocks
are called AXI-bus CCU. Both of them use the common clock bindings with no
custom properties. The list of exported clocks and reset signals can be found
in the files: 'include/dt-bindings/clock/bt1-ccu.h' and
'include/dt-bindings/reset/bt1-ccu.h'. Since System Devices and AXI-bus CCU
are a part of the Baikal-T1 SoC System Controller their DT nodes are supposed
to be a children of later one.</p>
</div>

<a id="dt-158e3f6339df9dc0e448"></a>

## Condition (<code>if</code>)

> <a id="dt-0c7b6d12024f922c1b96"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-824fdc441f7c94ae56ca"></a>
>
> #### <code>compatible</code> — not listed as required here
>
> <a id="dt-8239149d6c8b0a5dabbe"></a>
>
> **Rule for matching array elements (<code>contains</code>)**
>
> > **Exact value (<code>const</code>):** <span id="dt-0259836b095562054cc8"><code>&#34;baikal&#44;bt1&#45;ccu&#45;axi&#34;</code></span>

<a id="dt-94d3067a06aec87aad7f"></a>

## When the condition matches (<code>then</code>)

> <a id="dt-d3da345ec82b9041251c"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-409a7433a45f4ac6c62c"></a>
>
> #### <code>clocks</code> — not listed as required here
>
> <a id="dt-5151756dcb121c5a529b"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-19f4a82651f32f729cbe"></a>
>
> **Item 1**
>
> > <div id="dt-c5ef40e9df018a2fb87f">
> > <p style="white-space: pre-wrap">CCU SATA PLL output clock</p>
> > </div>
>
> <a id="dt-935fcb63f19ee1d239d5"></a>
>
> **Item 2**
>
> > <div id="dt-ca1d3dcb21a3a6442254">
> > <p style="white-space: pre-wrap">CCU PCIe PLL output clock</p>
> > </div>
>
> <a id="dt-a49847a9e15ea930a6a3"></a>
>
> **Item 3**
>
> > <div id="dt-8737b6c2900a7e9acd15">
> > <p style="white-space: pre-wrap">CCU Ethernet PLL output clock</p>
> > </div>
>
> <a id="dt-07ff27f9663a374fee3f"></a>
>
> #### <code>clock&#45;names</code> — not listed as required here
>
> <a id="dt-b2836dc421e568eaf8ca"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-fa9d7ca339569328086a"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-04e418b378a12ada262e"><code>&#34;sata&#95;clk&#34;</code></span>
>
> <a id="dt-b598e8ea8e93c3d38ad5"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-074a94995593b0f3e421"><code>&#34;pcie&#95;clk&#34;</code></span>
>
> <a id="dt-2ca4b8543b9b354c4c0a"></a>
>
> **Item 3**
>
> > **Exact value (<code>const</code>):** <span id="dt-4eb59e4ba2e5311420c5"><code>&#34;eth&#95;clk&#34;</code></span>

<a id="dt-6f6ab6f7f4b3f2f2f0a8"></a>

## When the condition does not match (<code>else</code>)

> <a id="dt-cf075a4b84ee9b101feb"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-4b1b13defe367825118f"></a>
>
> #### <code>clocks</code> — not listed as required here
>
> <a id="dt-96e8634e43111a255e99"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-4658f0d20639c309c4d8"></a>
>
> **Item 1**
>
> > <div id="dt-55718833faf8461a76a9">
> > <p style="white-space: pre-wrap">External reference clock</p>
> > </div>
>
> <a id="dt-1afff9668cdbf95260ee"></a>
>
> **Item 2**
>
> > <div id="dt-970a74f0a1279711fd7d">
> > <p style="white-space: pre-wrap">CCU SATA PLL output clock</p>
> > </div>
>
> <a id="dt-1d5b164bc04565a4c487"></a>
>
> **Item 3**
>
> > <div id="dt-d712511aa38724b5b357">
> > <p style="white-space: pre-wrap">CCU PCIe PLL output clock</p>
> > </div>
>
> <a id="dt-5c8ecff32f4eac6999d2"></a>
>
> **Item 4**
>
> > <div id="dt-a122e227e1c81507d87c">
> > <p style="white-space: pre-wrap">CCU Ethernet PLL output clock</p>
> > </div>
>
> <a id="dt-f950f068cc8fc9f05b1f"></a>
>
> #### <code>clock&#45;names</code> — not listed as required here
>
> <a id="dt-2d884b7961dec86493c4"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-a89abeba82d7c93ba0d9"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-a371d3b6f7a5240619b6"><code>&#34;ref&#95;clk&#34;</code></span>
>
> <a id="dt-b67d659a4695b7440798"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-760b4d42c91ee5dc690a"><code>&#34;sata&#95;clk&#34;</code></span>
>
> <a id="dt-5f4a0720ad37d1073039"></a>
>
> **Item 3**
>
> > **Exact value (<code>const</code>):** <span id="dt-61aade15518ec5616373"><code>&#34;pcie&#95;clk&#34;</code></span>
>
> <a id="dt-a342e851749459cfdb3b"></a>
>
> **Item 4**
>
> > **Exact value (<code>const</code>):** <span id="dt-7ea2637b791d3cd36987"><code>&#34;eth&#95;clk&#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

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;baikal&#44;bt1&#45;ccu&#45;axi&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;baikal&#44;bt1&#45;ccu&#45;sys&#34;</code></span>

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

### <code>reg</code> — not listed as required here

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

<a id="dt-7471877b51a93881192b"></a>

### <code>&#35;clock&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-0eebe37dd30ae3dd2a72"><code>1</code></span>

<a id="dt-02c38475362b738e226b"></a>

### <code>&#35;reset&#45;cells</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-374f156ee5b81c392b56"><code>1</code></span>

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

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

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

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

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

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-dab867b03596a88fc725"><code>3</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-65c84d57f9774b7ce5c4"><code>4</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.

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

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

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

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/clock/bt1-ccu.h&gt;

clock-controller@1f04d030 {
  compatible = "baikal,bt1-ccu-axi";
  reg = &lt;0x1f04d030 0x030&gt;;
  #clock-cells = &lt;1&gt;;
  #reset-cells = &lt;1&gt;;

  clocks = &lt;&amp;ccu_pll CCU_SATA_PLL&gt;,
           &lt;&amp;ccu_pll CCU_PCIE_PLL&gt;,
           &lt;&amp;ccu_pll CCU_ETH_PLL&gt;;
  clock-names = "sata_clk", "pcie_clk", "eth_clk";
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/clock/bt1-ccu.h&gt;

clock-controller@1f04d060 {
  compatible = "baikal,bt1-ccu-sys";
  reg = &lt;0x1f04d060 0x0a0&gt;;
  #clock-cells = &lt;1&gt;;
  #reset-cells = &lt;1&gt;;

  clocks = &lt;&amp;clk25m&gt;,
           &lt;&amp;ccu_pll CCU_SATA_PLL&gt;,
           &lt;&amp;ccu_pll CCU_PCIE_PLL&gt;,
           &lt;&amp;ccu_pll CCU_ETH_PLL&gt;;
  clock-names = "ref_clk", "sata_clk", "pcie_clk",
                "eth_clk";
};
</code></pre>

<pre id="dt-d0212a4cd671f89a0b40"><code class="language-dts">ccu_pll: clock-controller@1f04d000 {
  compatible = "baikal,bt1-ccu-pll";
  reg = &lt;0x1f04d000 0x028&gt;;
  #clock-cells = &lt;1&gt;;

  clocks = &lt;&amp;clk25m&gt;;
  clock-names = "ref_clk";
};
</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 2:</strong> <span> Copyright (C) 2020 BAIKAL ELECTRONICS, JSC</span></p>

<p id="dt-comment-2"><strong>Line 154:</strong> <span> AXI-bus Clock Control Unit node:</span></p>

<p id="dt-comment-3"><strong>Line 169:</strong> <span> System Devices Clock Control Unit node:</span></p>

<p id="dt-comment-4"><strong>Line 186:</strong> <span> Required Clock Control Unit PLL node:</span></p>

</details>
