* [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework
@ 2011-08-21 10:28 Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 02/14] MX25: make use of GPIO framework for MX25 processor Stefano Babic
` (16 more replies)
0 siblings, 17 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
IMX processors has a slightly different interface
to access GPIOs and do not make use of the provided GPIO
framework. The patch substitutes mxc_ specific
functions and make use of the API in asm/gpio.h
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
drivers/gpio/mxc_gpio.c | 51 ++++++++++++++++++++++++++++++++++++++---
drivers/spi/mxc_spi.c | 8 +++---
include/mxc_gpio.h | 57 -----------------------------------------------
3 files changed, 51 insertions(+), 65 deletions(-)
delete mode 100644 include/mxc_gpio.h
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 6efbb02..a7f36b2 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -2,6 +2,9 @@
* Copyright (C) 2009
* Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -22,10 +25,16 @@
*/
#include <common.h>
#include <asm/arch/imx-regs.h>
+#include <asm/gpio.h>
#include <asm/io.h>
-#include <mxc_gpio.h>
#include <errno.h>
+enum mxc_gpio_direction {
+ MXC_GPIO_DIRECTION_IN,
+ MXC_GPIO_DIRECTION_OUT,
+};
+
+
/* GPIO port description */
static unsigned long gpio_ports[] = {
[0] = GPIO1_BASE_ADDR,
@@ -41,7 +50,8 @@ static unsigned long gpio_ports[] = {
#endif
};
-int mxc_gpio_direction(unsigned int gpio, enum mxc_gpio_direction direction)
+static int mxc_gpio_direction(unsigned int gpio,
+ enum mxc_gpio_direction direction)
{
unsigned int port = gpio >> 5;
struct gpio_regs *regs;
@@ -68,7 +78,7 @@ int mxc_gpio_direction(unsigned int gpio, enum mxc_gpio_direction direction)
return 0;
}
-void mxc_gpio_set(unsigned int gpio, unsigned int value)
+void gpio_set_value(int gpio, int value)
{
unsigned int port = gpio >> 5;
struct gpio_regs *regs;
@@ -89,7 +99,7 @@ void mxc_gpio_set(unsigned int gpio, unsigned int value)
writel(l, ®s->gpio_dr);
}
-int mxc_gpio_get(unsigned int gpio)
+int gpio_get_value(int gpio)
{
unsigned int port = gpio >> 5;
struct gpio_regs *regs;
@@ -106,3 +116,36 @@ int mxc_gpio_get(unsigned int gpio)
return l;
}
+
+int gpio_request(int gp, const char *label)
+{
+ unsigned int port = gp >> 5;
+ if (port >= ARRAY_SIZE(gpio_ports))
+ return -EINVAL;
+ return 0;
+}
+
+void gpio_free(int gp)
+{
+}
+
+void gpio_toggle_value(int gp)
+{
+ gpio_set_value(gp, !gpio_get_value(gp));
+}
+
+int gpio_direction_input(int gp)
+{
+ return mxc_gpio_direction(gp, MXC_GPIO_DIRECTION_IN);
+}
+
+int gpio_direction_output(int gp, int value)
+{
+ int ret = mxc_gpio_direction(gp, MXC_GPIO_DIRECTION_OUT);
+
+ if (ret < 0)
+ return ret;
+
+ gpio_set_value(gp, value);
+ return 0;
+}
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 81381d9..2fa7486 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -23,7 +23,7 @@
#include <spi.h>
#include <asm/errno.h>
#include <asm/io.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
@@ -145,14 +145,14 @@ void spi_cs_activate(struct spi_slave *slave)
{
struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
if (mxcs->gpio > 0)
- mxc_gpio_set(mxcs->gpio, mxcs->ss_pol);
+ gpio_set_value(mxcs->gpio, mxcs->ss_pol);
}
void spi_cs_deactivate(struct spi_slave *slave)
{
struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
if (mxcs->gpio > 0)
- mxc_gpio_set(mxcs->gpio,
+ gpio_set_value(mxcs->gpio,
!(mxcs->ss_pol));
}
@@ -468,7 +468,7 @@ static int decode_cs(struct mxc_spi_slave *mxcs, unsigned int cs)
if (cs > 3) {
mxcs->gpio = cs >> 8;
cs &= 3;
- ret = mxc_gpio_direction(mxcs->gpio, OUT);
+ ret = gpio_direction_output(mxcs->gpio, 0);
if (ret) {
printf("mxc_spi: cannot setup gpio %d\n", mxcs->gpio);
return -EINVAL;
diff --git a/include/mxc_gpio.h b/include/mxc_gpio.h
deleted file mode 100644
index f673dce..0000000
--- a/include/mxc_gpio.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __MXC_GPIO_H
-#define __MXC_GPIO_H
-
-/* Converts a GPIO port number and the internal bit position
- * to the GPIO number
- */
-#define MXC_GPIO_PORT_TO_NUM(port, bit) (((port - 1) << 5) + (bit & 0x1f))
-
-enum mxc_gpio_direction {
- MXC_GPIO_DIRECTION_IN,
- MXC_GPIO_DIRECTION_OUT,
-};
-
-#ifdef CONFIG_MXC_GPIO
-extern int mxc_gpio_direction(unsigned int gpio,
- enum mxc_gpio_direction direction);
-extern void mxc_gpio_set(unsigned int gpio, unsigned int value);
-extern int mxc_gpio_get(unsigned int gpio);
-#else
-static inline int mxc_gpio_direction(unsigned int gpio,
- enum mxc_gpio_direction direction)
-{
- return 1;
-}
-static inline int mxc_gpio_get(unsigned int gpio)
-{
- return 1;
-}
-static inline void mxc_gpio_set(unsigned int gpio, unsigned int value)
-{
-}
-#endif
-
-#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 02/14] MX25: make use of GPIO framework for MX25 processor
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 03/14] MX31: make use of GPIO framework for MX31 processor Stefano Babic
` (15 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx25/gpio.h | 45 +++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx25/imx-regs.h | 12 --------
2 files changed, 45 insertions(+), 12 deletions(-)
create mode 100644 arch/arm/include/asm/arch-mx25/gpio.h
diff --git a/arch/arm/include/asm/arch-mx25/gpio.h b/arch/arm/include/asm/arch-mx25/gpio.h
new file mode 100644
index 0000000..dc6edc7
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx25/gpio.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __ASM_ARCH_MX25_GPIO_H
+#define __ASM_ARCH_MX25_GPIO_H
+
+/* Converts a GPIO port number and the internal bit position
+ * to the GPIO number
+ */
+#define MXC_GPIO_PORT_TO_NUM(port, bit) (((port - 1) << 5) + (bit & 0x1f))
+
+/* GPIO registers */
+struct gpio_regs {
+ u32 gpio_dr; /* data */
+ u32 gpio_dir; /* direction */
+ u32 psr; /* pad satus */
+ u32 icr1; /* interrupt config 1 */
+ u32 icr2; /* interrupt config 2 */
+ u32 imr; /* interrupt mask */
+ u32 isr; /* interrupt status */
+ u32 edge_sel; /* edge select */
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-mx25/imx-regs.h b/arch/arm/include/asm/arch-mx25/imx-regs.h
index 2ccb445..9e30f7c 100644
--- a/arch/arm/include/asm/arch-mx25/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx25/imx-regs.h
@@ -84,18 +84,6 @@ struct esdramc_regs {
u32 cdlyl; /* delay line cycle length debug */
};
-/* GPIO registers */
-struct gpio_regs {
- u32 gpio_dr; /* data */
- u32 gpio_dir; /* direction */
- u32 psr; /* pad satus */
- u32 icr1; /* interrupt config 1 */
- u32 icr2; /* interrupt config 2 */
- u32 imr; /* interrupt mask */
- u32 isr; /* interrupt status */
- u32 edge_sel; /* edge select */
-};
-
/* General Purpose Timer (GPT) registers */
struct gpt_regs {
u32 ctrl; /* control */
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 03/14] MX31: make use of GPIO framework for MX31 processor
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 02/14] MX25: make use of GPIO framework for MX25 processor Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 04/14] MX5: make use of GPIO framework for MX5 processor Stefano Babic
` (14 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx31/gpio.h | 35 +++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx31/imx-regs.h | 7 -----
2 files changed, 35 insertions(+), 7 deletions(-)
create mode 100644 arch/arm/include/asm/arch-mx31/gpio.h
diff --git a/arch/arm/include/asm/arch-mx31/gpio.h b/arch/arm/include/asm/arch-mx31/gpio.h
new file mode 100644
index 0000000..95b73bf
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx31/gpio.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __ASM_ARCH_MX31_GPIO_H
+#define __ASM_ARCH_MX31_GPIO_H
+
+/* GPIO Registers */
+struct gpio_regs {
+ u32 gpio_dr;
+ u32 gpio_dir;
+ u32 gpio_psr;
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 3c8d607..2064870 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -57,13 +57,6 @@ struct clock_control_regs {
u32 pdr2;
};
-/* GPIO Registers */
-struct gpio_regs {
- u32 gpio_dr;
- u32 gpio_dir;
- u32 gpio_psr;
-};
-
struct cspi_regs {
u32 rxdata;
u32 txdata;
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 04/14] MX5: make use of GPIO framework for MX5 processor
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 02/14] MX25: make use of GPIO framework for MX25 processor Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 03/14] MX31: make use of GPIO framework for MX31 processor Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 05/14] MX35: make use of GPIO framework for MX35 processor Stefano Babic
` (13 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx5/gpio.h | 35 ++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx5/imx-regs.h | 7 ------
2 files changed, 35 insertions(+), 7 deletions(-)
create mode 100644 arch/arm/include/asm/arch-mx5/gpio.h
diff --git a/arch/arm/include/asm/arch-mx5/gpio.h b/arch/arm/include/asm/arch-mx5/gpio.h
new file mode 100644
index 0000000..1dc34e9
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx5/gpio.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __ASM_ARCH_MX5_GPIO_H
+#define __ASM_ARCH_MX5_GPIO_H
+
+/* GPIO registers */
+struct gpio_regs {
+ u32 gpio_dr;
+ u32 gpio_dir;
+ u32 gpio_psr;
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h
index fb2c66f..a4e680b 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -409,13 +409,6 @@ struct iomuxc {
};
#endif
-/* GPIO Registers */
-struct gpio_regs {
- u32 gpio_dr;
- u32 gpio_dir;
- u32 gpio_psr;
-};
-
/* System Reset Controller (SRC) */
struct src {
u32 scr;
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 05/14] MX35: make use of GPIO framework for MX35 processor
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (2 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 04/14] MX5: make use of GPIO framework for MX5 processor Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 06/14] MX31: QONG: make use of GPIO framework Stefano Babic
` (12 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx35/gpio.h | 40 +++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/include/asm/arch-mx35/gpio.h
diff --git a/arch/arm/include/asm/arch-mx35/gpio.h b/arch/arm/include/asm/arch-mx35/gpio.h
new file mode 100644
index 0000000..7bcc3e8
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx35/gpio.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __ASM_ARCH_MX35_GPIO_H
+#define __ASM_ARCH_MX35_GPIO_H
+
+/* GPIO registers */
+struct gpio_regs {
+ u32 gpio_dr; /* data */
+ u32 gpio_dir; /* direction */
+ u32 psr; /* pad satus */
+ u32 icr1; /* interrupt config 1 */
+ u32 icr2; /* interrupt config 2 */
+ u32 imr; /* interrupt mask */
+ u32 isr; /* interrupt status */
+ u32 edge_sel; /* edge select */
+};
+
+#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 06/14] MX31: QONG: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (3 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 05/14] MX35: make use of GPIO framework for MX35 processor Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 07/14] MX5: efikamx: " Stefano Babic
` (11 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
board/davedenx/qong/fpga.c | 10 +++++-----
board/davedenx/qong/qong.c | 36 +++++++++++++++++-------------------
2 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/board/davedenx/qong/fpga.c b/board/davedenx/qong/fpga.c
index 789acf0..6536a0b 100644
--- a/board/davedenx/qong/fpga.c
+++ b/board/davedenx/qong/fpga.c
@@ -25,7 +25,7 @@
#include <common.h>
#include <asm/arch/clock.h>
#include <asm/arch/imx-regs.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <fpga.h>
#include <lattice.h>
#include "qong_fpga.h"
@@ -41,22 +41,22 @@ static void qong_jtag_init(void)
static void qong_fpga_jtag_set_tdi(int value)
{
- mxc_gpio_set(QONG_FPGA_TDI_PIN, value);
+ gpio_set_value(QONG_FPGA_TDI_PIN, value);
}
static void qong_fpga_jtag_set_tms(int value)
{
- mxc_gpio_set(QONG_FPGA_TMS_PIN, value);
+ gpio_set_value(QONG_FPGA_TMS_PIN, value);
}
static void qong_fpga_jtag_set_tck(int value)
{
- mxc_gpio_set(QONG_FPGA_TCK_PIN, value);
+ gpio_set_value(QONG_FPGA_TCK_PIN, value);
}
static int qong_fpga_jtag_get_tdo(void)
{
- return mxc_gpio_get(QONG_FPGA_TDO_PIN);
+ return gpio_get_value(QONG_FPGA_TDO_PIN);
}
lattice_board_specific_func qong_fpga_fns = {
diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c
index ec22627..99432ed 100644
--- a/board/davedenx/qong/qong.c
+++ b/board/davedenx/qong/qong.c
@@ -28,7 +28,7 @@
#include <asm/io.h>
#include <nand.h>
#include <fsl_pmic.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include "qong_fpga.h"
#include <watchdog.h>
@@ -51,9 +51,9 @@ int dram_init (void)
static void qong_fpga_reset(void)
{
- mxc_gpio_set(QONG_FPGA_RST_PIN, 0);
+ gpio_set_value(QONG_FPGA_RST_PIN, 0);
udelay(30);
- mxc_gpio_set(QONG_FPGA_RST_PIN, 1);
+ gpio_set_value(QONG_FPGA_RST_PIN, 1);
udelay(300);
}
@@ -76,21 +76,20 @@ int board_early_init_f (void)
/* FPGA reset Pin */
/* rstn = 0 */
- mxc_gpio_set(QONG_FPGA_RST_PIN, 0);
- mxc_gpio_direction(QONG_FPGA_RST_PIN, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(QONG_FPGA_RST_PIN, 0);
/* set interrupt pin as input */
- mxc_gpio_direction(QONG_FPGA_IRQ_PIN, MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(QONG_FPGA_IRQ_PIN);
/* FPGA JTAG Interface */
mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SFS6, MUX_CTL_GPIO));
mx31_gpio_mux(IOMUX_MODE(MUX_CTL_SCK6, MUX_CTL_GPIO));
mx31_gpio_mux(IOMUX_MODE(MUX_CTL_CAPTURE, MUX_CTL_GPIO));
mx31_gpio_mux(IOMUX_MODE(MUX_CTL_COMPARE, MUX_CTL_GPIO));
- mxc_gpio_direction(QONG_FPGA_TCK_PIN, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(QONG_FPGA_TMS_PIN, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(QONG_FPGA_TDI_PIN, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(QONG_FPGA_TDO_PIN, MXC_GPIO_DIRECTION_IN);
+ gpio_direction_output(QONG_FPGA_TCK_PIN, 0);
+ gpio_direction_output(QONG_FPGA_TMS_PIN, 0);
+ gpio_direction_output(QONG_FPGA_TDI_PIN, 0);
+ gpio_direction_input(QONG_FPGA_TDO_PIN);
#endif
/* setup pins for UART1 */
@@ -263,27 +262,26 @@ static void board_nand_setup(void)
qong_fpga_reset();
/* Enable NAND flash */
- mxc_gpio_set(15, 1);
- mxc_gpio_set(14, 1);
- mxc_gpio_direction(15, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(16, MXC_GPIO_DIRECTION_IN);
- mxc_gpio_direction(14, MXC_GPIO_DIRECTION_IN);
- mxc_gpio_set(15, 0);
+ gpio_set_value(15, 1);
+ gpio_set_value(14, 1);
+ gpio_direction_output(15, 0);
+ gpio_direction_input(16);
+ gpio_direction_input(14);
}
int qong_nand_rdy(void *chip)
{
udelay(1);
- return mxc_gpio_get(16);
+ return gpio_get_value(16);
}
void qong_nand_select_chip(struct mtd_info *mtd, int chip)
{
if (chip >= 0)
- mxc_gpio_set(15, 0);
+ gpio_set_value(15, 0);
else
- mxc_gpio_set(15, 1);
+ gpio_set_value(15, 1);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 07/14] MX5: efikamx: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (4 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 06/14] MX31: QONG: make use of GPIO framework Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 11:54 ` Marek Vasut
2011-08-21 10:28 ` [U-Boot] [PATCH 08/14] MX25: zmx25: " Stefano Babic
` (10 subsequent siblings)
16 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Marek Vasut <marek.vasut@gmail.com>
---
board/efikamx/efikamx.c | 62 ++++++++++++++++++----------------------------
1 files changed, 24 insertions(+), 38 deletions(-)
diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
index 4b36918..5be1f6c 100644
--- a/board/efikamx/efikamx.c
+++ b/board/efikamx/efikamx.c
@@ -27,7 +27,7 @@
#include <asm/arch/imx-regs.h>
#include <asm/arch/mx5x_pins.h>
#include <asm/arch/iomux.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <asm/errno.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/crm_regs.h>
@@ -76,28 +76,23 @@ u32 get_efika_rev(void)
* rev1.4: 1,0,0
*/
mxc_request_iomux(MX51_PIN_NANDF_CS0, IOMUX_CONFIG_GPIO);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0),
- MXC_GPIO_DIRECTION_OUT);
/* set to 1 in order to get correct value on board rev1.1 */
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0), 1);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0), 1);
mxc_request_iomux(MX51_PIN_NANDF_CS0, IOMUX_CONFIG_GPIO);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS0, PAD_CTL_100K_PU);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0),
- MXC_GPIO_DIRECTION_IN);
- rev |= (!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0))) << 0;
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0));
+ rev |= (!!gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0))) << 0;
mxc_request_iomux(MX51_PIN_NANDF_CS1, IOMUX_CONFIG_GPIO);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS1, PAD_CTL_100K_PU);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS1),
- MXC_GPIO_DIRECTION_IN);
- rev |= (!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS1))) << 1;
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS1));
+ rev |= (!!gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS1))) << 1;
mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_GPIO);
mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, PAD_CTL_100K_PU);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3),
- MXC_GPIO_DIRECTION_IN);
- rev |= (!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3));
+ rev |= (!!gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;
return (~rev & 0x7) + 1;
}
@@ -154,15 +149,11 @@ static void setup_iomux_spi(void)
/* Configure SS0 as a GPIO */
mxc_request_iomux(MX51_PIN_CSPI1_SS0, IOMUX_CONFIG_GPIO);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS0),
- MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS0), 0);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS0), 0);
/* Configure SS1 as a GPIO */
mxc_request_iomux(MX51_PIN_CSPI1_SS1, IOMUX_CONFIG_GPIO);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS1),
- MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS1), 1);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSPI1_SS1), 1);
/* 000: Select mux mode: ALT0 mux port: SS2 of instance: ecspi1. */
mxc_request_iomux(MX51_PIN_CSPI1_RDY, IOMUX_CONFIG_ALT0);
@@ -282,9 +273,9 @@ int board_mmc_getcd(u8 *absent, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *absent = mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0));
+ *absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0));
else
- *absent = mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
+ *absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
return 0;
}
@@ -307,10 +298,8 @@ int board_mmc_init(bd_t *bis)
PAD_CTL_100K_PU | PAD_CTL_ODE_OPENDRAIN_NONE |
PAD_CTL_SRE_FAST);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0),
- MXC_GPIO_DIRECTION_IN);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_1),
- MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_GPIO1_0));
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_GPIO1_1));
/* Internal SDHC1 IOMUX + SDHC2 IOMUX on old boards */
if (get_efika_rev() < EFIKAMX_BOARD_REV_12) {
@@ -389,10 +378,8 @@ int board_mmc_init(bd_t *bis)
PAD_CTL_100K_PU | PAD_CTL_ODE_OPENDRAIN_NONE |
PAD_CTL_SRE_FAST);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8),
- MXC_GPIO_DIRECTION_IN);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_GPIO1_7),
- MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8));
+ gpio_direction_input(IOMUX_TO_GPIO(MX51_PIN_GPIO1_7));
ret = fsl_esdhc_initialize(bis, &esdhc_cfg[0]);
if (!ret)
@@ -508,25 +495,24 @@ void setup_iomux_led(void)
{
/* Blue LED */
mxc_request_iomux(MX51_PIN_CSI1_D9, IOMUX_CONFIG_ALT3);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
- MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9), 0);
+
/* Green LED */
mxc_request_iomux(MX51_PIN_CSI1_VSYNC, IOMUX_CONFIG_ALT3);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
- MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC), 0);
+
/* Red LED */
mxc_request_iomux(MX51_PIN_CSI1_HSYNC, IOMUX_CONFIG_ALT3);
- mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
- MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), 0);
}
void efikamx_toggle_led(uint32_t mask)
{
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
+ gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
mask & EFIKAMX_LED_BLUE);
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
+ gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
mask & EFIKAMX_LED_GREEN);
- mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
+ gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
mask & EFIKAMX_LED_RED);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 08/14] MX25: zmx25: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (5 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 07/14] MX5: efikamx: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 09/14] MX5: mx53ard: " Stefano Babic
` (9 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Matthias Weisser <weisserm@arcor.de>
---
board/syteco/zmx25/zmx25.c | 35 ++++++++++++++---------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/board/syteco/zmx25/zmx25.c b/board/syteco/zmx25/zmx25.c
index f055038..893adc6 100644
--- a/board/syteco/zmx25/zmx25.c
+++ b/board/syteco/zmx25/zmx25.c
@@ -29,7 +29,7 @@
*
*/
#include <common.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/imx25-pinmux.h>
@@ -56,8 +56,7 @@ int board_init()
/* Setup of core volatage selection pin to run at 1.4V */
writel(gpio_mux_mode5, &muxctl->pad_ext_armclk); /* VCORE GPIO3[15] */
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(3, 15), MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(3, 15), 1);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(3, 15), 1);
/* Setup of input daisy chains for SD card pins*/
writel(gpio_mux_mode0_sion, &muxctl->pad_sd1_cmd);
@@ -69,11 +68,10 @@ int board_init()
/* Setup of digital output for USB power and OC */
writel(gpio_mux_mode5, &muxctl->pad_csi_d3); /* USB Power GPIO1[28] */
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(1, 28), MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(1, 28), 1);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 28), 1);
writel(gpio_mux_mode5, &muxctl->pad_csi_d2); /* USB OC GPIO1[27] */
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(1, 18), MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(MXC_GPIO_PORT_TO_NUM(1, 18));
/* Setup of digital output control pins */
writel(gpio_mux_mode5, &muxctl->pad_csi_d8); /* Ouput 1 Ctrl GPIO1[7] */
@@ -85,25 +83,21 @@ int board_init()
writel(0, &padctl->pad_csi_d5); /* Ouput 2 Stat pull up off */
/* Switch both output drivers off */
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(1, 7), 0);
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(1, 7), MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(1, 6), 0);
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(1, 6), MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 7), 0);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 6), 0);
/* Setup of key input pin GPIO2[29]*/
writel(gpio_mux_mode5 | MX25_PIN_MUX_SION, &muxctl->pad_kpp_row0);
writel(0, &padctl->pad_kpp_row0); /* Key pull up off */
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(2, 29), MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(MXC_GPIO_PORT_TO_NUM(2, 29));
/* Setup of status LED outputs */
writel(gpio_mux_mode5, &muxctl->pad_csi_d9); /* GPIO4[21] */
writel(gpio_mux_mode5, &muxctl->pad_csi_d4); /* GPIO1[29] */
/* Switch both LEDs off */
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(4, 21), MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(1, 29), MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
/* Setup of CAN1 and CAN2 signals */
writel(gpio_mux_mode6, &muxctl->pad_gpio_a); /* CAN1 TX */
@@ -158,13 +152,12 @@ int board_late_init(void)
writel(gpio_mux_mode2, &muxctl->pad_uart2_cts);
/* assert PHY reset (low) */
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(3, 16), 0);
- mxc_gpio_direction(MXC_GPIO_PORT_TO_NUM(3, 16), MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(MXC_GPIO_PORT_TO_NUM(3, 16), 0);
udelay(5000);
/* deassert PHY reset */
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(3, 16), 1);
+ gpio_set_value(MXC_GPIO_PORT_TO_NUM(3, 16), 1);
udelay(5000);
#endif
@@ -172,12 +165,12 @@ int board_late_init(void)
e = getenv("gs_base_board");
if (e != NULL) {
if (strcmp(e, "G283") == 0) {
- int key = mxc_gpio_get(MXC_GPIO_PORT_TO_NUM(2, 29));
+ int key = gpio_get_value(MXC_GPIO_PORT_TO_NUM(2, 29));
if (key) {
/* Switch on both LEDs to inidcate boot mode */
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
- mxc_gpio_set(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
+ gpio_set_value(MXC_GPIO_PORT_TO_NUM(1, 29), 0);
+ gpio_set_value(MXC_GPIO_PORT_TO_NUM(4, 21), 0);
setenv("preboot", "run gs_slow_boot");
} else
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 09/14] MX5: mx53ard: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (6 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 08/14] MX25: zmx25: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 10/14] MX5: mx53smd: " Stefano Babic
` (8 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53ard/mx53ard.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx53ard/mx53ard.c b/board/freescale/mx53ard/mx53ard.c
index 134603a..6e3360b 100644
--- a/board/freescale/mx53ard/mx53ard.c
+++ b/board/freescale/mx53ard/mx53ard.c
@@ -31,7 +31,7 @@
#include <netdev.h>
#include <mmc.h>
#include <fsl_esdhc.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#define ETHERNET_INT (1 * 32 + 31) /* GPIO2_31 */
@@ -93,9 +93,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *cd = mxc_gpio_get(1); /*GPIO1_1*/
+ *cd = gpio_get_value(1); /*GPIO1_1*/
else
- *cd = mxc_gpio_get(4); /*GPIO1_4*/
+ *cd = gpio_get_value(4); /*GPIO1_4*/
return 0;
}
@@ -176,7 +176,7 @@ static void weim_smc911x_iomux(void)
{
/* ETHERNET_INT as GPIO2_31 */
mxc_request_iomux(MX53_PIN_EIM_EB3, IOMUX_CONFIG_ALT1);
- mxc_gpio_direction(ETHERNET_INT, MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(ETHERNET_INT);
/* Data bus */
mxc_request_iomux(MX53_PIN_EIM_D16, IOMUX_CONFIG_ALT0);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 10/14] MX5: mx53smd: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (7 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 09/14] MX5: mx53ard: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 11/14] MX5: vision2: " Stefano Babic
` (7 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Fabio Estevam <fabio.estevam@freescale.com>
---
board/freescale/mx53smd/mx53smd.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/freescale/mx53smd/mx53smd.c b/board/freescale/mx53smd/mx53smd.c
index 21b5d14..4a7ee55 100644
--- a/board/freescale/mx53smd/mx53smd.c
+++ b/board/freescale/mx53smd/mx53smd.c
@@ -31,7 +31,7 @@
#include <netdev.h>
#include <mmc.h>
#include <fsl_esdhc.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -139,7 +139,7 @@ struct fsl_esdhc_cfg esdhc_cfg[1] = {
int board_mmc_getcd(u8 *cd, struct mmc *mmc)
{
- *cd = mxc_gpio_get(77); /*GPIO3_13*/
+ *cd = gpio_get_value(77); /*GPIO3_13*/
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 11/14] MX5: vision2: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (8 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 10/14] MX5: mx53smd: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 12/14] MX5: mx53evk: " Stefano Babic
` (6 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
board/ttcontrol/vision2/vision2.c | 71 ++++++++++++++-----------------------
1 files changed, 27 insertions(+), 44 deletions(-)
diff --git a/board/ttcontrol/vision2/vision2.c b/board/ttcontrol/vision2/vision2.c
index 565c4d0..17a2558 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -29,7 +29,7 @@
#include <asm/arch/mx5x_pins.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/iomux.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <asm/arch/sys_proto.h>
#include <asm/errno.h>
#include <i2c.h>
@@ -69,9 +69,9 @@ void hw_watchdog_reset(void)
int val;
/* toggle watchdog trigger pin */
- val = mxc_gpio_get(66);
+ val = gpio_get_value(66);
val = val ? 0 : 1;
- mxc_gpio_set(66, val);
+ gpio_set_value(66, val);
}
#endif
@@ -233,30 +233,22 @@ static void reset_peripherals(int reset)
if (reset) {
/* reset_n is on NANDF_D15 */
- mxc_gpio_set(89, 0);
- mxc_gpio_direction(89, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(89, 0);
#ifdef CONFIG_VISION2_HW_1_0
/*
* set FEC Configuration lines
* set levels of FEC config lines
*/
- mxc_gpio_set(75, 0);
- mxc_gpio_set(74, 1);
- mxc_gpio_set(95, 1);
- mxc_gpio_direction(75, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(74, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(95, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(75, 0);
+ gpio_direction_output(74, 1);
+ gpio_direction_output(95, 1);
/* set direction of FEC config lines */
- mxc_gpio_set(59, 0);
- mxc_gpio_set(60, 0);
- mxc_gpio_set(61, 0);
- mxc_gpio_set(55, 1);
- mxc_gpio_direction(59, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(60, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(61, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_direction(55, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(59, 0);
+ gpio_direction_output(60, 0);
+ gpio_direction_output(61, 0);
+ gpio_direction_output(55, 1);
/* FEC_RXD1 - sel GPIO (2-23) for configuration -> 1 */
mxc_request_iomux(MX51_PIN_EIM_EB3, IOMUX_CONFIG_ALT1);
@@ -283,7 +275,7 @@ static void reset_peripherals(int reset)
PAD_CTL_DRV_VOT_HIGH | PAD_CTL_DRV_MAX);
} else {
/* set FEC Control lines */
- mxc_gpio_direction(89, MXC_GPIO_DIRECTION_IN);
+ gpio_direction_input(89);
udelay(500);
#ifdef CONFIG_VISION2_HW_1_0
@@ -438,31 +430,23 @@ static void setup_gpios(void)
* Set GPIO1_4 to high and output; it is used to reset
* the system on reboot
*/
- mxc_gpio_set(4, 1);
- mxc_gpio_direction(4, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(4, 1);
- mxc_gpio_set(7, 0);
- mxc_gpio_direction(7, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(7, 0);
for (i = 65; i < 71; i++) {
- mxc_gpio_set(i, 0);
- mxc_gpio_direction(i, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(i, 0);
}
- mxc_gpio_set(94, 0);
- mxc_gpio_direction(94, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(94, 0);
/* Set POWER_OFF high */
- mxc_gpio_set(91, 1);
- mxc_gpio_direction(91, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(91, 1);
- mxc_gpio_set(90, 0);
- mxc_gpio_direction(90, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(90, 0);
- mxc_gpio_set(122, 0);
- mxc_gpio_direction(122, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(122, 0);
- mxc_gpio_set(121, 1);
- mxc_gpio_direction(121, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(121, 1);
WATCHDOG_RESET();
}
@@ -551,7 +535,7 @@ int get_mmc_getcd(u8 *cd, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *cd = mxc_gpio_get(0);
+ *cd = gpio_get_value(0);
else
*cd = 0;
@@ -623,8 +607,7 @@ int board_early_init_f(void)
init_drive_strength();
/* Setup debug led */
- mxc_gpio_set(6, 0);
- mxc_gpio_direction(6, MXC_GPIO_DIRECTION_OUT);
+ gpio_direction_output(6, 0);
mxc_request_iomux(MX51_PIN_GPIO1_6, IOMUX_CONFIG_ALT0);
mxc_iomux_set_pad(MX51_PIN_GPIO1_6, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
@@ -644,12 +627,12 @@ int board_early_init_f(void)
static void backlight(int on)
{
if (on) {
- mxc_gpio_set(65, 1);
+ gpio_set_value(65, 1);
udelay(10000);
- mxc_gpio_set(68, 1);
+ gpio_set_value(68, 1);
} else {
- mxc_gpio_set(65, 0);
- mxc_gpio_set(68, 0);
+ gpio_set_value(65, 0);
+ gpio_set_value(68, 0);
}
}
@@ -660,7 +643,7 @@ void lcd_enable(void)
mxc_request_iomux(MX51_PIN_DI1_PIN2, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_DI1_PIN3, IOMUX_CONFIG_ALT0);
- mxc_gpio_set(2, 1);
+ gpio_set_value(2, 1);
mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
ret = mx51_fb_init(&nec_nl6448bc26_09c);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 12/14] MX5: mx53evk: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (9 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 11/14] MX5: vision2: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 12:24 ` Jason Liu
2011-08-21 10:28 ` [U-Boot] [PATCH 13/14] MX5: mx53loco: " Stefano Babic
` (5 subsequent siblings)
16 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <r64343@freescale.com>
---
board/freescale/mx53evk/mx53evk.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c
index 88095dc..81857ff 100644
--- a/board/freescale/mx53evk/mx53evk.c
+++ b/board/freescale/mx53evk/mx53evk.c
@@ -33,7 +33,7 @@
#include <mmc.h>
#include <fsl_esdhc.h>
#include <fsl_pmic.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <mc13892.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -213,9 +213,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *cd = mxc_gpio_get(77); /*GPIO3_13*/
+ *cd = gpio_get_value(77); /*GPIO3_13*/
else
- *cd = mxc_gpio_get(75); /*GPIO3_11*/
+ *cd = gpio_get_value(75); /*GPIO3_11*/
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 13/14] MX5: mx53loco: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (10 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 12/14] MX5: mx53evk: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-22 2:54 ` Jason Liu
2011-08-21 10:28 ` [U-Boot] [PATCH 14/14] MX35: mx35pdk: " Stefano Babic
` (4 subsequent siblings)
16 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <r64343@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 18b388e..ade1006 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -34,7 +34,7 @@
#include <i2c.h>
#include <mmc.h>
#include <fsl_esdhc.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -146,9 +146,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *cd = mxc_gpio_get(77); /*GPIO3_13*/
+ *cd = gpio_get_value(77); /*GPIO3_13*/
else
- *cd = mxc_gpio_get(75); /*GPIO3_11*/
+ *cd = gpio_get_value(75); /*GPIO3_11*/
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 14/14] MX35: mx35pdk: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (11 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 13/14] MX5: mx53loco: " Stefano Babic
@ 2011-08-21 10:28 ` Stefano Babic
2011-08-21 16:37 ` [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using " Fabio Estevam
` (3 subsequent siblings)
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-21 10:28 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
board/freescale/mx35pdk/mx35pdk.c | 5 ++---
include/configs/mx35pdk.h | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c
index a6b5a51..9eefe5e 100644
--- a/board/freescale/mx35pdk/mx35pdk.c
+++ b/board/freescale/mx35pdk/mx35pdk.c
@@ -34,7 +34,7 @@
#include <mc9sdz60.h>
#include <mc13892.h>
#include <linux/types.h>
-#include <mxc_gpio.h>
+#include <asm/gpio.h>
#include <asm/arch/sys_proto.h>
#include <netdev.h>
@@ -240,8 +240,7 @@ int board_late_init(void)
mxc_request_iomux(MX35_PIN_COMPARE, MUX_CONFIG_GPIO);
mxc_iomux_set_input(MUX_IN_GPIO1_IN_5, INPUT_CTL_PATH0);
- mxc_gpio_direction(37, MXC_GPIO_DIRECTION_OUT);
- mxc_gpio_set(37, 1);
+ gpio_direction_output(37, 1);
}
val = mc9sdz60_reg_read(MC9SDZ60_REG_GPIO_1) | 0x04;
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index 0d4b733..4e9022d 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -63,6 +63,7 @@
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_SYS_I2C_SLAVE 0xfe
#define CONFIG_MXC_SPI
+#define CONFIG_MXC_GPIO
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 07/14] MX5: efikamx: make use of GPIO framework
2011-08-21 10:28 ` [U-Boot] [PATCH 07/14] MX5: efikamx: " Stefano Babic
@ 2011-08-21 11:54 ` Marek Vasut
2011-08-22 11:15 ` Stefano Babic
0 siblings, 1 reply; 25+ messages in thread
From: Marek Vasut @ 2011-08-21 11:54 UTC (permalink / raw)
To: u-boot
On Sunday, August 21, 2011 12:28:22 PM Stefano Babic wrote:
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Marek Vasut <marek.vasut@gmail.com>
> ---
> board/efikamx/efikamx.c | 62
> ++++++++++++++++++---------------------------- 1 files changed, 24
> insertions(+), 38 deletions(-)
>
> diff --git a/board/efikamx/efikamx.c b/board/efikamx/efikamx.c
> index 4b36918..5be1f6c 100644
> --- a/board/efikamx/efikamx.c
> +++ b/board/efikamx/efikamx.c
[...]
> @@ -508,25 +495,24 @@ void setup_iomux_led(void)
> {
> /* Blue LED */
> mxc_request_iomux(MX51_PIN_CSI1_D9, IOMUX_CONFIG_ALT3);
> - mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
> - MXC_GPIO_DIRECTION_OUT);
> + gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9), 0);
> +
> /* Green LED */
> mxc_request_iomux(MX51_PIN_CSI1_VSYNC, IOMUX_CONFIG_ALT3);
> - mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
> - MXC_GPIO_DIRECTION_OUT);
> + gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC), 0);
> +
> /* Red LED */
> mxc_request_iomux(MX51_PIN_CSI1_HSYNC, IOMUX_CONFIG_ALT3);
> - mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
> - MXC_GPIO_DIRECTION_OUT);
> + gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), 0);
I'd be careful about the LEDs here. Anyway, I'll try to test it sometimes soon
(begining of next week is ok?). If you won't get any feedback, you can have my
Ack.
> }
>
> void efikamx_toggle_led(uint32_t mask)
> {
> - mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
> + gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9),
> mask & EFIKAMX_LED_BLUE);
> - mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
> + gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),
> mask & EFIKAMX_LED_GREEN);
> - mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
> + gpio_set_value(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC),
> mask & EFIKAMX_LED_RED);
> }
Thanks Stefano, this really helps.
Cheers
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 12/14] MX5: mx53evk: make use of GPIO framework
2011-08-21 10:28 ` [U-Boot] [PATCH 12/14] MX5: mx53evk: " Stefano Babic
@ 2011-08-21 12:24 ` Jason Liu
0 siblings, 0 replies; 25+ messages in thread
From: Jason Liu @ 2011-08-21 12:24 UTC (permalink / raw)
To: u-boot
2011/8/21 Stefano Babic <sbabic@denx.de>:
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <r64343@freescale.com>
> ---
> ?board/freescale/mx53evk/mx53evk.c | ? ?6 +++---
> ?1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c
> index 88095dc..81857ff 100644
> --- a/board/freescale/mx53evk/mx53evk.c
> +++ b/board/freescale/mx53evk/mx53evk.c
> @@ -33,7 +33,7 @@
> ?#include <mmc.h>
> ?#include <fsl_esdhc.h>
> ?#include <fsl_pmic.h>
> -#include <mxc_gpio.h>
> +#include <asm/gpio.h>
> ?#include <mc13892.h>
>
> ?DECLARE_GLOBAL_DATA_PTR;
> @@ -213,9 +213,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> ? ? ? ?struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>
> ? ? ? ?if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
> - ? ? ? ? ? ? ? *cd = mxc_gpio_get(77); /*GPIO3_13*/
> + ? ? ? ? ? ? ? *cd = gpio_get_value(77); /*GPIO3_13*/
> ? ? ? ?else
> - ? ? ? ? ? ? ? *cd = mxc_gpio_get(75); /*GPIO3_11*/
> + ? ? ? ? ? ? ? *cd = gpio_get_value(75); /*GPIO3_11*/
>
> ? ? ? ?return 0;
> ?}
Acked-by: Jason Liu <jason.hui@linaro.org>
Tested-by: Jason Liu <jason.hui@linaro.org>
> --
> 1.7.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (12 preceding siblings ...)
2011-08-21 10:28 ` [U-Boot] [PATCH 14/14] MX35: mx35pdk: " Stefano Babic
@ 2011-08-21 16:37 ` Fabio Estevam
2011-08-22 7:54 ` Stefano Babic
2011-08-22 7:55 ` [U-Boot] [PATCH 15/15] MX5: mx51evk: make use of " Stefano Babic
` (2 subsequent siblings)
16 siblings, 1 reply; 25+ messages in thread
From: Fabio Estevam @ 2011-08-21 16:37 UTC (permalink / raw)
To: u-boot
Hi Stefano,
On Sun, Aug 21, 2011 at 7:28 AM, Stefano Babic <sbabic@denx.de> wrote:
> IMX processors has a slightly different interface
> to access GPIOs and do not make use of the provided GPIO
> framework. The patch substitutes mxc_ specific
> functions and make use of the API in asm/gpio.h
This is a nice series. I am wondering if mx51evk is missing.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 13/14] MX5: mx53loco: make use of GPIO framework
2011-08-21 10:28 ` [U-Boot] [PATCH 13/14] MX5: mx53loco: " Stefano Babic
@ 2011-08-22 2:54 ` Jason Liu
2011-08-22 7:57 ` Stefano Babic
0 siblings, 1 reply; 25+ messages in thread
From: Jason Liu @ 2011-08-22 2:54 UTC (permalink / raw)
To: u-boot
2011/8/21 Stefano Babic <sbabic@denx.de>:
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <r64343@freescale.com>
> ---
> ?board/freescale/mx53loco/mx53loco.c | ? ?6 +++---
> ?1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
> index 18b388e..ade1006 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -34,7 +34,7 @@
> ?#include <i2c.h>
> ?#include <mmc.h>
> ?#include <fsl_esdhc.h>
> -#include <mxc_gpio.h>
> +#include <asm/gpio.h>
>
> ?DECLARE_GLOBAL_DATA_PTR;
>
> @@ -146,9 +146,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> ? ? ? ?struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>
> ? ? ? ?if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
> - ? ? ? ? ? ? ? *cd = mxc_gpio_get(77); /*GPIO3_13*/
> + ? ? ? ? ? ? ? *cd = gpio_get_value(77); /*GPIO3_13*/
> ? ? ? ?else
> - ? ? ? ? ? ? ? *cd = mxc_gpio_get(75); /*GPIO3_11*/
> + ? ? ? ? ? ? ? *cd = gpio_get_value(75); /*GPIO3_11*/
>
> ? ? ? ?return 0;
> ?}
Acked-by: Jason Liu <Jason.hui@linaro.org>
Tested-by: Jason Liu <Jason.hui@linaro.org>
> --
> 1.7.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework
2011-08-21 16:37 ` [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using " Fabio Estevam
@ 2011-08-22 7:54 ` Stefano Babic
0 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-22 7:54 UTC (permalink / raw)
To: u-boot
On 08/21/2011 06:37 PM, Fabio Estevam wrote:
> Hi Stefano,
>
Hi Fabio,
> On Sun, Aug 21, 2011 at 7:28 AM, Stefano Babic <sbabic@denx.de> wrote:
>> IMX processors has a slightly different interface
>> to access GPIOs and do not make use of the provided GPIO
>> framework. The patch substitutes mxc_ specific
>> functions and make use of the API in asm/gpio.h
>
> This is a nice series. I am wondering if mx51evk is missing.
mx51evk is nastier because it access directly GPIOs register instead of
using the driver. I prepared the patch to clean up and I post now as
last of the series.
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 15/15] MX5: mx51evk: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (13 preceding siblings ...)
2011-08-21 16:37 ` [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using " Fabio Estevam
@ 2011-08-22 7:55 ` Stefano Babic
2011-08-26 10:10 ` [U-Boot] [PATCH 16/17] MX31: mx31ads: " Stefano Babic
2011-08-26 10:10 ` [U-Boot] [PATCH 17/17] MX31: imx31_litekit: " Stefano Babic
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-22 7:55 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
board/freescale/mx51evk/mx51evk.c | 18 +++++-------------
include/configs/mx51evk.h | 1 +
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index fd7342f..94ea1f2 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <asm/io.h>
+#include <asm/gpio.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/mx5x_pins.h>
#include <asm/arch/iomux.h>
@@ -180,7 +181,6 @@ static void setup_iomux_spi(void)
static void power_init(void)
{
unsigned int val;
- unsigned int reg;
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
/* Write needed to Power Gate 2 register */
@@ -249,13 +249,7 @@ static void power_init(void)
pmic_reg_write(REG_MODE_1, val);
udelay(200);
- reg = readl(GPIO2_BASE_ADDR + 0x0);
- reg &= ~0x4000; /* Lower reset line */
- writel(reg, GPIO2_BASE_ADDR + 0x0);
-
- reg = readl(GPIO2_BASE_ADDR + 0x4);
- reg |= 0x4000; /* configure GPIO lines as output */
- writel(reg, GPIO2_BASE_ADDR + 0x4);
+ gpio_direction_output(46, 0);
/* Reset the ethernet controller over GPIO */
writel(0x1, IOMUXC_BASE_ADDR + 0x0AC);
@@ -267,9 +261,7 @@ static void power_init(void)
udelay(500);
- reg = readl(GPIO2_BASE_ADDR + 0x0);
- reg |= 0x4000;
- writel(reg, GPIO2_BASE_ADDR + 0x0);
+ gpio_set_value(46, 1);
}
#ifdef CONFIG_FSL_ESDHC
@@ -278,9 +270,9 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
- *cd = readl(GPIO1_BASE_ADDR) & 0x01;
+ *cd = gpio_get_value(0);
else
- *cd = readl(GPIO1_BASE_ADDR) & 0x40;
+ *cd = gpio_get_value(6);
return 0;
}
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index 3f2aca1..7d05dc8 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -60,6 +60,7 @@
*/
#define CONFIG_MXC_UART
#define CONFIG_SYS_MX51_UART1
+#define CONFIG_MXC_GPIO
/*
* SPI Configs
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 13/14] MX5: mx53loco: make use of GPIO framework
2011-08-22 2:54 ` Jason Liu
@ 2011-08-22 7:57 ` Stefano Babic
0 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-22 7:57 UTC (permalink / raw)
To: u-boot
On 08/22/2011 04:54 AM, Jason Liu wrote:
> 2011/8/21 Stefano Babic <sbabic@denx.de>:
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> CC: Jason Liu <r64343@freescale.com>
>> ---
Hi Jason,
> Acked-by: Jason Liu <Jason.hui@linaro.org>
> Tested-by: Jason Liu <Jason.hui@linaro.org>
Thanks for testing !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 07/14] MX5: efikamx: make use of GPIO framework
2011-08-21 11:54 ` Marek Vasut
@ 2011-08-22 11:15 ` Stefano Babic
2011-08-22 12:28 ` Marek Vasut
0 siblings, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2011-08-22 11:15 UTC (permalink / raw)
To: u-boot
On 08/21/2011 01:54 PM, Marek Vasut wrote:
> On Sunday, August 21, 2011 12:28:22 PM Stefano Babic wrote:
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> CC: Marek Vasut <marek.vasut@gmail.com>
>> ---
Hi Marek,
>> + gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), 0);
>
> I'd be careful about the LEDs here.
Well, I have seen the LEDs were not explicitely initialized. Maybe it
relies on the default value of the DR register, that should be zero.
> Anyway, I'll try to test it sometimes soon
> (begining of next week is ok?).
Of course, yes. Thanks for testing !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 07/14] MX5: efikamx: make use of GPIO framework
2011-08-22 11:15 ` Stefano Babic
@ 2011-08-22 12:28 ` Marek Vasut
0 siblings, 0 replies; 25+ messages in thread
From: Marek Vasut @ 2011-08-22 12:28 UTC (permalink / raw)
To: u-boot
On Monday, August 22, 2011 01:15:52 PM Stefano Babic wrote:
> On 08/21/2011 01:54 PM, Marek Vasut wrote:
> > On Sunday, August 21, 2011 12:28:22 PM Stefano Babic wrote:
> >> Signed-off-by: Stefano Babic <sbabic@denx.de>
> >> CC: Marek Vasut <marek.vasut@gmail.com>
> >> ---
>
> Hi Marek,
>
> >> + gpio_direction_output(IOMUX_TO_GPIO(MX51_PIN_CSI1_HSYNC), 0);
> >
> > I'd be careful about the LEDs here.
>
> Well, I have seen the LEDs were not explicitely initialized. Maybe it
> relies on the default value of the DR register, that should be zero.
>
> > Anyway, I'll try to test it sometimes soon
> > (begining of next week is ok?).
>
> Of course, yes. Thanks for testing !
Well damn, my efikamx didn't arrive today as planned. You can merge it, according
to the schematics it looks ok.
Cheers
>
> Best regards,
> Stefano Babic
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 16/17] MX31: mx31ads: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (14 preceding siblings ...)
2011-08-22 7:55 ` [U-Boot] [PATCH 15/15] MX5: mx51evk: make use of " Stefano Babic
@ 2011-08-26 10:10 ` Stefano Babic
2011-08-26 10:10 ` [U-Boot] [PATCH 17/17] MX31: imx31_litekit: " Stefano Babic
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-26 10:10 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
include/configs/mx31ads.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
index 3c61911..adb2ee1 100644
--- a/include/configs/mx31ads.h
+++ b/include/configs/mx31ads.h
@@ -65,6 +65,7 @@
#define CONFIG_MXC_SPI 1
#define CONFIG_DEFAULT_SPI_BUS 1
#define CONFIG_DEFAULT_SPI_MODE (SPI_MODE_0 | SPI_CS_HIGH)
+#define CONFIG_MXC_GPIO
#define CONFIG_FSL_PMIC
#define CONFIG_FSL_PMIC_BUS 1
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 17/17] MX31: imx31_litekit: make use of GPIO framework
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
` (15 preceding siblings ...)
2011-08-26 10:10 ` [U-Boot] [PATCH 16/17] MX31: mx31ads: " Stefano Babic
@ 2011-08-26 10:10 ` Stefano Babic
16 siblings, 0 replies; 25+ messages in thread
From: Stefano Babic @ 2011-08-26 10:10 UTC (permalink / raw)
To: u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
include/configs/imx31_litekit.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
index 1131db0..b7f1cb3 100644
--- a/include/configs/imx31_litekit.h
+++ b/include/configs/imx31_litekit.h
@@ -63,6 +63,7 @@
#define CONFIG_MXC_UART 1
#define CONFIG_SYS_MX31_UART1 1
+#define CONFIG_MXC_GPIO
#define CONFIG_HARD_SPI 1
#define CONFIG_MXC_SPI 1
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
end of thread, other threads:[~2011-08-26 10:10 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 10:28 [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using GPIO framework Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 02/14] MX25: make use of GPIO framework for MX25 processor Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 03/14] MX31: make use of GPIO framework for MX31 processor Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 04/14] MX5: make use of GPIO framework for MX5 processor Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 05/14] MX35: make use of GPIO framework for MX35 processor Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 06/14] MX31: QONG: make use of GPIO framework Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 07/14] MX5: efikamx: " Stefano Babic
2011-08-21 11:54 ` Marek Vasut
2011-08-22 11:15 ` Stefano Babic
2011-08-22 12:28 ` Marek Vasut
2011-08-21 10:28 ` [U-Boot] [PATCH 08/14] MX25: zmx25: " Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 09/14] MX5: mx53ard: " Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 10/14] MX5: mx53smd: " Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 11/14] MX5: vision2: " Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 12/14] MX5: mx53evk: " Stefano Babic
2011-08-21 12:24 ` Jason Liu
2011-08-21 10:28 ` [U-Boot] [PATCH 13/14] MX5: mx53loco: " Stefano Babic
2011-08-22 2:54 ` Jason Liu
2011-08-22 7:57 ` Stefano Babic
2011-08-21 10:28 ` [U-Boot] [PATCH 14/14] MX35: mx35pdk: " Stefano Babic
2011-08-21 16:37 ` [U-Boot] [PATCH 01/14] IMX: uniform GPIO interface using " Fabio Estevam
2011-08-22 7:54 ` Stefano Babic
2011-08-22 7:55 ` [U-Boot] [PATCH 15/15] MX5: mx51evk: make use of " Stefano Babic
2011-08-26 10:10 ` [U-Boot] [PATCH 16/17] MX31: mx31ads: " Stefano Babic
2011-08-26 10:10 ` [U-Boot] [PATCH 17/17] MX31: imx31_litekit: " Stefano Babic
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.