xref: /linux/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt (revision 879c93f7062ff15c8712c660f24b79796100c10e)
1e1b2dc70SSimon ArlottBroadcom BCM2835 GPIO (and pinmux) controller
2e1b2dc70SSimon Arlott
3e1b2dc70SSimon ArlottThe BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
4e1b2dc70SSimon Arlottcontroller, and pinmux/control device.
5e1b2dc70SSimon Arlott
6e1b2dc70SSimon ArlottRequired properties:
7e1b2dc70SSimon Arlott- compatible: "brcm,bcm2835-gpio"
8f3fbedabSFlorian Fainelli- compatible: should be one of:
9f3fbedabSFlorian Fainelli  "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
10f3fbedabSFlorian Fainelli  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
119cd6237dSStefan Wahren  "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl
12*879c93f7SFlorian Fainelli  "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
13372c1d6dSMasanari Iida- reg: Should contain the physical address of the GPIO module's registers.
14e1b2dc70SSimon Arlott- gpio-controller: Marks the device node as a GPIO controller.
15e1b2dc70SSimon Arlott- #gpio-cells : Should be two. The first cell is the pin number and the
16e1b2dc70SSimon Arlott  second cell is used to specify optional parameters:
17e1b2dc70SSimon Arlott  - bit 0 specifies polarity (0 for normal, 1 for inverted)
18e1b2dc70SSimon Arlott- interrupts : The interrupt outputs from the controller. One interrupt per
19e1b2dc70SSimon Arlott  individual bank followed by the "all banks" interrupt.
20e1b2dc70SSimon Arlott- interrupt-controller: Marks the device node as an interrupt controller.
21e1b2dc70SSimon Arlott- #interrupt-cells : Should be 2.
22e1b2dc70SSimon Arlott  The first cell is the GPIO number.
23e1b2dc70SSimon Arlott  The second cell is used to specify flags:
24e1b2dc70SSimon Arlott    bits[3:0] trigger type and level flags:
25e1b2dc70SSimon Arlott      1 = low-to-high edge triggered.
26e1b2dc70SSimon Arlott      2 = high-to-low edge triggered.
27e1b2dc70SSimon Arlott      4 = active high level-sensitive.
28e1b2dc70SSimon Arlott      8 = active low level-sensitive.
29e1b2dc70SSimon Arlott    Valid combinations are 1, 2, 3, 4, 8.
30e1b2dc70SSimon Arlott
31e1b2dc70SSimon ArlottPlease refer to ../gpio/gpio.txt for a general description of GPIO bindings.
32e1b2dc70SSimon Arlott
33e1b2dc70SSimon ArlottPlease refer to pinctrl-bindings.txt in this directory for details of the
34e1b2dc70SSimon Arlottcommon pinctrl bindings used by client devices, including the meaning of the
35e1b2dc70SSimon Arlottphrase "pin configuration node".
36e1b2dc70SSimon Arlott
37e1b2dc70SSimon ArlottEach pin configuration node lists the pin(s) to which it applies, and one or
38e1b2dc70SSimon Arlottmore of the mux function to select on those pin(s), and pull-up/down
39e1b2dc70SSimon Arlottconfiguration. Each subnode only affects those parameters that are explicitly
40e1b2dc70SSimon Arlottlisted. In other words, a subnode that lists only a mux function implies no
41e1b2dc70SSimon Arlottinformation about any pull configuration. Similarly, a subnode that lists only
42e1b2dc70SSimon Arlotta pul parameter implies no information about the mux function.
43e1b2dc70SSimon Arlott
44e61941d1SMatheus CastelloThe BCM2835 pin configuration and multiplexing supports the generic bindings.
45e61941d1SMatheus CastelloFor details on each properties, you can refer to ./pinctrl-bindings.txt.
46e61941d1SMatheus Castello
47e61941d1SMatheus CastelloRequired sub-node properties:
48e61941d1SMatheus Castello  - pins
49e61941d1SMatheus Castello  - function
50e61941d1SMatheus Castello
51e61941d1SMatheus CastelloOptional sub-node properties:
52e61941d1SMatheus Castello  - bias-disable
53e61941d1SMatheus Castello  - bias-pull-up
54e61941d1SMatheus Castello  - bias-pull-down
55e61941d1SMatheus Castello  - output-high
56e61941d1SMatheus Castello  - output-low
57e61941d1SMatheus Castello
58e61941d1SMatheus CastelloLegacy pin configuration and multiplexing binding:
59e61941d1SMatheus Castello*** (Its use is deprecated, use generic multiplexing and configuration
60e61941d1SMatheus Castellobindings instead)
61e61941d1SMatheus Castello
62e1b2dc70SSimon ArlottRequired subnode-properties:
63e1b2dc70SSimon Arlott- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
64e1b2dc70SSimon Arlott  are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
65e1b2dc70SSimon Arlott
66e1b2dc70SSimon ArlottOptional subnode-properties:
67e1b2dc70SSimon Arlott- brcm,function: Integer, containing the function to mux to the pin(s):
68e1b2dc70SSimon Arlott  0: GPIO in
69e1b2dc70SSimon Arlott  1: GPIO out
70e1b2dc70SSimon Arlott  2: alt5
71e1b2dc70SSimon Arlott  3: alt4
72e1b2dc70SSimon Arlott  4: alt0
73e1b2dc70SSimon Arlott  5: alt1
74e1b2dc70SSimon Arlott  6: alt2
75e1b2dc70SSimon Arlott  7: alt3
76e1b2dc70SSimon Arlott- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
77e1b2dc70SSimon Arlott  0: none
78e1b2dc70SSimon Arlott  1: down
79e1b2dc70SSimon Arlott  2: up
80e1b2dc70SSimon Arlott
81e1b2dc70SSimon ArlottEach of brcm,function and brcm,pull may contain either a single value which
82e1b2dc70SSimon Arlottwill be applied to all pins in brcm,pins, or 1 value for each entry in
83e1b2dc70SSimon Arlottbrcm,pins.
84e1b2dc70SSimon Arlott
85e1b2dc70SSimon ArlottExample:
86e1b2dc70SSimon Arlott
87e1b2dc70SSimon Arlott	gpio: gpio {
88e1b2dc70SSimon Arlott		compatible = "brcm,bcm2835-gpio";
89e1b2dc70SSimon Arlott		reg = <0x2200000 0xb4>;
90e1b2dc70SSimon Arlott		interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
91e1b2dc70SSimon Arlott
92e1b2dc70SSimon Arlott		gpio-controller;
93e1b2dc70SSimon Arlott		#gpio-cells = <2>;
94e1b2dc70SSimon Arlott
95e1b2dc70SSimon Arlott		interrupt-controller;
96e1b2dc70SSimon Arlott		#interrupt-cells = <2>;
97e1b2dc70SSimon Arlott	};
98