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