Skip to contentSkip to conversation

AM64: Add support for GPIO

PATCH Superseded Aswath Govindraju 2 participants 7 messages Mar 4, 2021 – Mar 19, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover AM64: Add support for GPIO

The following series of patches adds support for gpio on AM642 evm/sk.

Changes since v1:
- Added DT for gpio subsystem present in MCU domain
- reserved the mcu gpio for firmware usage

This series of patches depend on,
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439039
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439153

Aswath Govindraju (2):
arm64: dts: ti: k3-am64: Add GPIO DT nodes
arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware
usage

 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts  |  5 +++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts   |  5 +++
 4 files changed, 82 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 arm64: dts: ti: k3-am64: Add GPIO DT nodes

Add device tree nodes for GPIO modules and interrupt controller in main and mcu domains.

---
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 2 files changed, 72 insertions(+)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +45 -0
index 0cf727e3d1e2..f580d5357051 100644
@@ -373,6 +373,51 @@
 		clocks = <&k3_clks 145 0>;
 	};
 
+	main_gpio_intr: interrupt-controller0 {
+		compatible = "ti,sci-intr";
+		ti,intr-trigger-type = <1>;
+		interrupt-controller;
+		interrupt-parent = <&gic500>;
+		#interrupt-cells = <1>;
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <3>;
+		ti,interrupt-ranges = <0 32 16>;
+	};
+
+	main_gpio0: gpio@600000 {
+		compatible = "ti,am64-gpio", "ti,keystone-gpio";
+		reg = <0x0 0x00600000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&main_gpio_intr>;
+		interrupts = <190>, <191>, <192>,
+			     <193>, <194>, <195>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <87>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 77 0>;
+		clock-names = "gpio";
+	};
+
+	main_gpio1: gpio@601000 {
+		compatible = "ti,am64-gpio", "ti,keystone-gpio";
+		reg = <0x0 0x00601000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&main_gpio_intr>;
+		interrupts = <180>, <181>, <182>,
+			     <183>, <184>, <185>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <88>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 78 0>;
+		clock-names = "gpio";
+	};
+
 	sdhci0: mmc@fa10000 {
 		compatible = "ti,am64-sdhci-8bit";
 		reg = <0x00 0xfa10000 0x00 0x260>, <0x00 0xfa18000 0x00 0x134>;
arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi +27 -0
index 1d2be485a669..99e94dee1bd4 100644
@@ -73,4 +73,31 @@
 		power-domains = <&k3_pds 148 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 148 0>;
 	};
+
+	mcu_gpio_intr: interrupt-controller1 {
+		compatible = "ti,sci-intr";
+		ti,intr-trigger-type = <1>;
+		interrupt-controller;
+		interrupt-parent = <&gic500>;
+		#interrupt-cells = <1>;
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <5>;
+		ti,interrupt-ranges = <0 104 4>;
+	};
+
+	mcu_gpio0: gpio@4201000 {
+		compatible = "ti,am64-gpio", "keystone-gpio";
+		reg = <0x0 0x4201000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		interrupt-parent = <&mcu_gpio_intr>;
+		interrupts = <30>, <31>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <23>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 79 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 79 0>;
+		clock-names = "gpio";
+	};
 };
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH v2 2/2 arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware usage

In reply to Aswath Govindraju

The gpio0 subsystem present in MCU domain might be used by firmware and is not pinned out in evm/sk. Therefore, reserve it for MCU firmware.

---
 arch/arm64/boot/dts/ti/k3-am642-evm.dts | 5 +++++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts  | 5 +++++
 2 files changed, 10 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-evm.dts +5 -0
index 962ef807e286..982b043c5100 100644
@@ -279,6 +279,11 @@
 	};
 };
 
+/* mcu_gpio0 is reserved for mcu firmware usage */
+&mcu_gpio0 {
+	status = "reserved";
+};
+
 &mcu_i2c0 {
 	status = "disabled";
 };
arch/arm64/boot/dts/ti/k3-am642-sk.dts +5 -0
index 397ed3b2e121..7ba1d6da4d9d 100644
@@ -204,6 +204,11 @@
 	status = "disabled";
 };
 
