Skip to contentSkip to conversation

Add Support for gpio0 in J721e

PATCH New Faiz Abbas 1 participant 5 messages Jan 28, 2020

Subsystems (2)
lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

cover Add Support for gpio0 in J721e

The following patches add support for main_gpio0 in J721e.

These depend on Vignesh's I2C series:
https://patchwork.ozlabs.org/cover/1229975/

Faiz Abbas (2):
arm: dts: k3-j721e-main: Add Support for gpio0
configs: j721e_evm_a72: Add GPIO support

Vignesh Raghavendra (2):
gpio: da8xx_gpio: Fix compiler warning
gpio: da8xx_gpio: Add "ti,keystone-gpio" compatible

 arch/arm/dts/k3-j721e-main.dtsi | 23 +++++++++++++++++++++++
 configs/j721e_evm_a72_defconfig |  1 +
 drivers/gpio/da8xx_gpio.c       |  3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)
Signature · 1 line
2.19.2
author
#1 lore raw

PATCH 1/4 gpio: da8xx_gpio: Fix compiler warning

From: Vignesh Raghavendra <[email protected]>

Fix below compiler warning for 64bit builds

drivers/gpio/da8xx_gpio.c: In function ‘davinci_get_gpio_bank’:
drivers/gpio/da8xx_gpio.c:446:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
return (struct davinci_gpio *)addr;

---
 drivers/gpio/da8xx_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/da8xx_gpio.c +1 -1
index bd5a366aef..d28e1fa14c 100644
@@ -434,7 +434,7 @@ int gpio_set_value(unsigned int gpio, int value)
 static struct davinci_gpio *davinci_get_gpio_bank(struct udevice *dev, unsigned int offset)
 {
 	struct davinci_gpio_bank *bank = dev_get_priv(dev);
-	unsigned int addr;
+	unsigned long addr;
 
 	/*
 	 * The device tree is not broken into banks but the infrastructure is
Signature · 1 line
2.19.2
author
#2 lore raw

PATCH 2/4 gpio: da8xx_gpio: Add "ti,keystone-gpio" compatible

In reply to Faiz Abbas

From: Vignesh Raghavendra <[email protected]>

Add "ti,keystone-gpio" compatible so as be able to use Linux DT files as is.

---
 drivers/gpio/da8xx_gpio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/da8xx_gpio.c +1 -0
index d28e1fa14c..ac88f0ca8d 100644
@@ -535,6 +535,7 @@ static int davinci_gpio_probe(struct udevice *dev)
 static const struct udevice_id davinci_gpio_ids[] = {
 	{ .compatible = "ti,dm6441-gpio" },
 	{ .compatible = "ti,k2g-gpio" },
+	{ .compatible = "ti,keystone-gpio" },
 	{ }
 };
 
Signature · 1 line
2.19.2
author
#3 lore raw

PATCH 3/4 arm: dts: k3-j721e-main: Add Support for gpio0

In reply to Faiz Abbas

Add the main_gpio0 node.

---
 arch/arm/dts/k3-j721e-main.dtsi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/dts/k3-j721e-main.dtsi +23 -0
index dfdba42271..7d68d379a6 100644
@@ -200,6 +200,29 @@
 		clock-names = "fclk";
 	};
 
+	main_gpio0: gpio at 600000 {
+		compatible = "ti,j721e-gpio", "ti,keystone-gpio";
+		reg = <0x0 0x00600000 0x0 0x100>;
+		gpio-controller;
+		#gpio-cells = <2>;
+//		interrupt-parent = <&main_gpio_intr>;
+		interrupts = <105 0 IRQ_TYPE_EDGE_RISING>,
+			     <105 1 IRQ_TYPE_EDGE_RISING>,
+			     <105 2 IRQ_TYPE_EDGE_RISING>,
+			     <105 3 IRQ_TYPE_EDGE_RISING>,
+			     <105 4 IRQ_TYPE_EDGE_RISING>,
+			     <105 5 IRQ_TYPE_EDGE_RISING>,
+			     <105 6 IRQ_TYPE_EDGE_RISING>,
+			     <105 7 IRQ_TYPE_EDGE_RISING>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		ti,ngpio = <128>;
+		ti,davinci-gpio-unbanked = <0>;
+		power-domains = <&k3_pds 105 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 105 0>;
+		clock-names = "gpio";
+	};
+
 	main_sdhci0: sdhci at 4f80000 {
 		compatible = "ti,j721e-sdhci-8bit";
 		reg = <0x0 0x4f80000 0x0 0x1000>, <0x0 0x4f88000 0x0 0x400>;
Signature · 1 line
2.19.2
author
#4 lore raw

PATCH 4/4 configs: j721e_evm_a72: Add GPIO support

In reply to Faiz Abbas

Enable CONFIG_DA8XX_GPIO to enable GPIO support.

---
 configs/j721e_evm_a72_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/j721e_evm_a72_defconfig +1 -0
index a998d771db..492c803677 100644
@@ -90,6 +90,7 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DM_GPIO=y
+CONFIG_DA8XX_GPIO=y
 CONFIG_DM_PCA953X=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_OMAP24XX=y
Signature · 1 line
2.19.2