# Freescale QorIQ 1588 timer based PTP clock

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

> Device-tree binding reference for Freescale QorIQ 1588 timer based PTP clock.

<!-- 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;ptp&#47;fsl&#44;ptp&#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;Frank Li &#60;Frank&#46;Li&#64;nxp&#46;com&#62;&#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-39566f01414e34c67b85"></a>

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

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

**Rule 1**

> **Allowed values (<code>enum</code>):** <a id="dt-617e1a2040e2496013d4"></a> <span id="dt-c31075c43df89b2793e3"><code>&#34;fsl&#44;etsec&#45;ptp&#34;</code></span>, <span id="dt-44b402f75e7bf3caf313"><code>&#34;fsl&#44;fman&#45;ptp&#45;timer&#34;</code></span>, <span id="dt-f03e1478792ca587ff5c"><code>&#34;fsl&#44;dpaa2&#45;ptp&#34;</code></span>

<a id="dt-7482b6e745c4f056161a"></a>

**Rule 2**

> <a id="dt-4c3e118873fbaedb5de2"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-b02d8860067795c00ae4"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-82dceb5784ff71f5fdf5"><code>&#34;pci1957&#44;ee02&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;fsl&#44;enetc&#45;ptp&#34;</code></span>

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

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

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

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

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

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

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

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

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

<a id="dt-40ea7fb4a7598cf985e6"></a>

### <code>fsl&#44;cksel</code> — not listed as required here

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

<div id="dt-7b7166df90df5c082cd9">
<p style="white-space: pre-wrap">Timer reference clock source.</p>
<p style="white-space: pre-wrap">Reference clock source is determined by the value, which is holded
in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the
value, which will be directly written in those bits, that is why,
according to reference manual, the next clock sources can be used:</p>
<pre><code>For eTSEC,
&lt;0&gt; - external high precision timer reference clock (TSEC_TMR_CLK
      input is used for this purpose);
&lt;1&gt; - eTSEC system clock;
&lt;2&gt; - eTSEC1 transmit clock;
&lt;3&gt; - RTC clock input.</code></pre>
<p style="white-space: pre-wrap">For DPAA FMan,
&lt;0&gt; - external high precision timer reference clock (TMR_1588_CLK)
&lt;1&gt; - MAC system clock (1/2 FMan clock)
&lt;2&gt; - reserved
&lt;3&gt; - RTC clock oscillator</p>
</div>

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

### <code>fsl&#44;tclk&#45;period</code> — not listed as required here

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

<div id="dt-9df80ee5fed453e16c16">
<p style="white-space: pre-wrap">Timer reference clock period in nanoseconds.</p>
</div>

<a id="dt-668ede3872422b2e1ba3"></a>

### <code>fsl&#44;tmr&#45;prsc</code> — not listed as required here

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

<div id="dt-f980564360f27c3b530f">
<p style="white-space: pre-wrap">Prescaler, divides the output clock.</p>
</div>

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

### <code>fsl&#44;tmr&#45;add</code> — not listed as required here

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

<div id="dt-4d29820e39f280262fbe">
<p style="white-space: pre-wrap">Frequency compensation value.</p>
</div>

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

### <code>fsl&#44;tmr&#45;fiper1</code> — not listed as required here

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

<div id="dt-4c8c4465d21260425808">
<p style="white-space: pre-wrap">Fixed interval period pulse generator.</p>
</div>

<a id="dt-4341489de3ad993d27f8"></a>

### <code>fsl&#44;tmr&#45;fiper2</code> — not listed as required here

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

<div id="dt-89ba1017ac2953bda8aa">
<p style="white-space: pre-wrap">Fixed interval period pulse generator.</p>
</div>

<a id="dt-7b7d0cae14cc7f83b6b4"></a>

### <code>fsl&#44;tmr&#45;fiper3</code> — not listed as required here

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

<div id="dt-38334dc9f543cf8b7e66">
<p style="white-space: pre-wrap">Fixed interval period pulse generator. Supported only on DPAA2 and ENETC hardware.</p>
</div>

