xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/renesas,rzg2l-pinctrl.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1354d7675SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2354d7675SEmmanuel Vadot%YAML 1.2
3354d7675SEmmanuel Vadot---
4354d7675SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/renesas,rzg2l-pinctrl.yaml#
5354d7675SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6354d7675SEmmanuel Vadot
7c9ccf3a3SEmmanuel Vadottitle: Renesas RZ/{G2L,V2L} combined Pin and GPIO controller
8354d7675SEmmanuel Vadot
9354d7675SEmmanuel Vadotmaintainers:
10354d7675SEmmanuel Vadot  - Geert Uytterhoeven <geert+renesas@glider.be>
11354d7675SEmmanuel Vadot  - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
12354d7675SEmmanuel Vadot
13354d7675SEmmanuel Vadotdescription:
14d5b0e70fSEmmanuel Vadot  The Renesas SoCs of the RZ/{G2L,V2L} alike series feature a combined Pin and
15d5b0e70fSEmmanuel Vadot  GPIO controller.
16354d7675SEmmanuel Vadot  Pin multiplexing and GPIO configuration is performed on a per-pin basis.
17354d7675SEmmanuel Vadot  Each port features up to 8 pins, each of them configurable for GPIO function
18354d7675SEmmanuel Vadot  (port mode) or in alternate function mode.
19354d7675SEmmanuel Vadot  Up to 8 different alternate function modes exist for each single pin.
20354d7675SEmmanuel Vadot
21354d7675SEmmanuel Vadotproperties:
22354d7675SEmmanuel Vadot  compatible:
23c9ccf3a3SEmmanuel Vadot    oneOf:
24c9ccf3a3SEmmanuel Vadot      - items:
25c9ccf3a3SEmmanuel Vadot          - enum:
267ef62cebSEmmanuel Vadot              - renesas,r9a07g043-pinctrl # RZ/G2UL{Type-1,Type-2} and RZ/Five
27354d7675SEmmanuel Vadot              - renesas,r9a07g044-pinctrl # RZ/G2{L,LC}
28*84943d6fSEmmanuel Vadot              - renesas,r9a08g045-pinctrl # RZ/G3S
29354d7675SEmmanuel Vadot
30c9ccf3a3SEmmanuel Vadot      - items:
31c9ccf3a3SEmmanuel Vadot          - enum:
32c9ccf3a3SEmmanuel Vadot              - renesas,r9a07g054-pinctrl     # RZ/V2L
33c9ccf3a3SEmmanuel Vadot          - const: renesas,r9a07g044-pinctrl  # RZ/G2{L,LC} fallback for RZ/V2L
34c9ccf3a3SEmmanuel Vadot
35354d7675SEmmanuel Vadot  reg:
36354d7675SEmmanuel Vadot    maxItems: 1
37354d7675SEmmanuel Vadot
38354d7675SEmmanuel Vadot  gpio-controller: true
39354d7675SEmmanuel Vadot
40354d7675SEmmanuel Vadot  '#gpio-cells':
41354d7675SEmmanuel Vadot    const: 2
42354d7675SEmmanuel Vadot    description:
43354d7675SEmmanuel Vadot      The first cell contains the global GPIO port index, constructed using the
44354d7675SEmmanuel Vadot      RZG2L_GPIO() helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h> and the
45354d7675SEmmanuel Vadot      second cell represents consumer flag as mentioned in ../gpio/gpio.txt
46354d7675SEmmanuel Vadot      E.g. "RZG2L_GPIO(39, 1)" for P39_1.
47354d7675SEmmanuel Vadot
48354d7675SEmmanuel Vadot  gpio-ranges:
49354d7675SEmmanuel Vadot    maxItems: 1
50354d7675SEmmanuel Vadot
51b97ee269SEmmanuel Vadot  interrupt-controller: true
52b97ee269SEmmanuel Vadot
53b97ee269SEmmanuel Vadot  '#interrupt-cells':
54b97ee269SEmmanuel Vadot    const: 2
55b97ee269SEmmanuel Vadot    description:
56b97ee269SEmmanuel Vadot      The first cell contains the global GPIO port index, constructed using the
57b97ee269SEmmanuel Vadot      RZG2L_GPIO() helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h> and the
58b97ee269SEmmanuel Vadot      second cell is used to specify the flag.
59b97ee269SEmmanuel Vadot      E.g. "interrupts = <RZG2L_GPIO(43, 0) IRQ_TYPE_EDGE_FALLING>;" if P43_0 is
60b97ee269SEmmanuel Vadot      being used as an interrupt.
61b97ee269SEmmanuel Vadot
62354d7675SEmmanuel Vadot  clocks:
63354d7675SEmmanuel Vadot    maxItems: 1
64354d7675SEmmanuel Vadot
65354d7675SEmmanuel Vadot  power-domains:
66354d7675SEmmanuel Vadot    maxItems: 1
67354d7675SEmmanuel Vadot
68354d7675SEmmanuel Vadot  resets:
69354d7675SEmmanuel Vadot    items:
70354d7675SEmmanuel Vadot      - description: GPIO_RSTN signal
71354d7675SEmmanuel Vadot      - description: GPIO_PORT_RESETN signal
72354d7675SEmmanuel Vadot      - description: GPIO_SPARE_RESETN signal
73354d7675SEmmanuel Vadot
74354d7675SEmmanuel VadotadditionalProperties:
75354d7675SEmmanuel Vadot  anyOf:
76354d7675SEmmanuel Vadot    - type: object
77*84943d6fSEmmanuel Vadot      additionalProperties: false
78354d7675SEmmanuel Vadot      allOf:
79354d7675SEmmanuel Vadot        - $ref: pincfg-node.yaml#
80354d7675SEmmanuel Vadot        - $ref: pinmux-node.yaml#
81354d7675SEmmanuel Vadot
82*84943d6fSEmmanuel Vadot        - if:
83*84943d6fSEmmanuel Vadot            properties:
84*84943d6fSEmmanuel Vadot              compatible:
85*84943d6fSEmmanuel Vadot                contains:
86*84943d6fSEmmanuel Vadot                  enum:
87*84943d6fSEmmanuel Vadot                    - renesas,r9a08g045-pinctrl
88*84943d6fSEmmanuel Vadot          then:
89*84943d6fSEmmanuel Vadot            properties:
90*84943d6fSEmmanuel Vadot              drive-strength: false
91*84943d6fSEmmanuel Vadot              output-impedance-ohms: false
92*84943d6fSEmmanuel Vadot              slew-rate: false
93*84943d6fSEmmanuel Vadot          else:
94*84943d6fSEmmanuel Vadot            properties:
95*84943d6fSEmmanuel Vadot              drive-strength-microamp: false
96*84943d6fSEmmanuel Vadot
97354d7675SEmmanuel Vadot      description:
98354d7675SEmmanuel Vadot        Pin controller client devices use pin configuration subnodes (children
99354d7675SEmmanuel Vadot        and grandchildren) for desired pin configuration.
100354d7675SEmmanuel Vadot        Client device subnodes use below standard properties.
101354d7675SEmmanuel Vadot
102354d7675SEmmanuel Vadot      properties:
103354d7675SEmmanuel Vadot        pinmux:
104354d7675SEmmanuel Vadot          description:
105354d7675SEmmanuel Vadot            Values are constructed from GPIO port number, pin number, and
106354d7675SEmmanuel Vadot            alternate function configuration number using the RZG2L_PORT_PINMUX()
107354d7675SEmmanuel Vadot            helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h>.
108354d7675SEmmanuel Vadot        pins: true
109354d7675SEmmanuel Vadot        drive-strength:
110354d7675SEmmanuel Vadot          enum: [ 2, 4, 8, 12 ]
111*84943d6fSEmmanuel Vadot        drive-strength-microamp:
112*84943d6fSEmmanuel Vadot          enum: [ 1900, 2200, 4000, 4400, 4500, 4700, 5200, 5300, 5700,
113*84943d6fSEmmanuel Vadot                  5800, 6000, 6050, 6100, 6550, 6800, 7000, 8000, 9000,
114*84943d6fSEmmanuel Vadot                  10000 ]
115e67e8565SEmmanuel Vadot        output-impedance-ohms:
116e67e8565SEmmanuel Vadot          enum: [ 33, 50, 66, 100 ]
117354d7675SEmmanuel Vadot        power-source:
118c9ccf3a3SEmmanuel Vadot          description: I/O voltage in millivolt.
119354d7675SEmmanuel Vadot          enum: [ 1800, 2500, 3300 ]
120354d7675SEmmanuel Vadot        slew-rate: true
121354d7675SEmmanuel Vadot        gpio-hog: true
122354d7675SEmmanuel Vadot        gpios: true
123354d7675SEmmanuel Vadot        input-enable: true
124354d7675SEmmanuel Vadot        output-high: true
125354d7675SEmmanuel Vadot        output-low: true
126354d7675SEmmanuel Vadot        line-name: true
127354d7675SEmmanuel Vadot
128354d7675SEmmanuel Vadot    - type: object
129354d7675SEmmanuel Vadot      additionalProperties:
130354d7675SEmmanuel Vadot        $ref: "#/additionalProperties/anyOf/0"
131354d7675SEmmanuel Vadot
132e67e8565SEmmanuel VadotallOf:
133fac71e4eSEmmanuel Vadot  - $ref: pinctrl.yaml#
134e67e8565SEmmanuel Vadot
135354d7675SEmmanuel Vadotrequired:
136354d7675SEmmanuel Vadot  - compatible
137354d7675SEmmanuel Vadot  - reg
138354d7675SEmmanuel Vadot  - gpio-controller
139354d7675SEmmanuel Vadot  - '#gpio-cells'
140354d7675SEmmanuel Vadot  - gpio-ranges
141b97ee269SEmmanuel Vadot  - interrupt-controller
142b97ee269SEmmanuel Vadot  - '#interrupt-cells'
143354d7675SEmmanuel Vadot  - clocks
144354d7675SEmmanuel Vadot  - power-domains
145354d7675SEmmanuel Vadot  - resets
146354d7675SEmmanuel Vadot
147354d7675SEmmanuel Vadotexamples:
148354d7675SEmmanuel Vadot  - |
149354d7675SEmmanuel Vadot    #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
150354d7675SEmmanuel Vadot    #include <dt-bindings/clock/r9a07g044-cpg.h>
151354d7675SEmmanuel Vadot
152354d7675SEmmanuel Vadot    pinctrl: pinctrl@11030000 {
153354d7675SEmmanuel Vadot            compatible = "renesas,r9a07g044-pinctrl";
154354d7675SEmmanuel Vadot            reg = <0x11030000 0x10000>;
155354d7675SEmmanuel Vadot
156354d7675SEmmanuel Vadot            gpio-controller;
157354d7675SEmmanuel Vadot            #gpio-cells = <2>;
158354d7675SEmmanuel Vadot            gpio-ranges = <&pinctrl 0 0 392>;
159b97ee269SEmmanuel Vadot            interrupt-controller;
160b97ee269SEmmanuel Vadot            #interrupt-cells = <2>;
161354d7675SEmmanuel Vadot            clocks = <&cpg CPG_MOD R9A07G044_GPIO_HCLK>;
162354d7675SEmmanuel Vadot            resets = <&cpg R9A07G044_GPIO_RSTN>,
163354d7675SEmmanuel Vadot                     <&cpg R9A07G044_GPIO_PORT_RESETN>,
164354d7675SEmmanuel Vadot                     <&cpg R9A07G044_GPIO_SPARE_RESETN>;
165354d7675SEmmanuel Vadot            power-domains = <&cpg>;
166354d7675SEmmanuel Vadot
167354d7675SEmmanuel Vadot            scif0_pins: serial0 {
168354d7675SEmmanuel Vadot                    pinmux = <RZG2L_PORT_PINMUX(38, 0, 1)>, /* Tx */
169354d7675SEmmanuel Vadot                             <RZG2L_PORT_PINMUX(38, 1, 1)>; /* Rx */
170354d7675SEmmanuel Vadot            };
171354d7675SEmmanuel Vadot
172354d7675SEmmanuel Vadot            i2c1_pins: i2c1 {
173354d7675SEmmanuel Vadot                    pins = "RIIC1_SDA", "RIIC1_SCL";
174354d7675SEmmanuel Vadot                    input-enable;
175354d7675SEmmanuel Vadot            };
176354d7675SEmmanuel Vadot
177354d7675SEmmanuel Vadot            sd1-pwr-en-hog {
178354d7675SEmmanuel Vadot                    gpio-hog;
179354d7675SEmmanuel Vadot                    gpios = <RZG2L_GPIO(39, 2) 0>;
180354d7675SEmmanuel Vadot                    output-high;
181354d7675SEmmanuel Vadot                    line-name = "sd1_pwr_en";
182354d7675SEmmanuel Vadot            };
183354d7675SEmmanuel Vadot
184354d7675SEmmanuel Vadot            sdhi1_pins: sd1 {
185354d7675SEmmanuel Vadot                    sd1_mux {
186354d7675SEmmanuel Vadot                            pinmux = <RZG2L_PORT_PINMUX(19, 0, 1)>, /* CD */
187354d7675SEmmanuel Vadot                                     <RZG2L_PORT_PINMUX(19, 1, 1)>; /* WP */
188354d7675SEmmanuel Vadot                            power-source = <3300>;
189354d7675SEmmanuel Vadot                    };
190354d7675SEmmanuel Vadot
191354d7675SEmmanuel Vadot                    sd1_data {
192354d7675SEmmanuel Vadot                            pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
193354d7675SEmmanuel Vadot                            power-source = <3300>;
194354d7675SEmmanuel Vadot                    };
195354d7675SEmmanuel Vadot
196354d7675SEmmanuel Vadot                    sd1_ctrl {
197354d7675SEmmanuel Vadot                            pins = "SD1_CLK", "SD1_CMD";
198354d7675SEmmanuel Vadot                            power-source = <3300>;
199354d7675SEmmanuel Vadot                    };
200354d7675SEmmanuel Vadot            };
201354d7675SEmmanuel Vadot    };
202