18c2ecf20Sopenharmony_ciBroadcom BCM2835 GPIO (and pinmux) controller 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThe BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt 48c2ecf20Sopenharmony_cicontroller, and pinmux/control device. 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciRequired properties: 78c2ecf20Sopenharmony_ci- compatible: "brcm,bcm2835-gpio" 88c2ecf20Sopenharmony_ci- compatible: should be one of: 98c2ecf20Sopenharmony_ci "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl 108c2ecf20Sopenharmony_ci "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 118c2ecf20Sopenharmony_ci "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl 128c2ecf20Sopenharmony_ci "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 138c2ecf20Sopenharmony_ci- reg: Should contain the physical address of the GPIO module's registers. 148c2ecf20Sopenharmony_ci- gpio-controller: Marks the device node as a GPIO controller. 158c2ecf20Sopenharmony_ci- #gpio-cells : Should be two. The first cell is the pin number and the 168c2ecf20Sopenharmony_ci second cell is used to specify optional parameters: 178c2ecf20Sopenharmony_ci - bit 0 specifies polarity (0 for normal, 1 for inverted) 188c2ecf20Sopenharmony_ci- interrupts : The interrupt outputs from the controller. One interrupt per 198c2ecf20Sopenharmony_ci individual bank followed by the "all banks" interrupt. For BCM7211, an 208c2ecf20Sopenharmony_ci additional set of per-bank interrupt line and an "all banks" wake-up 218c2ecf20Sopenharmony_ci interrupt may be specified. 228c2ecf20Sopenharmony_ci- interrupt-controller: Marks the device node as an interrupt controller. 238c2ecf20Sopenharmony_ci- #interrupt-cells : Should be 2. 248c2ecf20Sopenharmony_ci The first cell is the GPIO number. 258c2ecf20Sopenharmony_ci The second cell is used to specify flags: 268c2ecf20Sopenharmony_ci bits[3:0] trigger type and level flags: 278c2ecf20Sopenharmony_ci 1 = low-to-high edge triggered. 288c2ecf20Sopenharmony_ci 2 = high-to-low edge triggered. 298c2ecf20Sopenharmony_ci 4 = active high level-sensitive. 308c2ecf20Sopenharmony_ci 8 = active low level-sensitive. 318c2ecf20Sopenharmony_ci Valid combinations are 1, 2, 3, 4, 8. 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciPlease refer to ../gpio/gpio.txt for a general description of GPIO bindings. 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the 368c2ecf20Sopenharmony_cicommon pinctrl bindings used by client devices, including the meaning of the 378c2ecf20Sopenharmony_ciphrase "pin configuration node". 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciEach pin configuration node lists the pin(s) to which it applies, and one or 408c2ecf20Sopenharmony_cimore of the mux function to select on those pin(s), and pull-up/down 418c2ecf20Sopenharmony_ciconfiguration. Each subnode only affects those parameters that are explicitly 428c2ecf20Sopenharmony_cilisted. In other words, a subnode that lists only a mux function implies no 438c2ecf20Sopenharmony_ciinformation about any pull configuration. Similarly, a subnode that lists only 448c2ecf20Sopenharmony_cia pul parameter implies no information about the mux function. 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciThe BCM2835 pin configuration and multiplexing supports the generic bindings. 478c2ecf20Sopenharmony_ciFor details on each properties, you can refer to ./pinctrl-bindings.txt. 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ciRequired sub-node properties: 508c2ecf20Sopenharmony_ci - pins 518c2ecf20Sopenharmony_ci - function 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciOptional sub-node properties: 548c2ecf20Sopenharmony_ci - bias-disable 558c2ecf20Sopenharmony_ci - bias-pull-up 568c2ecf20Sopenharmony_ci - bias-pull-down 578c2ecf20Sopenharmony_ci - output-high 588c2ecf20Sopenharmony_ci - output-low 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ciLegacy pin configuration and multiplexing binding: 618c2ecf20Sopenharmony_ci*** (Its use is deprecated, use generic multiplexing and configuration 628c2ecf20Sopenharmony_cibindings instead) 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ciRequired subnode-properties: 658c2ecf20Sopenharmony_ci- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs 668c2ecf20Sopenharmony_ci are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53. 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ciOptional subnode-properties: 698c2ecf20Sopenharmony_ci- brcm,function: Integer, containing the function to mux to the pin(s): 708c2ecf20Sopenharmony_ci 0: GPIO in 718c2ecf20Sopenharmony_ci 1: GPIO out 728c2ecf20Sopenharmony_ci 2: alt5 738c2ecf20Sopenharmony_ci 3: alt4 748c2ecf20Sopenharmony_ci 4: alt0 758c2ecf20Sopenharmony_ci 5: alt1 768c2ecf20Sopenharmony_ci 6: alt2 778c2ecf20Sopenharmony_ci 7: alt3 788c2ecf20Sopenharmony_ci- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s): 798c2ecf20Sopenharmony_ci 0: none 808c2ecf20Sopenharmony_ci 1: down 818c2ecf20Sopenharmony_ci 2: up 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ciEach of brcm,function and brcm,pull may contain either a single value which 848c2ecf20Sopenharmony_ciwill be applied to all pins in brcm,pins, or 1 value for each entry in 858c2ecf20Sopenharmony_cibrcm,pins. 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ciExample: 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci gpio: gpio { 908c2ecf20Sopenharmony_ci compatible = "brcm,bcm2835-gpio"; 918c2ecf20Sopenharmony_ci reg = <0x2200000 0xb4>; 928c2ecf20Sopenharmony_ci interrupts = <2 17>, <2 19>, <2 18>, <2 20>; 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci gpio-controller; 958c2ecf20Sopenharmony_ci #gpio-cells = <2>; 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci interrupt-controller; 988c2ecf20Sopenharmony_ci #interrupt-cells = <2>; 998c2ecf20Sopenharmony_ci }; 100