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