summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhang Jiejing <jiejing.zhang@freescale.com>2012-05-18 11:08:05 +0800
committerZhang Jiejing <jiejing.zhang@freescale.com>2012-05-21 09:50:11 +0800
commit500e69df9073a8bc2773274c1139bb036b1a4195 (patch)
tree0aa8fd108e80d33af583382948c3a8fc774d3c92 /drivers
parent9b6dfc4b6f0d30b7284511a962e64e83c426b854 (diff)
downloadu-boot-imx-500e69df9073a8bc2773274c1139bb036b1a4195.zip
u-boot-imx-500e69df9073a8bc2773274c1139bb036b1a4195.tar.gz
u-boot-imx-500e69df9073a8bc2773274c1139bb036b1a4195.tar.bz2
ENGR00209899-1 mx6x: add generic gpio interface.
Add generic gpio interface in uboot. Seems more and more gpio operation invoke in uboot, without RAW register operation, we should use generic gpio interface. you should define the CONFIG_MXC_GPIO use generic gpio interface: gpio_request, gpio_direction_output, gpio_direction_input, gpio_set_value, gpio_get_value, etc. Test on MX6Q, MX6DL. Other MX6X should also define this config. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/mxc_gpio.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index acba56c..d07225d 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -28,6 +28,7 @@ LIB := $(obj)libgpio.a
COBJS-$(CONFIG_KIRKWOOD_GPIO) += kw_gpio.o
COBJS-$(CONFIG_MX31_GPIO) += mx31_gpio.o
COBJS-$(CONFIG_PCA953X) += pca953x.o
+COBJS-$(CONFIG_MXC_GPIO) += mxc_gpio.o
COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index a7f36b2..dde079f 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -25,9 +25,9 @@
*/
#include <common.h>
#include <asm/arch/imx-regs.h>
-#include <asm/gpio.h>
+#include <asm/arch/gpio.h>
#include <asm/io.h>
-#include <errno.h>
+#include <asm/errno.h>
enum mxc_gpio_direction {
MXC_GPIO_DIRECTION_IN,
@@ -40,14 +40,14 @@ static unsigned long gpio_ports[] = {
[0] = GPIO1_BASE_ADDR,
[1] = GPIO2_BASE_ADDR,
[2] = GPIO3_BASE_ADDR,
-#if defined(CONFIG_MX51) || defined(CONFIG_MX53)
+#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL)
[3] = GPIO4_BASE_ADDR,
-#endif
-#if defined(CONFIG_MX53)
+#if !defined(CONFIG_MX51)
[4] = GPIO5_BASE_ADDR,
[5] = GPIO6_BASE_ADDR,
[6] = GPIO7_BASE_ADDR,
#endif
+#endif
};
static int mxc_gpio_direction(unsigned int gpio,