xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/ingenic,pinctrl.yaml (revision 2eb4d8dc723da3cf7d735a3226ae49da4c8c5dbc)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/ingenic,pinctrl.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Ingenic SoCs pin controller devicetree bindings
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: >
10c66ec88fSEmmanuel Vadot  Please refer to pinctrl-bindings.txt in this directory for details of the
11c66ec88fSEmmanuel Vadot  common pinctrl bindings used by client devices, including the meaning of the
12c66ec88fSEmmanuel Vadot  phrase "pin configuration node".
13c66ec88fSEmmanuel Vadot
14c66ec88fSEmmanuel Vadot  For the Ingenic SoCs, pin control is tightly bound with GPIO ports. All pins
15c66ec88fSEmmanuel Vadot  may be used as GPIOs, multiplexed device functions are configured within the
16c66ec88fSEmmanuel Vadot  GPIO port configuration registers and it is typical to refer to pins using the
17c66ec88fSEmmanuel Vadot  naming scheme "PxN" where x is a character identifying the GPIO port with
18c66ec88fSEmmanuel Vadot  which the pin is associated and N is an integer from 0 to 31 identifying the
19c66ec88fSEmmanuel Vadot  pin within that GPIO port. For example PA0 is the first pin in GPIO port A,
20*2eb4d8dcSEmmanuel Vadot  and PB31 is the last pin in GPIO port B. The JZ4730, the JZ4740, the JZ4725B,
21*2eb4d8dcSEmmanuel Vadot  the X1000 and the X1830 contains 4 GPIO ports, PA to PD, for a total of 128
22*2eb4d8dcSEmmanuel Vadot  pins. The X2000 contains 5 GPIO ports, PA to PE, for a total of 160 pins.
23*2eb4d8dcSEmmanuel Vadot  The JZ4750, the JZ4755 the JZ4760, the JZ4770 and the JZ4780 contains 6 GPIO
24*2eb4d8dcSEmmanuel Vadot  ports, PA to PF, for a total of 192 pins. The JZ4775 contains 7 GPIO ports,
25*2eb4d8dcSEmmanuel Vadot  PA to PG, for a total of 224 pins.
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadotmaintainers:
28c66ec88fSEmmanuel Vadot  - Paul Cercueil <paul@crapouillou.net>
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadotproperties:
31c66ec88fSEmmanuel Vadot  nodename:
32c66ec88fSEmmanuel Vadot    pattern: "^pinctrl@[0-9a-f]+$"
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  compatible:
35c66ec88fSEmmanuel Vadot    oneOf:
36c66ec88fSEmmanuel Vadot      - enum:
37*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4730-pinctrl
38c66ec88fSEmmanuel Vadot          - ingenic,jz4740-pinctrl
39c66ec88fSEmmanuel Vadot          - ingenic,jz4725b-pinctrl
40*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4750-pinctrl
41*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4755-pinctrl
42c66ec88fSEmmanuel Vadot          - ingenic,jz4760-pinctrl
43c66ec88fSEmmanuel Vadot          - ingenic,jz4770-pinctrl
44*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4775-pinctrl
45c66ec88fSEmmanuel Vadot          - ingenic,jz4780-pinctrl
46c66ec88fSEmmanuel Vadot          - ingenic,x1000-pinctrl
47c66ec88fSEmmanuel Vadot          - ingenic,x1500-pinctrl
48c66ec88fSEmmanuel Vadot          - ingenic,x1830-pinctrl
49*2eb4d8dcSEmmanuel Vadot          - ingenic,x2000-pinctrl
50c66ec88fSEmmanuel Vadot      - items:
51c66ec88fSEmmanuel Vadot          - const: ingenic,jz4760b-pinctrl
52c66ec88fSEmmanuel Vadot          - const: ingenic,jz4760-pinctrl
53c66ec88fSEmmanuel Vadot      - items:
54c66ec88fSEmmanuel Vadot          - const: ingenic,x1000e-pinctrl
55c66ec88fSEmmanuel Vadot          - const: ingenic,x1000-pinctrl
56*2eb4d8dcSEmmanuel Vadot      - items:
57*2eb4d8dcSEmmanuel Vadot          - const: ingenic,x2000e-pinctrl
58*2eb4d8dcSEmmanuel Vadot          - const: ingenic,x2000-pinctrl
59c66ec88fSEmmanuel Vadot
60c66ec88fSEmmanuel Vadot  reg:
61c66ec88fSEmmanuel Vadot    maxItems: 1
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel Vadot  "#address-cells":
64c66ec88fSEmmanuel Vadot    const: 1
65c66ec88fSEmmanuel Vadot
66c66ec88fSEmmanuel Vadot  "#size-cells":
67c66ec88fSEmmanuel Vadot    const: 0
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel VadotpatternProperties:
70c66ec88fSEmmanuel Vadot  "^gpio@[0-9]$":
71c66ec88fSEmmanuel Vadot    type: object
72c66ec88fSEmmanuel Vadot    properties:
73c66ec88fSEmmanuel Vadot      compatible:
74c66ec88fSEmmanuel Vadot        enum:
75*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4730-gpio
76c66ec88fSEmmanuel Vadot          - ingenic,jz4740-gpio
77c66ec88fSEmmanuel Vadot          - ingenic,jz4725b-gpio
78*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4750-gpio
79*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4755-gpio
80c66ec88fSEmmanuel Vadot          - ingenic,jz4760-gpio
81c66ec88fSEmmanuel Vadot          - ingenic,jz4770-gpio
82*2eb4d8dcSEmmanuel Vadot          - ingenic,jz4775-gpio
83c66ec88fSEmmanuel Vadot          - ingenic,jz4780-gpio
84c66ec88fSEmmanuel Vadot          - ingenic,x1000-gpio
85c66ec88fSEmmanuel Vadot          - ingenic,x1500-gpio
86c66ec88fSEmmanuel Vadot          - ingenic,x1830-gpio
87*2eb4d8dcSEmmanuel Vadot          - ingenic,x2000-gpio
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot      reg:
90c66ec88fSEmmanuel Vadot        items:
91c66ec88fSEmmanuel Vadot          - description: The GPIO bank number
92c66ec88fSEmmanuel Vadot
93c66ec88fSEmmanuel Vadot      gpio-controller: true
94c66ec88fSEmmanuel Vadot
95c66ec88fSEmmanuel Vadot      "#gpio-cells":
96c66ec88fSEmmanuel Vadot        const: 2
97c66ec88fSEmmanuel Vadot
98c66ec88fSEmmanuel Vadot      gpio-ranges:
99c66ec88fSEmmanuel Vadot        maxItems: 1
100c66ec88fSEmmanuel Vadot
101c66ec88fSEmmanuel Vadot      interrupt-controller: true
102c66ec88fSEmmanuel Vadot
103c66ec88fSEmmanuel Vadot      "#interrupt-cells":
104c66ec88fSEmmanuel Vadot        const: 2
105c66ec88fSEmmanuel Vadot        description:
106c66ec88fSEmmanuel Vadot          Refer to ../interrupt-controller/interrupts.txt for more details.
107c66ec88fSEmmanuel Vadot
108c66ec88fSEmmanuel Vadot      interrupts:
109c66ec88fSEmmanuel Vadot        maxItems: 1
110c66ec88fSEmmanuel Vadot
111c66ec88fSEmmanuel Vadot    required:
112c66ec88fSEmmanuel Vadot      - compatible
113c66ec88fSEmmanuel Vadot      - reg
114c66ec88fSEmmanuel Vadot      - gpio-controller
115c66ec88fSEmmanuel Vadot      - "#gpio-cells"
116c66ec88fSEmmanuel Vadot      - interrupts
117c66ec88fSEmmanuel Vadot      - interrupt-controller
118c66ec88fSEmmanuel Vadot      - "#interrupt-cells"
119c66ec88fSEmmanuel Vadot
120c66ec88fSEmmanuel Vadot    additionalProperties: false
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadotrequired:
123c66ec88fSEmmanuel Vadot  - compatible
124c66ec88fSEmmanuel Vadot  - reg
125c66ec88fSEmmanuel Vadot  - "#address-cells"
126c66ec88fSEmmanuel Vadot  - "#size-cells"
127c66ec88fSEmmanuel Vadot
128c66ec88fSEmmanuel VadotadditionalProperties:
129c66ec88fSEmmanuel Vadot  anyOf:
130c66ec88fSEmmanuel Vadot    - type: object
131c66ec88fSEmmanuel Vadot      allOf:
132c66ec88fSEmmanuel Vadot        - $ref: pincfg-node.yaml#
133c66ec88fSEmmanuel Vadot        - $ref: pinmux-node.yaml#
134c66ec88fSEmmanuel Vadot
135c66ec88fSEmmanuel Vadot      properties:
136c66ec88fSEmmanuel Vadot        phandle: true
137c66ec88fSEmmanuel Vadot        function: true
138c66ec88fSEmmanuel Vadot        groups: true
139c66ec88fSEmmanuel Vadot        pins: true
140c66ec88fSEmmanuel Vadot        bias-disable: true
141c66ec88fSEmmanuel Vadot        bias-pull-up: true
142c66ec88fSEmmanuel Vadot        bias-pull-down: true
143c66ec88fSEmmanuel Vadot        output-low: true
144c66ec88fSEmmanuel Vadot        output-high: true
145c66ec88fSEmmanuel Vadot      additionalProperties: false
146c66ec88fSEmmanuel Vadot
147c66ec88fSEmmanuel Vadot    - type: object
148c66ec88fSEmmanuel Vadot      properties:
149c66ec88fSEmmanuel Vadot        phandle: true
150c66ec88fSEmmanuel Vadot      additionalProperties:
151c66ec88fSEmmanuel Vadot        type: object
152c66ec88fSEmmanuel Vadot        allOf:
153c66ec88fSEmmanuel Vadot          - $ref: pincfg-node.yaml#
154c66ec88fSEmmanuel Vadot          - $ref: pinmux-node.yaml#
155c66ec88fSEmmanuel Vadot
156c66ec88fSEmmanuel Vadot        properties:
157c66ec88fSEmmanuel Vadot          phandle: true
158c66ec88fSEmmanuel Vadot          function: true
159c66ec88fSEmmanuel Vadot          groups: true
160c66ec88fSEmmanuel Vadot          pins: true
161c66ec88fSEmmanuel Vadot          bias-disable: true
162c66ec88fSEmmanuel Vadot          bias-pull-up: true
163c66ec88fSEmmanuel Vadot          bias-pull-down: true
164c66ec88fSEmmanuel Vadot          output-low: true
165c66ec88fSEmmanuel Vadot          output-high: true
166c66ec88fSEmmanuel Vadot        additionalProperties: false
167c66ec88fSEmmanuel Vadot
168c66ec88fSEmmanuel Vadotexamples:
169c66ec88fSEmmanuel Vadot  - |
170c66ec88fSEmmanuel Vadot    pin-controller@10010000 {
171c66ec88fSEmmanuel Vadot      compatible = "ingenic,jz4770-pinctrl";
172c66ec88fSEmmanuel Vadot      reg = <0x10010000 0x600>;
173c66ec88fSEmmanuel Vadot
174c66ec88fSEmmanuel Vadot      #address-cells = <1>;
175c66ec88fSEmmanuel Vadot      #size-cells = <0>;
176c66ec88fSEmmanuel Vadot
177c66ec88fSEmmanuel Vadot      gpio@0 {
178c66ec88fSEmmanuel Vadot        compatible = "ingenic,jz4770-gpio";
179c66ec88fSEmmanuel Vadot        reg = <0>;
180c66ec88fSEmmanuel Vadot
181c66ec88fSEmmanuel Vadot        gpio-controller;
182c66ec88fSEmmanuel Vadot        gpio-ranges = <&pinctrl 0 0 32>;
183c66ec88fSEmmanuel Vadot        #gpio-cells = <2>;
184c66ec88fSEmmanuel Vadot
185c66ec88fSEmmanuel Vadot        interrupt-controller;
186c66ec88fSEmmanuel Vadot        #interrupt-cells = <2>;
187c66ec88fSEmmanuel Vadot
188c66ec88fSEmmanuel Vadot        interrupt-parent = <&intc>;
189c66ec88fSEmmanuel Vadot        interrupts = <17>;
190c66ec88fSEmmanuel Vadot      };
191c66ec88fSEmmanuel Vadot    };
192