+/* mcu_gpio0 is reserved for mcu firmware usage */
+&mcu_gpio0 {
+	status = "reserved";
+};
+
 &sdhci1 {
 	/* SD/MMC */
 	vmmc-supply = <&vdd_mmc1>;
Signature · 1 line
2.17.1
maintainer
#3 lore raw
In reply to Aswath Govindraju
Quoted 16 lines · Aswath Govindraju

The following series of patches adds support for gpio on AM642 evm/sk.

Changes since v1:
- Added DT for gpio subsystem present in MCU domain
- reserved the mcu gpio for firmware usage

This series of patches depend on,
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439039
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439153

Aswath Govindraju (2):
arm64: dts: ti: k3-am64: Add GPIO DT nodes
arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware
usage

Quoted 9 lines
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts  |  5 +++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts   |  5 +++
 4 files changed, 82 insertions(+)
Signature · 1 line
2.17.1

Based on your offline comment:
-----

On going through the bootlogs before posting for I found the following errors,

[    1.091117] davinci_gpio 601000.gpio: IRQ index 2 not found
[    1.101522] davinci_gpio 601000.gpio: error -ENXIO: IRQ not populated

Some issues in allocating interrupts in case of main_gpio1. I accumulated the gpio with interrupt numbers. I'll try to debug the reason behind it and update you with its status. (bootlogs of ti-sdk, also have this error).

-----

I am going to drop this off my queue, please update if the fixup is some system configuration error or repost with fix.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#4 lore raw

Hi Nishanth,

Quoted 42 lines · Nishanth Menon
Quoted 16 lines · Aswath Govindraju

The following series of patches adds support for gpio on AM642 evm/sk.

Changes since v1:
- Added DT for gpio subsystem present in MCU domain
- reserved the mcu gpio for firmware usage

This series of patches depend on,
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439039
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439153

Aswath Govindraju (2):
arm64: dts: ti: k3-am64: Add GPIO DT nodes
arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware
usage

Quoted 9 lines
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts  |  5 +++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts   |  5 +++
 4 files changed, 82 insertions(+)
Signature · 1 line
2.17.1

Based on your offline comment:
-----

On going through the bootlogs before posting for I found the following errors,

[    1.091117] davinci_gpio 601000.gpio: IRQ index 2 not found
[    1.101522] davinci_gpio 601000.gpio: error -ENXIO: IRQ not populated

Some issues in allocating interrupts in case of main_gpio1. I accumulated the gpio with interrupt numbers. I'll try to debug the reason behind it and update you with its status. (bootlogs of ti-sdk, also have this error).

Quoted 5 lines

-----

I am going to drop this off my queue, please update if the fixup is some system configuration error or repost with fix.

This is expected to be a fixup in the system configuration and not a bug in the patch series. So, can you please have these patches in your queue ? I'll soon post the test results indicating the functioning of GPIOs.

Thanks,
Aswath

maintainer
#5 lore raw
Quoted 47 lines · Aswath Govindraju

Hi Nishanth,

Quoted 44 lines · Nishanth Menon
Quoted 16 lines · Aswath Govindraju

The following series of patches adds support for gpio on AM642 evm/sk.

Changes since v1:
- Added DT for gpio subsystem present in MCU domain
- reserved the mcu gpio for firmware usage

This series of patches depend on,
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439039
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439153

Aswath Govindraju (2):
arm64: dts: ti: k3-am64: Add GPIO DT nodes
arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware
usage

Quoted 9 lines
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts  |  5 +++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts   |  5 +++
 4 files changed, 82 insertions(+)
Signature · 1 line
2.17.1

Based on your offline comment:
-----

On going through the bootlogs before posting for I found the following errors,

[    1.091117] davinci_gpio 601000.gpio: IRQ index 2 not found
[    1.101522] davinci_gpio 601000.gpio: error -ENXIO: IRQ not populated

Some issues in allocating interrupts in case of main_gpio1. I accumulated the gpio with interrupt numbers. I'll try to debug the reason behind it and update you with its status. (bootlogs of ti-sdk, also have this error).

-----

Quoted 7 lines
Quoted 3 lines

I am going to drop this off my queue, please update if the fixup is some system configuration error or repost with fix.

This is expected to be a fixup in the system configuration and not a bug in the patch series. So, can you please have these patches in your queue ? I'll soon post the test results indicating the functioning of GPIOs.

Thanks for clarifying. I will wait till the test results are posted. Thanks in advance for digging into this and detailed testing.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#6 lore raw

Hi Nishanth,

Quoted 52 lines · Nishanth Menon
Quoted 51 lines · Aswath Govindraju

Hi Nishanth,

Quoted 47 lines · Nishanth Menon
Quoted 16 lines · Aswath Govindraju

The following series of patches adds support for gpio on AM642 evm/sk.

Changes since v1:
- Added DT for gpio subsystem present in MCU domain
- reserved the mcu gpio for firmware usage

This series of patches depend on,
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439039
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=439153

Aswath Govindraju (2):
arm64: dts: ti: k3-am64: Add GPIO DT nodes
arm64: dts: ti: k3-am642: reserve gpio in mcu domain for firmware
usage

Quoted 9 lines
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 45 ++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi  | 27 ++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts  |  5 +++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts   |  5 +++
 4 files changed, 82 insertions(+)
Signature · 1 line
2.17.1

Based on your offline comment:
-----

On going through the bootlogs before posting for I found the following errors,

[    1.091117] davinci_gpio 601000.gpio: IRQ index 2 not found
[    1.101522] davinci_gpio 601000.gpio: error -ENXIO: IRQ not populated

Some issues in allocating interrupts in case of main_gpio1. I accumulated the gpio with interrupt numbers. I'll try to debug the reason behind it and update you with its status. (bootlogs of ti-sdk, also have this error).

-----

I am going to drop this off my queue, please update if the fixup is some system configuration error or repost with fix.

Quoted 8 lines
Quoted 3 lines

This is expected to be a fixup in the system configuration and not a bug in the patch series. So, can you please have these patches in your queue ? I'll soon post the test results indicating the functioning of GPIOs.

Thanks for clarifying. I will wait till the test results are posted. Thanks in advance for digging into this and detailed testing.

I've posted a respin(v3) of this series after rebasing on top of ti-k3-dts-next branch and adding the GPIO test logs.

Thanks,
Aswath