From patchwork Tue Jan 28 10:10:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 240388 List-Id: U-Boot discussion From: faiz_abbas at ti.com (Faiz Abbas) Date: Tue, 28 Jan 2020 15:40:02 +0530 Subject: [PATCH 1/4] gpio: da8xx_gpio: Fix compiler warning In-Reply-To: <20200128101005.18794-1-faiz_abbas@ti.com> References: <20200128101005.18794-1-faiz_abbas@ti.com> Message-ID: <20200128101005.18794-2-faiz_abbas@ti.com> From: Vignesh Raghavendra 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; Signed-off-by: Vignesh Raghavendra Signed-off-by: Faiz Abbas --- drivers/gpio/da8xx_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c index bd5a366aef..d28e1fa14c 100644 --- a/drivers/gpio/da8xx_gpio.c +++ b/drivers/gpio/da8xx_gpio.c @@ -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 From patchwork Tue Jan 28 10:10:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 240389 List-Id: U-Boot discussion From: faiz_abbas at ti.com (Faiz Abbas) Date: Tue, 28 Jan 2020 15:40:03 +0530 Subject: [PATCH 2/4] gpio: da8xx_gpio: Add "ti,keystone-gpio" compatible In-Reply-To: <20200128101005.18794-1-faiz_abbas@ti.com> References: <20200128101005.18794-1-faiz_abbas@ti.com> Message-ID: <20200128101005.18794-3-faiz_abbas@ti.com> From: Vignesh Raghavendra Add "ti,keystone-gpio" compatible so as be able to use Linux DT files as is. Signed-off-by: Vignesh Raghavendra Signed-off-by: Faiz Abbas --- drivers/gpio/da8xx_gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c index d28e1fa14c..ac88f0ca8d 100644 --- a/drivers/gpio/da8xx_gpio.c +++ b/drivers/gpio/da8xx_gpio.c @@ -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" }, { } }; From patchwork Tue Jan 28 10:10:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 240390 List-Id: U-Boot discussion From: faiz_abbas at ti.com (Faiz Abbas) Date: Tue, 28 Jan 2020 15:40:04 +0530 Subject: [PATCH 3/4] arm: dts: k3-j721e-main: Add Support for gpio0 In-Reply-To: <20200128101005.18794-1-faiz_abbas@ti.com> References: <20200128101005.18794-1-faiz_abbas@ti.com> Message-ID: <20200128101005.18794-4-faiz_abbas@ti.com> Add the main_gpio0 node. Signed-off-by: Faiz Abbas --- arch/arm/dts/k3-j721e-main.dtsi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/arch/arm/dts/k3-j721e-main.dtsi b/arch/arm/dts/k3-j721e-main.dtsi index dfdba42271..7d68d379a6 100644 --- a/arch/arm/dts/k3-j721e-main.dtsi +++ b/arch/arm/dts/k3-j721e-main.dtsi @@ -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>; From patchwork Tue Jan 28 10:10:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 240391 List-Id: U-Boot discussion From: faiz_abbas at ti.com (Faiz Abbas) Date: Tue, 28 Jan 2020 15:40:05 +0530 Subject: [PATCH 4/4] configs: j721e_evm_a72: Add GPIO support In-Reply-To: <20200128101005.18794-1-faiz_abbas@ti.com> References: <20200128101005.18794-1-faiz_abbas@ti.com> Message-ID: <20200128101005.18794-5-faiz_abbas@ti.com> Enable CONFIG_DA8XX_GPIO to enable GPIO support. Signed-off-by: Faiz Abbas --- configs/j721e_evm_a72_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index a998d771db..492c803677 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -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