# Renesas RZ/T2H and RZ/N2H Pin and GPIO controller

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

> Device-tree binding reference for Renesas RZ/T2H and RZ/N2H Pin and GPIO 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;pinctrl&#47;renesas&#44;r9a09g077&#45;pinctrl&#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;Lad Prabhakar &#60;prabhakar&#46;mahadev&#45;lad&#46;rj&#64;bp&#46;renesas&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Renesas RZ/T2H and RZ/N2H SoCs feature a combined Pin and GPIO controller. Pin multiplexing and GPIO configuration are performed on a per-pin basis. Each port supports up to 8 pins, each configurable for either GPIO (port mode) or alternate function mode. Each pin supports function mode values ranging from 0x0 to 0x2A, allowing selection from up to 43 different functions.</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;renesas&#44;r9a09g077&#45;pinctrl&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;renesas&#44;r9a09g087&#45;pinctrl&#34;</code></span>

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

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

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

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

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

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

**Item 1**

> <div id="dt-e773fec0b410a1422253">
> <p style="white-space: pre-wrap">Non-safety I/O Port base</p>
> </div>

<a id="dt-302751dd79bfd514b9d7"></a>

**Item 2**

> <div id="dt-b729cb065b03c20c0e01">
> <p style="white-space: pre-wrap">Safety I/O Port safety region base</p>
> </div>

<a id="dt-80d36cb915ffeff5364a"></a>

**Item 3**

> <div id="dt-5151e97c331b693ee0dd">
> <p style="white-space: pre-wrap">Safety I/O Port Non-safety region base</p>
> </div>

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

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

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

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

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

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

**Item 1**

> **Exact value (<code>const</code>):** <span id="dt-69afd9f8af3b0c5757d2"><code>&#34;nsr&#34;</code></span>

<a id="dt-12013039402717d72b48"></a>

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-8472c6e17fb2491b6ba3"><code>&#34;srs&#34;</code></span>

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

**Item 3**

> **Exact value (<code>const</code>):** <span id="dt-bd78c6ffbdc5ce20feb0"><code>&#34;srn&#34;</code></span>

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

### <code>gpio&#45;controller</code> — required here

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

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

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

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

<div id="dt-70b20397c3c73794f833">
<p style="white-space: pre-wrap">The first cell contains the global GPIO port index, constructed using the RZT2H_GPIO() helper macro from &lt;dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h&gt; (e.g. "RZT2H_GPIO(3, 0)" for P03_0). The second cell represents the consumer flag. Use the macros defined in include/dt-bindings/gpio/gpio.h.</p>
</div>

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

### <code>gpio&#45;ranges</code> — required here

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

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

### <code>interrupt&#45;controller</code> — not listed as required here

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

<a id="dt-8586fac2d9a71adf4795"></a>

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

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

<div id="dt-0cc2c51365b6879fba3b">
<p style="white-space: pre-wrap">The first cell contains the global GPIO port index, constructed using the RZT2H_GPIO() helper macro from &lt;dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h&gt; and the second cell is used to specify the flag. E.g. "interrupts = &lt;RZT2H_GPIO(8, 6) IRQ_TYPE_EDGE_FALLING&gt;;" if P08_6 is being used as an interrupt.</p>
</div>

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

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

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

<a id="dt-030bda573e8c53177f1a"></a>

### <code>power&#45;domains</code> — required here

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

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

## Reusable definitions (<code>definitions</code>)

<a id="dt-644fca3726beb8e824ab"></a>

### <code>renesas&#45;rzt2h&#45;n2h&#45;pins&#45;node</code>

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

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

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

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

**Rule 1**

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-5512dabf29ff80b64d2c">[<code>pincfg&#45;node&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pincfg-node.md#dt-root>)</span>

<a id="dt-82192e3dfd2cd921a05a"></a>

**Rule 2**

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-656d7d175524cc7eca68">[<code>pinmux&#45;node&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinmux-node.md#dt-root>)</span>

<a id="dt-07c6bb6a541bd4144ff2"></a>

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

<a id="dt-734094bb27d26dfacf07"></a>

**<code>pinmux</code> — not listed as required here**

<div id="dt-5deaa96dfe300c4ba517">
<p style="white-space: pre-wrap">Values are constructed from I/O port number, pin number, and alternate function configuration number using the RZT2H_PORT_PINMUX() helper macro from &lt;dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h&gt;.</p>
</div>

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

**<code>pins</code> — not listed as required here**

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

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

**<code>phandle</code> — not listed as required here**

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

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

**<code>input</code> — not listed as required here**

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

<a id="dt-73062affe778fabf0f77"></a>

**<code>input&#45;enable</code> — not listed as required here**

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

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

**<code>output&#45;enable</code> — not listed as required here**

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

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

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

<a id="dt-78b20517586dfce1a980"></a>

**Rule 1**

> **Required in this object (<code>required</code>):** <a id="dt-1f9b7bbec951860bd5ea"></a> <span id="dt-272394949394df3d138f"><code>&#34;pinmux&#34;</code></span>

<a id="dt-3789769b81a33970a2ff"></a>

**Rule 2**

> **Required in this object (<code>required</code>):** <a id="dt-ab85058fba48811094db"></a> <span id="dt-2724cce358425d006703"><code>&#34;pins&#34;</code></span>

