# Renesas RZ/A1 combined Pin and GPIO controller

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

> Device-tree binding reference for Renesas RZ/A1 combined 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;rza1&#45;ports&#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;Jacopo Mondi &#60;jacopo&#43;renesas&#64;jmondi&#46;org&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Geert Uytterhoeven &#60;geert&#43;renesas&#64;glider&#46;be&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Renesas SoCs of the RZ/A1 family feature a combined Pin and GPIO controller, named "Ports" in the hardware reference manual. Pin multiplexing and GPIO configuration is performed on a per-pin basis writing configuration values to per-port register sets. Each "port" features up to 16 pins, each of them configurable for GPIO function (port mode) or in alternate function mode. Up to 8 different alternate function modes exist for each single pin.</p>
</div>

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

> **Exact value (<code>const</code>):** <span id="dt-d1fe1b456a54b64074d3"><code>&#34;renesas&#44;r7s72100&#45;ports&#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;renesas&#44;r7s72101&#45;ports&#34;</code></span>
>
> <a id="dt-bdc26de0ccb1d52bb6a4"></a>
>
> **Item 2**
>
> > **Exact value (<code>const</code>):** <span id="dt-cc26fa5d96bc7cf0a818"><code>&#34;renesas&#44;r7s72100&#45;ports&#34;</code></span>

<a id="dt-39cb5b72c94e12bd53ea"></a>

**Rule 3**

> **Exact value (<code>const</code>):** <span id="dt-710bc579d54b8b6b1f6c"><code>&#34;renesas&#44;r7s72102&#45;ports&#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-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>

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

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

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

### <code>&#94;gpio&#45;&#91;0&#45;9&#93;&#42;&#36;</code> — name matches this regular expression

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

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

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<div id="dt-85325047fd970aa33674">
<p style="white-space: pre-wrap">Each port of the r7s72100 pin controller hardware is itself a GPIO controller. Different SoCs have different numbers of available pins per port, but generally speaking, each of them can be configured in GPIO ("port") mode on this hardware. Describe GPIO controllers using sub-nodes with the following properties.</p>
</div>

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

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

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

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

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

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

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

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

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

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

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

**Required in this object (<code>required</code>):** <a id="dt-98f29dbce774cd6663b3"></a> <span id="dt-9966b41862cbf006ffc2"><code>&#34;gpio&#45;controller&#34;</code></span>, <span id="dt-e76c56ed528ffc1f2868"><code>&#34;&#35;gpio&#45;cells&#34;</code></span>, <span id="dt-46120548ee8f8660a3cb"><code>&#34;gpio&#45;ranges&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

