# StarFive JH7100 Pin Controller

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

> Device-tree binding reference for StarFive JH7100 Pin 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;starfive&#44;jh7100&#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>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Bindings for the JH7100 RISC-V SoC from StarFive Ltd.</p>
<p style="white-space: pre-wrap">Out of the SoC's many pins only the ones named PAD_GPIO[0] to PAD_GPIO[63]
and PAD_FUNC_SHARE[0] to PAD_FUNC_SHARE[141] can be multiplexed and have
configurable bias, drive strength, schmitt trigger etc. The SoC has an
interesting 2-layered approach to pin muxing best illustrated by the diagram
below.</p>
<pre><code>                        Signal group 0, 1, ... or 6
                               ___|___
                              |       |
  LCD output -----------------|       |
  CMOS Camera interface ------|       |--- PAD_GPIO[0]
  Ethernet PHY interface -----|  MUX  |--- PAD_GPIO[1]
    ...                       |       |      ...
                              |       |--- PAD_GPIO[63]
   -------- GPIO0 ------------|       |
  |  -------|-- GPIO1 --------|       |--- PAD_FUNC_SHARE[0]
  | |       |   |             |       |--- PAD_FUNC_SHARE[1]
  | |       |   |  ...        |       |       ...
  | |       |   |             |       |--- PAD_FUNC_SHARE[141]
  | |  -----|---|-- GPIO63 ---|       |
  | | |     |   |   |          -------
  UART0     UART1 --</code></pre>
<p style="white-space: pre-wrap">The big MUX in the diagram only has 7 different ways of mapping peripherals
on the left to pins on the right. StarFive calls the 7 configurations "signal
groups".
However some peripherals have their I/O go through the 64 "GPIOs". The
diagram only shows UART0 and UART1, but this also includes a number of other
UARTs, I2Cs, SPIs, PWMs etc. All these peripherals are connected to all 64
GPIOs such that any GPIO can be set up to be controlled by any of the
peripherals.
Note that signal group 0 doesn't map any of the GPIOs to pins, and only
signal group 1 maps the GPIOs to the pins named PAD_GPIO[0] to PAD_GPIO[63].</p>
</div>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Emil Renner Berthing &#60;kernel&#64;esmil&#46;dk&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Drew Fustini &#60;drew&#64;beagleboard&#46;org&#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

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;starfive&#44;jh7100&#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>2</code></span>

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

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

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

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

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

**Item 2**

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

<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-df397b2b98a8cf834e89"></a>

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-86a6993fcd90367ac91d"><code>1</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>

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

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

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

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">The GPIO parent interrupt.</p>
</div>

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

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

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

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

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

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

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

### <code>starfive&#44;signal&#45;group</code> — not listed as required here

<div id="dt-47f97d2175bd602c2ba2">
<p style="white-space: pre-wrap">Select one of the 7 signal groups. If this property is not set it
defaults to the configuration already chosen by the earlier boot stages.</p>
</div>

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

**Allowed values (<code>enum</code>):** <a id="dt-5209da6a2376bf39e17a"></a> <span id="dt-9d10b66202f210314d2e"><code>0</code></span>, <span id="dt-6dca162c10f50eb63da5"><code>1</code></span>, <span id="dt-29839af2441821608f8c"><code>2</code></span>, <span id="dt-d8be73e674683d59c767"><code>3</code></span>, <span id="dt-03a72c557a70d7df6d43"><code>4</code></span>, <span id="dt-5622329f42f23dc8c2bd"><code>5</code></span>, <span id="dt-97abb18962174fd7bd0a"><code>6</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;reg&#45;names&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;clocks&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;gpio&#45;controller&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;&#35;gpio&#45;cells&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;interrupts&#34;</code></span>, <span id="dt-4503833a9b225761c43a"><code>&#34;interrupt&#45;controller&#34;</code></span>, <span id="dt-727c9b818c335e022c0e"><code>&#34;&#35;interrupt&#45;cells&#34;</code></span>

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

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

<a id="dt-767024746c3f2e8ec95b"></a>

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

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

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

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

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

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

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

<div id="dt-8ce33d991ee07e82e1ab">
<p style="white-space: pre-wrap">A pinctrl node should contain at least one subnode representing the
pinctrl groups available on the machine. Each subnode will list the
pins it needs, and how they should be configured, with regard to
muxer configuration, bias, input enable/disable, input schmitt
trigger enable/disable, slew-rate and drive strength.</p>
</div>

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

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

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

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

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

