Skip to contentSkip to conversation

i.MX51: handle IRQ for gpio 16..31

PATCH Superseded Eric Bénard 4 participants 11 messages Jul 20, 2010 – Jul 23, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 i.MX51: handle IRQ for gpio 16..31

The i.MX51 generates 2 IRQ for each GPIO bank : one for gpio 0 to 15 and one for gpio 16 to 31.
Actually only the lower IRQ is registered so register the second one.

---
 arch/arm/plat-mxc/gpio.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/gpio.c +6 -0
index 71437c6..7e64bba 100644
@@ -293,6 +293,12 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
 			set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
 			set_irq_data(port[i].irq, &port[i]);
 		}
+		if (cpu_is_mx51()) {
+			/* setup handler for GPIO 16 to 31 */
+			set_irq_chained_handler(port[i].irq + 1,
+					mx3_gpio_irq_handler);
+			set_irq_data(port[i].irq + 1, &port[i]);
+		}
 	}
 
 	if (cpu_is_mx2()) {
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 2/3 iomux-mx51: add 4 pin definitions

---
 arch/arm/plat-mxc/include/mach/iomux-mx51.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/include/mach/iomux-mx51.h +6 -0
index 56ed0a6..21bfa46 100644
@@ -215,9 +215,11 @@ typedef enum iomux_config {
 #define MX51_PAD_KEY_COL2__KEY_COL2             IOMUX_PAD(0x654, 0x264, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_KEY_COL3__KEY_COL3             IOMUX_PAD(0x658, 0x268, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_KEY_COL4__KEY_COL4             IOMUX_PAD(0x65C, 0x26C, 0, 0x0,   0, NO_PAD_CTRL)
+#define MX51_PAD_KEY_COL4__UART3_RTS		IOMUX_PAD(0x65C, 0x26C, 2, 0x9f0, 4, MX51_UART3_PAD_CTRL)
 #define MX51_PAD_KEY_COL4__I2C2_SCL		IOMUX_PAD(0x65C, 0x26C, (3 | IOMUX_CONFIG_SION), \
 							0x09b8, 1, MX51_I2C_PAD_CTRL)
 #define MX51_PAD_KEY_COL5__KEY_COL5             IOMUX_PAD(0x660, 0x270, 0, 0x0,   0, NO_PAD_CTRL)
+#define MX51_PAD_KEY_COL5__UART3_CTS		IOMUX_PAD(0x660, 0x270, 2, 0,     0, MX51_UART3_PAD_CTRL)
 #define MX51_PAD_KEY_COL5__I2C2_SDA		IOMUX_PAD(0x660, 0x270, (3 | IOMUX_CONFIG_SION), \
 							0x09bc, 1, MX51_I2C_PAD_CTRL)
 #define MX51_PAD_USBH1_CLK__USBH1_CLK           IOMUX_PAD(0x678, 0x278, 0, 0x0,   0, MX51_USBH1_PAD_CTRL)
@@ -307,7 +309,11 @@ typedef enum iomux_config {
 #define MX51_PAD_SD2_DATA2__SD2_DATA2           IOMUX_PAD(0x7CC, 0x3C4, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_SD2_DATA3__SD2_DATA3           IOMUX_PAD(0x7D0, 0x3C8, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_GPIO_1_2__GPIO_1_2		IOMUX_PAD(0x7D4, 0x3CC, 0, 0x0,   0, NO_PAD_CTRL)
+#define MX51_PAD_GPIO_1_2__I2C2_SCL		IOMUX_PAD(0x7D4, 0x3CC, (2 | IOMUX_CONFIG_SION), \
+							0x9b8,   3, MX51_I2C_PAD_CTRL)
 #define MX51_PAD_GPIO_1_3__GPIO_1_3		IOMUX_PAD(0x7D8, 0x3D0, 0, 0x0,   0, NO_PAD_CTRL)
+#define MX51_PAD_GPIO_1_3__I2C2_SDA		IOMUX_PAD(0x7D8, 0x3D0, (2 | IOMUX_CONFIG_SION), \
+							0x9bc,   3, MX51_I2C_PAD_CTRL)
 #define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ	IOMUX_PAD(0x7FC, 0x3D4, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_GPIO_1_4__GPIO_1_4		IOMUX_PAD(0x804, 0x3D8, 0, 0x0,   0, NO_PAD_CTRL)
 #define MX51_PAD_GPIO_1_5__GPIO_1_5		IOMUX_PAD(0x808, 0x3DC, 0, 0x0,   0, NO_PAD_CTRL)
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 3/3 i.MX51: add support for cpuimx51 module and its baseboard

