xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/brcm,bcm2835-gpio.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotBroadcom BCM2835 GPIO (and pinmux) controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
4*c66ec88fSEmmanuel Vadotcontroller, and pinmux/control device.
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel VadotRequired properties:
7*c66ec88fSEmmanuel Vadot- compatible: "brcm,bcm2835-gpio"
8*c66ec88fSEmmanuel Vadot- compatible: should be one of:
9*c66ec88fSEmmanuel Vadot  "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
10*c66ec88fSEmmanuel Vadot  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
11*c66ec88fSEmmanuel Vadot  "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl
12*c66ec88fSEmmanuel Vadot  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
13*c66ec88fSEmmanuel Vadot- reg: Should contain the physical address of the GPIO module's registers.
14*c66ec88fSEmmanuel Vadot- gpio-controller: Marks the device node as a GPIO controller.
15*c66ec88fSEmmanuel Vadot- #gpio-cells : Should be two. The first cell is the pin number and the
16*c66ec88fSEmmanuel Vadot  second cell is used to specify optional parameters:
17*c66ec88fSEmmanuel Vadot  - bit 0 specifies polarity (0 for normal, 1 for inverted)
18*c66ec88fSEmmanuel Vadot- interrupts : The interrupt outputs from the controller. One interrupt per
19*c66ec88fSEmmanuel Vadot  individual bank followed by the "all banks" interrupt. For BCM7211, an
20*c66ec88fSEmmanuel Vadot  additional set of per-bank interrupt line and an "all banks" wake-up
21*c66ec88fSEmmanuel Vadot  interrupt may be specified.
22*c66ec88fSEmmanuel Vadot- interrupt-controller: Marks the device node as an interrupt controller.
23*c66ec88fSEmmanuel Vadot- #interrupt-cells : Should be 2.
24*c66ec88fSEmmanuel Vadot  The first cell is the GPIO number.
25*c66ec88fSEmmanuel Vadot  The second cell is used to specify flags:
26*c66ec88fSEmmanuel Vadot    bits[3:0] trigger type and level flags:
27*c66ec88fSEmmanuel Vadot      1 = low-to-high edge triggered.
28*c66ec88fSEmmanuel Vadot      2 = high-to-low edge triggered.
29*c66ec88fSEmmanuel Vadot      4 = active high level-sensitive.
30*c66ec88fSEmmanuel Vadot      8 = active low level-sensitive.
31*c66ec88fSEmmanuel Vadot    Valid combinations are 1, 2, 3, 4, 8.
32*c66ec88fSEmmanuel Vadot
33*c66ec88fSEmmanuel VadotPlease refer to ../gpio/gpio.txt for a general description of GPIO bindings.
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt in this directory for details of the
36*c66ec88fSEmmanuel Vadotcommon pinctrl bindings used by client devices, including the meaning of the
37*c66ec88fSEmmanuel Vadotphrase "pin configuration node".
38*c66ec88fSEmmanuel Vadot
39*c66ec88fSEmmanuel VadotEach pin configuration node lists the pin(s) to which it applies, and one or
40*c66ec88fSEmmanuel Vadotmore of the mux function to select on those pin(s), and pull-up/down
41*c66ec88fSEmmanuel Vadotconfiguration. Each subnode only affects those parameters that are explicitly
42*c66ec88fSEmmanuel Vadotlisted. In other words, a subnode that lists only a mux function implies no
43*c66ec88fSEmmanuel Vadotinformation about any pull configuration. Similarly, a subnode that lists only
44*c66ec88fSEmmanuel Vadota pul parameter implies no information about the mux function.
45*c66ec88fSEmmanuel Vadot
46*c66ec88fSEmmanuel VadotThe BCM2835 pin configuration and multiplexing supports the generic bindings.
47*c66ec88fSEmmanuel VadotFor details on each properties, you can refer to ./pinctrl-bindings.txt.
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotRequired sub-node properties:
50*c66ec88fSEmmanuel Vadot  - pins
51*c66ec88fSEmmanuel Vadot  - function
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel VadotOptional sub-node properties:
54*c66ec88fSEmmanuel Vadot  - bias-disable
55*c66ec88fSEmmanuel Vadot  - bias-pull-up
56*c66ec88fSEmmanuel Vadot  - bias-pull-down
57*c66ec88fSEmmanuel Vadot  - output-high
58*c66ec88fSEmmanuel Vadot  - output-low
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel VadotLegacy pin configuration and multiplexing binding:
61*c66ec88fSEmmanuel Vadot*** (Its use is deprecated, use generic multiplexing and configuration
62*c66ec88fSEmmanuel Vadotbindings instead)
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel VadotRequired subnode-properties:
65*c66ec88fSEmmanuel Vadot- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
66*c66ec88fSEmmanuel Vadot  are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
67*c66ec88fSEmmanuel Vadot
68*c66ec88fSEmmanuel VadotOptional subnode-properties:
69*c66ec88fSEmmanuel Vadot- brcm,function: Integer, containing the function to mux to the pin(s):
70*c66ec88fSEmmanuel Vadot  0: GPIO in
71*c66ec88fSEmmanuel Vadot  1: GPIO out
72*c66ec88fSEmmanuel Vadot  2: alt5
73*c66ec88fSEmmanuel Vadot  3: alt4
74*c66ec88fSEmmanuel Vadot  4: alt0
75*c66ec88fSEmmanuel Vadot  5: alt1
76*c66ec88fSEmmanuel Vadot  6: alt2
77*c66ec88fSEmmanuel Vadot  7: alt3
78*c66ec88fSEmmanuel Vadot- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
79*c66ec88fSEmmanuel Vadot  0: none
80*c66ec88fSEmmanuel Vadot  1: down
81*c66ec88fSEmmanuel Vadot  2: up
82*c66ec88fSEmmanuel Vadot
83*c66ec88fSEmmanuel VadotEach of brcm,function and brcm,pull may contain either a single value which
84*c66ec88fSEmmanuel Vadotwill be applied to all pins in brcm,pins, or 1 value for each entry in
85*c66ec88fSEmmanuel Vadotbrcm,pins.
86*c66ec88fSEmmanuel Vadot
87*c66ec88fSEmmanuel VadotExample:
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot	gpio: gpio {
90*c66ec88fSEmmanuel Vadot		compatible = "brcm,bcm2835-gpio";
91*c66ec88fSEmmanuel Vadot		reg = <0x2200000 0xb4>;
92*c66ec88fSEmmanuel Vadot		interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
93*c66ec88fSEmmanuel Vadot
94*c66ec88fSEmmanuel Vadot		gpio-controller;
95*c66ec88fSEmmanuel Vadot		#gpio-cells = <2>;
96*c66ec88fSEmmanuel Vadot
97*c66ec88fSEmmanuel Vadot		interrupt-controller;
98*c66ec88fSEmmanuel Vadot		#interrupt-cells = <2>;
99*c66ec88fSEmmanuel Vadot	};
100