<a id="dt-79c1bec464ad3d9e93cd"></a>

### <code>fsl&#44;max&#45;adj</code> — not listed as required here

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

<div id="dt-ba20b34fa87f03c07d17">
<p style="white-space: pre-wrap">Maximum frequency adjustment in parts per billion.</p>
<p style="white-space: pre-wrap">These properties set the operational parameters for the PTP
clock. You must choose these carefully for the clock to work right.
Here is how to figure good values:</p>
<p style="white-space: pre-wrap">TimerOsc     = selected reference clock   MHz
tclk_period  = desired clock period       nanoseconds
NominalFreq  = 1000 / tclk_period         MHz
FreqDivRatio = TimerOsc / NominalFreq     (must be greater that 1.0)
tmr_add      = ceil(2^32 / FreqDivRatio)
OutputClock  = NominalFreq / tmr_prsc     MHz
PulseWidth   = 1 / OutputClock            microseconds
FiperFreq1   = desired frequency in Hz
FiperDiv1    = 1000000 * OutputClock / FiperFreq1
tmr_fiper1   = tmr_prsc * tclk_period * FiperDiv1 - tclk_period
max_adj      = 1000000000 * (FreqDivRatio - 1.0) - 1</p>
<p style="white-space: pre-wrap">The calculation for tmr_fiper2 is the same as for tmr_fiper1. The
driver expects that tmr_fiper1 will be correctly set to produce a 1
Pulse Per Second (PPS) signal, since this will be offered to the PPS
subsystem to synchronize the Linux clock.</p>
<p style="white-space: pre-wrap">When this attribute is not used, the IEEE 1588 timer reference clock
will use the eTSEC system clock (for Gianfar) or the MAC system
clock (for DPAA).</p>
</div>

<a id="dt-8af8fa2261d3b2692d7c"></a>

### <code>fsl&#44;extts&#45;fifo</code> — not listed as required here

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

<div id="dt-cacbb22dad77f3a17dd4">
<p style="white-space: pre-wrap">The presence of this property indicates hardware support for the external trigger stamp FIFO</p>
</div>

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

### <code>little&#45;endian</code> — not listed as required here

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

<div id="dt-9666ce8a1ec52638c9b5">
<p style="white-space: pre-wrap">The presence of this property indicates the 1588 timer support for the external trigger stamp FIFO. IP block is little-endian mode. The default endian mode is big-endian.</p>
</div>

**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;reg&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

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

### Rule 1

> <a id="dt-3bbb54dfa1f05dfb4d25"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-97f47e9dc804c839f86d"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-bbadeeb73dfaefabae79"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-ebe43a424f4497a78746"></a>
> >
> > **Rule for matching array elements (<code>contains</code>)**
> >
> > > **Exact value (<code>const</code>):** <span id="dt-8997992e7087b5549d86"><code>&#34;fsl&#44;enetc&#45;ptp&#34;</code></span>
>
> <a id="dt-1ba25143802b75b74702"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-5914c064454d3da9c609">[<code>&#47;schemas&#47;pci&#47;pci&#45;device&#46;yaml</code>](</kernel/hardware/devicetree-bindings/dt-shared/pci/pci-device.md#dt-root>)</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">#include &lt;dt-bindings/interrupt-controller/irq.h&gt;

phc@24e00 {
    compatible = "fsl,etsec-ptp";
    reg = &lt;0x24e00 0xb0&gt;;
    interrupts = &lt;12 IRQ_TYPE_LEVEL_LOW&gt;;
    interrupt-parent = &lt;&amp;ipic&gt;;
    fsl,cksel       = &lt;1&gt;;
    fsl,tclk-period = &lt;10&gt;;
    fsl,tmr-prsc    = &lt;100&gt;;
    fsl,tmr-add     = &lt;0x999999a4&gt;;
    fsl,tmr-fiper1  = &lt;0x3b9ac9f6&gt;;
    fsl,tmr-fiper2  = &lt;0x00018696&gt;;
    fsl,max-adj     = &lt;659999998&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>

</details>