CPUIMX51 is build around Freescale's i.MX515 and has up to 512MB of RAM, NAND Flash, Ethernet, USB Host with 4 ports hub, USB OTG, ST16554 Quad UART on nCS1, I2C RTC ...

MBIMX51 adds LEDS, Keypad, TSC2007 touchscreen controler ...

---
 arch/arm/mach-mx5/Kconfig                          |   21 ++
 arch/arm/mach-mx5/Makefile                         |    2 +
 arch/arm/mach-mx5/board-cpuimx51.c                 |  299 ++++++++++++++++++++
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c       |  200 +++++++++++++
 .../plat-mxc/include/mach/board-eukrea_cpuimx51.h  |   37 +++
 5 files changed, 559 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mx5/board-cpuimx51.c
 create mode 100644 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
 create mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h
arch/arm/mach-mx5/Kconfig +21 -0
index 6ef3428..5edd07e 100644
@@ -21,4 +21,25 @@ config MACH_MX51_3DS
 	help
 	  Include support for MX51PDK (3DS) platform. This includes specific
 	  configurations for the board and its peripherals.
+
+config MACH_EUKREA_CPUIMX51
+	bool "Support Eukrea CPUIMX51 module"
+	help
+	  Include support forEukrea CPUIMX27 platform. This includes
+	  specific configurations for the module and its peripherals.
+
+choice
+	prompt "Baseboard"
+	depends on MACH_EUKREA_CPUIMX51
+	default MACH_EUKREA_MBIMX51_BASEBOARD
+
+config MACH_EUKREA_MBIMX51_BASEBOARD
+	prompt "Eukrea MBIMX51 development board"
+	bool
+	help
+	  This adds board specific devices that can be found on Eukrea's
+	  MBIMX51 evaluation board.
+
+endchoice
+
 endif
arch/arm/mach-mx5/Makefile +2 -0
index c757c59..86c66e7 100644
@@ -7,3 +7,5 @@ obj-y   := cpu.o mm.o clock-mx51.o devices.o
 
 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
+obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
arch/arm/mach-mx5/board-cpuimx51.c new file +299 -0

299 lines not on this page · raw message

arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c new file +200 -0

200 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h new file +37 -0
new file mode 100644
index 0000000..73ce705
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Eric Benard - eric at eukrea.com
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+
+#ifndef __ASSEMBLY__
+/*
+ * This CPU module needs a baseboard to work. After basic initializing
+ * its own devices, it calls the baseboard's init function.
+ * TODO: Add your own baseboard init function and call it from
+ * inside eukrea_cpuimx51_init().
+ *
+ * This example here is for the development board. Refer
+ * eukrea_mbimx51-baseboard.c
+ */
+
+extern void eukrea_mbimx51_baseboard_init(void);
+
+#endif
+
+#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__ */
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH 3/3 i.MX51: add support for cpuimx51 module and its baseboard

Hi Eric,

Quoted 23 lines · Eric B?nard

CPUIMX51 is build around Freescale's i.MX515 and has up to 512MB of RAM, NAND Flash, Ethernet, USB Host with 4 ports hub, USB OTG, ST16554 Quad UART on nCS1, I2C RTC ...

MBIMX51 adds LEDS, Keypad, TSC2007 touchscreen controler ...

---
 arch/arm/mach-mx5/Kconfig                          |   21 ++
 arch/arm/mach-mx5/Makefile                         |    2 +
 arch/arm/mach-mx5/board-cpuimx51.c                 |  299 ++++++++++++++++++++
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c       |  200 +++++++++++++
 .../plat-mxc/include/mach/board-eukrea_cpuimx51.h  |   37 +++
 5 files changed, 559 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mx5/board-cpuimx51.c
 create mode 100644 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
 create mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h
arch/arm/mach-mx5/Kconfig +0 -0
index 6ef3428..5edd07e 100644

arch/arm/mach-mx5/Kconfig config MACH_MX51_3DS · line 28

Quoted 8 lines
arch/arm/mach-mx5/Kconfig +5 -0
@@ -21,4 +21,25 @@ config MACH_MX51_3DS
 	help
 	  Include support for MX51PDK (3DS) platform. This includes specific
 	  configurations for the board and its peripherals.