<div id="dt-74d5e30b04371193219c">
<p style="white-space: pre-wrap">The list of pin identifiers that properties in the node apply to.
This should be set using either the PAD_GPIO or PAD_FUNC_SHARE
macros.
Either this or "pinmux" has to be specified, but not both.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-9c92eb46b5bc941a53c3">[<code>&#47;schemas&#47;pinctrl&#47;pinmux&#45;node&#46;yaml&#35;&#47;properties&#47;pins</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinmux-node.md#dt-59fecfa5851e8becfa62>)</span>

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

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

<div id="dt-2cdd5afba37ec31ebe4c">
<p style="white-space: pre-wrap">The list of GPIOs and their mux settings that properties in the
node apply to. This should be set using the GPIOMUX macro.
Either this or "pins" has to be specified, but not both.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-94a7035c6b93647d36ce">[<code>&#47;schemas&#47;pinctrl&#47;pinmux&#45;node&#46;yaml&#35;&#47;properties&#47;pinmux</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinmux-node.md#dt-075f3f0ae5eec63808da>)</span>

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

**<code>bias&#45;disable</code> — not listed as required here**

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

<a id="dt-2246d24e24dd48f0ca04"></a>

**<code>bias&#45;pull&#45;up</code> — not listed as required here**

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

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

**<code>bias&#45;pull&#45;down</code> — not listed as required here**

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

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

**<code>drive&#45;strength</code> — not listed as required here**

**Allowed values (<code>enum</code>):** <a id="dt-9400080d2e8c9f3cf87d"></a> <span id="dt-7cdd46e58f0f2cf13b9e"><code>14</code></span>, <span id="dt-904de5a3f687902ea624"><code>21</code></span>, <span id="dt-d13f5bb2cb4a9e94980f"><code>28</code></span>, <span id="dt-8898d6d945fb0cec4e83"><code>35</code></span>, <span id="dt-c145aabf1a5939770f00"><code>42</code></span>, <span id="dt-9f7776594d60ba820e0a"><code>49</code></span>, <span id="dt-d1048d8899a75edbcfc3"><code>56</code></span>, <span id="dt-0b87b06a7cc2b19beed9"><code>63</code></span>

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

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

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

<a id="dt-96fb76fccdb40b067089"></a>

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

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

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

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

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

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

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

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

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

**<code>slew&#45;rate</code> — not listed as required here**

**Maximum value (<code>maximum</code>):** <span id="dt-56ef913d5bd54258a468"><code>7</code></span>

<a id="dt-3591b7bac71b5f97162b"></a>

**<code>starfive&#44;strong&#45;pull&#45;up</code> — not listed as required here**

<div id="dt-45fb8d2919b8fb25e857">
<p style="white-space: pre-wrap">enable strong pull-up.</p>
</div>

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

<a id="dt-b6906daa802ce692c5da"></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-69d18d7b4e9c4581a5d1"></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-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/clock/starfive-jh7100.h&gt;
#include &lt;dt-bindings/reset/starfive-jh7100.h&gt;
#include &lt;dt-bindings/pinctrl/pinctrl-starfive-jh7100.h&gt;