<a id="dt-ed101d8c8695a3b9fb49"></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-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

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

### <code>&#46;&#42;&#45;group&#36;</code> — name matches this regular expression

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

<div id="dt-0857559c687ec66dd5fa">
<p style="white-space: pre-wrap">Pin controller client devices can organize pin configuration entries into grouping nodes ending in "-group". These group nodes may contain multiple child nodes each ending in "-pins" to configure distinct sets of pins.</p>
</div>

<a id="dt-bb0a3ecc08ee60c29eeb"></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-b4f41a1c7104129cd36f"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

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

**<code>&#45;pins&#36;</code> — name matches this regular expression**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1c20efc9d4570233b8f7">[<code>&#35;&#47;definitions&#47;renesas&#45;rzt2h&#45;n2h&#45;pins&#45;node</code>](<#dt-644fca3726beb8e824ab>)</span>

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

### <code>&#45;pins&#36;</code> — name matches this regular expression

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-8c082b219690062f90c6">[<code>&#35;&#47;definitions&#47;renesas&#45;rzt2h&#45;n2h&#45;pins&#45;node</code>](<#dt-644fca3726beb8e824ab>)</span>

<a id="dt-38ce17a2b980a512069e"></a>

### <code>&#45;hog&#36;</code> — name matches this regular expression

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

<div id="dt-ff00c62082e9b158efbb">
<p style="white-space: pre-wrap">GPIO hog node</p>
</div>

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

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

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

**<code>gpio&#45;hog</code> — required here**

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

<a id="dt-772f025dd908a327705f"></a>

**<code>gpios</code> — required here**

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

<a id="dt-2573f43a91053c06659a"></a>

**<code>input</code> — not listed as required here**

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

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

**<code>output&#45;high</code> — not listed as required here**

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

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

**<code>output&#45;low</code> — not listed as required here**

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

<a id="dt-07d6a79defd0084437a4"></a>

**<code>line&#45;name</code> — not listed as required here**

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

**Required in this object (<code>required</code>):** <a id="dt-193afe90807d3638a3aa"></a> <span id="dt-e2e56bf982b27fa65685"><code>&#34;gpio&#45;hog&#34;</code></span>, <span id="dt-7fba4c446c869d20cf9b"><code>&#34;gpios&#34;</code></span>

<a id="dt-cec64c9098a23a78bbe6"></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-935ee547587f3e75de61"></a>

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

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

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>pinctrl&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinctrl.md#dt-root>)</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;reg&#45;names&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;gpio&#45;controller&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;&#35;gpio&#45;cells&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;gpio&#45;ranges&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;clocks&#34;</code></span>, <span id="dt-4503833a9b225761c43a"><code>&#34;power&#45;domains&#34;</code></span>

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</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/clock/renesas,r9a09g077-cpg-mssr.h&gt;
#include &lt;dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h&gt;

pinctrl@802c0000 {
    compatible = "renesas,r9a09g077-pinctrl";
    reg = &lt;0x802c0000 0x2000&gt;,
          &lt;0x812c0000 0x2000&gt;,
          &lt;0x802b0000 0x2000&gt;;
    reg-names = "nsr", "srs", "srn";
    clocks = &lt;&amp;cpg CPG_CORE R9A09G077_CLK_PCLKM&gt;;
    gpio-controller;
    #gpio-cells = &lt;2&gt;;
    gpio-ranges = &lt;&amp;pinctrl 0 0 288&gt;;
    interrupt-controller;
    #interrupt-cells = &lt;2&gt;;
    power-domains = &lt;&amp;cpg&gt;;

    serial0-pins {
        pinmux = &lt;RZT2H_PORT_PINMUX(38, 0, 1)&gt;, /* Tx */
                 &lt;RZT2H_PORT_PINMUX(38, 1, 1)&gt;; /* Rx */
    };

    sd1-pwr-en-hog {
        gpio-hog;
        gpios = &lt;RZT2H_GPIO(39, 2) 0&gt;;
        output-high;
        line-name = "sd1_pwr_en";
    };

    i2c0-pins {
        pins = "RIIC0_SDA", "RIIC0_SCL";
        input-enable;
    };

    sd0-sd-group {
        ctrl-pins {
            pinmux = &lt;RZT2H_PORT_PINMUX(12, 0, 0x29)&gt;, /* SD0_CLK */
                     &lt;RZT2H_PORT_PINMUX(12, 1, 0x29)&gt;; /* SD0_CMD */
        };

        data-pins {
            pinmux = &lt;RZT2H_PORT_PINMUX(12, 0, 0x29)&gt;, /* SD0_CLK */
                     &lt;RZT2H_PORT_PINMUX(12, 1, 0x29)&gt;; /* SD0_CMD */
        };
    };
};
</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 22:</strong> <span> RZ/T2H</span></p>

<p id="dt-comment-2"><strong>Line 23:</strong> <span> RZ/N2H</span></p>

<p id="dt-comment-3"><strong>Line 92:</strong> <span> Grouping nodes: allow multiple "-pins" subnodes within a "-group"</span></p>

<p id="dt-comment-4"><strong>Line 104:</strong> <span> Standalone "-pins" nodes under client devices or groups</span></p>

</details>