> <a id="dt-74025fdda3b0f2ccbb52"></a>
>
> ### At least one of these rules must match (<code>anyOf</code>)
>
> <a id="dt-a33e995e3459bbc9c3bf"></a>
>
> #### Rule 1
>
> > **Value type (<code>type</code>):** <span id="dt-8f7d8194563269752d66"><code>&#34;object&#34;</code></span>
> >
> > <a id="dt-cd38571e0ef2875bbf7e"></a>
> >
> > **All of these rules must match (<code>allOf</code>)**
> >
> > <a id="dt-67bf03de8b1cd4523243"></a>
> >
> > **Rule 1**
> >
> > > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-a1e025752b4ac3b293ee">[<code>pincfg&#45;node&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pincfg-node.md#dt-root>)</span>
> >
> > <a id="dt-eb191eda50c42855c8ad"></a>
> >
> > **Rule 2**
> >
> > > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-85ccf6e810e3dfc514c5">[<code>pinmux&#45;node&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinmux-node.md#dt-root>)</span>
> >
> > <div id="dt-5ef1ad922cfb1e1b3a8c">
> > <p style="white-space: pre-wrap">A pin multiplexing sub-node describes how to configure a set of (or a single) pin in some desired alternate function mode. A single sub-node may define several pin configurations. A few alternate function require special pin configuration flags to be supplied along with the alternate function configuration number. The hardware reference manual specifies when a pin function requires "software IO driven" mode to be specified. To do so use the generic properties from the &lt;include/linux/pinctrl/pinconf_generic.h&gt; header file to instruct the pin controller to perform the desired pin configuration operation. The hardware reference manual specifies when a pin has to be configured to work in bi-directional mode and when the IO direction has to be specified by software. Bi-directional pins must be managed by the pin controller driver internally, while software driven IO direction has to be explicitly selected when multiple options are available.</p>
> > </div>
> >
> > <a id="dt-ee2c393d33ea61fdcb10"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-987f796a07866a67e141"></a>
> >
> > **<code>pinmux</code> — required here**
> >
> > <div id="dt-656fcad37ea816c980dd">
> > <p style="white-space: pre-wrap">Integer array representing pin number and pin multiplexing
> > configuration.
> > When a pin has to be configured in alternate function mode, use
> > this property to identify the pin by its global index, and provide
> > its alternate function configuration number along with it.
> > When multiple pins are required to be configured as part of the
> > same alternate function they shall be specified as members of the
> > same argument list of a single "pinmux" property.
> > Helper macros to ease assembling the pin index from its position
> > (port where it sits on and pin number) and alternate function
> > identifier are provided by the pin controller header file at:
> > &lt;include/dt-bindings/pinctrl/r7s72100-pinctrl.h&gt;
> > Integers values in "pinmux" argument list are assembled as:
> > ((PORT * 16 + PIN) | MUX_FUNC &lt;&lt; 16)</p>
> > </div>
> >
> > <a id="dt-9aa236e563ae7e02a33f"></a>
> >
> > **<code>input&#45;enable</code> — not listed as required here**
> >
> > <code>true</code> — No constraints added by this property rule.
> >
> > <a id="dt-c3aa330e585b96ee2073"></a>
> >
> > **<code>output&#45;enable</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-919bbbcbeed554b46cc2"></a> <span id="dt-231102036fc0ec7e09c8"><code>&#34;pinmux&#34;</code></span>
> >
> > <a id="dt-b64bb7c924d4e6b8ba7a"></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-9f432d735b8d2134a7ea"></a>
>
> #### Rule 2
>
> > **Value type (<code>type</code>):** <span id="dt-8ced3f9faed618b8bf5b"><code>&#34;object&#34;</code></span>
> >
> > <a id="dt-bce3783d1f440a7733bc"></a>
> >
> > **Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**
> >
> > > **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-fd78f5954bc3d12343f8">[<code>&#35;&#47;additionalProperties&#47;anyOf&#47;0</code>](<#dt-a33e995e3459bbc9c3bf>)</span>

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

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

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/pinctrl/r7s72100-pinctrl.h&gt;
pinctrl: pinctrl@fcfe3000 {
        compatible = "renesas,r7s72100-ports";

        reg = &lt;0xfcfe3000 0x4230&gt;;

        /*
         * A GPIO controller node, controlling 16 pins indexed from 0.
         * The GPIO controller base in the global pin indexing space is pin
         * 48, thus pins [0 - 15] on this controller map to pins [48 - 63]
         * in the global pin indexing space.
         */
        port3: gpio-3 {
                gpio-controller;
                #gpio-cells = &lt;2&gt;;
                gpio-ranges = &lt;&amp;pinctrl 0 48 16&gt;;
        };

        /*
         * A serial communication interface with a TX output pin and an RX
         * input pin.
         * Pin #0 on port #3 is configured as alternate function #6.
         * Pin #2 on port #3 is configured as alternate function #4.
         */
        scif2_pins: serial2 {
                pinmux = &lt;RZA1_PINMUX(3, 0, 6)&gt;, &lt;RZA1_PINMUX(3, 2, 4)&gt;;
        };

        /*
         * I2c master: both SDA and SCL pins need bi-directional operations
         * Pin #4 on port #1 is configured as alternate function #1.
         * Pin #5 on port #1 is configured as alternate function #1.
         * Both need to work in bi-directional mode, the driver must manage
         * this internally.
         */
        i2c2_pins: i2c2 {
                pinmux = &lt;RZA1_PINMUX(1, 4, 1)&gt;, &lt;RZA1_PINMUX(1, 5, 1)&gt;;
        };

        /*
         * Multi-function timer input and output compare pins.
         */
        tioc0_pins: tioc0 {
                /*
                 * Configure TIOC0A as software driven input
                 * Pin #0 on port #4 is configured as alternate function #2
                 * with IO direction specified by software as input.
                 */
                tioc0_input_pins {
                        pinmux = &lt;RZA1_PINMUX(4, 0, 2)&gt;;
                        input-enable;
                };

                /*
                 * Configure TIOC0B as software driven output
                 * Pin #1 on port #4 is configured as alternate function #1
                 * with IO direction specified by software as output.
                 */
                tioc0_output_pins {
                        pinmux = &lt;RZA1_PINMUX(4, 1, 1)&gt;;
                        output-enable;
                };
        };
};
</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 25:</strong> <span> RZ/A1H</span></p>

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

<p id="dt-comment-3"><strong>Line 28:</strong> <span> fallback</span></p>

<p id="dt-comment-4"><strong>Line 29:</strong> <span> RZ/A1L</span></p>

</details>
