xref: /linux/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: SpacemiT K1 SoC Pin Controller
8
9maintainers:
10  - Yixun Lan <dlan@gentoo.org>
11
12properties:
13  compatible:
14    const: spacemit,k1-pinctrl
15
16  reg:
17    items:
18      - description: pinctrl io memory base
19
20patternProperties:
21  '-cfg$':
22    type: object
23    additionalProperties: false
24
25    description:
26      A pinctrl node should contain at least one subnode representing the
27      pinctrl groups available on the machine.
28
29    patternProperties:
30      '-pins$':
31        type: object
32        additionalProperties: false
33
34        description:
35          Each subnode will list the pins it needs, and how they should
36          be configured, with regard to muxer configuration, bias pull,
37          drive strength, input schmitt trigger, slew rate, power source.
38
39        allOf:
40          - $ref: pincfg-node.yaml#
41          - $ref: pinmux-node.yaml#
42
43        properties:
44          pinmux:
45            description:
46              The list of GPIOs and their mux settings that properties in the
47              node apply to. This should be set using the K1_PADCONF macro to
48              construct the value.
49
50          bias-disable: true
51
52          bias-pull-down: true
53
54          bias-pull-up:
55            description: |
56              typical value for selecting bias pull up or strong pull up.
57              0: normal bias pull up
58              1: strong bias pull up
59            enum: [ 0, 1 ]
60
61          drive-strength:
62            description: |
63              typical current when output high level.
64              1.8V output: 11, 21, 32, 42 (mA)
65              3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA)
66
67          input-schmitt:
68            description: |
69              typical threshold for schmitt trigger.
70              0: buffer mode
71              1: trigger mode
72              2, 3: trigger mode
73            $ref: /schemas/types.yaml#/definitions/uint32
74            enum: [ 0, 1, 2, 3 ]
75
76          power-source:
77            description: external power supplies at 1.8v or 3.3v.
78            enum: [ 1800, 3300 ]
79
80          slew-rate:
81            description: |
82              slew rate for output buffer.
83              0: disable it
84              1: enable it (via bundled value from drive strength)
85              2: slow speed 0
86              3: slow speed 1
87              4: medium speed
88              5: fast speed
89            enum: [ 0, 1, 2, 3, 4, 5 ]
90
91        required:
92          - pinmux
93
94required:
95  - compatible
96  - reg
97
98additionalProperties: false
99
100examples:
101  - |
102    #define K1_PADCONF(pin, func) (((pin) << 16) | (func))
103
104    soc {
105        #address-cells = <2>;
106        #size-cells = <2>;
107
108        pinctrl@d401e000 {
109            compatible = "spacemit,k1-pinctrl";
110            reg = <0x0 0xd401e000 0x0 0x400>;
111
112            uart0_2_cfg: uart0-2-cfg {
113                uart0-2-pins {
114                    pinmux = <K1_PADCONF(68, 2)>,
115                             <K1_PADCONF(69, 2)>;
116
117                    bias-pull-up = <0>;
118                    drive-strength = <32>;
119                };
120            };
121        };
122    };
123
124...
125