xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/allwinner,sun4i-a10-pinctrl.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7*7ef62cebSEmmanuel Vadottitle: Allwinner A10 Pin Controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chen-Yu Tsai <wens@csie.org>
11c66ec88fSEmmanuel Vadot  - Maxime Ripard <mripard@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotproperties:
14c66ec88fSEmmanuel Vadot  "#gpio-cells":
15c66ec88fSEmmanuel Vadot    const: 3
16c66ec88fSEmmanuel Vadot    description:
17c66ec88fSEmmanuel Vadot      GPIO consumers must use three arguments, first the number of the
18c66ec88fSEmmanuel Vadot      bank, then the pin number inside that bank, and finally the GPIO
19c66ec88fSEmmanuel Vadot      flags.
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot  "#interrupt-cells":
22c66ec88fSEmmanuel Vadot    const: 3
23c66ec88fSEmmanuel Vadot    description:
24c66ec88fSEmmanuel Vadot      Interrupts consumers must use three arguments, first the number
25c66ec88fSEmmanuel Vadot      of the bank, then the pin number inside that bank, and finally
26c66ec88fSEmmanuel Vadot      the interrupts flags.
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  compatible:
29c66ec88fSEmmanuel Vadot    enum:
30c66ec88fSEmmanuel Vadot      - allwinner,sun4i-a10-pinctrl
31c66ec88fSEmmanuel Vadot      - allwinner,sun5i-a10s-pinctrl
32c66ec88fSEmmanuel Vadot      - allwinner,sun5i-a13-pinctrl
33c66ec88fSEmmanuel Vadot      - allwinner,sun6i-a31-pinctrl
34c66ec88fSEmmanuel Vadot      - allwinner,sun6i-a31-r-pinctrl
35c66ec88fSEmmanuel Vadot      - allwinner,sun6i-a31s-pinctrl
36c66ec88fSEmmanuel Vadot      - allwinner,sun7i-a20-pinctrl
37c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a23-pinctrl
38c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a23-r-pinctrl
39c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a33-pinctrl
40c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a83t-pinctrl
41c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a83t-r-pinctrl
42c66ec88fSEmmanuel Vadot      - allwinner,sun8i-h3-pinctrl
43c66ec88fSEmmanuel Vadot      - allwinner,sun8i-h3-r-pinctrl
44c66ec88fSEmmanuel Vadot      - allwinner,sun8i-r40-pinctrl
45c66ec88fSEmmanuel Vadot      - allwinner,sun8i-v3-pinctrl
46c66ec88fSEmmanuel Vadot      - allwinner,sun8i-v3s-pinctrl
47c66ec88fSEmmanuel Vadot      - allwinner,sun9i-a80-pinctrl
48c66ec88fSEmmanuel Vadot      - allwinner,sun9i-a80-r-pinctrl
49b97ee269SEmmanuel Vadot      - allwinner,sun20i-d1-pinctrl
50c66ec88fSEmmanuel Vadot      - allwinner,sun50i-a64-pinctrl
51c66ec88fSEmmanuel Vadot      - allwinner,sun50i-a64-r-pinctrl
526be33864SEmmanuel Vadot      - allwinner,sun50i-a100-pinctrl
536be33864SEmmanuel Vadot      - allwinner,sun50i-a100-r-pinctrl
54c66ec88fSEmmanuel Vadot      - allwinner,sun50i-h5-pinctrl
55c66ec88fSEmmanuel Vadot      - allwinner,sun50i-h6-pinctrl
56c66ec88fSEmmanuel Vadot      - allwinner,sun50i-h6-r-pinctrl
575def4c47SEmmanuel Vadot      - allwinner,sun50i-h616-pinctrl
585def4c47SEmmanuel Vadot      - allwinner,sun50i-h616-r-pinctrl
59c66ec88fSEmmanuel Vadot      - allwinner,suniv-f1c100s-pinctrl
60c66ec88fSEmmanuel Vadot      - nextthing,gr8-pinctrl
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  reg:
63c66ec88fSEmmanuel Vadot    maxItems: 1
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel Vadot  interrupts:
66c66ec88fSEmmanuel Vadot    minItems: 1
675def4c47SEmmanuel Vadot    maxItems: 8
68c66ec88fSEmmanuel Vadot    description:
69c66ec88fSEmmanuel Vadot      One interrupt per external interrupt bank supported on the
70c66ec88fSEmmanuel Vadot      controller, sorted by bank number ascending order.
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  clocks:
73c66ec88fSEmmanuel Vadot    items:
74c66ec88fSEmmanuel Vadot      - description: Bus Clock
75c66ec88fSEmmanuel Vadot      - description: High Frequency Oscillator
76c66ec88fSEmmanuel Vadot      - description: Low Frequency Oscillator
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot  clock-names:
79c66ec88fSEmmanuel Vadot    items:
80c66ec88fSEmmanuel Vadot      - const: apb
81c66ec88fSEmmanuel Vadot      - const: hosc
82c66ec88fSEmmanuel Vadot      - const: losc
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot  gpio-controller: true
85c66ec88fSEmmanuel Vadot  interrupt-controller: true
86c66ec88fSEmmanuel Vadot  gpio-line-names: true
87c66ec88fSEmmanuel Vadot
88c66ec88fSEmmanuel Vadot  input-debounce:
89c66ec88fSEmmanuel Vadot    description:
90c66ec88fSEmmanuel Vadot      Debouncing periods in microseconds, one period per interrupt
91c66ec88fSEmmanuel Vadot      bank found in the controller
92c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
93c66ec88fSEmmanuel Vadot    minItems: 1
945def4c47SEmmanuel Vadot    maxItems: 8
95c66ec88fSEmmanuel Vadot
96c66ec88fSEmmanuel VadotpatternProperties:
97c66ec88fSEmmanuel Vadot  # It's pretty scary, but the basic idea is that:
98c66ec88fSEmmanuel Vadot  #   - One node name can start with either s- or r- for PRCM nodes,
99c66ec88fSEmmanuel Vadot  #   - Then, the name itself can be any repetition of <string>- (to
100c66ec88fSEmmanuel Vadot  #     accomodate with nodes like uart4-rts-cts-pins), where each
101c66ec88fSEmmanuel Vadot  #     string can be either starting with 'p' but in a string longer
102c66ec88fSEmmanuel Vadot  #     than 3, or something that doesn't start with 'p',
103c66ec88fSEmmanuel Vadot  #   - Then, the bank name is optional and will be between pa and pg,
104c66ec88fSEmmanuel Vadot  #     pl or pm. Some pins groups that have several options will have
105c66ec88fSEmmanuel Vadot  #     the pin numbers then,
106c66ec88fSEmmanuel Vadot  #   - Finally, the name will end with either -pin or pins.
107c66ec88fSEmmanuel Vadot
108c66ec88fSEmmanuel Vadot  "^([rs]-)?(([a-z0-9]{3,}|[a-oq-z][a-z0-9]*?)?-)+?(p[a-ilm][0-9]*?-)??pins?$":
109c66ec88fSEmmanuel Vadot    type: object
110c66ec88fSEmmanuel Vadot
111c66ec88fSEmmanuel Vadot    properties:
112c66ec88fSEmmanuel Vadot      pins: true
113c66ec88fSEmmanuel Vadot      function: true
114c66ec88fSEmmanuel Vadot      bias-disable: true
115c66ec88fSEmmanuel Vadot      bias-pull-up: true
116c66ec88fSEmmanuel Vadot      bias-pull-down: true
117c66ec88fSEmmanuel Vadot
118c66ec88fSEmmanuel Vadot      drive-strength:
119c66ec88fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
120c66ec88fSEmmanuel Vadot        enum: [10, 20, 30, 40]
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadot    required:
123c66ec88fSEmmanuel Vadot      - pins
124c66ec88fSEmmanuel Vadot      - function
125c66ec88fSEmmanuel Vadot
126c66ec88fSEmmanuel Vadot    additionalProperties: false
127c66ec88fSEmmanuel Vadot
128b97ee269SEmmanuel Vadot  "^vcc-p[a-ilm]-supply$":
129c66ec88fSEmmanuel Vadot    description:
130c66ec88fSEmmanuel Vadot      Power supplies for pin banks.
131c66ec88fSEmmanuel Vadot
132c66ec88fSEmmanuel Vadotrequired:
133c66ec88fSEmmanuel Vadot  - "#gpio-cells"
134c66ec88fSEmmanuel Vadot  - compatible
135c66ec88fSEmmanuel Vadot  - reg
136c66ec88fSEmmanuel Vadot  - clocks
137c66ec88fSEmmanuel Vadot  - clock-names
138c66ec88fSEmmanuel Vadot  - gpio-controller
139c66ec88fSEmmanuel Vadot
140c66ec88fSEmmanuel VadotallOf:
141c66ec88fSEmmanuel Vadot  # FIXME: We should have the pin bank supplies here, but not a lot of
142c66ec88fSEmmanuel Vadot  # boards are defining it at the moment so it would generate a lot of
143c66ec88fSEmmanuel Vadot  # warnings.
144c66ec88fSEmmanuel Vadot
145e67e8565SEmmanuel Vadot  - $ref: "pinctrl.yaml#"
146c66ec88fSEmmanuel Vadot  - if:
147b97ee269SEmmanuel Vadot      not:
148b97ee269SEmmanuel Vadot        properties:
149b97ee269SEmmanuel Vadot          compatible:
150b97ee269SEmmanuel Vadot            enum:
151b97ee269SEmmanuel Vadot              - allwinner,sun50i-h616-r-pinctrl
152b97ee269SEmmanuel Vadot
153b97ee269SEmmanuel Vadot    then:
154b97ee269SEmmanuel Vadot      required:
155b97ee269SEmmanuel Vadot        - "#interrupt-cells"
156b97ee269SEmmanuel Vadot        - interrupts
157b97ee269SEmmanuel Vadot        - interrupt-controller
158b97ee269SEmmanuel Vadot
159b97ee269SEmmanuel Vadot  - if:
160c66ec88fSEmmanuel Vadot      properties:
161c66ec88fSEmmanuel Vadot        compatible:
162c66ec88fSEmmanuel Vadot          enum:
1635def4c47SEmmanuel Vadot            - allwinner,sun50i-h616-pinctrl
1645def4c47SEmmanuel Vadot
1655def4c47SEmmanuel Vadot    then:
1665def4c47SEmmanuel Vadot      properties:
1675def4c47SEmmanuel Vadot        interrupts:
1685def4c47SEmmanuel Vadot          minItems: 8
1695def4c47SEmmanuel Vadot
1705def4c47SEmmanuel Vadot  - if:
1715def4c47SEmmanuel Vadot      properties:
1725def4c47SEmmanuel Vadot        compatible:
1735def4c47SEmmanuel Vadot          enum:
1746be33864SEmmanuel Vadot            - allwinner,sun50i-a100-pinctrl
1756be33864SEmmanuel Vadot
1766be33864SEmmanuel Vadot    then:
1776be33864SEmmanuel Vadot      properties:
1786be33864SEmmanuel Vadot        interrupts:
1796be33864SEmmanuel Vadot          minItems: 7
1806be33864SEmmanuel Vadot          maxItems: 7
1816be33864SEmmanuel Vadot
1826be33864SEmmanuel Vadot  - if:
1836be33864SEmmanuel Vadot      properties:
1846be33864SEmmanuel Vadot        compatible:
1856be33864SEmmanuel Vadot          enum:
186b97ee269SEmmanuel Vadot            - allwinner,sun20i-d1-pinctrl
187b97ee269SEmmanuel Vadot
188b97ee269SEmmanuel Vadot    then:
189b97ee269SEmmanuel Vadot      properties:
190b97ee269SEmmanuel Vadot        interrupts:
191b97ee269SEmmanuel Vadot          minItems: 6
192b97ee269SEmmanuel Vadot          maxItems: 6
193b97ee269SEmmanuel Vadot
194b97ee269SEmmanuel Vadot  - if:
195b97ee269SEmmanuel Vadot      properties:
196b97ee269SEmmanuel Vadot        compatible:
197b97ee269SEmmanuel Vadot          enum:
198c66ec88fSEmmanuel Vadot            - allwinner,sun9i-a80-pinctrl
199c66ec88fSEmmanuel Vadot
200c66ec88fSEmmanuel Vadot    then:
201c66ec88fSEmmanuel Vadot      properties:
202c66ec88fSEmmanuel Vadot        interrupts:
203c66ec88fSEmmanuel Vadot          minItems: 5
204c66ec88fSEmmanuel Vadot          maxItems: 5
205c66ec88fSEmmanuel Vadot
2066be33864SEmmanuel Vadot  - if:
207c66ec88fSEmmanuel Vadot      properties:
208c66ec88fSEmmanuel Vadot        compatible:
209c66ec88fSEmmanuel Vadot          enum:
210c66ec88fSEmmanuel Vadot            - allwinner,sun6i-a31-pinctrl
211c66ec88fSEmmanuel Vadot            - allwinner,sun6i-a31s-pinctrl
212c66ec88fSEmmanuel Vadot            - allwinner,sun50i-h6-pinctrl
213c66ec88fSEmmanuel Vadot
214c66ec88fSEmmanuel Vadot    then:
215c66ec88fSEmmanuel Vadot      properties:
216c66ec88fSEmmanuel Vadot        interrupts:
217c66ec88fSEmmanuel Vadot          minItems: 4
218c66ec88fSEmmanuel Vadot          maxItems: 4
219c66ec88fSEmmanuel Vadot
2206be33864SEmmanuel Vadot  - if:
221c66ec88fSEmmanuel Vadot      properties:
222c66ec88fSEmmanuel Vadot        compatible:
223c66ec88fSEmmanuel Vadot          enum:
224c66ec88fSEmmanuel Vadot            - allwinner,sun8i-a23-pinctrl
225c66ec88fSEmmanuel Vadot            - allwinner,sun8i-a83t-pinctrl
226c66ec88fSEmmanuel Vadot            - allwinner,sun50i-a64-pinctrl
227c66ec88fSEmmanuel Vadot            - allwinner,sun50i-h5-pinctrl
228c66ec88fSEmmanuel Vadot            - allwinner,suniv-f1c100s-pinctrl
229c66ec88fSEmmanuel Vadot
230c66ec88fSEmmanuel Vadot    then:
231c66ec88fSEmmanuel Vadot      properties:
232c66ec88fSEmmanuel Vadot        interrupts:
233c66ec88fSEmmanuel Vadot          minItems: 3
234c66ec88fSEmmanuel Vadot          maxItems: 3
235c66ec88fSEmmanuel Vadot
2366be33864SEmmanuel Vadot  - if:
237c66ec88fSEmmanuel Vadot      properties:
238c66ec88fSEmmanuel Vadot        compatible:
239c66ec88fSEmmanuel Vadot          enum:
240c66ec88fSEmmanuel Vadot            - allwinner,sun6i-a31-r-pinctrl
241c66ec88fSEmmanuel Vadot            - allwinner,sun8i-a33-pinctrl
242c66ec88fSEmmanuel Vadot            - allwinner,sun8i-h3-pinctrl
243c66ec88fSEmmanuel Vadot            - allwinner,sun8i-v3-pinctrl
244c66ec88fSEmmanuel Vadot            - allwinner,sun8i-v3s-pinctrl
245c66ec88fSEmmanuel Vadot            - allwinner,sun9i-a80-r-pinctrl
246c66ec88fSEmmanuel Vadot            - allwinner,sun50i-h6-r-pinctrl
247c66ec88fSEmmanuel Vadot
248c66ec88fSEmmanuel Vadot    then:
249c66ec88fSEmmanuel Vadot      properties:
250c66ec88fSEmmanuel Vadot        interrupts:
251c66ec88fSEmmanuel Vadot          minItems: 2
252c66ec88fSEmmanuel Vadot          maxItems: 2
253c66ec88fSEmmanuel Vadot
2546be33864SEmmanuel Vadot  - if:
2556be33864SEmmanuel Vadot      properties:
2566be33864SEmmanuel Vadot        compatible:
2576be33864SEmmanuel Vadot          enum:
2586be33864SEmmanuel Vadot            - allwinner,sun4i-a10-pinctrl
2596be33864SEmmanuel Vadot            - allwinner,sun5i-a10s-pinctrl
2606be33864SEmmanuel Vadot            - allwinner,sun5i-a13-pinctrl
2616be33864SEmmanuel Vadot            - allwinner,sun7i-a20-pinctrl
2626be33864SEmmanuel Vadot            - allwinner,sun8i-a23-r-pinctrl
2636be33864SEmmanuel Vadot            - allwinner,sun8i-a83t-r-pinctrl
2646be33864SEmmanuel Vadot            - allwinner,sun8i-h3-r-pinctrl
2656be33864SEmmanuel Vadot            - allwinner,sun8i-r40-pinctrl
2666be33864SEmmanuel Vadot            - allwinner,sun50i-a64-r-pinctrl
2676be33864SEmmanuel Vadot            - allwinner,sun50i-a100-r-pinctrl
2686be33864SEmmanuel Vadot            - nextthing,gr8-pinctrl
2696be33864SEmmanuel Vadot
2706be33864SEmmanuel Vadot    then:
271c66ec88fSEmmanuel Vadot      properties:
272c66ec88fSEmmanuel Vadot        interrupts:
273c66ec88fSEmmanuel Vadot          minItems: 1
274c66ec88fSEmmanuel Vadot          maxItems: 1
275c66ec88fSEmmanuel Vadot
276c66ec88fSEmmanuel VadotadditionalProperties: false
277c66ec88fSEmmanuel Vadot
278c66ec88fSEmmanuel Vadotexamples:
279c66ec88fSEmmanuel Vadot  - |
280c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/sun5i-ccu.h>
281c66ec88fSEmmanuel Vadot
282c66ec88fSEmmanuel Vadot    pio: pinctrl@1c20800 {
283c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun5i-a13-pinctrl";
284c66ec88fSEmmanuel Vadot        reg = <0x01c20800 0x400>;
285c66ec88fSEmmanuel Vadot        interrupts = <28>;
286c66ec88fSEmmanuel Vadot        clocks = <&ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>;
287c66ec88fSEmmanuel Vadot        clock-names = "apb", "hosc", "losc";
288c66ec88fSEmmanuel Vadot        gpio-controller;
289c66ec88fSEmmanuel Vadot        interrupt-controller;
290c66ec88fSEmmanuel Vadot        #interrupt-cells = <3>;
291c66ec88fSEmmanuel Vadot        #gpio-cells = <3>;
292c66ec88fSEmmanuel Vadot
293c66ec88fSEmmanuel Vadot        uart1_pe_pins: uart1-pe-pins {
294c66ec88fSEmmanuel Vadot            pins = "PE10", "PE11";
295c66ec88fSEmmanuel Vadot            function = "uart1";
296c66ec88fSEmmanuel Vadot        };
297c66ec88fSEmmanuel Vadot
298c66ec88fSEmmanuel Vadot        uart1_pg_pins: uart1-pg-pins {
299c66ec88fSEmmanuel Vadot            pins = "PG3", "PG4";
300c66ec88fSEmmanuel Vadot            function = "uart1";
301c66ec88fSEmmanuel Vadot        };
302c66ec88fSEmmanuel Vadot    };
303