Skip to contentSkip to conversation

arm64: dts: ti: am6: Add gpio nodes

RFC PATCH Applied Keerthy 3 participants 9 messages Jun 6, 2019 – Jun 17, 2019

Subsystems (3)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

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.

Resending with the linux-gpio and gpio Maintainers copied.

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
author
#1 lore raw

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
index 553b92a7e87b..bc6b4b62df83 100644
@@ -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
#2 lore raw

Re: [RFC RESEND PATCH v2 1/4] dt-bindings: gpio: davinci: Add k3 am654 compatible

Quoted 4 lines · Keerthy

The patch adds k3 am654 compatible, specific properties and an example.

Patch applied with the three others, so now all
GPIO changes are in tree.

Please funnel all the DTS changes through ARM SoC.

Yours,
Linus Walleij

author
#3 lore raw

Re: [RFC RESEND PATCH v2 1/4] dt-bindings: gpio: davinci: Add k3 am654 compatible

Quoted 11 lines · Linus Walleij
Quoted 4 lines · Keerthy

The patch adds k3 am654 compatible, specific properties and an example.

Patch applied with the three others, so now all
GPIO changes are in tree.

Please funnel all the DTS changes through ARM SoC.

Thank you Linus!

Tero,

Could you pull the dts changes on top of intr dts patches.

Regards,
Keerthy

Quoted 4 lines

Yours,
Linus Walleij

Applied
#4 lore raw

Re: [RFC RESEND PATCH v2 1/4] dt-bindings: gpio: davinci: Add k3 am654 compatible

Quoted 13 lines · keerthy
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Keerthy

The patch adds k3 am654 compatible, specific properties and an example.

Patch applied with the three others, so now all
GPIO changes are in tree.

Quoted 7 lines
Quoted 1 line

Please funnel all the DTS changes through ARM SoC.

Thank you Linus!

Tero,

Could you pull the dts changes on top of intr dts patches.

Queued patches #2...#4 towards 5.3, thanks.

-Tero

Quoted 7 lines

Regards,
Keerthy

Quoted 4 lines

Yours,
Linus Walleij

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author
#5 lore raw

RFC PATCH v2 2/4 arm64: dts: ti: am6-wakeup: Add gpio node

In reply to Keerthy

Add 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
index f1ca171abdf8..9cf2c0849a24 100644
@@ -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
author
#6 lore raw

RFC PATCH v2 3/4 arm64: dts: ti: am6-main: Add gpio nodes

In reply to Keerthy

Add 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
index 22154f401930..182efe70402b 100644
@@ -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
#7 lore raw

Re: [RFC RESEND PATCH v2 3/4] arm64: dts: ti: am6-main: Add gpio nodes

Quoted 33 lines · Keerthy

Add 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 +17 -0
index 22154f401930..182efe70402b 100644
@@ -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";
+	};
+

arch/arm64/boot/dts/ti/k3-am65-main.dtsi line 379

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +10 -0
+	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>;

The above line has an extra tab. Fixed locally and pushed to am654-next.

-Tero

arch/arm64/boot/dts/ti/k3-am65-main.dtsi line 385

Quoted 7 lines
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +5 -0
+		ti,ngpio = <90>;
+		ti,davinci-gpio-unbanked = <0>;
+		clocks = <&k3_clks 58 0>;
+		clock-names = "gpio";
+	};
  };

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author
#8 lore raw

RFC PATCH v2 4/4 arm64: dts: ti: am654-base-board: Add gpio_keys node

In reply to Keerthy

There 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
index cf1aa276a1ea..ea50b6e36eff 100644
@@ -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