+
+config MACH_EUKREA_CPUIMX51
+	bool "Support Eukrea CPUIMX51 module"
+	help
+	  Include support forEukrea CPUIMX27 platform. This includes

s/CPUIMX27/CPUIMX51/

arch/arm/mach-mx5/Kconfig config MACH_MX51_3DS · line 30

Quoted 2 lines
arch/arm/mach-mx5/Kconfig +2 -0
+	  specific configurations for the module and its peripherals.
+

[snip]

baruch

Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH v2 3/3 i.MX51: add support for cpuimx51 module and its baseboard

CPUIMX51 is build around Freescale's i.MX515 and has up to 512MB of RAM, NAND Flash, Ethernet, USB Host with 4 ports hub, USB OTG, ST16554 Quad UART on nCS1, I2C RTC ...

MBIMX51 adds LEDS, Keypad, TSC2007 touchscreen controler ...

---
v2 : fix board name in Kconfig help

 arch/arm/mach-mx5/Kconfig                          |   21 ++
 arch/arm/mach-mx5/Makefile                         |    2 +
 arch/arm/mach-mx5/board-cpuimx51.c                 |  299 ++++++++++++++++++++
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c       |  200 +++++++++++++
 .../plat-mxc/include/mach/board-eukrea_cpuimx51.h  |   37 +++
 5 files changed, 559 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-mx5/board-cpuimx51.c
 create mode 100644 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
 create mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h
arch/arm/mach-mx5/Kconfig +21 -0
index 6ef3428..0848db5 100644
@@ -21,4 +21,25 @@ config MACH_MX51_3DS
 	help
 	  Include support for MX51PDK (3DS) platform. This includes specific
 	  configurations for the board and its peripherals.
+
+config MACH_EUKREA_CPUIMX51
+	bool "Support Eukrea CPUIMX51 module"
+	help
+	  Include support for Eukrea CPUIMX51 platform. This includes
+	  specific configurations for the module and its peripherals.
+
+choice
+	prompt "Baseboard"
+	depends on MACH_EUKREA_CPUIMX51
+	default MACH_EUKREA_MBIMX51_BASEBOARD
+
+config MACH_EUKREA_MBIMX51_BASEBOARD
+	prompt "Eukrea MBIMX51 development board"
+	bool
+	help
+	  This adds board specific devices that can be found on Eukrea's
+	  MBIMX51 evaluation board.
+
+endchoice
+
 endif
arch/arm/mach-mx5/Makefile +2 -0
index c757c59..86c66e7 100644
@@ -7,3 +7,5 @@ obj-y   := cpu.o mm.o clock-mx51.o devices.o
 
 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
+obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
arch/arm/mach-mx5/board-cpuimx51.c new file +299 -0

299 lines not on this page · raw message

arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c new file +200 -0

200 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h new file +37 -0
new file mode 100644
index 0000000..73ce705
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Eric Benard - eric at eukrea.com
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+
+#ifndef __ASSEMBLY__
+/*
+ * This CPU module needs a baseboard to work. After basic initializing
+ * its own devices, it calls the baseboard's init function.
+ * TODO: Add your own baseboard init function and call it from
+ * inside eukrea_cpuimx51_init().
+ *
+ * This example here is for the development board. Refer
+ * eukrea_mbimx51-baseboard.c
+ */
+
+extern void eukrea_mbimx51_baseboard_init(void);
+
+#endif
+
+#endif /* __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__ */
Signature · 1 line
1.6.3.3
maintainer
#5 lore raw

PATCH 3/3 i.MX51: add support for cpuimx51 module and its baseboard

In reply to Eric Bénard

Hi Eric,

some comments inline...

arch/arm/mach-mx5/board-cpuimx51.c

Quoted 14 lines

---

(quoted diff) +1 -0
+
 endif
arch/arm/mach-mx5/Makefile +2 -0
index c757c59..86c66e7 100644
@@ -7,3 +7,5 @@ obj-y   := cpu.o mm.o clock-mx51.o devices.o
 
 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
+obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
arch/arm/mach-mx5/board-cpuimx51.c +0 -0

[snip]

There are several occurences of the string "babbage" left in this file.

Quoted 4 lines
arch/arm/mach-mx5/board-cpuimx51.c +4 -0
+
+/*
+ * Board specific initialization.
+ */

