arm64: dts: ti: am6: Add gpio nodes
Subsystems (3)
v2 cover arm64: dts: ti: am6: Add gpio nodes
K3 AM6 platform has 2 instances of gpio banks on main domain and 1 instance on wakeup domin. All are capable of generating banked interrupts.
This series also adds 2 goio_keys nodes connected to SW6 SW5 switches and tested for gpio_keys interrupts.
The series depends on:
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=112791
Posting as RFC as it has dependencies to be merged.
Changes in v2:
* Added a separate am654 compatible.
Keerthy (4):
dt-bindings: gpio: davinci: Add k3 am654 compatible
arm64: dts: ti: am6-wakeup: Add gpio node
arm64: dts: ti: am6-main: Add gpio nodes
arm64: dts: ti: am654-base-board: Add gpio_keys node
.../devicetree/bindings/gpio/gpio-davinci.txt | 18 +++++++++++ arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 32 +++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am65-wakeup.dtsi | 15 +++++++++ .../arm64/boot/dts/ti/k3-am654-base-board.dts | 27 ++++++++++++++++ 4 files changed, 92 insertions(+)
Signature · 1 line
2.17.1
RFC PATCH v2 1/4 dt-bindings: gpio: davinci: Add k3 am654 compatible
The patch adds k3 am654 compatible, specific properties and an example.
--- .../devicetree/bindings/gpio/gpio-davinci.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/gpio/gpio-davinci.txt +18 -0
@@ -5,6 +5,7 @@ Required Properties: "ti,keystone-gpio": for Keystone 2 66AK2H/K, 66AK2L, 66AK2E SoCs "ti,k2g-gpio", "ti,keystone-gpio": for 66AK2G + "ti,am654-gpio", "ti,keystone-gpio": for TI K3 AM654 - reg: Physical base address of the controller and the size of memory mapped registers.
@@ -145,3 +146,20 @@ gpio0: gpio@260bf00 { ti,ngpio = <32>; ti,davinci-gpio-unbanked = <32>; }; + +Example for K3 AM654: + +wkup_gpio0: wkup_gpio0@42110000 { + compatible = "ti,am654-gpio", "ti,keystone-gpio"; + reg = <0x42110000 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&intr_wkup_gpio>; + interrupts = <59 128>, <59 129>, <59 130>, <59 131>; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <56>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k3_clks 59 0>; + clock-names = "gpio"; +};
Signature · 1 line
2.17.1
RFC PATCH v2 2/4 arm64: dts: ti: am6-wakeup: Add gpio node
In reply to KeerthyAdd gpio0 node under wakeup domain. This has 56 gpios and all are capable of generating banked interrupts.
--- arch/arm64/boot/dts/ti/k3-am65-wakeup.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-wakeup.dtsi +15 -0
@@ -74,4 +74,19 @@ ti,sci-dst-id = <56>; ti,sci-rm-range-girq = <0x4>; }; + + wkup_gpio0: wkup_gpio0@42110000 { + compatible = "ti,am654-gpio", "ti,keystone-gpio"; + reg = <0x42110000 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&intr_wkup_gpio>; + interrupts = <59 128>, <59 129>, <59 130>, <59 131>; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <56>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k3_clks 59 0>; + clock-names = "gpio"; + }; };
Signature · 1 line
2.17.1
RFC PATCH v2 3/4 arm64: dts: ti: am6-main: Add gpio nodes
In reply to KeerthyAdd gpio0/1 nodes under main domain. They have 96 and 90 gpios respectively and all are capable of generating banked interrupts.
--- arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +32 -0
@@ -350,4 +350,36 @@ ti,sci-rm-range-global-event = <0x1>; }; }; + + main_gpio0: main_gpio0@600000 { + compatible = "ti,am654-gpio", "ti,keystone-gpio"; + reg = <0x0 0x600000 0x0 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&intr_main_gpio>; + interrupts = <57 256>, <57 257>, <57 258>, <57 259>, <57 260>, + <57 261>; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <96>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k3_clks 57 0>; + clock-names = "gpio"; + }; + + main_gpio1: main_gpio1@601000 { + compatible = "ti,am654-gpio", "ti,keystone-gpio"; + reg = <0x0 0x601000 0x0 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&intr_main_gpio>; + interrupts = <58 256>, <58 257>, <58 258>, <58 259>, <58 260>, + <58 261>; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <90>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k3_clks 58 0>; + clock-names = "gpio"; + }; };
Signature · 1 line
2.17.1
RFC PATCH v2 4/4 arm64: dts: ti: am654-base-board: Add gpio_keys node
In reply to KeerthyThere are 2 push buttons: SW5 and SW6 that are basically connected to WKUP_GPIO0_24 and WKUP_GPIO0_27 respectively. Add the respective nodes and the pinctrl data to set the mode to GPIO and Input.
--- .../arm64/boot/dts/ti/k3-am654-base-board.dts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/ti/k3-am654-base-board.dts +27 -0
@@ -6,6 +6,7 @@ /dts-v1/; #include "k3-am654.dtsi" +#include <dt-bindings/input/input.h> / { compatible = "ti,am654-evm", "ti,am654";
@@ -33,6 +34,25 @@ no-map; }; }; + + gpio-keys { + compatible = "gpio-keys"; + autorepeat; + pinctrl-names = "default"; + pinctrl-0 = <&push_button_pins_default>; + + sw5 { + label = "GPIO Key USER1"; + linux,code = <BTN_0>; + gpios = <&wkup_gpio0 24 GPIO_ACTIVE_LOW>; + }; + + sw6 { + label = "GPIO Key USER2"; + linux,code = <BTN_1>; + gpios = <&wkup_gpio0 27 GPIO_ACTIVE_LOW>; + }; + }; }; &wkup_pmx0 {
@@ -42,6 +62,13 @@ AM65X_WKUP_IOPAD(0x00e4, PIN_INPUT, 0) /* (AD6) WKUP_I2C0_SDA */ >; }; + + push_button_pins_default: push_button__pins_default { + pinctrl-single,pins = < + AM65X_WKUP_IOPAD(0x0030, PIN_INPUT, 7) /* (R5) WKUP_GPIO0_24 */ + AM65X_WKUP_IOPAD(0x003c, PIN_INPUT, 7) /* (P2) WKUP_GPIO0_27 */ + >; + }; }; &main_pmx0 {
Signature · 1 line
2.17.1