# Canaan Kendryte K230 Pin Controller

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

> Device-tree binding reference for Canaan Kendryte K230 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;canaan&#44;k230&#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;Ze Huang &#60;18771902331&#64;163&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The Canaan Kendryte K230 platform includes 64 IO pins, each capable of multiplexing up to 5 different functions. Pin function configuration is performed on a per-pin basis.</p>
</div>

<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;canaan&#44;k230&#45;pinctrl&#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-e92215bd3c2f5373b164"></a>

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

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

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

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

<a id="dt-9069dcc32114c9a4bdd9"></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-d0f0a177b390ac94f08f">
<p style="white-space: pre-wrap">A pinctrl node should contain at least one subnode representing the pinctrl groups available on the machine.</p>
</div>

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

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

<a id="dt-45ce341b5f8458b3fea7"></a>

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

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

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

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

<a id="dt-7064e09e625fd89214c5"></a>

**Rule 1**

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1ab98dd39cc9c2f529eb">[<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-86b891e06f7f871e7d47"></a>

**Rule 2**

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

<a id="dt-c1cc29311eb694dc1318"></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-de110361542b8b6bafdd">
<p style="white-space: pre-wrap">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, slew-rate enable/disable, slew-rate, drive strength.</p>
</div>

<a id="dt-56add3280622015e4cf6"></a>

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

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

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

<div id="dt-80c6fd773465016af8f2">
<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 with the macro 'K230_PINMUX(pin, mode)'</p>
</div>

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

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

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

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

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

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

<a id="dt-272893ff51597b7e0ef2"></a>

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

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

<a id="dt-7129f258b522f4034d9b"></a>

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

**Minimum value (<code>minimum</code>):** <span id="dt-534e6a42801f883f4640"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-f442f5e57f3857784991"><code>15</code></span>

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

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

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

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

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

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

<a id="dt-05f9de5aafeae6c1b5a0"></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-435871b7469a73f711a6"></a>

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

<div id="dt-5ce248623785a397cefb">
<p style="white-space: pre-wrap">slew rate control enable
0: disable
1: enable</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-ac0087613c0809a3cec8"></a> <span id="dt-4e02b019f1577ff5f615"><code>0</code></span>, <span id="dt-25feab789c145521c44a"><code>1</code></span>

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

**<code>power&#45;source</code> — not listed as required here**

<div id="dt-a9db1d516dc6982873df">
<p style="white-space: pre-wrap">Specifies the power source voltage for the IO bank that the
pin belongs to. Each bank of IO pins operate at a specific,
fixed voltage levels. Incorrect voltage configuration can
damage the chip. The defined constants represent the
possible voltage configurations:</p>
<p style="white-space: pre-wrap">- K230_MSC_3V3 (value 0): 3.3V power supply
- K230_MSC_1V8 (value 1): 1.8V power supply</p>
<p style="white-space: pre-wrap">The following banks have the corresponding voltage
configurations:</p>
<p style="white-space: pre-wrap">- bank IO0 to IO1: Fixed at 1.8V
- bank IO2 to IO13: Fixed at 1.8V
- bank IO14 to IO25: Fixed at 1.8V
- bank IO26 to IO37: Fixed at 1.8V
- bank IO38 to IO49: Fixed at 1.8V
- bank IO50 to IO61: Fixed at 3.3V
- bank IO62 to IO63: Fixed at 1.8V</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-e3d11fce2bf528146195"></a> <span id="dt-1506a8a0cef6d00c25bd"><code>0</code></span>, <span id="dt-ab11af252df8db445c4a"><code>1</code></span>

**Required in this object (<code>required</code>):** <a id="dt-f76161ae051217197ce9"></a> <span id="dt-c70edf322d0f179a8dac"><code>&#34;pinmux&#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>

<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">pinctrl@91105000 {
    compatible = "canaan,k230-pinctrl";
    reg = &lt;0x91105000 0x100&gt;;

    uart2-pins {
        uart2-pins-cfg {
            pinmux = &lt;0x503&gt;, /* uart2 txd */
                     &lt;0x603&gt;; /* uart2 rxd */
            slew-rate = &lt;0&gt;;
            drive-strength = &lt;4&gt;;
            power-source = &lt;1&gt;;
            input-enable;
            output-enable;
            bias-disable;
        };
    };
};
</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>