arch/arm/mach-mx5/board-cpuimx51.c line 248

Quoted 10 lines
arch/arm/mach-mx5/board-cpuimx51.c +10 -0
+static void __init mxc_board_init(void)
+{
+	mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
+					ARRAY_SIZE(mx51babbage_pads));
+
+	mxc_register_device(&mxc_uart_device0, &uart_pdata);
+	gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq");
+	gpio_direction_input(CPUIMX51_QUARTA_GPIO);
+	gpio_free(CPUIMX51_QUARTA_GPIO);
+	set_irq_type(CPUIMX51_QUARTA_IRQ, IRQF_TRIGGER_HIGH);

struct plat_serial8250_port has the irqflags field which should be used here.

Quoted 13 lines
arch/arm/mach-mx5/board-cpuimx51.c +13 -0
+	gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq");
+	gpio_direction_input(CPUIMX51_QUARTB_GPIO);
+	gpio_free(CPUIMX51_QUARTB_GPIO);
+	set_irq_type(CPUIMX51_QUARTB_IRQ, IRQF_TRIGGER_HIGH);
+	gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq");
+	gpio_direction_input(CPUIMX51_QUARTC_GPIO);
+	gpio_free(CPUIMX51_QUARTC_GPIO);
+	set_irq_type(CPUIMX51_QUARTC_IRQ, IRQF_TRIGGER_HIGH);
+	gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq");
+	gpio_direction_input(CPUIMX51_QUARTD_GPIO);
+	gpio_free(CPUIMX51_QUARTD_GPIO);
+	set_irq_type(CPUIMX51_QUARTD_IRQ, IRQF_TRIGGER_HIGH);
+

[snip]

Quoted 29 lines
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h new file +23 -0
new file mode 100644
index 0000000..73ce705
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Eric Benard - eric at eukrea.com
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+#define __ASM_ARCH_MXC_BOARD_EUKREA_CPUIMX51_H__
+
+#ifndef __ASSEMBLY__
+/*

arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h line 33

Quoted 10 lines
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h new file +10 -0
+ * This CPU module needs a baseboard to work. After basic initializing
+ * its own devices, it calls the baseboard's init function.
+ * TODO: Add your own baseboard init function and call it from
+ * inside eukrea_cpuimx51_init().
+ *
+ * This example here is for the development board. Refer
+ * eukrea_mbimx51-baseboard.c
+ */
+
+extern void eukrea_mbimx51_baseboard_init(void);

I'm not entirely happy with this. I think this should be in a file with "baseboard" in its file name rather than being named after the board. I realized you have the prototype for the baseboard init function for other eukrea boards in board specific header files aswell. How about creating a single eukrea-baseboards.h file where all available eukrea baseboards are combined?

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

PATCH 3/3 i.MX51: add support for cpuimx51 module and its baseboard

Hi Sascha,

Le 22/07/2010 15:31, Sascha Hauer a ?crit :

Quoted 10 lines

arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h line 33

Quoted 2 lines
arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx51.h new file +2 -0
+
+extern void eukrea_mbimx51_baseboard_init(void);

I'm not entirely happy with this. I think this should be in a file with "baseboard" in its file name rather than being named after the board. I realized you have the prototype for the baseboard init function for other eukrea boards in board specific header files aswell. How about creating a single eukrea-baseboards.h file where all available eukrea baseboards are combined?

OK, is it possible that you apply this patch :
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-July/020755.html
then I'll merge all the .h in one and add the i.MX51 on top of this.

Thanks
Eric

#7 lore raw

PATCH v3 1/1 i.MX51: add support for cpuimx51 module and its baseboard

In reply to Sascha Hauer

CPUIMX51 is build around Freescale's i.MX515 and has up to 512MB of RAM, NAND Flash, Ethernet, USB Host with 4 ports hub, USB OTG, ST16554 Quad UART on nCS1, I2C RTC ...

MBIMX51 adds LEDS, Keypad, TSC2007 touchscreen controler ...

---
v3 : fix forgotten babbage strings, use irqflags for quad uart's irq,
use eukrea-baseboards.h
v2 : fix board name in Kconfig help

 arch/arm/mach-mx5/Kconfig                          |   21 ++
 arch/arm/mach-mx5/Makefile                         |    2 +
 arch/arm/mach-mx5/board-cpuimx51.c                 |  293 ++++++++++++++++++++
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c       |  200 +++++++++++++
 arch/arm/plat-mxc/include/mach/eukrea-baseboards.h |    4 +-
 5 files changed, 519 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-mx5/board-cpuimx51.c
 create mode 100644 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
