# ARM MHUv2 Mailbox Controller

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

> Device-tree binding reference for ARM MHUv2 Mailbox Controller.

<!-- 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;mailbox&#47;arm&#44;mhuv2&#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;Tushar Khandelwal &#60;tushar&#46;khandelwal&#64;arm&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Viresh Kumar &#60;viresh&#46;kumar&#64;linaro&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Arm Message Handling Unit (MHU) Version 2 is a mailbox controller that has
between 1 and 124 channel windows (each 32-bit wide) to provide unidirectional
communication with remote processor(s), where the number of channel windows
are implementation dependent.</p>
<p style="white-space: pre-wrap">Given the unidirectional nature of the controller, an MHUv2 mailbox may only
be written to or read from. If a pair of MHU controllers is implemented
between two processing elements to provide bidirectional communication, these
must be specified as two separate mailboxes.</p>
<p style="white-space: pre-wrap">If the interrupts property is present in device tree node, then its treated as
a "receiver" mailbox, otherwise a "sender".</p>
<p style="white-space: pre-wrap">An MHU controller must be specified along with the supported transport
protocols. The transport protocols determine the method of data transmission
as well as the number of provided mailbox channels.</p>
<p style="white-space: pre-wrap">Following are the possible transport protocols.</p>
<pre><code>- Data-transfer: Each transfer is made of one or more words, using one or more
  channel windows.</code></pre>
<pre><code>- Doorbell: Each transfer is made up of single bit flag, using any one of the
  bits in a channel window. A channel window can support up to 32 doorbells
  and the entire window shall be used in doorbell protocol.  Optionally, data
  may be transmitted through a shared memory region, wherein the MHU is used
  strictly as an interrupt generation mechanism but that is out of the scope
  of these bindings.</code></pre>
</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;mhuv2&#45;tx&#34;</code></span>, <span id="dt-b228f13d1a3291d89dd4"><code>&#34;arm&#44;mhuv2&#45;rx&#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-39566f01414e34c67b85"></a>

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

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

**Rule 1**

> <div id="dt-ab1c3e7063bd95dc962e">
> <p style="white-space: pre-wrap">Sender mode</p>
> </div>
>
> <a id="dt-07409cc9508405f48983"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-822691c82c9797f7b1f9"></a>
>
> **Item 1**
>
> > **Exact value (<code>const</code>):** <span id="dt-5deec2612224d8d915da"><code>&#34;arm&#44;mhuv2&#45;tx&#34;</code></span>
>
> <a id="dt-bc83d1191bdc72da8559"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-1da74b37131fdcec1073"><code>&#34;arm&#44;primecell&#34;</code></span>

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

**Rule 2**

> <div id="dt-4b64ce44adfe069638c4">
> <p style="white-space: pre-wrap">Receiver-mode</p>
> </div>
>
> <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;arm&#44;mhuv2&#45;rx&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;arm&#44;primecell&#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

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">The MHUv2 controller always implements an interrupt in the "receiver"
mode, while the interrupt in the "sender" mode was not available in the
version MHUv2.0, but the later versions do have it.</p>
</div>

**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-041d7cd76b652a5de06a"></a>

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

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

<a id="dt-3372b8a873ee856acf4c"></a>

### <code>arm&#44;mhuv2&#45;protocols</code> — required here

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

<div id="dt-e8fa47b9758b4d2e9b6a">
<p style="white-space: pre-wrap">The MHUv2 controller may contain up to 124 channel windows (each 32-bit
wide). The hardware and the DT bindings allows any combination of those to
be used for various transport protocols.</p>
<p style="white-space: pre-wrap">This property allows a platform to describe how these channel windows are
used in various transport protocols. The entries in this property shall be
present as an array of tuples, where each tuple describes details about
one of the transport protocol being implemented over some channel
window(s).</p>
<p style="white-space: pre-wrap">The first field of a tuple signifies the transfer protocol, 0 is reserved
for doorbell protocol, and 1 is reserved for data-transfer protocol.
Using any other value in the first field of a tuple makes it invalid.</p>
<p style="white-space: pre-wrap">The second field of a tuple signifies the number of channel windows where
the protocol would be used and should be set to a non zero value. For
doorbell protocol this field signifies the number of 32-bit channel
windows that implement the doorbell protocol. For data-transfer protocol,
this field signifies the number of 32-bit channel windows that implement
the data-transfer protocol.</p>
<p style="white-space: pre-wrap">The total number of channel windows specified here shouldn't be more than
the ones implemented by the platform, though one can specify lesser number
of windows here than what the platform implements.</p>
<pre><code>mhu: mailbox@2b1f0000 {
    ...</code></pre>
<pre><code>    arm,mhuv2-protocols = &lt;0 2&gt;, &lt;1 1&gt;, &lt;1 5&gt;, &lt;1 7&gt;;
}</code></pre>
<p style="white-space: pre-wrap">The above example defines the protocols of an ARM MHUv2 mailbox
controller, where a total of 15 channel windows are used. The first two
windows are used in doorbell protocol (64 doorbells), followed by 1, 5 and
7 windows (separately) used in data-transfer protocol.</p>
</div>

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

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