soc {
    #address-cells = &lt;2&gt;;
    #size-cells = &lt;2&gt;;

    pinctrl@11910000 {
        compatible = "starfive,jh7100-pinctrl";
        reg = &lt;0x0 0x11910000 0x0 0x10000&gt;,
              &lt;0x0 0x11858000 0x0 0x1000&gt;;
        reg-names = "gpio", "padctl";
        clocks = &lt;&amp;clkgen JH7100_CLK_GPIO_APB&gt;;
        resets = &lt;&amp;clkgen JH7100_RSTN_GPIO_APB&gt;;
        interrupts = &lt;32&gt;;
        gpio-controller;
        #gpio-cells = &lt;2&gt;;
        interrupt-controller;
        #interrupt-cells = &lt;2&gt;;
        starfive,signal-group = &lt;6&gt;;

        gmac_pins_default: gmac-0 {
            gtxclk-pins {
                pins = &lt;PAD_FUNC_SHARE(115)&gt;;
                bias-pull-up;
                drive-strength = &lt;35&gt;;
                input-enable;
                input-schmitt-enable;
                slew-rate = &lt;0&gt;;
            };
            miitxclk-pins {
                pins = &lt;PAD_FUNC_SHARE(116)&gt;;
                bias-pull-up;
                drive-strength = &lt;14&gt;;
                input-enable;
                input-schmitt-disable;
                slew-rate = &lt;0&gt;;
            };
            tx-pins {
                pins = &lt;PAD_FUNC_SHARE(117)&gt;,
                       &lt;PAD_FUNC_SHARE(119)&gt;,
                       &lt;PAD_FUNC_SHARE(120)&gt;,
                       &lt;PAD_FUNC_SHARE(121)&gt;,
                       &lt;PAD_FUNC_SHARE(122)&gt;,
                       &lt;PAD_FUNC_SHARE(123)&gt;,
                       &lt;PAD_FUNC_SHARE(124)&gt;,
                       &lt;PAD_FUNC_SHARE(125)&gt;,
                       &lt;PAD_FUNC_SHARE(126)&gt;;
                bias-disable;
                drive-strength = &lt;35&gt;;
                input-disable;
                input-schmitt-disable;
                slew-rate = &lt;0&gt;;
            };
            rxclk-pins {
                pins = &lt;PAD_FUNC_SHARE(127)&gt;;
                bias-pull-up;
                drive-strength = &lt;14&gt;;
                input-enable;
                input-schmitt-disable;
                slew-rate = &lt;6&gt;;
            };
            rxer-pins {
                pins = &lt;PAD_FUNC_SHARE(129)&gt;;
                bias-pull-up;
                drive-strength = &lt;14&gt;;
                input-enable;
                input-schmitt-disable;
                slew-rate = &lt;0&gt;;
            };
            rx-pins {
                pins = &lt;PAD_FUNC_SHARE(128)&gt;,
                       &lt;PAD_FUNC_SHARE(130)&gt;,
                       &lt;PAD_FUNC_SHARE(131)&gt;,
                       &lt;PAD_FUNC_SHARE(132)&gt;,
                       &lt;PAD_FUNC_SHARE(133)&gt;,
                       &lt;PAD_FUNC_SHARE(134)&gt;,
                       &lt;PAD_FUNC_SHARE(135)&gt;,
                       &lt;PAD_FUNC_SHARE(136)&gt;,
                       &lt;PAD_FUNC_SHARE(137)&gt;,
                       &lt;PAD_FUNC_SHARE(138)&gt;,
                       &lt;PAD_FUNC_SHARE(139)&gt;,
                       &lt;PAD_FUNC_SHARE(140)&gt;,
                       &lt;PAD_FUNC_SHARE(141)&gt;;
                bias-pull-up;
                drive-strength = &lt;14&gt;;
                input-enable;
                input-schmitt-enable;
                slew-rate = &lt;0&gt;;
            };
        };

        i2c0_pins_default: i2c0-0 {
            i2c-pins {
                pinmux = &lt;GPIOMUX(62, GPO_LOW,
                          GPO_I2C0_PAD_SCK_OEN,
                          GPI_I2C0_PAD_SCK_IN)&gt;,
                         &lt;GPIOMUX(61, GPO_LOW,
                          GPO_I2C0_PAD_SDA_OEN,
                          GPI_I2C0_PAD_SDA_IN)&gt;;
                bias-disable; /* external pull-up */
                input-enable;
                input-schmitt-enable;
            };
        };

        uart3_pins_default: uart3-0 {
            rx-pins {
                pinmux = &lt;GPIOMUX(13, GPO_LOW, GPO_DISABLE,
                          GPI_UART3_PAD_SIN)&gt;;
                bias-pull-up;
                input-enable;
                input-schmitt-enable;
            };
            tx-pins {
                pinmux = &lt;GPIOMUX(14, GPO_UART3_PAD_SOUT,
                          GPO_ENABLE, GPI_NONE)&gt;;
                bias-disable;
                input-disable;
                input-schmitt-disable;
            };
        };
    };

    gmac {
        pinctrl-0 = &lt;&amp;gmac_pins_default&gt;;
        pinctrl-names = "default";
    };

    i2c {
        pinctrl-0 = &lt;&amp;i2c0_pins_default&gt;;
        pinctrl-names = "default";
    };

    uart3 {
        pinctrl-0 = &lt;&amp;uart3_pins_default&gt;;
        pinctrl-names = "default";
    };
};
</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>