arch/arm/mach-mx5/Kconfig +21 -0
index 6ef3428..0848db5 100644
@@ -21,4 +21,25 @@ config MACH_MX51_3DS
 	help
 	  Include support for MX51PDK (3DS) platform. This includes specific
 	  configurations for the board and its peripherals.
+
+config MACH_EUKREA_CPUIMX51
+	bool "Support Eukrea CPUIMX51 module"
+	help
+	  Include support for Eukrea CPUIMX51 platform. This includes
+	  specific configurations for the module and its peripherals.
+
+choice
+	prompt "Baseboard"
+	depends on MACH_EUKREA_CPUIMX51
+	default MACH_EUKREA_MBIMX51_BASEBOARD
+
+config MACH_EUKREA_MBIMX51_BASEBOARD
+	prompt "Eukrea MBIMX51 development board"
+	bool
+	help
+	  This adds board specific devices that can be found on Eukrea's
+	  MBIMX51 evaluation board.
+
+endchoice
+
 endif
arch/arm/mach-mx5/Makefile +2 -0
index c757c59..86c66e7 100644
@@ -7,3 +7,5 @@ obj-y   := cpu.o mm.o clock-mx51.o devices.o
 
 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
+obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
+obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
arch/arm/mach-mx5/board-cpuimx51.c new file +293 -0

293 lines not on this page · raw message

arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c new file +200 -0

200 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/eukrea-baseboards.h +3 -1
index 4e7cbe7..634e3f4 100644
@@ -28,17 +28,19 @@
  * its own devices, it calls baseboard's init function.
  * TODO: Add your own baseboard init function and call it from
  * inside eukrea_cpuimx25_init() eukrea_cpuimx27_init()
- * or eukrea_cpuimx35_init().
+ * eukrea_cpuimx35_init() or eukrea_cpuimx51_init().
  *
  * This example here is for the development board. Refer
  * mach-mx25/eukrea_mbimxsd-baseboard.c for cpuimx25
  * mach-imx/eukrea_mbimx27-baseboard.c for cpuimx27
  * mach-mx3/eukrea_mbimxsd-baseboard.c for cpuimx35
+ * mach-mx5/eukrea_mbimx51-baseboard.c for cpuimx51
  */
 
 extern void eukrea_mbimx25_baseboard_init(void);
 extern void eukrea_mbimx27_baseboard_init(void);
 extern void eukrea_mbimx35_baseboard_init(void);
+extern void eukrea_mbimx51_baseboard_init(void);
 
 #endif
 
Signature · 1 line
1.6.3.3
#8 lore raw

PATCH 1/3 i.MX51: handle IRQ for gpio 16..31

In reply to Eric Bénard

Eric,

Quoted 14 lines · Eric B?nard

The i.MX51 generates 2 IRQ for each GPIO bank : one for gpio 0 to 15 and one for gpio 16 to 31.
Actually only the lower IRQ is registered so register the second one.

---
 arch/arm/plat-mxc/gpio.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/gpio.c +0 -0
index 71437c6..7e64bba 100644

arch/arm/plat-mxc/gpio.c int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) · line 300

Quoted 8 lines
arch/arm/plat-mxc/gpio.c +5 -0
@@ -293,6 +293,12 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
 			set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
 			set_irq_data(port[i].irq, &port[i]);
 		}
+		if (cpu_is_mx51()) {
+			/* setup handler for GPIO 16 to 31 */
+			set_irq_chained_handler(port[i].irq + 1,
+					mx3_gpio_irq_handler);
+			set_irq_data(port[i].irq + 1, &port[i]);

This is making an assumption that the high irq line is 1 more than low one. There is no guarantee this will always be true. This will also then require change when adding MX53 support and other new chips in the pipeline.

Adding irq_high field to struct mxc_gpio_port and setting up the handler when it is non-zero will avoid a cpu_is_x.

Rob

#9 lore raw

PATCH 1/3 i.MX51: handle IRQ for gpio 16..31

Hi Rob,

Le 21/07/2010 11:04, Rob Herring a ?crit :

Quoted 29 lines · Eric B?nard
Quoted 14 lines

The i.MX51 generates 2 IRQ for each GPIO bank : one for gpio 0 to 15 and one for gpio 16 to 31.
Actually only the lower IRQ is registered so register the second one.

---
  arch/arm/plat-mxc/gpio.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/gpio.c +0 -0
index 71437c6..7e64bba 100644

arch/arm/plat-mxc/gpio.c int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) · line 300

