xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/pinctrl-mt8195.yaml (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/pinctrl-mt8195.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Mediatek MT8195 Pin Controller
8
9maintainers:
10  - Sean Wang <sean.wang@mediatek.com>
11
12description: |
13  The Mediatek's Pin controller is used to control SoC pins.
14
15properties:
16  compatible:
17    const: mediatek,mt8195-pinctrl
18
19  gpio-controller: true
20
21  '#gpio-cells':
22    description: |
23      Number of cells in GPIO specifier. Since the generic GPIO binding is used,
24      the amount of cells must be specified as 2. See the below
25      mentioned gpio binding representation for description of particular cells.
26    const: 2
27
28  gpio-ranges:
29    description: gpio valid number range.
30    maxItems: 1
31
32  gpio-line-names: true
33
34  reg:
35    description: |
36      Physical address base for gpio base registers. There are 8 GPIO
37      physical address base in mt8195.
38    maxItems: 8
39
40  reg-names:
41    description: |
42      Gpio base register names.
43    maxItems: 8
44
45  interrupt-controller: true
46
47  '#interrupt-cells':
48    const: 2
49
50  interrupts:
51    description: The interrupt outputs to sysirq.
52    maxItems: 1
53
54  mediatek,rsel-resistance-in-si-unit:
55    type: boolean
56    description: |
57      Identifying i2c pins pull up/down type which is RSEL. It can support
58      RSEL define or si unit value(ohm) to set different resistance.
59
60# PIN CONFIGURATION NODES
61patternProperties:
62  '-pins$':
63    type: object
64    additionalProperties: false
65    patternProperties:
66      '^pins':
67        type: object
68        additionalProperties: false
69        description: |
70          A pinctrl node should contain at least one subnodes representing the
71          pinctrl groups available on the machine. Each subnode will list the
72          pins it needs, and how they should be configured, with regard to muxer
73          configuration, pullups, drive strength, input enable/disable and
74          input schmitt.
75          An example of using macro:
76          pincontroller {
77            /* GPIO0 set as multifunction GPIO0 */
78            gpio-pins {
79              pins {
80                pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
81              }
82            };
83            /* GPIO8 set as multifunction SDA0 */
84            i2c0-pins {
85              pins {
86                pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
87              }
88            };
89          };
90        $ref: "pinmux-node.yaml"
91
92        properties:
93          pinmux:
94            description: |
95              Integer array, represents gpio pin number and mux setting.
96              Supported pin number and mux varies for different SoCs, and are
97              defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h
98              directly.
99
100          drive-strength:
101            enum: [2, 4, 6, 8, 10, 12, 14, 16]
102
103          drive-strength-microamp:
104            enum: [125, 250, 500, 1000]
105
106          bias-pull-down:
107            oneOf:
108              - type: boolean
109              - enum: [100, 101, 102, 103]
110                description: mt8195 pull down PUPD/R0/R1 type define value.
111              - enum: [200, 201, 202, 203, 204, 205, 206, 207]
112                description: mt8195 pull down RSEL type define value.
113              - enum: [75000, 5000]
114                description: mt8195 pull down RSEL type si unit value(ohm).
115            description: |
116              For pull down type is normal, it don't need add RSEL & R1R0 define
117              and resistance value.
118              For pull down type is PUPD/R0/R1 type, it can add R1R0 define to
119              set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
120              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
121              "MTK_PUPD_SET_R1R0_11" define in mt8195.
122              For pull down type is RSEL, it can add RSEL define & resistance
123              value(ohm) to set different resistance by identifying property
124              "mediatek,rsel-resistance-in-si-unit".
125              It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
126              & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
127              & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
128              & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
129              define in mt8195. It can also support resistance value(ohm)
130              "75000" & "5000" in mt8195.
131
132              An example of using RSEL define:
133              pincontroller {
134                i2c0_pin {
135                  pins {
136                    pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
137                    bias-pull-down = <MTK_PULL_SET_RSEL_001>;
138                  }
139                };
140              };
141              An example of using si unit resistance value(ohm):
142              &pio {
143                mediatek,rsel-resistance-in-si-unit;
144              }
145              pincontroller {
146                i2c0_pin {
147                  pins {
148                    pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
149                    bias-pull-down = <75000>;
150                  }
151                };
152              };
153
154          bias-pull-up:
155            oneOf:
156              - type: boolean
157              - enum: [100, 101, 102, 103]
158                description: mt8195 pull up PUPD/R0/R1 type define value.
159              - enum: [200, 201, 202, 203, 204, 205, 206, 207]
160                description: mt8195 pull up RSEL type define value.
161              - enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000]
162                description: mt8195 pull up RSEL type si unit value(ohm).
163            description: |
164              For pull up type is normal, it don't need add RSEL & R1R0 define
165              and resistance value.
166              For pull up type is PUPD/R0/R1 type, it can add R1R0 define to
167              set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
168              "MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" &
169              "MTK_PUPD_SET_R1R0_11" define in mt8195.
170              For pull up type is RSEL, it can add RSEL define & resistance
171              value(ohm) to set different resistance by identifying property
172              "mediatek,rsel-resistance-in-si-unit".
173              It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
174              & "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011"
175              & "MTK_PULL_SET_RSEL_100" & "MTK_PULL_SET_RSEL_101"
176              & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
177              define in mt8195. It can also support resistance value(ohm)
178              "1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" &
179              "75000" in mt8195.
180              An example of using RSEL define:
181              pincontroller {
182                i2c0-pins {
183                  pins {
184                    pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
185                    bias-pull-up = <MTK_PULL_SET_RSEL_001>;
186                  }
187                };
188              };
189              An example of using si unit resistance value(ohm):
190              &pio {
191                mediatek,rsel-resistance-in-si-unit;
192              }
193              pincontroller {
194                i2c0-pins {
195                  pins {
196                    pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
197                    bias-pull-up = <1000>;
198                  }
199                };
200              };
201
202          bias-disable: true
203
204          output-high: true
205
206          output-low: true
207
208          input-enable: true
209
210          input-disable: true
211
212          input-schmitt-enable: true
213
214          input-schmitt-disable: true
215
216        required:
217          - pinmux
218
219allOf:
220  - $ref: "pinctrl.yaml#"
221
222required:
223  - compatible
224  - reg
225  - interrupts
226  - interrupt-controller
227  - '#interrupt-cells'
228  - gpio-controller
229  - '#gpio-cells'
230  - gpio-ranges
231
232additionalProperties: false
233
234examples:
235  - |
236    #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
237    #include <dt-bindings/interrupt-controller/arm-gic.h>
238    #
239    pio: pinctrl@10005000 {
240      compatible = "mediatek,mt8195-pinctrl";
241      reg = <0x10005000 0x1000>,
242            <0x11d10000 0x1000>,
243            <0x11d30000 0x1000>,
244            <0x11d40000 0x1000>,
245            <0x11e20000 0x1000>,
246            <0x11eb0000 0x1000>,
247            <0x11f40000 0x1000>,
248            <0x1000b000 0x1000>;
249      reg-names = "iocfg0", "iocfg_bm", "iocfg_bl",
250                  "iocfg_br", "iocfg_lm", "iocfg_rb",
251                  "iocfg_tl", "eint";
252      gpio-controller;
253      #gpio-cells = <2>;
254      gpio-ranges = <&pio 0 0 144>;
255      interrupt-controller;
256      interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH 0>;
257      #interrupt-cells = <2>;
258
259      pio-pins {
260        pins {
261          pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
262          output-low;
263        };
264      };
265
266      spi0-pins {
267        pins-spi {
268          pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>,
269                   <PINMUX_GPIO134__FUNC_SPIM0_MO>,
270                   <PINMUX_GPIO133__FUNC_SPIM0_CLK>;
271          bias-disable;
272        };
273        pins-spi-mi {
274          pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>;
275          bias-pull-down;
276        };
277      };
278
279      i2c0-pins {
280        pins {
281          pinmux = <PINMUX_GPIO8__FUNC_SDA0>,
282                   <PINMUX_GPIO9__FUNC_SCL0>;
283          bias-disable;
284          drive-strength-microamp = <1000>;
285        };
286      };
287    };
288