1c66ec88fSEmmanuel VadotDavinci/Keystone GPIO controller bindings 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotRequired Properties: 4c66ec88fSEmmanuel Vadot- compatible: should be "ti,dm6441-gpio": for Davinci da850 SoCs 5c66ec88fSEmmanuel Vadot "ti,keystone-gpio": for Keystone 2 66AK2H/K, 66AK2L, 6c66ec88fSEmmanuel Vadot 66AK2E SoCs 7c66ec88fSEmmanuel Vadot "ti,k2g-gpio", "ti,keystone-gpio": for 66AK2G 8c66ec88fSEmmanuel Vadot "ti,am654-gpio", "ti,keystone-gpio": for TI K3 AM654 9c66ec88fSEmmanuel Vadot "ti,j721e-gpio", "ti,keystone-gpio": for J721E SoCs 10*5def4c47SEmmanuel Vadot "ti,am64-gpio", "ti,keystone-gpio": for AM64 SoCs 11c66ec88fSEmmanuel Vadot 12c66ec88fSEmmanuel Vadot- reg: Physical base address of the controller and the size of memory mapped 13c66ec88fSEmmanuel Vadot registers. 14c66ec88fSEmmanuel Vadot 15c66ec88fSEmmanuel Vadot- gpio-controller : Marks the device node as a gpio controller. 16c66ec88fSEmmanuel Vadot 17c66ec88fSEmmanuel Vadot- #gpio-cells : Should be two. 18c66ec88fSEmmanuel Vadot - first cell is the pin number 19c66ec88fSEmmanuel Vadot - second cell is used to specify optional parameters (unused) 20c66ec88fSEmmanuel Vadot 21c66ec88fSEmmanuel Vadot- interrupts: Array of GPIO interrupt number. Only banked or unbanked IRQs are 22c66ec88fSEmmanuel Vadot supported at a time. 23c66ec88fSEmmanuel Vadot 24c66ec88fSEmmanuel Vadot- ti,ngpio: The number of GPIO pins supported. 25c66ec88fSEmmanuel Vadot 26c66ec88fSEmmanuel Vadot- ti,davinci-gpio-unbanked: The number of GPIOs that have an individual interrupt 27c66ec88fSEmmanuel Vadot line to processor. 28c66ec88fSEmmanuel Vadot 29c66ec88fSEmmanuel Vadot- clocks: Should contain the device's input clock, and should be defined as per 30c66ec88fSEmmanuel Vadot the appropriate clock bindings consumer usage in, 31c66ec88fSEmmanuel Vadot 32c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/clock/keystone-gate.txt 33c66ec88fSEmmanuel Vadot for 66AK2HK/66AK2L/66AK2E SoCs or, 34c66ec88fSEmmanuel Vadot 35c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/clock/ti,sci-clk.txt 36c66ec88fSEmmanuel Vadot for 66AK2G SoCs 37c66ec88fSEmmanuel Vadot 38c66ec88fSEmmanuel Vadot- clock-names: Name should be "gpio"; 39c66ec88fSEmmanuel Vadot 40c66ec88fSEmmanuel VadotCurrently clock-names and clocks are needed for all keystone 2 platforms 41c66ec88fSEmmanuel VadotDavinci platforms do not have DT clocks as of now. 42c66ec88fSEmmanuel Vadot 43c66ec88fSEmmanuel VadotThe GPIO controller also acts as an interrupt controller. It uses the default 44c66ec88fSEmmanuel Vadottwo cells specifier as described in Documentation/devicetree/bindings/ 45c66ec88fSEmmanuel Vadotinterrupt-controller/interrupts.txt. 46c66ec88fSEmmanuel Vadot 47c66ec88fSEmmanuel VadotExample: 48c66ec88fSEmmanuel Vadot 49c66ec88fSEmmanuel Vadotgpio: gpio@1e26000 { 50c66ec88fSEmmanuel Vadot compatible = "ti,dm6441-gpio"; 51c66ec88fSEmmanuel Vadot gpio-controller; 52c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 53c66ec88fSEmmanuel Vadot reg = <0x226000 0x1000>; 54c66ec88fSEmmanuel Vadot interrupt-parent = <&intc>; 55c66ec88fSEmmanuel Vadot interrupts = <42 IRQ_TYPE_EDGE_BOTH 43 IRQ_TYPE_EDGE_BOTH 56c66ec88fSEmmanuel Vadot 44 IRQ_TYPE_EDGE_BOTH 45 IRQ_TYPE_EDGE_BOTH 57c66ec88fSEmmanuel Vadot 46 IRQ_TYPE_EDGE_BOTH 47 IRQ_TYPE_EDGE_BOTH 58c66ec88fSEmmanuel Vadot 48 IRQ_TYPE_EDGE_BOTH 49 IRQ_TYPE_EDGE_BOTH 59c66ec88fSEmmanuel Vadot 50 IRQ_TYPE_EDGE_BOTH>; 60c66ec88fSEmmanuel Vadot ti,ngpio = <144>; 61c66ec88fSEmmanuel Vadot ti,davinci-gpio-unbanked = <0>; 62c66ec88fSEmmanuel Vadot interrupt-controller; 63c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 64c66ec88fSEmmanuel Vadot}; 65c66ec88fSEmmanuel Vadot 66c66ec88fSEmmanuel Vadotleds { 67c66ec88fSEmmanuel Vadot compatible = "gpio-leds"; 68c66ec88fSEmmanuel Vadot 69c66ec88fSEmmanuel Vadot led1 { 70c66ec88fSEmmanuel Vadot label = "davinci:green:usr1"; 71c66ec88fSEmmanuel Vadot gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; 72c66ec88fSEmmanuel Vadot ... 73c66ec88fSEmmanuel Vadot }; 74c66ec88fSEmmanuel Vadot 75c66ec88fSEmmanuel Vadot led2 { 76c66ec88fSEmmanuel Vadot label = "davinci:red:debug1"; 77c66ec88fSEmmanuel Vadot gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; 78c66ec88fSEmmanuel Vadot ... 79c66ec88fSEmmanuel Vadot }; 80c66ec88fSEmmanuel Vadot}; 81c66ec88fSEmmanuel Vadot 82c66ec88fSEmmanuel VadotExample for 66AK2G: 83c66ec88fSEmmanuel Vadot 84c66ec88fSEmmanuel Vadotgpio0: gpio@2603000 { 85c66ec88fSEmmanuel Vadot compatible = "ti,k2g-gpio", "ti,keystone-gpio"; 86c66ec88fSEmmanuel Vadot reg = <0x02603000 0x100>; 87c66ec88fSEmmanuel Vadot gpio-controller; 88c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 89c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 432 IRQ_TYPE_EDGE_RISING>, 90c66ec88fSEmmanuel Vadot <GIC_SPI 433 IRQ_TYPE_EDGE_RISING>, 91c66ec88fSEmmanuel Vadot <GIC_SPI 434 IRQ_TYPE_EDGE_RISING>, 92c66ec88fSEmmanuel Vadot <GIC_SPI 435 IRQ_TYPE_EDGE_RISING>, 93c66ec88fSEmmanuel Vadot <GIC_SPI 436 IRQ_TYPE_EDGE_RISING>, 94c66ec88fSEmmanuel Vadot <GIC_SPI 437 IRQ_TYPE_EDGE_RISING>, 95c66ec88fSEmmanuel Vadot <GIC_SPI 438 IRQ_TYPE_EDGE_RISING>, 96c66ec88fSEmmanuel Vadot <GIC_SPI 439 IRQ_TYPE_EDGE_RISING>, 97c66ec88fSEmmanuel Vadot <GIC_SPI 440 IRQ_TYPE_EDGE_RISING>; 98c66ec88fSEmmanuel Vadot interrupt-controller; 99c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 100c66ec88fSEmmanuel Vadot ti,ngpio = <144>; 101c66ec88fSEmmanuel Vadot ti,davinci-gpio-unbanked = <0>; 102c66ec88fSEmmanuel Vadot clocks = <&k2g_clks 0x001b 0x0>; 103c66ec88fSEmmanuel Vadot clock-names = "gpio"; 104c66ec88fSEmmanuel Vadot}; 105c66ec88fSEmmanuel Vadot 106c66ec88fSEmmanuel VadotExample for 66AK2HK/66AK2L/66AK2E: 107c66ec88fSEmmanuel Vadot 108c66ec88fSEmmanuel Vadotgpio0: gpio@260bf00 { 109c66ec88fSEmmanuel Vadot compatible = "ti,keystone-gpio"; 110c66ec88fSEmmanuel Vadot reg = <0x0260bf00 0x100>; 111c66ec88fSEmmanuel Vadot gpio-controller; 112c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 113c66ec88fSEmmanuel Vadot /* HW Interrupts mapped to GPIO pins */ 114c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 120 IRQ_TYPE_EDGE_RISING>, 115c66ec88fSEmmanuel Vadot <GIC_SPI 121 IRQ_TYPE_EDGE_RISING>, 116c66ec88fSEmmanuel Vadot <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>, 117c66ec88fSEmmanuel Vadot <GIC_SPI 123 IRQ_TYPE_EDGE_RISING>, 118c66ec88fSEmmanuel Vadot <GIC_SPI 124 IRQ_TYPE_EDGE_RISING>, 119c66ec88fSEmmanuel Vadot <GIC_SPI 125 IRQ_TYPE_EDGE_RISING>, 120c66ec88fSEmmanuel Vadot <GIC_SPI 126 IRQ_TYPE_EDGE_RISING>, 121c66ec88fSEmmanuel Vadot <GIC_SPI 127 IRQ_TYPE_EDGE_RISING>, 122c66ec88fSEmmanuel Vadot <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>, 123c66ec88fSEmmanuel Vadot <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>, 124c66ec88fSEmmanuel Vadot <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>, 125c66ec88fSEmmanuel Vadot <GIC_SPI 131 IRQ_TYPE_EDGE_RISING>, 126c66ec88fSEmmanuel Vadot <GIC_SPI 132 IRQ_TYPE_EDGE_RISING>, 127c66ec88fSEmmanuel Vadot <GIC_SPI 133 IRQ_TYPE_EDGE_RISING>, 128c66ec88fSEmmanuel Vadot <GIC_SPI 134 IRQ_TYPE_EDGE_RISING>, 129c66ec88fSEmmanuel Vadot <GIC_SPI 135 IRQ_TYPE_EDGE_RISING>, 130c66ec88fSEmmanuel Vadot <GIC_SPI 136 IRQ_TYPE_EDGE_RISING>, 131c66ec88fSEmmanuel Vadot <GIC_SPI 137 IRQ_TYPE_EDGE_RISING>, 132c66ec88fSEmmanuel Vadot <GIC_SPI 138 IRQ_TYPE_EDGE_RISING>, 133c66ec88fSEmmanuel Vadot <GIC_SPI 139 IRQ_TYPE_EDGE_RISING>, 134c66ec88fSEmmanuel Vadot <GIC_SPI 140 IRQ_TYPE_EDGE_RISING>, 135c66ec88fSEmmanuel Vadot <GIC_SPI 141 IRQ_TYPE_EDGE_RISING>, 136c66ec88fSEmmanuel Vadot <GIC_SPI 142 IRQ_TYPE_EDGE_RISING>, 137c66ec88fSEmmanuel Vadot <GIC_SPI 143 IRQ_TYPE_EDGE_RISING>, 138c66ec88fSEmmanuel Vadot <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>, 139c66ec88fSEmmanuel Vadot <GIC_SPI 145 IRQ_TYPE_EDGE_RISING>, 140c66ec88fSEmmanuel Vadot <GIC_SPI 146 IRQ_TYPE_EDGE_RISING>, 141c66ec88fSEmmanuel Vadot <GIC_SPI 147 IRQ_TYPE_EDGE_RISING>, 142c66ec88fSEmmanuel Vadot <GIC_SPI 148 IRQ_TYPE_EDGE_RISING>, 143c66ec88fSEmmanuel Vadot <GIC_SPI 149 IRQ_TYPE_EDGE_RISING>, 144c66ec88fSEmmanuel Vadot <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>, 145c66ec88fSEmmanuel Vadot <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>; 146c66ec88fSEmmanuel Vadot clocks = <&clkgpio>; 147c66ec88fSEmmanuel Vadot clock-names = "gpio"; 148c66ec88fSEmmanuel Vadot ti,ngpio = <32>; 149c66ec88fSEmmanuel Vadot ti,davinci-gpio-unbanked = <32>; 150c66ec88fSEmmanuel Vadot}; 151c66ec88fSEmmanuel Vadot 152c66ec88fSEmmanuel VadotExample for K3 AM654: 153c66ec88fSEmmanuel Vadot 154c66ec88fSEmmanuel Vadotwkup_gpio0: wkup_gpio0@42110000 { 155c66ec88fSEmmanuel Vadot compatible = "ti,am654-gpio", "ti,keystone-gpio"; 156c66ec88fSEmmanuel Vadot reg = <0x42110000 0x100>; 157c66ec88fSEmmanuel Vadot gpio-controller; 158c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 159c66ec88fSEmmanuel Vadot interrupt-parent = <&intr_wkup_gpio>; 160c66ec88fSEmmanuel Vadot interrupts = <59 128>, <59 129>, <59 130>, <59 131>; 161c66ec88fSEmmanuel Vadot interrupt-controller; 162c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 163c66ec88fSEmmanuel Vadot ti,ngpio = <56>; 164c66ec88fSEmmanuel Vadot ti,davinci-gpio-unbanked = <0>; 165c66ec88fSEmmanuel Vadot clocks = <&k3_clks 59 0>; 166c66ec88fSEmmanuel Vadot clock-names = "gpio"; 167c66ec88fSEmmanuel Vadot}; 168