<a id="dt-2d0b52e71d064b761f19"></a>

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

> <a id="dt-96319588c17aed7ef830"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-7395abcc5d38e05d630c"></a>
>
> **Item 1**
>
> > **Allowed values (<code>enum</code>):** <a id="dt-ce5c74fd2a9ef63fa151"></a> <span id="dt-07acd1a8a9d9728747fa"><code>0</code></span>, <span id="dt-7fa30e2a345ace066337"><code>1</code></span>
>
> <a id="dt-5087dbd7c03f51a4ce1f"></a>
>
> **Item 2**
>
> > **Minimum value (<code>minimum</code>):** <span id="dt-fc905246cce0c9d53d66"><code>0</code></span>
> >
> > **Maximum value (<code>maximum</code>):** <span id="dt-e6c106c7605f329fec5b"><code>124</code></span>

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

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

<div id="dt-c8db8f9a4474894f1bab">
<p style="white-space: pre-wrap">It is always set to 2. The first argument in the consumers 'mboxes'
property represents the channel window group, which may be used in
doorbell, or data-transfer protocol, and the second argument (only
relevant in doorbell protocol, should be 0 otherwise) represents the
doorbell number within the 32 bit wide channel window.</p>
<p style="white-space: pre-wrap">From the example given above for arm,mhuv2-protocols, here is how a client
node can reference them.</p>
<p style="white-space: pre-wrap">mboxes = &lt;&amp;mhu 0 5&gt;; // Channel Window Group 0, doorbell 5.
mboxes = &lt;&amp;mhu 1 7&gt;; // Channel Window Group 1, doorbell 7.
mboxes = &lt;&amp;mhu 2 0&gt;; // Channel Window Group 2, data transfer protocol with 1 window.
mboxes = &lt;&amp;mhu 3 0&gt;; // Channel Window Group 3, data transfer protocol with 5 windows.
mboxes = &lt;&amp;mhu 4 0&gt;; // Channel Window Group 4, data transfer protocol with 7 windows.</p>
</div>

**Exact value (<code>const</code>):** <span id="dt-35dce2a22cd12b009c30"><code>2</code></span>

<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;arm&#44;mhuv2&#45;rx&#34;</code></span>

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

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

> **Required in this object (<code>required</code>):** <a id="dt-824165741bab07e919e7"></a> <span id="dt-0be16f81402541b26aff"><code>&#34;interrupts&#34;</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;reg&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;&#35;mbox&#45;cells&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;arm&#44;mhuv2&#45;protocols&#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">soc {
    #address-cells = &lt;2&gt;;
    #size-cells = &lt;2&gt;;

    mhu_tx: mailbox@2b1f0000 {
        #mbox-cells = &lt;2&gt;;
        compatible = "arm,mhuv2-tx", "arm,primecell";
        reg = &lt;0 0x2b1f0000 0 0x1000&gt;;
        clocks = &lt;&amp;clock 0&gt;;
        clock-names = "apb_pclk";
        interrupts = &lt;0 45 4&gt;;
        arm,mhuv2-protocols = &lt;1 5&gt;, &lt;1 2&gt;, &lt;1 5&gt;, &lt;1 7&gt;, &lt;0 2&gt;;
    };

    mhu_rx: mailbox@2b1f1000 {
        #mbox-cells = &lt;2&gt;;
        compatible = "arm,mhuv2-rx", "arm,primecell";
        reg = &lt;0 0x2b1f1000 0 0x1000&gt;;
        clocks = &lt;&amp;clock 0&gt;;
        clock-names = "apb_pclk";
        interrupts = &lt;0 46 4&gt;;
        arm,mhuv2-protocols = &lt;1 1&gt;, &lt;1 7&gt;, &lt;0 2&gt;;
    };

    mhu_client: dsp@596e8000 {
        compatible = "fsl,imx8qxp-dsp";
        reg = &lt;0 0x596e8000 0 0x88000&gt;;
        clocks = &lt;&amp;adma_lpcg 0&gt;, &lt;&amp;adma_lpcg 1&gt;, &lt;&amp;adma_lpcg 2&gt;;
        clock-names = "ipg", "ocram", "core";
        power-domains = &lt;&amp;pd 0&gt;, &lt;&amp;pd 1&gt;;
        mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
        mboxes = &lt;&amp;mhu_tx 2 0&gt;, //data-transfer protocol with 5 windows, mhu-tx
                 &lt;&amp;mhu_tx 3 0&gt;, //data-transfer protocol with 7 windows, mhu-tx
                 &lt;&amp;mhu_rx 2 27&gt;, //doorbell protocol channel 2, doorbell 27, mhu-rx
                 &lt;&amp;mhu_rx 0 0&gt;;  //data-transfer protocol with 1 window, mhu-rx
        memory-region = &lt;&amp;dsp_reserved&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 43:</strong> <span> We need a select here so we don't match all nodes with 'arm,primecell'</span></p>

<p id="dt-comment-2"><strong>Line 150:</strong> <span> Interrupt is compulsory for receiver</span></p>

<p id="dt-comment-3"><strong>Line 168:</strong> <span> Multiple transport protocols implemented by the mailbox controllers</span></p>

</details>