Quoted 8 lines
arch/arm/plat-mxc/gpio.c +5 -0
@@ -293,6 +293,12 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
  			set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
  			set_irq_data(port[i].irq,&port[i]);
  		}
+		if (cpu_is_mx51()) {
+			/* setup handler for GPIO 16 to 31 */
+			set_irq_chained_handler(port[i].irq + 1,
+					mx3_gpio_irq_handler);
+			set_irq_data(port[i].irq + 1,&port[i]);

This is making an assumption that the high irq line is 1 more than low one. There is no guarantee this will always be true. This will also then require change when adding MX53 support and other new chips in the pipeline.

Quoted 3 lines

Adding irq_high field to struct mxc_gpio_port and setting up the handler when it is non-zero will avoid a cpu_is_x.

OK, I'll update the patch this way.
Thanks,
Eric

#10 lore raw

PATCH v2 1/3 i.MX51: handle IRQ for gpio 16..31

In reply to Rob Herring

The i.MX51 generates 2 IRQ for each GPIO bank : one for gpio 0 to 15 and one for gpio 16 to 31.
Actually only the lower IRQ is registered so register the second one.

---
v2 :
add irq_high to struct mxc_gpio_port as per Rob Herring's suggestion

 arch/arm/mach-mx5/devices.c           |    4 ++++
 arch/arm/plat-mxc/gpio.c              |    6 ++++++
 arch/arm/plat-mxc/include/mach/gpio.h |    1 +
 3 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/devices.c +4 -0
index aafa61c..1920ff4 100644
@@ -250,24 +250,28 @@ static struct mxc_gpio_port mxc_gpio_ports[] = {
 		.chip.label = "gpio-0",
 		.base = MX51_IO_ADDRESS(MX51_GPIO1_BASE_ADDR),
 		.irq = MX51_MXC_INT_GPIO1_LOW,
+		.irq_high = MX51_MXC_INT_GPIO1_HIGH,
 		.virtual_irq_start = MXC_GPIO_IRQ_START
 	},
 	{
 		.chip.label = "gpio-1",
 		.base = MX51_IO_ADDRESS(MX51_GPIO2_BASE_ADDR),
 		.irq = MX51_MXC_INT_GPIO2_LOW,
+		.irq_high = MX51_MXC_INT_GPIO2_HIGH,
 		.virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 1
 	},
 	{
 		.chip.label = "gpio-2",
 		.base = MX51_IO_ADDRESS(MX51_GPIO3_BASE_ADDR),
 		.irq = MX51_MXC_INT_GPIO3_LOW,
+		.irq_high = MX51_MXC_INT_GPIO3_HIGH,
 		.virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 2
 	},
 	{
 		.chip.label = "gpio-3",
 		.base = MX51_IO_ADDRESS(MX51_GPIO4_BASE_ADDR),
 		.irq = MX51_MXC_INT_GPIO4_LOW,
+		.irq_high = MX51_MXC_INT_GPIO4_HIGH,
 		.virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3
 	},
 };
arch/arm/plat-mxc/gpio.c +6 -0
index 71437c6..11dc061 100644
@@ -292,6 +292,12 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
 			/* setup one handler for each entry */
 			set_irq_chained_handler(port[i].irq, mx3_gpio_irq_handler);
 			set_irq_data(port[i].irq, &port[i]);
+			if (port[i].irq_high) {
+				/* setup handler for GPIO 16 to 31 */
+				set_irq_chained_handler(port[i].irq_high,
+						mx3_gpio_irq_handler);
+				set_irq_data(port[i].irq_high, &port[i]);
+			}
 		}
 	}
 
arch/arm/plat-mxc/include/mach/gpio.h +1 -0
index 894d2f8..9541ecb 100644
@@ -33,6 +33,7 @@
 struct mxc_gpio_port {
 	void __iomem *base;
 	int irq;
+	int irq_high;
 	int virtual_irq_start;
 	struct gpio_chip chip;
 	u32 both_edges;
Signature · 1 line
1.6.3.3