Skip to contentSkip to conversation

dm: gpio: Add DM compatibility to GPIO driver for Davinci

PATCH New Adam Ford 2 participants 2 messages Jun 11, 2018 – Jun 19, 2018

Subsystems (4)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v2 1/1 dm: gpio: Add DM compatibility to GPIO driver for Davinci

This adds DM_GPIO support for the davinici GPIO driver with DT support.

arch/arm/mach-davinci/include/mach/gpio.h +13 -1
index f1d4d9e9e0..d4b25c3d60 100644
@@ -39,7 +39,7 @@ struct davinci_gpio_bank {
 	unsigned int irq_num;
 	unsigned int irq_mask;
 	unsigned long *in_use;
-	unsigned long base;
+	struct davinci_gpio *base;
 };
 
 #define davinci_gpio_bank01 ((struct davinci_gpio *)DAVINCI_GPIO_BANK01)
@@ -48,7 +48,9 @@ struct davinci_gpio_bank {
 #define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67)
 #define davinci_gpio_bank8 ((struct davinci_gpio *)DAVINCI_GPIO_BANK8)
 
+#ifndef CONFIG_DM_GPIO
 #define gpio_status()		gpio_info()
+#endif
 #define GPIO_NAME_SIZE		20
 #if defined(CONFIG_SOC_DM644X)
 /* GPIO0 to GPIO53, omit the V3.3 volts one */
@@ -63,4 +65,14 @@ struct davinci_gpio_bank {
 
 void gpio_info(void);
 
+#ifdef CONFIG_DM_GPIO
+
+/* Information about a GPIO bank */
+struct davinci_gpio_platdata {
+	int bank_index;
+	ulong base;	/* address of registers in physical memory */
+	const char *port_name;
+};
+#endif
+
 #endif
board/davinci/da8xxevm/da850evm.c +2 -0
index c565ba7831..5583b45792 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <environment.h>
 #include <i2c.h>
 #include <net.h>
@@ -24,6 +25,7 @@
 #include <linux/errno.h>
 #include <hwconfig.h>
 #include <asm/mach-types.h>
+#include <asm/gpio.h>
 
 #ifdef CONFIG_MMC_DAVINCI
 #include <mmc.h>
configs/da850evm_defconfig +1 -1
index bb1368b9ad..6a2b7ae670 100644
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot > "
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_FLASH is not set
-# CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
 # CONFIG_CMD_PART is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -37,6 +36,7 @@ CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_DM_I2C_COMPAT=y
 CONFIG_DM_SPI_FLASH=y
drivers/gpio/da8xx_gpio.c +169 -24

253 lines not on this page · raw message

include/configs/da850evm.h +1 -1
index d2cd440311..ebfdd1c7a3 100644
@@ -40,7 +40,6 @@
 
 #ifdef CONFIG_DIRECT_NOR_BOOT
 #define CONFIG_ARCH_CPU_INIT
-#define CONFIG_DA8XX_GPIO
 #define CONFIG_SYS_DV_NOR_BOOT_CFG	(0x11)
 #endif
 
@@ -227,6 +226,7 @@
 #define CONFIG_MTD_PARTITIONS		/* required for UBI partition support */
 #endif
 
+#define CONFIG_DA8XX_GPIO
 /*
  * U-Boot general configuration
  */
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 dm: gpio: Add DM compatibility to GPIO driver for Davinci

arch/arm/mach-davinci/include/mach/gpio.h

Quoted 7 lines · Adam Ford

This adds DM_GPIO support for the davinici GPIO driver with DT support.

arch/arm/mach-davinci/include/mach/gpio.h +0 -0
index f1d4d9e9e0..d4b25c3d60 100644

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180619/a609e704/attachment.sig>