xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/raspberrypi,rp1-gpio.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/raspberrypi,rp1-gpio.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: RaspberryPi RP1 GPIO/Pinconf/Pinmux Controller submodule
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - A. della Porta <andrea.porta@suse.com>
11*833e5d42SEmmanuel Vadot
12*833e5d42SEmmanuel Vadotdescription:
13*833e5d42SEmmanuel Vadot  The RP1 chipset is a Multi Function Device containing, among other
14*833e5d42SEmmanuel Vadot  sub-peripherals, a gpio/pinconf/mux controller whose 54 pins are grouped
15*833e5d42SEmmanuel Vadot  into 3 banks.
16*833e5d42SEmmanuel Vadot  It works also as an interrupt controller for those gpios.
17*833e5d42SEmmanuel Vadot
18*833e5d42SEmmanuel Vadotproperties:
19*833e5d42SEmmanuel Vadot  compatible:
20*833e5d42SEmmanuel Vadot    const: raspberrypi,rp1-gpio
21*833e5d42SEmmanuel Vadot
22*833e5d42SEmmanuel Vadot  reg:
23*833e5d42SEmmanuel Vadot    maxItems: 3
24*833e5d42SEmmanuel Vadot    description: One reg specifier for each one of the 3 pin banks.
25*833e5d42SEmmanuel Vadot
26*833e5d42SEmmanuel Vadot  '#gpio-cells':
27*833e5d42SEmmanuel Vadot    description: The first cell is the pin number and the second cell is used
28*833e5d42SEmmanuel Vadot      to specify the flags (see include/dt-bindings/gpio/gpio.h).
29*833e5d42SEmmanuel Vadot    const: 2
30*833e5d42SEmmanuel Vadot
31*833e5d42SEmmanuel Vadot  gpio-controller: true
32*833e5d42SEmmanuel Vadot
33*833e5d42SEmmanuel Vadot  gpio-ranges:
34*833e5d42SEmmanuel Vadot    maxItems: 1
35*833e5d42SEmmanuel Vadot
36*833e5d42SEmmanuel Vadot  gpio-line-names:
37*833e5d42SEmmanuel Vadot    maxItems: 54
38*833e5d42SEmmanuel Vadot
39*833e5d42SEmmanuel Vadot  interrupts:
40*833e5d42SEmmanuel Vadot    maxItems: 3
41*833e5d42SEmmanuel Vadot    description: One interrupt specifier for each one of the 3 pin banks.
42*833e5d42SEmmanuel Vadot
43*833e5d42SEmmanuel Vadot  '#interrupt-cells':
44*833e5d42SEmmanuel Vadot    description:
45*833e5d42SEmmanuel Vadot      Specifies the Bank number [0, 1, 2] and Flags as defined in
46*833e5d42SEmmanuel Vadot      include/dt-bindings/interrupt-controller/irq.h.
47*833e5d42SEmmanuel Vadot    const: 2
48*833e5d42SEmmanuel Vadot
49*833e5d42SEmmanuel Vadot  interrupt-controller: true
50*833e5d42SEmmanuel Vadot
51*833e5d42SEmmanuel VadotpatternProperties:
52*833e5d42SEmmanuel Vadot  '-state$':
53*833e5d42SEmmanuel Vadot    oneOf:
54*833e5d42SEmmanuel Vadot      - $ref: '#/$defs/raspberrypi-rp1-state'
55*833e5d42SEmmanuel Vadot      - patternProperties:
56*833e5d42SEmmanuel Vadot          '-pins$':
57*833e5d42SEmmanuel Vadot            $ref: '#/$defs/raspberrypi-rp1-state'
58*833e5d42SEmmanuel Vadot        additionalProperties: false
59*833e5d42SEmmanuel Vadot
60*833e5d42SEmmanuel Vadot$defs:
61*833e5d42SEmmanuel Vadot  raspberrypi-rp1-state:
62*833e5d42SEmmanuel Vadot    allOf:
63*833e5d42SEmmanuel Vadot      - $ref: pincfg-node.yaml#
64*833e5d42SEmmanuel Vadot      - $ref: pinmux-node.yaml#
65*833e5d42SEmmanuel Vadot
66*833e5d42SEmmanuel Vadot    description:
67*833e5d42SEmmanuel Vadot      Pin controller client devices use pin configuration subnodes (children
68*833e5d42SEmmanuel Vadot      and grandchildren) for desired pin configuration.
69*833e5d42SEmmanuel Vadot      Client device subnodes use below standard properties.
70*833e5d42SEmmanuel Vadot
71*833e5d42SEmmanuel Vadot    properties:
72*833e5d42SEmmanuel Vadot      pins:
73*833e5d42SEmmanuel Vadot        description:
74*833e5d42SEmmanuel Vadot          List of gpio pins affected by the properties specified in this
75*833e5d42SEmmanuel Vadot          subnode.
76*833e5d42SEmmanuel Vadot        items:
77*833e5d42SEmmanuel Vadot          pattern: '^gpio([0-9]|[1-4][0-9]|5[0-3])$'
78*833e5d42SEmmanuel Vadot
79*833e5d42SEmmanuel Vadot      function:
80*833e5d42SEmmanuel Vadot        enum: [ alt0, alt1, alt2, alt3, alt4, gpio, alt6, alt7, alt8, none,
81*833e5d42SEmmanuel Vadot                aaud, dcd0, dpi, dsi0_te_ext, dsi1_te_ext, dsr0, dtr0, gpclk0,
82*833e5d42SEmmanuel Vadot                gpclk1, gpclk2, gpclk3, gpclk4, gpclk5, i2c0, i2c1, i2c2, i2c3,
83*833e5d42SEmmanuel Vadot                i2c4, i2c5, i2c6, i2s0, i2s1, i2s2, ir, mic, pcie_clkreq_n,
84*833e5d42SEmmanuel Vadot                pio, proc_rio, pwm0, pwm1, ri0, sd0, sd1, spi0, spi1, spi2,
85*833e5d42SEmmanuel Vadot                spi3, spi4, spi5, spi6, spi7, spi8, uart0, uart1, uart2, uart3,
86*833e5d42SEmmanuel Vadot                uart4, uart5, vbus0, vbus1, vbus2, vbus3 ]
87*833e5d42SEmmanuel Vadot
88*833e5d42SEmmanuel Vadot        description:
89*833e5d42SEmmanuel Vadot          Specify the alternative function to be configured for the specified
90*833e5d42SEmmanuel Vadot          pins.
91*833e5d42SEmmanuel Vadot
92*833e5d42SEmmanuel Vadot      bias-disable: true
93*833e5d42SEmmanuel Vadot      bias-pull-down: true
94*833e5d42SEmmanuel Vadot      bias-pull-up: true
95*833e5d42SEmmanuel Vadot      input-enable: true
96*833e5d42SEmmanuel Vadot      input-schmitt-enable: true
97*833e5d42SEmmanuel Vadot      output-enable: true
98*833e5d42SEmmanuel Vadot      output-high: true
99*833e5d42SEmmanuel Vadot      output-low: true
100*833e5d42SEmmanuel Vadot      slew-rate:
101*833e5d42SEmmanuel Vadot        description: 0 is slow slew rate, 1 is fast slew rate
102*833e5d42SEmmanuel Vadot        enum: [ 0, 1 ]
103*833e5d42SEmmanuel Vadot      drive-strength:
104*833e5d42SEmmanuel Vadot        enum: [ 2, 4, 8, 12 ]
105*833e5d42SEmmanuel Vadot
106*833e5d42SEmmanuel Vadot    additionalProperties: false
107*833e5d42SEmmanuel Vadot
108*833e5d42SEmmanuel VadotallOf:
109*833e5d42SEmmanuel Vadot  - $ref: pinctrl.yaml#
110*833e5d42SEmmanuel Vadot
111*833e5d42SEmmanuel Vadotrequired:
112*833e5d42SEmmanuel Vadot  - reg
113*833e5d42SEmmanuel Vadot  - compatible
114*833e5d42SEmmanuel Vadot  - '#gpio-cells'
115*833e5d42SEmmanuel Vadot  - gpio-controller
116*833e5d42SEmmanuel Vadot  - interrupts
117*833e5d42SEmmanuel Vadot  - '#interrupt-cells'
118*833e5d42SEmmanuel Vadot  - interrupt-controller
119*833e5d42SEmmanuel Vadot
120*833e5d42SEmmanuel VadotunevaluatedProperties: false
121*833e5d42SEmmanuel Vadot
122*833e5d42SEmmanuel Vadotexamples:
123*833e5d42SEmmanuel Vadot  - |
124*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
125*833e5d42SEmmanuel Vadot
126*833e5d42SEmmanuel Vadot    rp1 {
127*833e5d42SEmmanuel Vadot        #address-cells = <2>;
128*833e5d42SEmmanuel Vadot        #size-cells = <2>;
129*833e5d42SEmmanuel Vadot
130*833e5d42SEmmanuel Vadot        rp1_gpio: pinctrl@c0400d0000 {
131*833e5d42SEmmanuel Vadot            reg = <0xc0 0x400d0000  0x0 0xc000>,
132*833e5d42SEmmanuel Vadot                  <0xc0 0x400e0000  0x0 0xc000>,
133*833e5d42SEmmanuel Vadot                  <0xc0 0x400f0000  0x0 0xc000>;
134*833e5d42SEmmanuel Vadot            compatible = "raspberrypi,rp1-gpio";
135*833e5d42SEmmanuel Vadot            gpio-controller;
136*833e5d42SEmmanuel Vadot            #gpio-cells = <2>;
137*833e5d42SEmmanuel Vadot            interrupt-controller;
138*833e5d42SEmmanuel Vadot            #interrupt-cells = <2>;
139*833e5d42SEmmanuel Vadot            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>,
140*833e5d42SEmmanuel Vadot                         <1 IRQ_TYPE_LEVEL_HIGH>,
141*833e5d42SEmmanuel Vadot                         <2 IRQ_TYPE_LEVEL_HIGH>;
142*833e5d42SEmmanuel Vadot            gpio-line-names =
143*833e5d42SEmmanuel Vadot                   "ID_SDA", // GPIO0
144*833e5d42SEmmanuel Vadot                   "ID_SCL", // GPIO1
145*833e5d42SEmmanuel Vadot                   "GPIO2", "GPIO3", "GPIO4", "GPIO5", "GPIO6",
146*833e5d42SEmmanuel Vadot                   "GPIO7", "GPIO8", "GPIO9", "GPIO10", "GPIO11",
147*833e5d42SEmmanuel Vadot                   "GPIO12", "GPIO13", "GPIO14", "GPIO15", "GPIO16",
148*833e5d42SEmmanuel Vadot                   "GPIO17", "GPIO18", "GPIO19", "GPIO20", "GPIO21",
149*833e5d42SEmmanuel Vadot                   "GPIO22", "GPIO23", "GPIO24", "GPIO25", "GPIO26",
150*833e5d42SEmmanuel Vadot                   "GPIO27",
151*833e5d42SEmmanuel Vadot                   "PCIE_RP1_WAKE", // GPIO28
152*833e5d42SEmmanuel Vadot                   "FAN_TACH", // GPIO29
153*833e5d42SEmmanuel Vadot                   "HOST_SDA", // GPIO30
154*833e5d42SEmmanuel Vadot                   "HOST_SCL", // GPIO31
155*833e5d42SEmmanuel Vadot                   "ETH_RST_N", // GPIO32
156*833e5d42SEmmanuel Vadot                   "", // GPIO33
157*833e5d42SEmmanuel Vadot                   "CD0_IO0_MICCLK", // GPIO34
158*833e5d42SEmmanuel Vadot                   "CD0_IO0_MICDAT0", // GPIO35
159*833e5d42SEmmanuel Vadot                   "RP1_PCIE_CLKREQ_N", // GPIO36
160*833e5d42SEmmanuel Vadot                   "", // GPIO37
161*833e5d42SEmmanuel Vadot                   "CD0_SDA", // GPIO38
162*833e5d42SEmmanuel Vadot                   "CD0_SCL", // GPIO39
163*833e5d42SEmmanuel Vadot                   "CD1_SDA", // GPIO40
164*833e5d42SEmmanuel Vadot                   "CD1_SCL", // GPIO41
165*833e5d42SEmmanuel Vadot                   "USB_VBUS_EN", // GPIO42
166*833e5d42SEmmanuel Vadot                   "USB_OC_N", // GPIO43
167*833e5d42SEmmanuel Vadot                   "RP1_STAT_LED", // GPIO44
168*833e5d42SEmmanuel Vadot                   "FAN_PWM", // GPIO45
169*833e5d42SEmmanuel Vadot                   "CD1_IO0_MICCLK", // GPIO46
170*833e5d42SEmmanuel Vadot                   "2712_WAKE", // GPIO47
171*833e5d42SEmmanuel Vadot                   "CD1_IO1_MICDAT1", // GPIO48
172*833e5d42SEmmanuel Vadot                   "EN_MAX_USB_CUR", // GPIO49
173*833e5d42SEmmanuel Vadot                   "", // GPIO50
174*833e5d42SEmmanuel Vadot                   "", // GPIO51
175*833e5d42SEmmanuel Vadot                   "", // GPIO52
176*833e5d42SEmmanuel Vadot                   ""; // GPIO53
177*833e5d42SEmmanuel Vadot
178*833e5d42SEmmanuel Vadot            rp1-i2s0-default-state {
179*833e5d42SEmmanuel Vadot                function = "i2s0";
180*833e5d42SEmmanuel Vadot                pins = "gpio18", "gpio19", "gpio20", "gpio21";
181*833e5d42SEmmanuel Vadot                bias-disable;
182*833e5d42SEmmanuel Vadot            };
183*833e5d42SEmmanuel Vadot
184*833e5d42SEmmanuel Vadot            rp1-uart0-default-state {
185*833e5d42SEmmanuel Vadot                txd-pins {
186*833e5d42SEmmanuel Vadot                    function = "uart0";
187*833e5d42SEmmanuel Vadot                    pins = "gpio14";
188*833e5d42SEmmanuel Vadot                    bias-disable;
189*833e5d42SEmmanuel Vadot                };
190*833e5d42SEmmanuel Vadot
191*833e5d42SEmmanuel Vadot                rxd-pins {
192*833e5d42SEmmanuel Vadot                    function = "uart0";
193*833e5d42SEmmanuel Vadot                    pins = "gpio15";
194*833e5d42SEmmanuel Vadot                    bias-pull-up;
195*833e5d42SEmmanuel Vadot                };
196*833e5d42SEmmanuel Vadot            };
197*833e5d42SEmmanuel Vadot        };
198*833e5d42SEmmanuel Vadot    };
199