aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 20:36:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 20:36:02 -0400
commit3645f0cd96fbf72c614673c5f4b1a8675f82a379 (patch)
tree84539c44e461eb9451cc0320dec70eedc9724796
parentf1d2c07d331f717da79a42952be7dc1c0d35f846 (diff)
parentc7b0807b9d4faddd87a75a5acb079e5dbfedd211 (diff)
Merge tag 'irq' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc sparse IRQ conversion from Arnd Bergmann: "The I.MX platform is getting converted to use sparse IRQs. We are doing this for all platforms over time, because this is one of the requirements for building a multiplatform kernel, and generally a good idea." * tag 'irq' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: imx: select USE_OF ARM: imx: Fix build error due to missing irqs.h include ARM: imx: enable SPARSE_IRQ for imx platform ARM: fiq: change FIQ_START to a variable tty: serial: imx: remove the use of MXC_INTERNAL_IRQS ARM: imx: remove unneeded mach/irq.h inclusion i2c: imx: remove unneeded mach/irqs.h inclusion ARM: imx: add a legacy irqdomain for mx31ads ARM: imx: add a legacy irqdomain for 3ds_debugboard ARM: imx: pass gpio than irq number into mxc_expio_init ARM: imx: leave irq_base of wm8350_platform_data uninitialized dma: ipu: remove the use of ipu_platform_data ARM: imx: move irq_domain_add_legacy call into avic driver ARM: imx: move irq_domain_add_legacy call into tzic driver gpio/mxc: move irq_domain_add_legacy call into gpio driver ARM: imx: eliminate macro IRQ_GPIOx() ARM: imx: eliminate macro IOMUX_TO_IRQ() ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/include/asm/mach/irq.h2
-rw-r--r--arch/arm/kernel/fiq.c9
-rw-r--r--arch/arm/mach-imx/Kconfig4
-rw-r--r--arch/arm/mach-imx/devices-imx31.h4
-rw-r--r--arch/arm/mach-imx/devices-imx35.h4
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c3
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c6
-rw-r--r--arch/arm/mach-imx/imx27-dt.c28
-rw-r--r--arch/arm/mach-imx/imx51-dt.c27
-rw-r--r--arch/arm/mach-imx/imx53-dt.c27
-rw-r--r--arch/arm/mach-imx/mach-apf9328.c7
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c18
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c12
-rw-r--r--arch/arm/mach-imx/mach-cpuimx35.c3
-rw-r--r--arch/arm/mach-imx/mach-cpuimx51sd.c3
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c9
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c14
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c20
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c1
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c16
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c7
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c12
-rw-r--r--arch/arm/mach-imx/mach-mx31_3ds.c18
-rw-r--r--arch/arm/mach-imx/mach-mx31ads.c63
-rw-r--r--arch/arm/mach-imx/mach-mx31lilly.c10
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c11
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c10
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c18
-rw-r--r--arch/arm/mach-imx/mach-mx51_3ds.c3
-rw-r--r--arch/arm/mach-imx/mach-mx53_ard.c5
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c6
-rw-r--r--arch/arm/mach-imx/mach-pca100.c5
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c24
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c4
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c6
-rw-r--r--arch/arm/mach-imx/mach-qong.c10
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c7
-rw-r--r--arch/arm/mach-imx/mach-vpr200.c10
-rw-r--r--arch/arm/mach-imx/mm-imx1.c1
-rw-r--r--arch/arm/mach-imx/mm-imx21.c1
-rw-r--r--arch/arm/mach-imx/mm-imx25.c1
-rw-r--r--arch/arm/mach-imx/mm-imx27.c1
-rw-r--r--arch/arm/mach-imx/mm-imx3.c1
-rw-r--r--arch/arm/mach-imx/mx31lilly-db.c11
-rw-r--r--arch/arm/mach-imx/mx31lite-db.c5
-rw-r--r--arch/arm/mach-imx/mx51_efika.c3
-rw-r--r--arch/arm/mach-imx/pcm970-baseboard.c13
-rw-r--r--arch/arm/mach-rpc/irq.c2
-rw-r--r--arch/arm/plat-mxc/3ds_debugboard.c50
-rw-r--r--arch/arm/plat-mxc/avic.c35
-rw-r--r--arch/arm/plat-mxc/devices/platform-ipu-core.c5
-rw-r--r--arch/arm/plat-mxc/include/mach/3ds_debugboard.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h3
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v1.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/ipu.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h44
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h111
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h107
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h72
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h127
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h87
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h118
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h109
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h77
-rw-r--r--arch/arm/plat-mxc/include/mach/mx50.h187
-rw-r--r--arch/arm/plat-mxc/include/mach/mx51.h209
-rw-r--r--arch/arm/plat-mxc/include/mach/mx53.h217
-rw-r--r--arch/arm/plat-mxc/tzic.c30
-rw-r--r--arch/arm/plat-s3c24xx/irq.c2
-rw-r--r--drivers/dma/ipu/ipu_idmac.c8
-rw-r--r--drivers/dma/ipu/ipu_irq.c14
-rw-r--r--drivers/gpio/gpio-mxc.c56
-rw-r--r--drivers/i2c/busses/i2c-imx.c1
-rw-r--r--drivers/media/video/mx1_camera.c1
-rw-r--r--drivers/tty/serial/imx.c6
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c1
79 files changed, 1052 insertions, 1131 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dc3de407ce05..7658d19bb111 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -470,6 +470,8 @@ config ARCH_MXC
470 select CLKSRC_MMIO 470 select CLKSRC_MMIO
471 select GENERIC_IRQ_CHIP 471 select GENERIC_IRQ_CHIP
472 select MULTI_IRQ_HANDLER 472 select MULTI_IRQ_HANDLER
473 select SPARSE_IRQ
474 select USE_OF
473 help 475 help
474 Support for Freescale MXC/iMX-based family of processors 476 Support for Freescale MXC/iMX-based family of processors
475 477
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index febe495d0c6e..15cb035309f7 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -17,7 +17,7 @@ struct seq_file;
17/* 17/*
18 * This is internal. Do not use it. 18 * This is internal. Do not use it.
19 */ 19 */
20extern void init_FIQ(void); 20extern void init_FIQ(int);
21extern int show_fiq_list(struct seq_file *, int); 21extern int show_fiq_list(struct seq_file *, int);
22 22
23#ifdef CONFIG_MULTI_IRQ_HANDLER 23#ifdef CONFIG_MULTI_IRQ_HANDLER
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index c32f8456aa09..2adda11f712f 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -122,14 +122,16 @@ void release_fiq(struct fiq_handler *f)
122 while (current_fiq->fiq_op(current_fiq->dev_id, 0)); 122 while (current_fiq->fiq_op(current_fiq->dev_id, 0));
123} 123}
124 124
125static int fiq_start;
126
125void enable_fiq(int fiq) 127void enable_fiq(int fiq)
126{ 128{
127 enable_irq(fiq + FIQ_START); 129 enable_irq(fiq + fiq_start);
128} 130}
129 131
130void disable_fiq(int fiq) 132void disable_fiq(int fiq)
131{ 133{
132 disable_irq(fiq + FIQ_START); 134 disable_irq(fiq + fiq_start);
133} 135}
134 136
135EXPORT_SYMBOL(set_fiq_handler); 137EXPORT_SYMBOL(set_fiq_handler);
@@ -140,7 +142,8 @@ EXPORT_SYMBOL(release_fiq);
140EXPORT_SYMBOL(enable_fiq); 142EXPORT_SYMBOL(enable_fiq);
141EXPORT_SYMBOL(disable_fiq); 143EXPORT_SYMBOL(disable_fiq);
142 144
143void __init init_FIQ(void) 145void __init init_FIQ(int start)
144{ 146{
145 no_fiq_insn = *(unsigned long *)0xffff001c; 147 no_fiq_insn = *(unsigned long *)0xffff001c;
148 fiq_start = start;
146} 149}
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 7616101a35f0..afd542ad6f97 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -382,7 +382,6 @@ config MACH_IMX27IPCAM
382config MACH_IMX27_DT 382config MACH_IMX27_DT
383 bool "Support i.MX27 platforms from device tree" 383 bool "Support i.MX27 platforms from device tree"
384 select SOC_IMX27 384 select SOC_IMX27
385 select USE_OF
386 help 385 help
387 Include support for Freescale i.MX27 based platforms 386 Include support for Freescale i.MX27 based platforms
388 using the device tree for discovery 387 using the device tree for discovery
@@ -674,7 +673,6 @@ comment "i.MX51 machines:"
674config MACH_IMX51_DT 673config MACH_IMX51_DT
675 bool "Support i.MX51 platforms from device tree" 674 bool "Support i.MX51 platforms from device tree"
676 select SOC_IMX51 675 select SOC_IMX51
677 select USE_OF
678 select MACH_MX51_BABBAGE 676 select MACH_MX51_BABBAGE
679 help 677 help
680 Include support for Freescale i.MX51 based platforms 678 Include support for Freescale i.MX51 based platforms
@@ -770,7 +768,6 @@ comment "i.MX53 machines:"
770config MACH_IMX53_DT 768config MACH_IMX53_DT
771 bool "Support i.MX53 platforms from device tree" 769 bool "Support i.MX53 platforms from device tree"
772 select SOC_IMX53 770 select SOC_IMX53
773 select USE_OF
774 select MACH_MX53_ARD 771 select MACH_MX53_ARD
775 select MACH_MX53_EVK 772 select MACH_MX53_EVK
776 select MACH_MX53_LOCO 773 select MACH_MX53_LOCO
@@ -845,7 +842,6 @@ config SOC_IMX6Q
845 select MFD_ANATOP 842 select MFD_ANATOP
846 select PINCTRL 843 select PINCTRL
847 select PINCTRL_IMX6Q 844 select PINCTRL_IMX6Q
848 select USE_OF
849 845
850 help 846 help
851 This enables support for Freescale i.MX6 Quad processor. 847 This enables support for Freescale i.MX6 Quad processor.
diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
index 13f533d0aa5c..8b2ceb45bb83 100644
--- a/arch/arm/mach-imx/devices-imx31.h
+++ b/arch/arm/mach-imx/devices-imx31.h
@@ -42,8 +42,8 @@ extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[];
42#define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) 42#define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata)
43 43
44extern const struct imx_ipu_core_data imx31_ipu_core_data; 44extern const struct imx_ipu_core_data imx31_ipu_core_data;
45#define imx31_add_ipu_core(pdata) \ 45#define imx31_add_ipu_core() \
46 imx_add_ipu_core(&imx31_ipu_core_data, pdata) 46 imx_add_ipu_core(&imx31_ipu_core_data)
47#define imx31_alloc_mx3_camera(pdata) \ 47#define imx31_alloc_mx3_camera(pdata) \
48 imx_alloc_mx3_camera(&imx31_ipu_core_data, pdata) 48 imx_alloc_mx3_camera(&imx31_ipu_core_data, pdata)
49#define imx31_add_mx3_sdc_fb(pdata) \ 49#define imx31_add_mx3_sdc_fb(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx35.h b/arch/arm/mach-imx/devices-imx35.h
index 4815be1ee675..c3e9f206ac2b 100644
--- a/arch/arm/mach-imx/devices-imx35.h
+++ b/arch/arm/mach-imx/devices-imx35.h
@@ -50,8 +50,8 @@ extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[];
50#define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) 50#define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata)
51 51
52extern const struct imx_ipu_core_data imx35_ipu_core_data; 52extern const struct imx_ipu_core_data imx35_ipu_core_data;
53#define imx35_add_ipu_core(pdata) \ 53#define imx35_add_ipu_core() \
54 imx_add_ipu_core(&imx35_ipu_core_data, pdata) 54 imx_add_ipu_core(&imx35_ipu_core_data)
55#define imx35_alloc_mx3_camera(pdata) \ 55#define imx35_alloc_mx3_camera(pdata) \
56 imx_alloc_mx3_camera(&imx35_ipu_core_data, pdata) 56 imx_alloc_mx3_camera(&imx35_ipu_core_data, pdata)
57#define imx35_add_mx3_sdc_fb(pdata) \ 57#define imx35_add_mx3_sdc_fb(pdata) \
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index b46cab0ced53..fd3177f9e79a 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -266,7 +266,7 @@ static struct spi_board_info __maybe_unused
266 .bus_num = 0, 266 .bus_num = 0,
267 .chip_select = 0, 267 .chip_select = 0,
268 .max_speed_hz = 1500000, 268 .max_speed_hz = 1500000,
269 .irq = IRQ_GPIOD(25), 269 /* irq number is run-time assigned */
270 .platform_data = &ads7846_config, 270 .platform_data = &ads7846_config,
271 .mode = SPI_MODE_2, 271 .mode = SPI_MODE_2,
272 }, 272 },
@@ -329,6 +329,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
329 /* SPI_CS0 init */ 329 /* SPI_CS0 init */
330 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); 330 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
331 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data); 331 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data);
332 eukrea_mbimx27_spi_board_info[0].irq = gpio_to_irq(IMX_GPIO_NR(4, 25));
332 spi_register_board_info(eukrea_mbimx27_spi_board_info, 333 spi_register_board_info(eukrea_mbimx27_spi_board_info,
333 ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); 334 ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
334 335
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 557f6c486053..6e9dd12a6961 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -95,10 +95,6 @@ static const struct fb_videomode fb_modedb[] = {
95 }, 95 },
96}; 96};
97 97
98static const struct ipu_platform_data mx3_ipu_data __initconst = {
99 .irq_base = MXC_IPU_IRQ_START,
100};
101
102static struct mx3fb_platform_data mx3fb_pdata __initdata = { 98static struct mx3fb_platform_data mx3fb_pdata __initdata = {
103 .name = "CMO-QVGA", 99 .name = "CMO-QVGA",
104 .mode = fb_modedb, 100 .mode = fb_modedb,
@@ -287,7 +283,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
287 printk(KERN_ERR "error setting mbimxsd pads !\n"); 283 printk(KERN_ERR "error setting mbimxsd pads !\n");
288 284
289 imx35_add_imx_uart1(&uart_pdata); 285 imx35_add_imx_uart1(&uart_pdata);
290 imx35_add_ipu_core(&mx3_ipu_data); 286 imx35_add_ipu_core();
291 imx35_add_mx3_sdc_fb(&mx3fb_pdata); 287 imx35_add_mx3_sdc_fb(&mx3fb_pdata);
292 288
293 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); 289 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index 52efe4d5149b..e80d5235dac0 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/irqdomain.h>
14#include <linux/of_irq.h> 13#include <linux/of_irq.h>
15#include <linux/of_platform.h> 14#include <linux/of_platform.h>
16#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
@@ -33,35 +32,8 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
33 { /* sentinel */ } 32 { /* sentinel */ }
34}; 33};
35 34
36static int __init imx27_avic_add_irq_domain(struct device_node *np,
37 struct device_node *interrupt_parent)
38{
39 irq_domain_add_legacy(np, 64, 0, 0, &irq_domain_simple_ops, NULL);
40 return 0;
41}
42
43static int __init imx27_gpio_add_irq_domain(struct device_node *np,
44 struct device_node *interrupt_parent)
45{
46 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
47
48 gpio_irq_base -= 32;
49 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops,
50 NULL);
51
52 return 0;
53}
54
55static const struct of_device_id imx27_irq_match[] __initconst = {
56 { .compatible = "fsl,imx27-avic", .data = imx27_avic_add_irq_domain, },
57 { .compatible = "fsl,imx27-gpio", .data = imx27_gpio_add_irq_domain, },
58 { /* sentinel */ }
59};
60
61static void __init imx27_dt_init(void) 35static void __init imx27_dt_init(void)
62{ 36{
63 of_irq_init(imx27_irq_match);
64
65 of_platform_populate(NULL, of_default_bus_match_table, 37 of_platform_populate(NULL, of_default_bus_match_table,
66 imx27_auxdata_lookup, NULL); 38 imx27_auxdata_lookup, NULL);
67} 39}
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index 18e78dba4298..d4067fe36357 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/irqdomain.h>
15#include <linux/of_irq.h> 14#include <linux/of_irq.h>
16#include <linux/of_platform.h> 15#include <linux/of_platform.h>
17#include <linux/pinctrl/machine.h> 16#include <linux/pinctrl/machine.h>
@@ -45,30 +44,6 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
45 { /* sentinel */ } 44 { /* sentinel */ }
46}; 45};
47 46
48static int __init imx51_tzic_add_irq_domain(struct device_node *np,
49 struct device_node *interrupt_parent)
50{
51 irq_domain_add_legacy(np, 128, 0, 0, &irq_domain_simple_ops, NULL);
52 return 0;
53}
54
55static int __init imx51_gpio_add_irq_domain(struct device_node *np,
56 struct device_node *interrupt_parent)
57{
58 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
59
60 gpio_irq_base -= 32;
61 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL);
62
63 return 0;
64}
65
66static const struct of_device_id imx51_irq_match[] __initconst = {
67 { .compatible = "fsl,imx51-tzic", .data = imx51_tzic_add_irq_domain, },
68 { .compatible = "fsl,imx51-gpio", .data = imx51_gpio_add_irq_domain, },
69 { /* sentinel */ }
70};
71
72static const struct of_device_id imx51_iomuxc_of_match[] __initconst = { 47static const struct of_device_id imx51_iomuxc_of_match[] __initconst = {
73 { .compatible = "fsl,imx51-iomuxc-babbage", .data = imx51_babbage_common_init, }, 48 { .compatible = "fsl,imx51-iomuxc-babbage", .data = imx51_babbage_common_init, },
74 { /* sentinel */ } 49 { /* sentinel */ }
@@ -80,8 +55,6 @@ static void __init imx51_dt_init(void)
80 const struct of_device_id *of_id; 55 const struct of_device_id *of_id;
81 void (*func)(void); 56 void (*func)(void);
82 57
83 of_irq_init(imx51_irq_match);
84
85 pinctrl_provide_dummies(); 58 pinctrl_provide_dummies();
86 59
87 node = of_find_matching_node(NULL, imx51_iomuxc_of_match); 60 node = of_find_matching_node(NULL, imx51_iomuxc_of_match);
diff --git a/arch/arm/mach-imx/imx53-dt.c b/arch/arm/mach-imx/imx53-dt.c
index eb04b6248e48..fdd90805d98e 100644
--- a/arch/arm/mach-imx/imx53-dt.c
+++ b/arch/arm/mach-imx/imx53-dt.c
@@ -15,7 +15,6 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/irqdomain.h>
19#include <linux/of_irq.h> 18#include <linux/of_irq.h>
20#include <linux/of_platform.h> 19#include <linux/of_platform.h>
21#include <linux/pinctrl/machine.h> 20#include <linux/pinctrl/machine.h>
@@ -52,30 +51,6 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
52 { /* sentinel */ } 51 { /* sentinel */ }
53}; 52};
54 53
55static int __init imx53_tzic_add_irq_domain(struct device_node *np,
56 struct device_node *interrupt_parent)
57{
58 irq_domain_add_legacy(np, 128, 0, 0, &irq_domain_simple_ops, NULL);
59 return 0;
60}
61
62static int __init imx53_gpio_add_irq_domain(struct device_node *np,
63 struct device_node *interrupt_parent)
64{
65 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
66
67 gpio_irq_base -= 32;
68 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, NULL);
69
70 return 0;
71}
72
73static const struct of_device_id imx53_irq_match[] __initconst = {
74 { .compatible = "fsl,imx53-tzic", .data = imx53_tzic_add_irq_domain, },
75 { .compatible = "fsl,imx53-gpio", .data = imx53_gpio_add_irq_domain, },
76 { /* sentinel */ }
77};
78
79static const struct of_device_id imx53_iomuxc_of_match[] __initconst = { 54static const struct of_device_id imx53_iomuxc_of_match[] __initconst = {
80 { .compatible = "fsl,imx53-iomuxc-ard", .data = imx53_ard_common_init, }, 55 { .compatible = "fsl,imx53-iomuxc-ard", .data = imx53_ard_common_init, },
81 { .compatible = "fsl,imx53-iomuxc-evk", .data = imx53_evk_common_init, }, 56 { .compatible = "fsl,imx53-iomuxc-evk", .data = imx53_evk_common_init, },
@@ -103,8 +78,6 @@ static void __init imx53_dt_init(void)
103 const struct of_device_id *of_id; 78 const struct of_device_id *of_id;
104 void (*func)(void); 79 void (*func)(void);
105 80
106 of_irq_init(imx53_irq_match);
107
108 pinctrl_provide_dummies(); 81 pinctrl_provide_dummies();
109 82
110 node = of_find_matching_node(NULL, imx53_iomuxc_of_match); 83 node = of_find_matching_node(NULL, imx53_iomuxc_of_match);
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index f4a63ee9e217..7b99a79722b6 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/mtd/physmap.h> 19#include <linux/mtd/physmap.h>
20#include <linux/dm9000.h> 20#include <linux/dm9000.h>
21#include <linux/gpio.h>
21#include <linux/i2c.h> 22#include <linux/i2c.h>
22 23
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
@@ -26,7 +27,6 @@
26 27
27#include <mach/common.h> 28#include <mach/common.h>
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <mach/irqs.h>
30#include <mach/iomux-mx1.h> 30#include <mach/iomux-mx1.h>
31 31
32#include "devices-imx1.h" 32#include "devices-imx1.h"
@@ -87,8 +87,7 @@ static struct resource dm9000_resources[] = {
87 .end = MX1_CS4_PHYS + 0x00C00003, 87 .end = MX1_CS4_PHYS + 0x00C00003,
88 .flags = IORESOURCE_MEM, 88 .flags = IORESOURCE_MEM,
89 }, { 89 }, {
90 .start = IRQ_GPIOB(14), 90 /* irq number is run-time assigned */
91 .end = IRQ_GPIOB(14),
92 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 91 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
93 }, 92 },
94}; 93};
@@ -129,6 +128,8 @@ static void __init apf9328_init(void)
129 128
130 imx1_add_imx_i2c(&apf9328_i2c_data); 129 imx1_add_imx_i2c(&apf9328_i2c_data);
131 130
131 dm9000_resources[2].start = gpio_to_irq(IMX_GPIO_NR(2, 14));
132 dm9000_resources[2].end = gpio_to_irq(IMX_GPIO_NR(2, 14));
132 platform_add_devices(devices, ARRAY_SIZE(devices)); 133 platform_add_devices(devices, ARRAY_SIZE(devices));
133} 134}
134 135
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index c650145d1646..2c6ab3273f9e 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -367,10 +367,6 @@ static const struct fb_videomode fb_modedb[] = {
367 }, 367 },
368}; 368};
369 369
370static const struct ipu_platform_data mx3_ipu_data __initconst = {
371 .irq_base = MXC_IPU_IRQ_START,
372};
373
374static struct mx3fb_platform_data mx3fb_pdata __initdata = { 370static struct mx3fb_platform_data mx3fb_pdata __initdata = {
375 .name = "CRT-VGA", 371 .name = "CRT-VGA",
376 .mode = fb_modedb, 372 .mode = fb_modedb,
@@ -408,7 +404,8 @@ static int armadillo5x0_sdhc1_init(struct device *dev,
408 gpio_direction_input(gpio_wp); 404 gpio_direction_input(gpio_wp);
409 405
410 /* When supported the trigger type have to be BOTH */ 406 /* When supported the trigger type have to be BOTH */
411 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq, 407 ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)),
408 detect_irq,
412 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 409 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
413 "sdhc-detect", data); 410 "sdhc-detect", data);
414 411
@@ -429,7 +426,7 @@ err_gpio_free:
429 426
430static void armadillo5x0_sdhc1_exit(struct device *dev, void *data) 427static void armadillo5x0_sdhc1_exit(struct device *dev, void *data)
431{ 428{
432 free_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), data); 429 free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)), data);
433 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)); 430 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK));
434 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B)); 431 gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B));
435} 432}
@@ -450,8 +447,7 @@ static struct resource armadillo5x0_smc911x_resources[] = {
450 .end = MX31_CS3_BASE_ADDR + SZ_32M - 1, 447 .end = MX31_CS3_BASE_ADDR + SZ_32M - 1,
451 .flags = IORESOURCE_MEM, 448 .flags = IORESOURCE_MEM,
452 }, { 449 }, {
453 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), 450 /* irq number is run-time assigned */
454 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
455 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 451 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
456 }, 452 },
457}; 453};
@@ -498,6 +494,10 @@ static void __init armadillo5x0_init(void)
498 494
499 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 495 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
500 496
497 armadillo5x0_smc911x_resources[1].start =
498 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0));
499 armadillo5x0_smc911x_resources[1].end =
500 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0));
501 platform_add_devices(devices, ARRAY_SIZE(devices)); 501 platform_add_devices(devices, ARRAY_SIZE(devices));
502 imx_add_gpio_keys(&armadillo5x0_button_data); 502 imx_add_gpio_keys(&armadillo5x0_button_data);
503 imx31_add_imx_i2c1(NULL); 503 imx31_add_imx_i2c1(NULL);
@@ -513,7 +513,7 @@ static void __init armadillo5x0_init(void)
513 imx31_add_mxc_mmc(0, &sdhc_pdata); 513 imx31_add_mxc_mmc(0, &sdhc_pdata);
514 514
515 /* Register FB */ 515 /* Register FB */
516 imx31_add_ipu_core(&mx3_ipu_data); 516 imx31_add_ipu_core();
517 imx31_add_mx3_sdc_fb(&mx3fb_pdata); 517 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
518 518
519 /* Register NOR Flash */ 519 /* Register NOR Flash */
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 9a3b06e688c5..2bb9e18d9ee1 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -169,28 +169,28 @@ static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = {
169static struct plat_serial8250_port serial_platform_data[] = { 169static struct plat_serial8250_port serial_platform_data[] = {
170 { 170 {
171 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000), 171 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000),
172 .irq = IRQ_GPIOB(23), 172 /* irq number is run-time assigned */
173 .uartclk = 14745600, 173 .uartclk = 14745600,
174 .regshift = 1, 174 .regshift = 1,
175 .iotype = UPIO_MEM, 175 .iotype = UPIO_MEM,
176 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 176 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
177 }, { 177 }, {
178 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000), 178 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000),
179 .irq = IRQ_GPIOB(22), 179 /* irq number is run-time assigned */
180 .uartclk = 14745600, 180 .uartclk = 14745600,
181 .regshift = 1, 181 .regshift = 1,
182 .iotype = UPIO_MEM, 182 .iotype = UPIO_MEM,
183 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 183 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
184 }, { 184 }, {
185 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000), 185 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000),
186 .irq = IRQ_GPIOB(27), 186 /* irq number is run-time assigned */
187 .uartclk = 14745600, 187 .uartclk = 14745600,
188 .regshift = 1, 188 .regshift = 1,
189 .iotype = UPIO_MEM, 189 .iotype = UPIO_MEM,
190 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 190 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
191 }, { 191 }, {
192 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000), 192 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000),
193 .irq = IRQ_GPIOB(30), 193 /* irq number is run-time assigned */
194 .uartclk = 14745600, 194 .uartclk = 14745600,
195 .regshift = 1, 195 .regshift = 1,
196 .iotype = UPIO_MEM, 196 .iotype = UPIO_MEM,
@@ -279,6 +279,10 @@ static void __init eukrea_cpuimx27_init(void)
279#endif 279#endif
280 280
281#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 281#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
282 serial_platform_data[0].irq = IMX_GPIO_NR(2, 23);
283 serial_platform_data[1].irq = IMX_GPIO_NR(2, 22);
284 serial_platform_data[2].irq = IMX_GPIO_NR(2, 27);
285 serial_platform_data[3].irq = IMX_GPIO_NR(2, 30);
282 platform_device_register(&serial_device); 286 platform_device_register(&serial_device);
283#endif 287#endif
284 288
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 1634e54ffed5..d49b0ec6bdec 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -71,7 +71,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
71 }, { 71 }, {
72 I2C_BOARD_INFO("tsc2007", 0x48), 72 I2C_BOARD_INFO("tsc2007", 0x48),
73 .platform_data = &tsc2007_info, 73 .platform_data = &tsc2007_info,
74 .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO), 74 /* irq number is run-time assigned */
75 }, 75 },
76}; 76};
77 77
@@ -172,6 +172,7 @@ static void __init eukrea_cpuimx35_init(void)
172 imx35_add_imx_uart0(&uart_pdata); 172 imx35_add_imx_uart0(&uart_pdata);
173 imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); 173 imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info);
174 174
175 eukrea_cpuimx35_i2c_devices[1].irq = gpio_to_irq(TSC2007_IRQGPIO);
175 i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices, 176 i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices,
176 ARRAY_SIZE(eukrea_cpuimx35_i2c_devices)); 177 ARRAY_SIZE(eukrea_cpuimx35_i2c_devices));
177 imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); 178 imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data);
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index e78b40b41462..b87cc49ab1e8 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -258,7 +258,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = {
258 .mode = SPI_MODE_0, 258 .mode = SPI_MODE_0,
259 .chip_select = 0, 259 .chip_select = 0,
260 .platform_data = &mcp251x_info, 260 .platform_data = &mcp251x_info,
261 .irq = IMX_GPIO_TO_IRQ(CAN_IRQGPIO) 261 /* irq number is run-time assigned */
262 }, 262 },
263}; 263};
264 264
@@ -309,6 +309,7 @@ static void __init eukrea_cpuimx51sd_init(void)
309 msleep(20); 309 msleep(20);
310 gpio_set_value(CAN_RST, 1); 310 gpio_set_value(CAN_RST, 1);
311 imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata); 311 imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata);
312 cpuimx51sd_spi_device[0].irq = gpio_to_irq(CAN_IRQGPIO);
312 spi_register_board_info(cpuimx51sd_spi_device, 313 spi_register_board_info(cpuimx51sd_spi_device,
313 ARRAY_SIZE(cpuimx51sd_spi_device)); 314 ARRAY_SIZE(cpuimx51sd_spi_device));
314 315
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index ba09552fe5fe..f264ddddd47c 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -40,6 +40,7 @@
40#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include <asm/system_info.h> 41#include <asm/system_info.h>
42#include <mach/common.h> 42#include <mach/common.h>
43#include <mach/hardware.h>
43#include <mach/iomux-mx27.h> 44#include <mach/iomux-mx27.h>
44 45
45#include "devices-imx27.h" 46#include "devices-imx27.h"
@@ -47,7 +48,7 @@
47#define TVP5150_RSTN (GPIO_PORTC + 18) 48#define TVP5150_RSTN (GPIO_PORTC + 18)
48#define TVP5150_PWDN (GPIO_PORTC + 19) 49#define TVP5150_PWDN (GPIO_PORTC + 19)
49#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 50#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
50#define SDHC1_IRQ IRQ_GPIOB(25) 51#define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25)
51 52
52#define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) 53#define MOTHERBOARD_BIT2 (GPIO_PORTD + 31)
53#define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) 54#define MOTHERBOARD_BIT1 (GPIO_PORTD + 30)
@@ -307,14 +308,14 @@ static int visstrim_m10_sdhc1_init(struct device *dev,
307{ 308{
308 int ret; 309 int ret;
309 310
310 ret = request_irq(SDHC1_IRQ, detect_irq, IRQF_TRIGGER_FALLING, 311 ret = request_irq(gpio_to_irq(SDHC1_IRQ_GPIO), detect_irq,
311 "mmc-detect", data); 312 IRQF_TRIGGER_FALLING, "mmc-detect", data);
312 return ret; 313 return ret;
313} 314}
314 315
315static void visstrim_m10_sdhc1_exit(struct device *dev, void *data) 316static void visstrim_m10_sdhc1_exit(struct device *dev, void *data)
316{ 317{
317 free_irq(SDHC1_IRQ, data); 318 free_irq(gpio_to_irq(SDHC1_IRQ_GPIO), data);
318} 319}
319 320
320static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = { 321static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 140f55010630..426d2087c460 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/irqdomain.h>
20#include <linux/of.h> 19#include <linux/of.h>
21#include <linux/of_address.h> 20#include <linux/of_address.h>
22#include <linux/of_irq.h> 21#include <linux/of_irq.h>
@@ -177,21 +176,8 @@ static void __init imx6q_map_io(void)
177 imx6q_clock_map_io(); 176 imx6q_clock_map_io();
178} 177}
179 178
180static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
181 struct device_node *interrupt_parent)
182{
183 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
184
185 gpio_irq_base -= 32;
186 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops,
187 NULL);
188
189 return 0;
190}
191
192static const struct of_device_id imx6q_irq_match[] __initconst = { 179static const struct of_device_id imx6q_irq_match[] __initconst = {
193 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, 180 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
194 { .compatible = "fsl,imx6q-gpio", .data = imx6q_gpio_add_irq_domain, },
195 { /* sentinel */ } 181 { /* sentinel */ }
196}; 182};
197 183
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 15a26e908260..5d08533ab2c7 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -73,7 +73,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
73 { 73 {
74 .membase = KZM_ARM11_IO_ADDRESS(KZM_ARM11_16550), 74 .membase = KZM_ARM11_IO_ADDRESS(KZM_ARM11_16550),
75 .mapbase = KZM_ARM11_16550, 75 .mapbase = KZM_ARM11_16550,
76 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), 76 /* irq number is run-time assigned */
77 .irqflags = IRQ_TYPE_EDGE_RISING, 77 .irqflags = IRQ_TYPE_EDGE_RISING,
78 .uartclk = 14745600, 78 .uartclk = 14745600,
79 .regshift = 0, 79 .regshift = 0,
@@ -91,8 +91,7 @@ static struct resource serial8250_resources[] = {
91 .flags = IORESOURCE_MEM, 91 .flags = IORESOURCE_MEM,
92 }, 92 },
93 { 93 {
94 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), 94 /* irq number is run-time assigned */
95 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1),
96 .flags = IORESOURCE_IRQ, 95 .flags = IORESOURCE_IRQ,
97 }, 96 },
98}; 97};
@@ -125,6 +124,13 @@ static int __init kzm_init_ext_uart(void)
125 tmp |= 0x2; 124 tmp |= 0x2;
126 __raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1)); 125 __raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1));
127 126
127 serial_platform_data[0].irq =
128 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
129 serial8250_resources[1].start =
130 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
131 serial8250_resources[1].end =
132 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
133
128 return platform_device_register(&serial_device); 134 return platform_device_register(&serial_device);
129} 135}
130#else 136#else
@@ -152,8 +158,7 @@ static struct resource kzm_smsc9118_resources[] = {
152 .flags = IORESOURCE_MEM, 158 .flags = IORESOURCE_MEM,
153 }, 159 },
154 { 160 {
155 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2), 161 /* irq number is run-time assigned */
156 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2),
157 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 162 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
158 }, 163 },
159}; 164};
@@ -184,6 +189,11 @@ static int __init kzm_init_smsc9118(void)
184 189
185 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 190 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
186 191
192 kzm_smsc9118_resources[1].start =
193 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2));
194 kzm_smsc9118_resources[1].end =
195 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2));
196
187 return platform_device_register(&kzm_smsc9118_device); 197 return platform_device_register(&kzm_smsc9118_device);
188} 198}
189#else 199#else
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 7274e7928136..667f359a2e8b 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -26,7 +26,6 @@
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/iomux-mx1.h> 28#include <mach/iomux-mx1.h>
29#include <mach/irqs.h>
30 29
31#include "devices-imx1.h" 30#include "devices-imx1.h"
32 31
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 3e7401fca76c..ed22e3fe6ec8 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -38,7 +38,7 @@
38 (MX21ADS_MMIO_BASE_ADDR + (offset)) 38 (MX21ADS_MMIO_BASE_ADDR + (offset))
39 39
40#define MX21ADS_CS8900A_MMIO_SIZE 0x200000 40#define MX21ADS_CS8900A_MMIO_SIZE 0x200000
41#define MX21ADS_CS8900A_IRQ IRQ_GPIOE(11) 41#define MX21ADS_CS8900A_IRQ_GPIO IMX_GPIO_NR(5, 11)
42#define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000) 42#define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000)
43#define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000) 43#define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000)
44#define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000) 44#define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000)
@@ -159,9 +159,10 @@ static struct platform_device mx21ads_nor_mtd_device = {
159 .resource = &mx21ads_flash_resource, 159 .resource = &mx21ads_flash_resource,
160}; 160};
161 161
162static const struct resource mx21ads_cs8900_resources[] __initconst = { 162static struct resource mx21ads_cs8900_resources[] __initdata = {
163 DEFINE_RES_MEM(MX21_CS1_BASE_ADDR, MX21ADS_CS8900A_MMIO_SIZE), 163 DEFINE_RES_MEM(MX21_CS1_BASE_ADDR, MX21ADS_CS8900A_MMIO_SIZE),
164 DEFINE_RES_IRQ(MX21ADS_CS8900A_IRQ), 164 /* irq number is run-time assigned */
165 DEFINE_RES_IRQ(-1),
165}; 166};
166 167
167static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = { 168static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = {
@@ -241,13 +242,13 @@ static int mx21ads_sdhc_get_ro(struct device *dev)
241static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, 242static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq,
242 void *data) 243 void *data)
243{ 244{
244 return request_irq(IRQ_GPIOD(25), detect_irq, 245 return request_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), detect_irq,
245 IRQF_TRIGGER_FALLING, "mmc-detect", data); 246 IRQF_TRIGGER_FALLING, "mmc-detect", data);
246} 247}
247 248
248static void mx21ads_sdhc_exit(struct device *dev, void *data) 249static void mx21ads_sdhc_exit(struct device *dev, void *data)
249{ 250{
250 free_irq(IRQ_GPIOD(25), data); 251 free_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), data);
251} 252}
252 253
253static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = { 254static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = {
@@ -304,6 +305,11 @@ static void __init mx21ads_board_init(void)
304 imx21_add_mxc_nand(&mx21ads_nand_board_info); 305 imx21_add_mxc_nand(&mx21ads_nand_board_info);
305 306
306 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 307 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
308
309 mx21ads_cs8900_resources[1].start =
310 gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO);
311 mx21ads_cs8900_resources[1].end =
312 gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO);
307 platform_device_register_full(&mx21ads_cs8900_devinfo); 313 platform_device_register_full(&mx21ads_cs8900_devinfo);
308} 314}
309 315
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index ce9a5c26290c..58c24c1a7ab7 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -40,7 +40,6 @@
40#include <mach/common.h> 40#include <mach/common.h>
41#include <mach/iomux-mx27.h> 41#include <mach/iomux-mx27.h>
42#include <mach/ulpi.h> 42#include <mach/ulpi.h>
43#include <mach/irqs.h>
44#include <mach/3ds_debugboard.h> 43#include <mach/3ds_debugboard.h>
45 44
46#include "devices-imx27.h" 45#include "devices-imx27.h"
@@ -48,7 +47,6 @@
48#define SD1_EN_GPIO IMX_GPIO_NR(2, 25) 47#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
49#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23) 48#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
50#define SPI2_SS0 IMX_GPIO_NR(4, 21) 49#define SPI2_SS0 IMX_GPIO_NR(4, 21)
51#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(3, 28))
52#define PMIC_INT IMX_GPIO_NR(3, 14) 50#define PMIC_INT IMX_GPIO_NR(3, 14)
53#define SPI1_SS0 IMX_GPIO_NR(4, 28) 51#define SPI1_SS0 IMX_GPIO_NR(4, 28)
54#define SD1_CD IMX_GPIO_NR(2, 26) 52#define SD1_CD IMX_GPIO_NR(2, 26)
@@ -445,7 +443,7 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
445 .bus_num = 1, 443 .bus_num = 1,
446 .chip_select = 0, /* SS0 */ 444 .chip_select = 0, /* SS0 */
447 .platform_data = &mc13783_pdata, 445 .platform_data = &mc13783_pdata,
448 .irq = IMX_GPIO_TO_IRQ(PMIC_INT), 446 /* irq number is run-time assigned */
449 .mode = SPI_CS_HIGH, 447 .mode = SPI_CS_HIGH,
450 }, { 448 }, {
451 .modalias = "l4f00242t03", 449 .modalias = "l4f00242t03",
@@ -496,10 +494,11 @@ static void __init mx27pdk_init(void)
496 494
497 imx27_add_spi_imx1(&spi2_pdata); 495 imx27_add_spi_imx1(&spi2_pdata);
498 imx27_add_spi_imx0(&spi1_pdata); 496 imx27_add_spi_imx0(&spi1_pdata);
497 mx27_3ds_spi_devs[0].irq = gpio_to_irq(PMIC_INT);
499 spi_register_board_info(mx27_3ds_spi_devs, 498 spi_register_board_info(mx27_3ds_spi_devs,
500 ARRAY_SIZE(mx27_3ds_spi_devs)); 499 ARRAY_SIZE(mx27_3ds_spi_devs));
501 500
502 if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 501 if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28)))
503 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 502 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
504 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); 503 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
505 platform_add_devices(devices, ARRAY_SIZE(devices)); 504 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 7936bb32264d..7dc59bac0e55 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -246,25 +246,25 @@ static const struct imx_fb_platform_data mx27ads_fb_data __initconst = {
246static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, 246static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
247 void *data) 247 void *data)
248{ 248{
249 return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING, 249 return request_irq(gpio_to_irq(IMX_GPIO_NR(5, 21)), detect_irq,
250 "sdhc1-card-detect", data); 250 IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
251} 251}
252 252
253static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 253static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
254 void *data) 254 void *data)
255{ 255{
256 return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING, 256 return request_irq(gpio_to_irq(IMX_GPIO_NR(2, 7)), detect_irq,
257 "sdhc2-card-detect", data); 257 IRQF_TRIGGER_RISING, "sdhc2-card-detect", data);
258} 258}
259 259
260static void mx27ads_sdhc1_exit(struct device *dev, void *data) 260static void mx27ads_sdhc1_exit(struct device *dev, void *data)
261{ 261{
262 free_irq(IRQ_GPIOE(21), data); 262 free_irq(gpio_to_irq(IMX_GPIO_NR(5, 21)), data);
263} 263}
264 264
265static void mx27ads_sdhc2_exit(struct device *dev, void *data) 265static void mx27ads_sdhc2_exit(struct device *dev, void *data)
266{ 266{
267 free_irq(IRQ_GPIOB(7), data); 267 free_irq(gpio_to_irq(IMX_GPIO_NR(2, 7)), data);
268} 268}
269 269
270static const struct imxmmc_platform_data sdhc1_pdata __initconst = { 270static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 928e1dcbc6a7..8915f937b7d5 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -44,9 +44,6 @@
44 44
45#include "devices-imx31.h" 45#include "devices-imx31.h"
46 46
47/* CPLD IRQ line for external uart, external ethernet etc */
48#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1)
49
50static int mx31_3ds_pins[] = { 47static int mx31_3ds_pins[] = {
51 /* UART1 */ 48 /* UART1 */
52 MX31_PIN_CTS1__CTS1, 49 MX31_PIN_CTS1__CTS1,
@@ -277,10 +274,6 @@ static const struct fb_videomode fb_modedb[] = {
277 }, 274 },
278}; 275};
279 276
280static struct ipu_platform_data mx3_ipu_data = {
281 .irq_base = MXC_IPU_IRQ_START,
282};
283
284static struct mx3fb_platform_data mx3fb_pdata __initdata = { 277static struct mx3fb_platform_data mx3fb_pdata __initdata = {
285 .name = "Epson-VGA", 278 .name = "Epson-VGA",
286 .mode = fb_modedb, 279 .mode = fb_modedb,
@@ -317,7 +310,7 @@ static int mx31_3ds_sdhc1_init(struct device *dev,
317 return ret; 310 return ret;
318 } 311 }
319 312
320 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 313 ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)),
321 detect_irq, IRQF_DISABLED | 314 detect_irq, IRQF_DISABLED |
322 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, 315 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
323 "sdhc1-detect", data); 316 "sdhc1-detect", data);
@@ -336,7 +329,7 @@ gpio_free:
336 329
337static void mx31_3ds_sdhc1_exit(struct device *dev, void *data) 330static void mx31_3ds_sdhc1_exit(struct device *dev, void *data)
338{ 331{
339 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), data); 332 free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)), data);
340 gpio_free_array(mx31_3ds_sdhc1_gpios, 333 gpio_free_array(mx31_3ds_sdhc1_gpios,
341 ARRAY_SIZE(mx31_3ds_sdhc1_gpios)); 334 ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
342} 335}
@@ -539,7 +532,7 @@ static struct spi_board_info mx31_3ds_spi_devs[] __initdata = {
539 .bus_num = 1, 532 .bus_num = 1,
540 .chip_select = 1, /* SS2 */ 533 .chip_select = 1, /* SS2 */
541 .platform_data = &mc13783_pdata, 534 .platform_data = &mc13783_pdata,
542 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 535 /* irq number is run-time assigned */
543 .mode = SPI_CS_HIGH, 536 .mode = SPI_CS_HIGH,
544 }, { 537 }, {
545 .modalias = "l4f00242t03", 538 .modalias = "l4f00242t03",
@@ -714,6 +707,7 @@ static void __init mx31_3ds_init(void)
714 imx31_add_mxc_nand(&mx31_3ds_nand_board_info); 707 imx31_add_mxc_nand(&mx31_3ds_nand_board_info);
715 708
716 imx31_add_spi_imx1(&spi1_pdata); 709 imx31_add_spi_imx1(&spi1_pdata);
710 mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
717 spi_register_board_info(mx31_3ds_spi_devs, 711 spi_register_board_info(mx31_3ds_spi_devs,
718 ARRAY_SIZE(mx31_3ds_spi_devs)); 712 ARRAY_SIZE(mx31_3ds_spi_devs));
719 713
@@ -736,7 +730,7 @@ static void __init mx31_3ds_init(void)
736 if (!otg_mode_host) 730 if (!otg_mode_host)
737 imx31_add_fsl_usb2_udc(&usbotg_pdata); 731 imx31_add_fsl_usb2_udc(&usbotg_pdata);
738 732
739 if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 733 if (mxc_expio_init(MX31_CS5_BASE_ADDR, IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)))
740 printk(KERN_WARNING "Init of the debug board failed, all " 734 printk(KERN_WARNING "Init of the debug board failed, all "
741 "devices on the debug board are unusable.\n"); 735 "devices on the debug board are unusable.\n");
742 imx31_add_imx2_wdt(); 736 imx31_add_imx2_wdt();
@@ -744,7 +738,7 @@ static void __init mx31_3ds_init(void)
744 imx31_add_mxc_mmc(0, &sdhc1_pdata); 738 imx31_add_mxc_mmc(0, &sdhc1_pdata);
745 739
746 imx31_add_spi_imx0(&spi0_pdata); 740 imx31_add_spi_imx0(&spi0_pdata);
747 imx31_add_ipu_core(&mx3_ipu_data); 741 imx31_add_ipu_core();
748 imx31_add_mx3_sdc_fb(&mx3fb_pdata); 742 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
749 743
750 /* CSI */ 744 /* CSI */
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index 4518e5448227..d37f4809c556 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -21,6 +21,7 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/irqdomain.h>
24 25
25#include <asm/mach-types.h> 26#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -62,20 +63,18 @@
62#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) 63#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
63#define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS) 64#define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS)
64#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) 65#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
65#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
66 66
67#define MXC_EXP_IO_BASE MXC_BOARD_IRQ_START 67#define EXPIO_INT_XUART_INTA 10
68#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) 68#define EXPIO_INT_XUART_INTB 11
69
70#define EXPIO_INT_XUART_INTA (MXC_EXP_IO_BASE + 10)
71#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11)
72 69
73#define MXC_MAX_EXP_IO_LINES 16 70#define MXC_MAX_EXP_IO_LINES 16
74 71
75/* CS8900 */ 72/* CS8900 */
76#define EXPIO_INT_ENET_INT (MXC_EXP_IO_BASE + 8) 73#define EXPIO_INT_ENET_INT 8
77#define CS4_CS8900_MMIO_START 0x20000 74#define CS4_CS8900_MMIO_START 0x20000
78 75
76static struct irq_domain *domain;
77
79/* 78/*
80 * The serial port definition structure. 79 * The serial port definition structure.
81 */ 80 */
@@ -83,7 +82,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
83 { 82 {
84 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTA), 83 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTA),
85 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTA), 84 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTA),
86 .irq = EXPIO_INT_XUART_INTA,
87 .uartclk = 14745600, 85 .uartclk = 14745600,
88 .regshift = 0, 86 .regshift = 0,
89 .iotype = UPIO_MEM, 87 .iotype = UPIO_MEM,
@@ -91,7 +89,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
91 }, { 89 }, {
92 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTB), 90 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTB),
93 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTB), 91 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTB),
94 .irq = EXPIO_INT_XUART_INTB,
95 .uartclk = 14745600, 92 .uartclk = 14745600,
96 .regshift = 0, 93 .regshift = 0,
97 .iotype = UPIO_MEM, 94 .iotype = UPIO_MEM,
@@ -108,9 +105,9 @@ static struct platform_device serial_device = {
108 }, 105 },
109}; 106};
110 107
111static const struct resource mx31ads_cs8900_resources[] __initconst = { 108static struct resource mx31ads_cs8900_resources[] __initdata = {
112 DEFINE_RES_MEM(MX31_CS4_BASE_ADDR + CS4_CS8900_MMIO_START, SZ_64K), 109 DEFINE_RES_MEM(MX31_CS4_BASE_ADDR + CS4_CS8900_MMIO_START, SZ_64K),
113 DEFINE_RES_IRQ(EXPIO_INT_ENET_INT), 110 DEFINE_RES_IRQ(-1),
114}; 111};
115 112
116static const struct platform_device_info mx31ads_cs8900_devinfo __initconst = { 113static const struct platform_device_info mx31ads_cs8900_devinfo __initconst = {
@@ -122,11 +119,19 @@ static const struct platform_device_info mx31ads_cs8900_devinfo __initconst = {
122 119
123static int __init mxc_init_extuart(void) 120static int __init mxc_init_extuart(void)
124{ 121{
122 serial_platform_data[0].irq = irq_find_mapping(domain,
123 EXPIO_INT_XUART_INTA);
124 serial_platform_data[1].irq = irq_find_mapping(domain,
125 EXPIO_INT_XUART_INTB);
125 return platform_device_register(&serial_device); 126 return platform_device_register(&serial_device);
126} 127}
127 128
128static void __init mxc_init_ext_ethernet(void) 129static void __init mxc_init_ext_ethernet(void)
129{ 130{
131 mx31ads_cs8900_resources[1].start =
132 irq_find_mapping(domain, EXPIO_INT_ENET_INT);
133 mx31ads_cs8900_resources[1].end =
134 irq_find_mapping(domain, EXPIO_INT_ENET_INT);
130 platform_device_register_full( 135 platform_device_register_full(
131 (struct platform_device_info *)&mx31ads_cs8900_devinfo); 136 (struct platform_device_info *)&mx31ads_cs8900_devinfo);
132} 137}
@@ -157,12 +162,12 @@ static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
157 imr_val = __raw_readw(PBC_INTMASK_SET_REG); 162 imr_val = __raw_readw(PBC_INTMASK_SET_REG);
158 int_valid = __raw_readw(PBC_INTSTATUS_REG) & imr_val; 163 int_valid = __raw_readw(PBC_INTSTATUS_REG) & imr_val;
159 164
160 expio_irq = MXC_EXP_IO_BASE; 165 expio_irq = 0;
161 for (; int_valid != 0; int_valid >>= 1, expio_irq++) { 166 for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
162 if ((int_valid & 1) == 0) 167 if ((int_valid & 1) == 0)
163 continue; 168 continue;
164 169
165 generic_handle_irq(expio_irq); 170 generic_handle_irq(irq_find_mapping(domain, expio_irq));
166 } 171 }
167} 172}
168 173
@@ -172,7 +177,7 @@ static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
172 */ 177 */
173static void expio_mask_irq(struct irq_data *d) 178static void expio_mask_irq(struct irq_data *d)
174{ 179{
175 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 180 u32 expio = d->hwirq;
176 /* mask the interrupt */ 181 /* mask the interrupt */
177 __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG); 182 __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG);
178 __raw_readw(PBC_INTMASK_CLEAR_REG); 183 __raw_readw(PBC_INTMASK_CLEAR_REG);
@@ -184,7 +189,7 @@ static void expio_mask_irq(struct irq_data *d)
184 */ 189 */
185static void expio_ack_irq(struct irq_data *d) 190static void expio_ack_irq(struct irq_data *d)
186{ 191{
187 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 192 u32 expio = d->hwirq;
188 /* clear the interrupt status */ 193 /* clear the interrupt status */
189 __raw_writew(1 << expio, PBC_INTSTATUS_REG); 194 __raw_writew(1 << expio, PBC_INTSTATUS_REG);
190} 195}
@@ -195,7 +200,7 @@ static void expio_ack_irq(struct irq_data *d)
195 */ 200 */
196static void expio_unmask_irq(struct irq_data *d) 201static void expio_unmask_irq(struct irq_data *d)
197{ 202{
198 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 203 u32 expio = d->hwirq;
199 /* unmask the interrupt */ 204 /* unmask the interrupt */
200 __raw_writew(1 << expio, PBC_INTMASK_SET_REG); 205 __raw_writew(1 << expio, PBC_INTMASK_SET_REG);
201} 206}
@@ -209,7 +214,8 @@ static struct irq_chip expio_irq_chip = {
209 214
210static void __init mx31ads_init_expio(void) 215static void __init mx31ads_init_expio(void)
211{ 216{
212 int i; 217 int irq_base;
218 int i, irq;
213 219
214 printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n"); 220 printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n");
215 221
@@ -221,13 +227,21 @@ static void __init mx31ads_init_expio(void)
221 /* disable the interrupt and clear the status */ 227 /* disable the interrupt and clear the status */
222 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG); 228 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
223 __raw_writew(0xFFFF, PBC_INTSTATUS_REG); 229 __raw_writew(0xFFFF, PBC_INTSTATUS_REG);
224 for (i = MXC_EXP_IO_BASE; i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES); 230
225 i++) { 231 irq_base = irq_alloc_descs(-1, 0, MXC_MAX_EXP_IO_LINES, numa_node_id());
232 WARN_ON(irq_base < 0);
233
234 domain = irq_domain_add_legacy(NULL, MXC_MAX_EXP_IO_LINES, irq_base, 0,
235 &irq_domain_simple_ops, NULL);
236 WARN_ON(!domain);
237
238 for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) {
226 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); 239 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq);
227 set_irq_flags(i, IRQF_VALID); 240 set_irq_flags(i, IRQF_VALID);
228 } 241 }
229 irq_set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_HIGH); 242 irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_4));
230 irq_set_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler); 243 irq_set_irq_type(irq, IRQ_TYPE_LEVEL_HIGH);
244 irq_set_chained_handler(irq, mx31ads_expio_irq_handler);
231} 245}
232 246
233#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 247#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
@@ -479,7 +493,6 @@ static int mx31_wm8350_init(struct wm8350 *wm8350)
479 493
480static struct wm8350_platform_data __initdata mx31_wm8350_pdata = { 494static struct wm8350_platform_data __initdata mx31_wm8350_pdata = {
481 .init = mx31_wm8350_init, 495 .init = mx31_wm8350_init,
482 .irq_base = MXC_BOARD_IRQ_START + MXC_MAX_EXP_IO_LINES,
483}; 496};
484#endif 497#endif
485 498
@@ -488,13 +501,17 @@ static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = {
488 { 501 {
489 I2C_BOARD_INFO("wm8350", 0x1a), 502 I2C_BOARD_INFO("wm8350", 0x1a),
490 .platform_data = &mx31_wm8350_pdata, 503 .platform_data = &mx31_wm8350_pdata,
491 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 504 /* irq number is run-time assigned */
492 }, 505 },
493#endif 506#endif
494}; 507};
495 508
496static void __init mxc_init_i2c(void) 509static void __init mxc_init_i2c(void)
497{ 510{
511#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
512 mx31ads_i2c1_devices[0].irq =
513 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
514#endif
498 i2c_register_board_info(1, mx31ads_i2c1_devices, 515 i2c_register_board_info(1, mx31ads_i2c1_devices,
499 ARRAY_SIZE(mx31ads_i2c1_devices)); 516 ARRAY_SIZE(mx31ads_i2c1_devices));
500 517
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 83714b0cc290..34b9bf075daf 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -65,8 +65,7 @@ static struct resource smsc91x_resources[] = {
65 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
66 }, 66 },
67 { 67 {
68 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), 68 /* irq number is run-time assigned */
69 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
70 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, 69 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
71 } 70 }
72}; 71};
@@ -233,7 +232,7 @@ static struct spi_board_info mc13783_dev __initdata = {
233 .bus_num = 1, 232 .bus_num = 1,
234 .chip_select = 0, 233 .chip_select = 0,
235 .platform_data = &mc13783_pdata, 234 .platform_data = &mc13783_pdata,
236 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 235 /* irq number is run-time assigned */
237}; 236};
238 237
239static struct platform_device *devices[] __initdata = { 238static struct platform_device *devices[] __initdata = {
@@ -285,10 +284,15 @@ static void __init mx31lilly_board_init(void)
285 284
286 imx31_add_spi_imx0(&spi0_pdata); 285 imx31_add_spi_imx0(&spi0_pdata);
287 imx31_add_spi_imx1(&spi1_pdata); 286 imx31_add_spi_imx1(&spi1_pdata);
287 mc13783_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
288 spi_register_board_info(&mc13783_dev, 1); 288 spi_register_board_info(&mc13783_dev, 1);
289 289
290 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 290 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
291 291
292 smsc91x_resources[1].start =
293 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0));
294 smsc91x_resources[1].end =
295 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0));
292 platform_add_devices(devices, ARRAY_SIZE(devices)); 296 platform_add_devices(devices, ARRAY_SIZE(devices));
293 297
294 /* USB */ 298 /* USB */
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index 686c60587980..c8785b39eaed 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -43,7 +43,6 @@
43#include <mach/common.h> 43#include <mach/common.h>
44#include <mach/board-mx31lite.h> 44#include <mach/board-mx31lite.h>
45#include <mach/iomux-mx3.h> 45#include <mach/iomux-mx3.h>
46#include <mach/irqs.h>
47#include <mach/ulpi.h> 46#include <mach/ulpi.h>
48 47
49#include "devices-imx31.h" 48#include "devices-imx31.h"
@@ -83,8 +82,7 @@ static struct resource smsc911x_resources[] = {
83 .end = MX31_CS4_BASE_ADDR + 0x100, 82 .end = MX31_CS4_BASE_ADDR + 0x100,
84 .flags = IORESOURCE_MEM, 83 .flags = IORESOURCE_MEM,
85 }, { 84 }, {
86 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6), 85 /* irq number is run-time assigned */
87 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
88 .flags = IORESOURCE_IRQ, 86 .flags = IORESOURCE_IRQ,
89 }, 87 },
90}; 88};
@@ -124,7 +122,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = {
124 .bus_num = 1, 122 .bus_num = 1,
125 .chip_select = 0, 123 .chip_select = 0,
126 .platform_data = &mc13783_pdata, 124 .platform_data = &mc13783_pdata,
127 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 125 /* irq number is run-time assigned */
128}; 126};
129 127
130/* 128/*
@@ -258,6 +256,7 @@ static void __init mx31lite_init(void)
258 imx31_add_mxc_nand(&mx31lite_nand_board_info); 256 imx31_add_mxc_nand(&mx31lite_nand_board_info);
259 257
260 imx31_add_spi_imx1(&spi1_pdata); 258 imx31_add_spi_imx1(&spi1_pdata);
259 mc13783_spi_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
261 spi_register_board_info(&mc13783_spi_dev, 1); 260 spi_register_board_info(&mc13783_spi_dev, 1);
262 261
263 /* USB */ 262 /* USB */
@@ -274,6 +273,10 @@ static void __init mx31lite_init(void)
274 pr_warning("could not get LAN irq gpio\n"); 273 pr_warning("could not get LAN irq gpio\n");
275 else { 274 else {
276 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6)); 275 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
276 smsc911x_resources[1].start =
277 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6));
278 smsc911x_resources[1].end =
279 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6));
277 platform_device_register(&smsc911x_device); 280 platform_device_register(&smsc911x_device);
278 } 281 }
279} 282}
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 63e84e67b990..d46290b288ed 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -303,7 +303,7 @@ static struct imx_ssi_platform_data moboard_ssi_pdata = {
303static struct spi_board_info moboard_spi_board_info[] __initdata = { 303static struct spi_board_info moboard_spi_board_info[] __initdata = {
304 { 304 {
305 .modalias = "mc13783", 305 .modalias = "mc13783",
306 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 306 /* irq number is run-time assigned */
307 .max_speed_hz = 300000, 307 .max_speed_hz = 300000,
308 .bus_num = 1, 308 .bus_num = 1,
309 .chip_select = 0, 309 .chip_select = 0,
@@ -473,10 +473,6 @@ static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
473 .leds = mx31moboard_leds, 473 .leds = mx31moboard_leds,
474}; 474};
475 475
476static const struct ipu_platform_data mx3_ipu_data __initconst = {
477 .irq_base = MXC_IPU_IRQ_START,
478};
479
480static struct platform_device *devices[] __initdata = { 476static struct platform_device *devices[] __initdata = {
481 &mx31moboard_flash, 477 &mx31moboard_flash,
482}; 478};
@@ -494,7 +490,7 @@ static int __init mx31moboard_init_cam(void)
494 int dma, ret = -ENOMEM; 490 int dma, ret = -ENOMEM;
495 struct platform_device *pdev; 491 struct platform_device *pdev;
496 492
497 imx31_add_ipu_core(&mx3_ipu_data); 493 imx31_add_ipu_core();
498 494
499 pdev = imx31_alloc_mx3_camera(&camera_pdata); 495 pdev = imx31_alloc_mx3_camera(&camera_pdata);
500 if (IS_ERR(pdev)) 496 if (IS_ERR(pdev))
@@ -557,6 +553,8 @@ static void __init mx31moboard_init(void)
557 553
558 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); 554 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
559 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); 555 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
556 moboard_spi_board_info[0].irq =
557 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
560 spi_register_board_info(moboard_spi_board_info, 558 spi_register_board_info(moboard_spi_board_info,
561 ARRAY_SIZE(moboard_spi_board_info)); 559 ARRAY_SIZE(moboard_spi_board_info));
562 560
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 69018e5c52de..504983c68aa8 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -46,7 +46,6 @@
46#include <mach/hardware.h> 46#include <mach/hardware.h>
47#include <mach/common.h> 47#include <mach/common.h>
48#include <mach/iomux-mx35.h> 48#include <mach/iomux-mx35.h>
49#include <mach/irqs.h>
50#include <mach/3ds_debugboard.h> 49#include <mach/3ds_debugboard.h>
51#include <video/platform_lcd.h> 50#include <video/platform_lcd.h>
52 51
@@ -80,10 +79,6 @@ static const struct fb_videomode fb_modedb[] = {
80 }, 79 },
81}; 80};
82 81
83static const struct ipu_platform_data mx3_ipu_data __initconst = {
84 .irq_base = MXC_IPU_IRQ_START,
85};
86
87static struct mx3fb_platform_data mx3fb_pdata __initdata = { 82static struct mx3fb_platform_data mx3fb_pdata __initdata = {
88 .name = "Ceramate-CLAA070VC01", 83 .name = "Ceramate-CLAA070VC01",
89 .mode = fb_modedb, 84 .mode = fb_modedb,
@@ -136,8 +131,6 @@ static struct platform_device mx35_3ds_lcd = {
136 .dev.platform_data = &mx35_3ds_lcd_data, 131 .dev.platform_data = &mx35_3ds_lcd_data,
137}; 132};
138 133
139#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1))
140
141static const struct imxuart_platform_data uart_pdata __initconst = { 134static const struct imxuart_platform_data uart_pdata __initconst = {
142 .flags = IMXUART_HAVE_RTSCTS, 135 .flags = IMXUART_HAVE_RTSCTS,
143}; 136};
@@ -297,10 +290,6 @@ err:
297 return ret; 290 return ret;
298} 291}
299 292
300static const struct ipu_platform_data mx35_3ds_ipu_data __initconst = {
301 .irq_base = MXC_IPU_IRQ_START,
302};
303
304static struct i2c_board_info mx35_3ds_i2c_camera = { 293static struct i2c_board_info mx35_3ds_i2c_camera = {
305 I2C_BOARD_INFO("ov2640", 0x30), 294 I2C_BOARD_INFO("ov2640", 0x30),
306}; 295};
@@ -492,7 +481,7 @@ static struct i2c_board_info mx35_3ds_i2c_mc13892 = {
492 481
493 I2C_BOARD_INFO("mc13892", 0x08), 482 I2C_BOARD_INFO("mc13892", 0x08),
494 .platform_data = &mx35_3ds_mc13892_data, 483 .platform_data = &mx35_3ds_mc13892_data,
495 .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), 484 /* irq number is run-time assigned */
496}; 485};
497 486
498static void __init imx35_3ds_init_mc13892(void) 487static void __init imx35_3ds_init_mc13892(void)
@@ -504,6 +493,7 @@ static void __init imx35_3ds_init_mc13892(void)
504 return; 493 return;
505 } 494 }
506 495
496 mx35_3ds_i2c_mc13892.irq = gpio_to_irq(GPIO_PMIC_INT);
507 i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1); 497 i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1);
508} 498}
509 499
@@ -588,7 +578,7 @@ static void __init mx35_3ds_init(void)
588 imx35_add_mxc_nand(&mx35pdk_nand_board_info); 578 imx35_add_mxc_nand(&mx35pdk_nand_board_info);
589 imx35_add_sdhci_esdhc_imx(0, NULL); 579 imx35_add_sdhci_esdhc_imx(0, NULL);
590 580
591 if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 581 if (mxc_expio_init(MX35_CS5_BASE_ADDR, IMX_GPIO_NR(1, 1)))
592 pr_warn("Init of the debugboard failed, all " 582 pr_warn("Init of the debugboard failed, all "
593 "devices on the debugboard are unusable.\n"); 583 "devices on the debugboard are unusable.\n");
594 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); 584 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);
@@ -596,7 +586,7 @@ static void __init mx35_3ds_init(void)
596 i2c_register_board_info( 586 i2c_register_board_info(
597 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds)); 587 0, i2c_devices_3ds, ARRAY_SIZE(i2c_devices_3ds));
598 588
599 imx35_add_ipu_core(&mx35_3ds_ipu_data); 589 imx35_add_ipu_core();
600 platform_device_register(&mx35_3ds_ov2640); 590 platform_device_register(&mx35_3ds_ov2640);
601 imx35_3ds_init_camera(); 591 imx35_3ds_init_camera();
602 592
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 2edb563b968d..9ee84a4af639 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -26,7 +26,6 @@
26 26
27#include "devices-imx51.h" 27#include "devices-imx51.h"
28 28
29#define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 6))
30#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) 29#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
31 30
32static iomux_v3_cfg_t mx51_3ds_pads[] = { 31static iomux_v3_cfg_t mx51_3ds_pads[] = {
@@ -148,7 +147,7 @@ static void __init mx51_3ds_init(void)
148 spi_register_board_info(mx51_3ds_spi_nor_device, 147 spi_register_board_info(mx51_3ds_spi_nor_device,
149 ARRAY_SIZE(mx51_3ds_spi_nor_device)); 148 ARRAY_SIZE(mx51_3ds_spi_nor_device));
150 149
151 if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 150 if (mxc_expio_init(MX51_CS5_BASE_ADDR, IMX_GPIO_NR(1, 6)))
152 printk(KERN_WARNING "Init of the debugboard failed, all " 151 printk(KERN_WARNING "Init of the debugboard failed, all "
153 "devices on the board are unusable.\n"); 152 "devices on the board are unusable.\n");
154 153
diff --git a/arch/arm/mach-imx/mach-mx53_ard.c b/arch/arm/mach-imx/mach-mx53_ard.c
index 4a7593a953e2..f641a1758691 100644
--- a/arch/arm/mach-imx/mach-mx53_ard.c
+++ b/arch/arm/mach-imx/mach-mx53_ard.c
@@ -135,8 +135,7 @@ static struct resource ard_smsc911x_resources[] = {
135 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
136 }, 136 },
137 { 137 {
138 .start = IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B), 138 /* irq number is run-time assigned */
139 .end = IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
140 .flags = IORESOURCE_IRQ, 139 .flags = IORESOURCE_IRQ,
141 }, 140 },
142}; 141};
@@ -240,6 +239,8 @@ static void __init mx53_ard_board_init(void)
240 imx53_ard_common_init(); 239 imx53_ard_common_init();
241 mx53_ard_io_init(); 240 mx53_ard_io_init();
242 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 241 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
242 ard_smsc911x_resources[1].start = gpio_to_irq(ARD_ETHERNET_INT_B);
243 ard_smsc911x_resources[1].end = gpio_to_irq(ARD_ETHERNET_INT_B);
243 platform_add_devices(devices, ARRAY_SIZE(devices)); 244 platform_add_devices(devices, ARRAY_SIZE(devices));
244 245
245 imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); 246 imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 8b3d3f07d894..0bf6d30aa32d 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -213,13 +213,13 @@ static const struct imx_fb_platform_data mxt_td60_fb_data __initconst = {
213static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq, 213static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
214 void *data) 214 void *data)
215{ 215{
216 return request_irq(IRQ_GPIOF(8), detect_irq, IRQF_TRIGGER_FALLING, 216 return request_irq(gpio_to_irq(IMX_GPIO_NR(6, 8)), detect_irq,
217 "sdhc1-card-detect", data); 217 IRQF_TRIGGER_FALLING, "sdhc1-card-detect", data);
218} 218}
219 219
220static void mxt_td60_sdhc1_exit(struct device *dev, void *data) 220static void mxt_td60_sdhc1_exit(struct device *dev, void *data)
221{ 221{
222 free_irq(IRQ_GPIOF(8), data); 222 free_irq(gpio_to_irq(IMX_GPIO_NR(6, 8)), data);
223} 223}
224 224
225static const struct imxmmc_platform_data sdhc1_pdata __initconst = { 225static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index d37ed25003b2..de8516b7d69f 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -36,7 +36,6 @@
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <mach/iomux-mx27.h> 37#include <mach/iomux-mx27.h>
38#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39#include <mach/irqs.h>
40#include <mach/ulpi.h> 39#include <mach/ulpi.h>
41 40
42#include "devices-imx27.h" 41#include "devices-imx27.h"
@@ -245,7 +244,7 @@ static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
245{ 244{
246 int ret; 245 int ret;
247 246
248 ret = request_irq(IRQ_GPIOC(29), detect_irq, 247 ret = request_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), detect_irq,
249 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 248 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
250 "imx-mmc-detect", data); 249 "imx-mmc-detect", data);
251 if (ret) 250 if (ret)
@@ -257,7 +256,7 @@ static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
257 256
258static void pca100_sdhc2_exit(struct device *dev, void *data) 257static void pca100_sdhc2_exit(struct device *dev, void *data)
259{ 258{
260 free_irq(IRQ_GPIOC(29), data); 259 free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data);
261} 260}
262 261
263static const struct imxmmc_platform_data sdhc_pdata __initconst = { 262static const struct imxmmc_platform_data sdhc_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index cd48712a6f50..e3c45130fb3c 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -225,8 +225,7 @@ static struct resource smsc911x_resources[] = {
225 .end = MX31_CS1_BASE_ADDR + 0x300 + SZ_64K - 1, 225 .end = MX31_CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
226 .flags = IORESOURCE_MEM, 226 .flags = IORESOURCE_MEM,
227 }, { 227 }, {
228 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 228 /* irq number is run-time assigned */
229 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
230 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 229 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
231 }, 230 },
232}; 231};
@@ -371,7 +370,7 @@ static int pcm970_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
371 gpio_direction_input(SDHC1_GPIO_WP); 370 gpio_direction_input(SDHC1_GPIO_WP);
372#endif 371#endif
373 372
374 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq, 373 ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SCK6)), detect_irq,
375 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 374 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
376 "sdhc-detect", data); 375 "sdhc-detect", data);
377 if (ret) 376 if (ret)
@@ -391,7 +390,7 @@ err_gpio_free:
391 390
392static void pcm970_sdhc1_exit(struct device *dev, void *data) 391static void pcm970_sdhc1_exit(struct device *dev, void *data)
393{ 392{
394 free_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), data); 393 free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SCK6)), data);
395 gpio_free(SDHC1_GPIO_DET); 394 gpio_free(SDHC1_GPIO_DET);
396 gpio_free(SDHC1_GPIO_WP); 395 gpio_free(SDHC1_GPIO_WP);
397} 396}
@@ -442,10 +441,6 @@ static struct platform_device *devices[] __initdata = {
442 &pcm037_mt9v022, 441 &pcm037_mt9v022,
443}; 442};
444 443
445static const struct ipu_platform_data mx3_ipu_data __initconst = {
446 .irq_base = MXC_IPU_IRQ_START,
447};
448
449static const struct fb_videomode fb_modedb[] = { 444static const struct fb_videomode fb_modedb[] = {
450 { 445 {
451 /* 240x320 @ 60 Hz Sharp */ 446 /* 240x320 @ 60 Hz Sharp */
@@ -511,8 +506,7 @@ static struct resource pcm970_sja1000_resources[] = {
511 .end = MX31_CS5_BASE_ADDR + 0x100 - 1, 506 .end = MX31_CS5_BASE_ADDR + 0x100 - 1,
512 .flags = IORESOURCE_MEM, 507 .flags = IORESOURCE_MEM,
513 }, { 508 }, {
514 .start = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)), 509 /* irq number is run-time assigned */
515 .end = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)),
516 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, 510 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
517 }, 511 },
518}; 512};
@@ -633,6 +627,10 @@ static void __init pcm037_init(void)
633 pr_warning("could not get LAN irq gpio\n"); 627 pr_warning("could not get LAN irq gpio\n");
634 else { 628 else {
635 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); 629 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
630 smsc911x_resources[1].start =
631 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
632 smsc911x_resources[1].end =
633 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1));
636 platform_device_register(&pcm037_eth); 634 platform_device_register(&pcm037_eth);
637 } 635 }
638 636
@@ -646,7 +644,7 @@ static void __init pcm037_init(void)
646 644
647 imx31_add_mxc_nand(&pcm037_nand_board_info); 645 imx31_add_mxc_nand(&pcm037_nand_board_info);
648 imx31_add_mxc_mmc(0, &sdhc_pdata); 646 imx31_add_mxc_mmc(0, &sdhc_pdata);
649 imx31_add_ipu_core(&mx3_ipu_data); 647 imx31_add_ipu_core();
650 imx31_add_mx3_sdc_fb(&mx3fb_pdata); 648 imx31_add_mx3_sdc_fb(&mx3fb_pdata);
651 649
652 /* CSI */ 650 /* CSI */
@@ -659,6 +657,10 @@ static void __init pcm037_init(void)
659 657
660 pcm037_init_camera(); 658 pcm037_init_camera();
661 659
660 pcm970_sja1000_resources[1].start =
661 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
662 pcm970_sja1000_resources[1].end =
663 gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105)));
662 platform_device_register(&pcm970_sja1000); 664 platform_device_register(&pcm970_sja1000);
663 665
664 if (otg_mode_host) { 666 if (otg_mode_host) {
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 3fbb89d74fcc..95f49d936fd3 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -27,6 +27,7 @@
27#include <linux/mfd/mc13783.h> 27#include <linux/mfd/mc13783.h>
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/irq.h> 29#include <linux/irq.h>
30#include <linux/gpio.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -274,7 +275,7 @@ static struct mc13xxx_platform_data pcm038_pmic = {
274static struct spi_board_info pcm038_spi_board_info[] __initdata = { 275static struct spi_board_info pcm038_spi_board_info[] __initdata = {
275 { 276 {
276 .modalias = "mc13783", 277 .modalias = "mc13783",
277 .irq = IRQ_GPIOB(23), 278 /* irq number is run-time assigned */
278 .max_speed_hz = 300000, 279 .max_speed_hz = 300000,
279 .bus_num = 0, 280 .bus_num = 0,
280 .chip_select = 0, 281 .chip_select = 0,
@@ -325,6 +326,7 @@ static void __init pcm038_init(void)
325 mxc_gpio_mode(GPIO_PORTB | 23 | GPIO_GPIO | GPIO_IN); 326 mxc_gpio_mode(GPIO_PORTB | 23 | GPIO_GPIO | GPIO_IN);
326 327
327 imx27_add_spi_imx0(&pcm038_spi0_data); 328 imx27_add_spi_imx0(&pcm038_spi0_data);
329 pcm038_spi_board_info[0].irq = gpio_to_irq(IMX_GPIO_NR(2, 23));
328 spi_register_board_info(pcm038_spi_board_info, 330 spi_register_board_info(pcm038_spi_board_info,
329 ARRAY_SIZE(pcm038_spi_board_info)); 331 ARRAY_SIZE(pcm038_spi_board_info));
330 332
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 1f20f222375e..e4bd4387e344 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -76,10 +76,6 @@ static const struct fb_videomode fb_modedb[] = {
76 }, 76 },
77}; 77};
78 78
79static const struct ipu_platform_data mx3_ipu_data __initconst = {
80 .irq_base = MXC_IPU_IRQ_START,
81};
82
83static struct mx3fb_platform_data mx3fb_pdata __initdata = { 79static struct mx3fb_platform_data mx3fb_pdata __initdata = {
84 .name = "Sharp-LQ035Q7", 80 .name = "Sharp-LQ035Q7",
85 .mode = fb_modedb, 81 .mode = fb_modedb,
@@ -376,7 +372,7 @@ static void __init pcm043_init(void)
376 372
377 imx35_add_imx_i2c0(&pcm043_i2c0_data); 373 imx35_add_imx_i2c0(&pcm043_i2c0_data);
378 374
379 imx35_add_ipu_core(&mx3_ipu_data); 375 imx35_add_ipu_core();
380 imx35_add_mx3_sdc_fb(&mx3fb_pdata); 376 imx35_add_mx3_sdc_fb(&mx3fb_pdata);
381 377
382 if (otg_mode_host) { 378 if (otg_mode_host) {
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index a13087b11a6e..fb25fbd31226 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -22,7 +22,6 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/irqs.h>
26#include <asm/mach-types.h> 25#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
28#include <asm/mach/time.h> 27#include <asm/mach/time.h>
@@ -51,8 +50,6 @@
51 (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE) 50 (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE)
52#define QONG_DNET_SIZE 0x00001000 51#define QONG_DNET_SIZE 0x00001000
53 52
54#define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1)
55
56static const struct imxuart_platform_data uart_pdata __initconst = { 53static const struct imxuart_platform_data uart_pdata __initconst = {
57 .flags = IMXUART_HAVE_RTSCTS, 54 .flags = IMXUART_HAVE_RTSCTS,
58}; 55};
@@ -78,8 +75,7 @@ static struct resource dnet_resources[] = {
78 .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1, 75 .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1,
79 .flags = IORESOURCE_MEM, 76 .flags = IORESOURCE_MEM,
80 }, { 77 }, {
81 .start = QONG_FPGA_IRQ, 78 /* irq number is run-time assigned */
82 .end = QONG_FPGA_IRQ,
83 .flags = IORESOURCE_IRQ, 79 .flags = IORESOURCE_IRQ,
84 }, 80 },
85}; 81};
@@ -95,6 +91,10 @@ static int __init qong_init_dnet(void)
95{ 91{
96 int ret; 92 int ret;
97 93
94 dnet_resources[1].start =
95 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1));
96 dnet_resources[1].end =
97 gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1));
98 ret = platform_device_register(&dnet_device); 98 ret = platform_device_register(&dnet_device);
99 return ret; 99 return ret;
100} 100}
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index cb9ceae2f648..67ff38e9a3ca 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -14,6 +14,7 @@
14#include <linux/mtd/physmap.h> 14#include <linux/mtd/physmap.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/dm9000.h> 16#include <linux/dm9000.h>
17#include <linux/gpio.h>
17 18
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -21,7 +22,6 @@
21 22
22#include <mach/common.h> 23#include <mach/common.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <mach/irqs.h>
25#include <mach/iomux-mx1.h> 25#include <mach/iomux-mx1.h>
26 26
27#include "devices-imx1.h" 27#include "devices-imx1.h"
@@ -78,8 +78,7 @@ static struct resource dm9000x_resources[] = {
78 .end = MX1_CS5_PHYS + 5, 78 .end = MX1_CS5_PHYS + 5,
79 .flags = IORESOURCE_MEM, /* data access */ 79 .flags = IORESOURCE_MEM, /* data access */
80 }, { 80 }, {
81 .start = IRQ_GPIOC(3), 81 /* irq number is run-time assigned */
82 .end = IRQ_GPIOC(3),
83 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 82 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
84 }, 83 },
85}; 84};
@@ -123,6 +122,8 @@ static void __init scb9328_init(void)
123 imx1_add_imx_uart0(&uart_pdata); 122 imx1_add_imx_uart0(&uart_pdata);
124 123
125 printk(KERN_INFO"Scb9328: Adding devices\n"); 124 printk(KERN_INFO"Scb9328: Adding devices\n");
125 dm9000x_resources[2].start = gpio_to_irq(IMX_GPIO_NR(3, 3));
126 dm9000x_resources[2].end = gpio_to_irq(IMX_GPIO_NR(3, 3));
126 platform_add_devices(devices, ARRAY_SIZE(devices)); 127 platform_add_devices(devices, ARRAY_SIZE(devices));
127} 128}
128 129
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index b26209d4bcef..39eb7960e2a4 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -31,7 +31,6 @@
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/common.h> 32#include <mach/common.h>
33#include <mach/iomux-mx35.h> 33#include <mach/iomux-mx35.h>
34#include <mach/irqs.h>
35 34
36#include <linux/i2c.h> 35#include <linux/i2c.h>
37#include <linux/i2c/at24.h> 36#include <linux/i2c/at24.h>
@@ -87,10 +86,6 @@ static const struct fb_videomode fb_modedb[] = {
87 } 86 }
88}; 87};
89 88
90static const struct ipu_platform_data mx3_ipu_data __initconst = {
91 .irq_base = MXC_IPU_IRQ_START,
92};
93
94static struct mx3fb_platform_data mx3fb_pdata __initdata = { 89static struct mx3fb_platform_data mx3fb_pdata __initdata = {
95 .name = "PT0708048", 90 .name = "PT0708048",
96 .mode = fb_modedb, 91 .mode = fb_modedb,
@@ -162,7 +157,7 @@ static struct i2c_board_info vpr200_i2c_devices[] = {
162 }, { 157 }, {
163 I2C_BOARD_INFO("mc13892", 0x08), 158 I2C_BOARD_INFO("mc13892", 0x08),
164 .platform_data = &vpr200_pmic, 159 .platform_data = &vpr200_pmic,
165 .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), 160 /* irq number is run-time assigned */
166 } 161 }
167}; 162};
168 163
@@ -290,7 +285,7 @@ static void __init vpr200_board_init(void)
290 imx35_add_imx_uart0(NULL); 285 imx35_add_imx_uart0(NULL);
291 imx35_add_imx_uart2(NULL); 286 imx35_add_imx_uart2(NULL);
292 287
293 imx35_add_ipu_core(&mx3_ipu_data); 288 imx35_add_ipu_core();
294 imx35_add_mx3_sdc_fb(&mx3fb_pdata); 289 imx35_add_mx3_sdc_fb(&mx3fb_pdata);
295 290
296 imx35_add_fsl_usb2_udc(&otg_device_pdata); 291 imx35_add_fsl_usb2_udc(&otg_device_pdata);
@@ -299,6 +294,7 @@ static void __init vpr200_board_init(void)
299 imx35_add_mxc_nand(&vpr200_nand_board_info); 294 imx35_add_mxc_nand(&vpr200_nand_board_info);
300 imx35_add_sdhci_esdhc_imx(0, NULL); 295 imx35_add_sdhci_esdhc_imx(0, NULL);
301 296
297 vpr200_i2c_devices[1].irq = gpio_to_irq(GPIO_PMIC_INT);
302 i2c_register_board_info(0, vpr200_i2c_devices, 298 i2c_register_board_info(0, vpr200_i2c_devices,
303 ARRAY_SIZE(vpr200_i2c_devices)); 299 ARRAY_SIZE(vpr200_i2c_devices));
304 300
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index fcafd3dafb8c..6d60d51868bc 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/common.h> 25#include <mach/common.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/irqs.h>
28#include <mach/iomux-v1.h> 27#include <mach/iomux-v1.h>
29 28
30static struct map_desc imx_io_desc[] __initdata = { 29static struct map_desc imx_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 5f43905e5290..d056dad0940d 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -26,7 +26,6 @@
26#include <mach/devices-common.h> 26#include <mach/devices-common.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <mach/irqs.h>
30#include <mach/iomux-v1.h> 29#include <mach/iomux-v1.h>
31 30
32/* MX21 memory map definition */ 31/* MX21 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 6ff37140a4f8..388928fdb11a 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -29,7 +29,6 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/mx25.h> 30#include <mach/mx25.h>
31#include <mach/iomux-v3.h> 31#include <mach/iomux-v3.h>
32#include <mach/irqs.h>
33 32
34/* 33/*
35 * This table defines static virtual address mappings for I/O regions. 34 * This table defines static virtual address mappings for I/O regions.
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 25662558e018..e7e24afc45ed 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -26,7 +26,6 @@
26#include <mach/devices-common.h> 26#include <mach/devices-common.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <mach/irqs.h>
30#include <mach/iomux-v1.h> 29#include <mach/iomux-v1.h>
31 30
32/* MX27 memory map definition */ 31/* MX27 memory map definition */
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index a8983b9778d1..fe96105109b3 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -30,7 +30,6 @@
30#include <mach/devices-common.h> 30#include <mach/devices-common.h>
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/iomux-v3.h> 32#include <mach/iomux-v3.h>
33#include <mach/irqs.h>
34 33
35#include "crmregs-imx3.h" 34#include "crmregs-imx3.h"
36 35
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index 7d26f766a4ee..29e890f92055 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -130,7 +130,8 @@ static int mxc_mmc1_init(struct device *dev,
130 gpio_direction_input(gpio_det); 130 gpio_direction_input(gpio_det);
131 gpio_direction_input(gpio_wp); 131 gpio_direction_input(gpio_wp);
132 132
133 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq, 133 ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)),
134 detect_irq,
134 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 135 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
135 "MMC detect", data); 136 "MMC detect", data);
136 if (ret) 137 if (ret)
@@ -151,7 +152,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data)
151{ 152{
152 gpio_free(gpio_det); 153 gpio_free(gpio_det);
153 gpio_free(gpio_wp); 154 gpio_free(gpio_wp);
154 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data); 155 free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)), data);
155} 156}
156 157
157static const struct imxmmc_platform_data mmc_pdata __initconst = { 158static const struct imxmmc_platform_data mmc_pdata __initconst = {
@@ -161,10 +162,6 @@ static const struct imxmmc_platform_data mmc_pdata __initconst = {
161}; 162};
162 163
163/* Framebuffer support */ 164/* Framebuffer support */
164static const struct ipu_platform_data ipu_data __initconst = {
165 .irq_base = MXC_IPU_IRQ_START,
166};
167
168static const struct fb_videomode fb_modedb = { 165static const struct fb_videomode fb_modedb = {
169 /* 640x480 TFT panel (IPS-056T) */ 166 /* 640x480 TFT panel (IPS-056T) */
170 .name = "CRT-VGA", 167 .name = "CRT-VGA",
@@ -198,7 +195,7 @@ static void __init mx31lilly_init_fb(void)
198 return; 195 return;
199 } 196 }
200 197
201 imx31_add_ipu_core(&ipu_data); 198 imx31_add_ipu_core();
202 imx31_add_mx3_sdc_fb(&fb_pdata); 199 imx31_add_mx3_sdc_fb(&fb_pdata);
203 gpio_direction_output(LCD_VCC_EN_GPIO, 1); 200 gpio_direction_output(LCD_VCC_EN_GPIO, 1);
204} 201}
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index fa60ef6ac7ff..83d17d9e0bc8 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -116,7 +116,8 @@ static int mxc_mmc1_init(struct device *dev,
116 gpio_direction_input(gpio_det); 116 gpio_direction_input(gpio_det);
117 gpio_direction_input(gpio_wp); 117 gpio_direction_input(gpio_wp);
118 118
119 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq, 119 ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)),
120 detect_irq,
120 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 121 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
121 "MMC detect", data); 122 "MMC detect", data);
122 if (ret) 123 if (ret)
@@ -137,7 +138,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data)
137{ 138{
138 gpio_free(gpio_det); 139 gpio_free(gpio_det);
139 gpio_free(gpio_wp); 140 gpio_free(gpio_wp);
140 free_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), data); 141 free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)), data);
141} 142}
142 143
143static const struct imxmmc_platform_data mmc_pdata __initconst = { 144static const struct imxmmc_platform_data mmc_pdata __initconst = {
diff --git a/arch/arm/mach-imx/mx51_efika.c b/arch/arm/mach-imx/mx51_efika.c
index ec6ca91b299b..ee870c49bc63 100644
--- a/arch/arm/mach-imx/mx51_efika.c
+++ b/arch/arm/mach-imx/mx51_efika.c
@@ -587,7 +587,7 @@ static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
587 .bus_num = 0, 587 .bus_num = 0,
588 .chip_select = 0, 588 .chip_select = 0,
589 .platform_data = &mx51_efika_mc13892_data, 589 .platform_data = &mx51_efika_mc13892_data,
590 .irq = IMX_GPIO_TO_IRQ(EFIKAMX_PMIC), 590 /* irq number is run-time assigned */
591 }, 591 },
592}; 592};
593 593
@@ -620,6 +620,7 @@ void __init efika_board_common_init(void)
620 620
621 gpio_request(EFIKAMX_PMIC, "pmic irq"); 621 gpio_request(EFIKAMX_PMIC, "pmic irq");
622 gpio_direction_input(EFIKAMX_PMIC); 622 gpio_direction_input(EFIKAMX_PMIC);
623 mx51_efika_spi_board_info[1].irq = gpio_to_irq(EFIKAMX_PMIC);
623 spi_register_board_info(mx51_efika_spi_board_info, 624 spi_register_board_info(mx51_efika_spi_board_info,
624 ARRAY_SIZE(mx51_efika_spi_board_info)); 625 ARRAY_SIZE(mx51_efika_spi_board_info));
625 imx51_add_ecspi(0, &mx51_efika_spi_pdata); 626 imx51_add_ecspi(0, &mx51_efika_spi_pdata);
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 99afbc3f43a3..9917e2ff51da 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -95,14 +95,14 @@ static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void
95{ 95{
96 int ret; 96 int ret;
97 97
98 ret = request_irq(IRQ_GPIOC(29), detect_irq, IRQF_TRIGGER_FALLING, 98 ret = request_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), detect_irq,
99 "imx-mmc-detect", data); 99 IRQF_TRIGGER_FALLING, "imx-mmc-detect", data);
100 if (ret) 100 if (ret)
101 return ret; 101 return ret;
102 102
103 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); 103 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro");
104 if (ret) { 104 if (ret) {
105 free_irq(IRQ_GPIOC(29), data); 105 free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data);
106 return ret; 106 return ret;
107 } 107 }
108 108
@@ -113,7 +113,7 @@ static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void
113 113
114static void pcm970_sdhc2_exit(struct device *dev, void *data) 114static void pcm970_sdhc2_exit(struct device *dev, void *data)
115{ 115{
116 free_irq(IRQ_GPIOC(29), data); 116 free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data);
117 gpio_free(GPIO_PORTC + 28); 117 gpio_free(GPIO_PORTC + 28);
118} 118}
119 119
@@ -192,8 +192,7 @@ static struct resource pcm970_sja1000_resources[] = {
192 .end = MX27_CS4_BASE_ADDR + 0x100 - 1, 192 .end = MX27_CS4_BASE_ADDR + 0x100 - 1,
193 .flags = IORESOURCE_MEM, 193 .flags = IORESOURCE_MEM,
194 }, { 194 }, {
195 .start = IRQ_GPIOE(19), 195 /* irq number is run-time assigned */
196 .end = IRQ_GPIOE(19),
197 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, 196 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
198 }, 197 },
199}; 198};
@@ -227,5 +226,7 @@ void __init pcm970_baseboard_init(void)
227 imx27_add_imx_fb(&pcm038_fb_data); 226 imx27_add_imx_fb(&pcm038_fb_data);
228 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); 227 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN);
229 imx27_add_mxc_mmc(1, &sdhc_pdata); 228 imx27_add_mxc_mmc(1, &sdhc_pdata);
229 pcm970_sja1000_resources[1].start = gpio_to_irq(IMX_GPIO_NR(5, 19));
230 pcm970_sja1000_resources[1].end = gpio_to_irq(IMX_GPIO_NR(5, 19));
230 platform_device_register(&pcm970_sja1000); 231 platform_device_register(&pcm970_sja1000);
231} 232}
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
index cf0e669eaf1a..3e4fa849c64d 100644
--- a/arch/arm/mach-rpc/irq.c
+++ b/arch/arm/mach-rpc/irq.c
@@ -163,6 +163,6 @@ void __init rpc_init_irq(void)
163 } 163 }
164 } 164 }
165 165
166 init_FIQ(); 166 init_FIQ(FIQ_START);
167} 167}
168 168
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c
index 5cac2c540f4f..5c10ad05df74 100644
--- a/arch/arm/plat-mxc/3ds_debugboard.c
+++ b/arch/arm/plat-mxc/3ds_debugboard.c
@@ -12,9 +12,11 @@
12 12
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/irqdomain.h>
15#include <linux/io.h> 16#include <linux/io.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
17#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/module.h>
18#include <linux/smsc911x.h> 20#include <linux/smsc911x.h>
19#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
20#include <linux/regulator/fixed.h> 22#include <linux/regulator/fixed.h>
@@ -48,27 +50,22 @@
48/* CPU ID and Personality ID */ 50/* CPU ID and Personality ID */
49#define MCU_BOARD_ID_REG 0x68 51#define MCU_BOARD_ID_REG 0x68
50 52
51#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_BOARD_IRQ_START)
52#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_INTERNAL_IRQS)
53
54#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
55#define MXC_MAX_EXP_IO_LINES 16 53#define MXC_MAX_EXP_IO_LINES 16
56 54
57/* interrupts like external uart , external ethernet etc*/ 55/* interrupts like external uart , external ethernet etc*/
58#define EXPIO_INT_ENET (MXC_BOARD_IRQ_START + 0) 56#define EXPIO_INT_ENET 0
59#define EXPIO_INT_XUART_A (MXC_BOARD_IRQ_START + 1) 57#define EXPIO_INT_XUART_A 1
60#define EXPIO_INT_XUART_B (MXC_BOARD_IRQ_START + 2) 58#define EXPIO_INT_XUART_B 2
61#define EXPIO_INT_BUTTON_A (MXC_BOARD_IRQ_START + 3) 59#define EXPIO_INT_BUTTON_A 3
62#define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) 60#define EXPIO_INT_BUTTON_B 4
63 61
64static void __iomem *brd_io; 62static void __iomem *brd_io;
63static struct irq_domain *domain;
65 64
66static struct resource smsc911x_resources[] = { 65static struct resource smsc911x_resources[] = {
67 { 66 {
68 .flags = IORESOURCE_MEM, 67 .flags = IORESOURCE_MEM,
69 } , { 68 } , {
70 .start = EXPIO_INT_ENET,
71 .end = EXPIO_INT_ENET,
72 .flags = IORESOURCE_IRQ, 69 .flags = IORESOURCE_IRQ,
73 }, 70 },
74}; 71};
@@ -100,11 +97,11 @@ static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
100 imr_val = __raw_readw(brd_io + INTR_MASK_REG); 97 imr_val = __raw_readw(brd_io + INTR_MASK_REG);
101 int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; 98 int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val;
102 99
103 expio_irq = MXC_BOARD_IRQ_START; 100 expio_irq = 0;
104 for (; int_valid != 0; int_valid >>= 1, expio_irq++) { 101 for (; int_valid != 0; int_valid >>= 1, expio_irq++) {
105 if ((int_valid & 1) == 0) 102 if ((int_valid & 1) == 0)
106 continue; 103 continue;
107 generic_handle_irq(expio_irq); 104 generic_handle_irq(irq_find_mapping(domain, expio_irq));
108 } 105 }
109 106
110 desc->irq_data.chip->irq_ack(&desc->irq_data); 107 desc->irq_data.chip->irq_ack(&desc->irq_data);
@@ -118,7 +115,7 @@ static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc)
118static void expio_mask_irq(struct irq_data *d) 115static void expio_mask_irq(struct irq_data *d)
119{ 116{
120 u16 reg; 117 u16 reg;
121 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 118 u32 expio = d->hwirq;
122 119
123 reg = __raw_readw(brd_io + INTR_MASK_REG); 120 reg = __raw_readw(brd_io + INTR_MASK_REG);
124 reg |= (1 << expio); 121 reg |= (1 << expio);
@@ -127,7 +124,7 @@ static void expio_mask_irq(struct irq_data *d)
127 124
128static void expio_ack_irq(struct irq_data *d) 125static void expio_ack_irq(struct irq_data *d)
129{ 126{
130 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 127 u32 expio = d->hwirq;
131 128
132 __raw_writew(1 << expio, brd_io + INTR_RESET_REG); 129 __raw_writew(1 << expio, brd_io + INTR_RESET_REG);
133 __raw_writew(0, brd_io + INTR_RESET_REG); 130 __raw_writew(0, brd_io + INTR_RESET_REG);
@@ -137,7 +134,7 @@ static void expio_ack_irq(struct irq_data *d)
137static void expio_unmask_irq(struct irq_data *d) 134static void expio_unmask_irq(struct irq_data *d)
138{ 135{
139 u16 reg; 136 u16 reg;
140 u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 137 u32 expio = d->hwirq;
141 138
142 reg = __raw_readw(brd_io + INTR_MASK_REG); 139 reg = __raw_readw(brd_io + INTR_MASK_REG);
143 reg &= ~(1 << expio); 140 reg &= ~(1 << expio);
@@ -155,8 +152,10 @@ static struct regulator_consumer_supply dummy_supplies[] = {
155 REGULATOR_SUPPLY("vddvario", "smsc911x"), 152 REGULATOR_SUPPLY("vddvario", "smsc911x"),
156}; 153};
157 154
158int __init mxc_expio_init(u32 base, u32 p_irq) 155int __init mxc_expio_init(u32 base, u32 intr_gpio)
159{ 156{
157 u32 p_irq = gpio_to_irq(intr_gpio);
158 int irq_base;
160 int i; 159 int i;
161 160
162 brd_io = ioremap(BOARD_IO_ADDR(base), SZ_4K); 161 brd_io = ioremap(BOARD_IO_ADDR(base), SZ_4K);
@@ -178,16 +177,23 @@ int __init mxc_expio_init(u32 base, u32 p_irq)
178 /* 177 /*
179 * Configure INT line as GPIO input 178 * Configure INT line as GPIO input
180 */ 179 */
181 gpio_request(MXC_IRQ_TO_GPIO(p_irq), "expio_pirq"); 180 gpio_request(intr_gpio, "expio_pirq");
182 gpio_direction_input(MXC_IRQ_TO_GPIO(p_irq)); 181 gpio_direction_input(intr_gpio);
183 182
184 /* disable the interrupt and clear the status */ 183 /* disable the interrupt and clear the status */
185 __raw_writew(0, brd_io + INTR_MASK_REG); 184 __raw_writew(0, brd_io + INTR_MASK_REG);
186 __raw_writew(0xFFFF, brd_io + INTR_RESET_REG); 185 __raw_writew(0xFFFF, brd_io + INTR_RESET_REG);
187 __raw_writew(0, brd_io + INTR_RESET_REG); 186 __raw_writew(0, brd_io + INTR_RESET_REG);
188 __raw_writew(0x1F, brd_io + INTR_MASK_REG); 187 __raw_writew(0x1F, brd_io + INTR_MASK_REG);
189 for (i = MXC_EXP_IO_BASE; 188
190 i < (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES); i++) { 189 irq_base = irq_alloc_descs(-1, 0, MXC_MAX_EXP_IO_LINES, numa_node_id());
190 WARN_ON(irq_base < 0);
191
192 domain = irq_domain_add_legacy(NULL, MXC_MAX_EXP_IO_LINES, irq_base, 0,
193 &irq_domain_simple_ops, NULL);
194 WARN_ON(!domain);
195
196 for (i = irq_base; i < irq_base + MXC_MAX_EXP_IO_LINES; i++) {
191 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); 197 irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq);
192 set_irq_flags(i, IRQF_VALID); 198 set_irq_flags(i, IRQF_VALID);
193 } 199 }
@@ -199,6 +205,8 @@ int __init mxc_expio_init(u32 base, u32 p_irq)
199 205
200 smsc911x_resources[0].start = LAN9217_BASE_ADDR(base); 206 smsc911x_resources[0].start = LAN9217_BASE_ADDR(base);
201 smsc911x_resources[0].end = LAN9217_BASE_ADDR(base) + 0x100 - 1; 207 smsc911x_resources[0].end = LAN9217_BASE_ADDR(base) + 0x100 - 1;
208 smsc911x_resources[1].start = irq_find_mapping(domain, EXPIO_INT_ENET);
209 smsc911x_resources[1].end = irq_find_mapping(domain, EXPIO_INT_ENET);
202 platform_device_register(&smsc_lan9217_device); 210 platform_device_register(&smsc_lan9217_device);
203 211
204 return 0; 212 return 0;
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c
index 689f81f9593b..cbd55c36def3 100644
--- a/arch/arm/plat-mxc/avic.c
+++ b/arch/arm/plat-mxc/avic.c
@@ -19,11 +19,14 @@
19 19
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/irqdomain.h>
22#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h>
23#include <mach/common.h> 25#include <mach/common.h>
24#include <asm/mach/irq.h> 26#include <asm/mach/irq.h>
25#include <asm/exception.h> 27#include <asm/exception.h>
26#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/irqs.h>
27 30
28#include "irq-common.h" 31#include "irq-common.h"
29 32
@@ -50,15 +53,19 @@
50#define AVIC_NUM_IRQS 64 53#define AVIC_NUM_IRQS 64
51 54
52void __iomem *avic_base; 55void __iomem *avic_base;
56static struct irq_domain *domain;
53 57
54static u32 avic_saved_mask_reg[2]; 58static u32 avic_saved_mask_reg[2];
55 59
56#ifdef CONFIG_MXC_IRQ_PRIOR 60#ifdef CONFIG_MXC_IRQ_PRIOR
57static int avic_irq_set_priority(unsigned char irq, unsigned char prio) 61static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
58{ 62{
63 struct irq_data *d = irq_get_irq_data(irq);
59 unsigned int temp; 64 unsigned int temp;
60 unsigned int mask = 0x0F << irq % 8 * 4; 65 unsigned int mask = 0x0F << irq % 8 * 4;
61 66
67 irq = d->hwirq;
68
62 if (irq >= AVIC_NUM_IRQS) 69 if (irq >= AVIC_NUM_IRQS)
63 return -EINVAL; 70 return -EINVAL;
64 71
@@ -75,8 +82,11 @@ static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
75#ifdef CONFIG_FIQ 82#ifdef CONFIG_FIQ
76static int avic_set_irq_fiq(unsigned int irq, unsigned int type) 83static int avic_set_irq_fiq(unsigned int irq, unsigned int type)
77{ 84{
85 struct irq_data *d = irq_get_irq_data(irq);
78 unsigned int irqt; 86 unsigned int irqt;
79 87
88 irq = d->hwirq;
89
80 if (irq >= AVIC_NUM_IRQS) 90 if (irq >= AVIC_NUM_IRQS)
81 return -EINVAL; 91 return -EINVAL;
82 92
@@ -108,7 +118,7 @@ static void avic_irq_suspend(struct irq_data *d)
108{ 118{
109 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 119 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
110 struct irq_chip_type *ct = gc->chip_types; 120 struct irq_chip_type *ct = gc->chip_types;
111 int idx = gc->irq_base >> 5; 121 int idx = d->hwirq >> 5;
112 122
113 avic_saved_mask_reg[idx] = __raw_readl(avic_base + ct->regs.mask); 123 avic_saved_mask_reg[idx] = __raw_readl(avic_base + ct->regs.mask);
114 __raw_writel(gc->wake_active, avic_base + ct->regs.mask); 124 __raw_writel(gc->wake_active, avic_base + ct->regs.mask);
@@ -118,7 +128,7 @@ static void avic_irq_resume(struct irq_data *d)
118{ 128{
119 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 129 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
120 struct irq_chip_type *ct = gc->chip_types; 130 struct irq_chip_type *ct = gc->chip_types;
121 int idx = gc->irq_base >> 5; 131 int idx = d->hwirq >> 5;
122 132
123 __raw_writel(avic_saved_mask_reg[idx], avic_base + ct->regs.mask); 133 __raw_writel(avic_saved_mask_reg[idx], avic_base + ct->regs.mask);
124} 134}
@@ -128,11 +138,10 @@ static void avic_irq_resume(struct irq_data *d)
128#define avic_irq_resume NULL 138#define avic_irq_resume NULL
129#endif 139#endif
130 140
131static __init void avic_init_gc(unsigned int irq_start) 141static __init void avic_init_gc(int idx, unsigned int irq_start)
132{ 142{
133 struct irq_chip_generic *gc; 143 struct irq_chip_generic *gc;
134 struct irq_chip_type *ct; 144 struct irq_chip_type *ct;
135 int idx = irq_start >> 5;
136 145
137 gc = irq_alloc_generic_chip("mxc-avic", 1, irq_start, avic_base, 146 gc = irq_alloc_generic_chip("mxc-avic", 1, irq_start, avic_base,
138 handle_level_irq); 147 handle_level_irq);
@@ -161,7 +170,7 @@ asmlinkage void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
161 if (nivector == 0xffff) 170 if (nivector == 0xffff)
162 break; 171 break;
163 172
164 handle_IRQ(nivector, regs); 173 handle_IRQ(irq_find_mapping(domain, nivector), regs);
165 } while (1); 174 } while (1);
166} 175}
167 176
@@ -172,6 +181,8 @@ asmlinkage void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
172 */ 181 */
173void __init mxc_init_irq(void __iomem *irqbase) 182void __init mxc_init_irq(void __iomem *irqbase)
174{ 183{
184 struct device_node *np;
185 int irq_base;
175 int i; 186 int i;
176 187
177 avic_base = irqbase; 188 avic_base = irqbase;
@@ -190,8 +201,16 @@ void __init mxc_init_irq(void __iomem *irqbase)
190 __raw_writel(0, avic_base + AVIC_INTTYPEH); 201 __raw_writel(0, avic_base + AVIC_INTTYPEH);
191 __raw_writel(0, avic_base + AVIC_INTTYPEL); 202 __raw_writel(0, avic_base + AVIC_INTTYPEL);
192 203
193 for (i = 0; i < AVIC_NUM_IRQS; i += 32) 204 irq_base = irq_alloc_descs(-1, 0, AVIC_NUM_IRQS, numa_node_id());
194 avic_init_gc(i); 205 WARN_ON(irq_base < 0);
206
207 np = of_find_compatible_node(NULL, NULL, "fsl,avic");
208 domain = irq_domain_add_legacy(np, AVIC_NUM_IRQS, irq_base, 0,
209 &irq_domain_simple_ops, NULL);
210 WARN_ON(!domain);
211
212 for (i = 0; i < AVIC_NUM_IRQS / 32; i++, irq_base += 32)
213 avic_init_gc(i, irq_base);
195 214
196 /* Set default priority value (0) for all IRQ's */ 215 /* Set default priority value (0) for all IRQ's */
197 for (i = 0; i < 8; i++) 216 for (i = 0; i < 8; i++)
@@ -199,7 +218,7 @@ void __init mxc_init_irq(void __iomem *irqbase)
199 218
200#ifdef CONFIG_FIQ 219#ifdef CONFIG_FIQ
201 /* Initialize FIQ */ 220 /* Initialize FIQ */
202 init_FIQ(); 221 init_FIQ(FIQ_START);
203#endif 222#endif
204 223
205 printk(KERN_INFO "MXC IRQ initialized\n"); 224 printk(KERN_INFO "MXC IRQ initialized\n");
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c
index 79d340ae0af1..d1e33cc6f12e 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/plat-mxc/devices/platform-ipu-core.c
@@ -30,8 +30,7 @@ const struct imx_ipu_core_data imx35_ipu_core_data __initconst =
30static struct platform_device *imx_ipu_coredev __initdata; 30static struct platform_device *imx_ipu_coredev __initdata;
31 31
32struct platform_device *__init imx_add_ipu_core( 32struct platform_device *__init imx_add_ipu_core(
33 const struct imx_ipu_core_data *data, 33 const struct imx_ipu_core_data *data)
34 const struct ipu_platform_data *pdata)
35{ 34{
36 /* The resource order is important! */ 35 /* The resource order is important! */
37 struct resource res[] = { 36 struct resource res[] = {
@@ -55,7 +54,7 @@ struct platform_device *__init imx_add_ipu_core(
55 }; 54 };
56 55
57 return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1, 56 return imx_ipu_coredev = imx_add_platform_device("ipu-core", -1,
58 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 57 res, ARRAY_SIZE(res), NULL, 0);
59} 58}
60 59
61struct platform_device *__init imx_alloc_mx3_camera( 60struct platform_device *__init imx_alloc_mx3_camera(
diff --git a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h b/arch/arm/plat-mxc/include/mach/3ds_debugboard.h
index a384fdd49c62..9fd6cb3f8fad 100644
--- a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h
+++ b/arch/arm/plat-mxc/include/mach/3ds_debugboard.h
@@ -13,6 +13,6 @@
13#ifndef __ASM_ARCH_MXC_3DS_DB_H__ 13#ifndef __ASM_ARCH_MXC_3DS_DB_H__
14#define __ASM_ARCH_MXC_3DS_DB_H__ 14#define __ASM_ARCH_MXC_3DS_DB_H__
15 15
16extern int __init mxc_expio_init(u32 base, u32 p_irq); 16extern int __init mxc_expio_init(u32 base, u32 intr_gpio);
17 17
18#endif /* __ASM_ARCH_MXC_3DS_DB_H__ */ 18#endif /* __ASM_ARCH_MXC_3DS_DB_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 1b2258daa05b..a7f5bb1084d7 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -183,7 +183,6 @@ struct platform_device *__init imx_add_imx_udc(
183 const struct imx_imx_udc_data *data, 183 const struct imx_imx_udc_data *data,
184 const struct imxusb_platform_data *pdata); 184 const struct imxusb_platform_data *pdata);
185 185
186#include <mach/ipu.h>
187#include <mach/mx3fb.h> 186#include <mach/mx3fb.h>
188#include <mach/mx3_camera.h> 187#include <mach/mx3_camera.h>
189struct imx_ipu_core_data { 188struct imx_ipu_core_data {
@@ -192,8 +191,7 @@ struct imx_ipu_core_data {
192 resource_size_t errirq; 191 resource_size_t errirq;
193}; 192};
194struct platform_device *__init imx_add_ipu_core( 193struct platform_device *__init imx_add_ipu_core(
195 const struct imx_ipu_core_data *data, 194 const struct imx_ipu_core_data *data);
196 const struct ipu_platform_data *pdata);
197struct platform_device *__init imx_alloc_mx3_camera( 195struct platform_device *__init imx_alloc_mx3_camera(
198 const struct imx_ipu_core_data *data, 196 const struct imx_ipu_core_data *data,
199 const struct mx3_camera_pdata *pdata); 197 const struct mx3_camera_pdata *pdata);
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 0630513554de..1d432a75e409 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -128,6 +128,4 @@
128/* range e.g. GPIO_1_5 is gpio 5 under linux */ 128/* range e.g. GPIO_1_5 is gpio 5 under linux */
129#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) 129#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr))
130 130
131#define IMX_GPIO_TO_IRQ(gpio) (MXC_GPIO_IRQ_START + (gpio))
132
133#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ 131#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 63f22a009a65..d8b65b51f2a9 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -160,9 +160,6 @@ int mxc_iomux_mode(unsigned int pin_mode);
160 160
161#define IOMUX_TO_GPIO(iomux_pin) \ 161#define IOMUX_TO_GPIO(iomux_pin) \
162 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) 162 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT)
163#define IOMUX_TO_IRQ(iomux_pin) \
164 (((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) + \
165 MXC_GPIO_IRQ_START)
166 163
167/* 164/*
168 * This enumeration is constructed based on the Section 165 * This enumeration is constructed based on the Section
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h
index f7d18046c04f..02651a40fe23 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v1.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h
@@ -85,13 +85,6 @@
85#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT) 85#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
86#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT) 86#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
87 87
88#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
89#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
90#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
91#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
92#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
93#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
94
95extern int mxc_gpio_mode(int gpio_mode); 88extern int mxc_gpio_mode(int gpio_mode);
96extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, 89extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
97 const char *label); 90 const char *label);
diff --git a/arch/arm/plat-mxc/include/mach/ipu.h b/arch/arm/plat-mxc/include/mach/ipu.h
index a9221f1cc1a0..539e559d18b2 100644
--- a/arch/arm/plat-mxc/include/mach/ipu.h
+++ b/arch/arm/plat-mxc/include/mach/ipu.h
@@ -110,10 +110,6 @@ enum ipu_rotate_mode {
110 IPU_ROTATE_90_LEFT = 7, 110 IPU_ROTATE_90_LEFT = 7,
111}; 111};
112 112
113struct ipu_platform_data {
114 unsigned int irq_base;
115};
116
117/* 113/*
118 * Enumeration of DI ports for ADC. 114 * Enumeration of DI ports for ADC.
119 */ 115 */
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index fd9efb044656..d73f5e8ea9cb 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -11,50 +11,6 @@
11#ifndef __ASM_ARCH_MXC_IRQS_H__ 11#ifndef __ASM_ARCH_MXC_IRQS_H__
12#define __ASM_ARCH_MXC_IRQS_H__ 12#define __ASM_ARCH_MXC_IRQS_H__
13 13
14#include <asm-generic/gpio.h>
15
16/*
17 * SoCs with GIC interrupt controller have 160 IRQs, those with TZIC
18 * have 128 IRQs, and those with AVIC have 64.
19 *
20 * To support single image, the biggest number should be defined on
21 * top of the list.
22 */
23#if defined CONFIG_ARM_GIC
24#define MXC_INTERNAL_IRQS 160
25#elif defined CONFIG_MXC_TZIC
26#define MXC_INTERNAL_IRQS 128
27#else
28#define MXC_INTERNAL_IRQS 64
29#endif
30
31#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
32
33/*
34 * The next 16 interrupts are for board specific purposes. Since
35 * the kernel can only run on one machine at a time, we can re-use
36 * these. If you need more, increase MXC_BOARD_IRQS, but keep it
37 * within sensible limits.
38 */
39#define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + ARCH_NR_GPIOS)
40
41#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
42#define MXC_BOARD_IRQS 80
43#else
44#define MXC_BOARD_IRQS 16
45#endif
46
47#define MXC_IPU_IRQ_START (MXC_BOARD_IRQ_START + MXC_BOARD_IRQS)
48
49#ifdef CONFIG_MX3_IPU_IRQS
50#define MX3_IPU_IRQS CONFIG_MX3_IPU_IRQS
51#else
52#define MX3_IPU_IRQS 0
53#endif
54/* REVISIT: Add IPU irqs on IMX51 */
55
56#define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS)
57
58extern int imx_irq_set_priority(unsigned char irq, unsigned char prio); 14extern int imx_irq_set_priority(unsigned char irq, unsigned char prio);
59 15
60/* all normal IRQs can be FIQs */ 16/* all normal IRQs can be FIQs */
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index 2b7c08d13e89..45bd31cc34d6 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -78,61 +78,62 @@
78#define MX1_IO_ADDRESS(x) IOMEM(MX1_IO_P2V(x)) 78#define MX1_IO_ADDRESS(x) IOMEM(MX1_IO_P2V(x))
79 79
80/* fixed interrput numbers */ 80/* fixed interrput numbers */
81#define MX1_INT_SOFTINT 0 81#include <asm/irq.h>
82#define MX1_INT_CSI 6 82#define MX1_INT_SOFTINT (NR_IRQS_LEGACY + 0)
83#define MX1_DSPA_MAC_INT 7 83#define MX1_INT_CSI (NR_IRQS_LEGACY + 6)
84#define MX1_DSPA_INT 8 84#define MX1_DSPA_MAC_INT (NR_IRQS_LEGACY + 7)
85#define MX1_COMP_INT 9 85#define MX1_DSPA_INT (NR_IRQS_LEGACY + 8)
86#define MX1_MSHC_XINT 10 86#define MX1_COMP_INT (NR_IRQS_LEGACY + 9)
87#define MX1_GPIO_INT_PORTA 11 87#define MX1_MSHC_XINT (NR_IRQS_LEGACY + 10)
88#define MX1_GPIO_INT_PORTB 12 88#define MX1_GPIO_INT_PORTA (NR_IRQS_LEGACY + 11)
89#define MX1_GPIO_INT_PORTC 13 89#define MX1_GPIO_INT_PORTB (NR_IRQS_LEGACY + 12)
90#define MX1_INT_LCDC 14 90#define MX1_GPIO_INT_PORTC (NR_IRQS_LEGACY + 13)
91#define MX1_SIM_INT 15 91#define MX1_INT_LCDC (NR_IRQS_LEGACY + 14)
92#define MX1_SIM_DATA_INT 16 92#define MX1_SIM_INT (NR_IRQS_LEGACY + 15)
93#define MX1_RTC_INT 17 93#define MX1_SIM_DATA_INT (NR_IRQS_LEGACY + 16)
94#define MX1_RTC_SAMINT 18 94#define MX1_RTC_INT (NR_IRQS_LEGACY + 17)
95#define MX1_INT_UART2PFERR 19 95#define MX1_RTC_SAMINT (NR_IRQS_LEGACY + 18)
96#define MX1_INT_UART2RTS 20 96#define MX1_INT_UART2PFERR (NR_IRQS_LEGACY + 19)
97#define MX1_INT_UART2DTR 21 97#define MX1_INT_UART2RTS (NR_IRQS_LEGACY + 20)
98#define MX1_INT_UART2UARTC 22 98#define MX1_INT_UART2DTR (NR_IRQS_LEGACY + 21)
99#define MX1_INT_UART2TX 23 99#define MX1_INT_UART2UARTC (NR_IRQS_LEGACY + 22)
100#define MX1_INT_UART2RX 24 100#define MX1_INT_UART2TX (NR_IRQS_LEGACY + 23)
101#define MX1_INT_UART1PFERR 25 101#define MX1_INT_UART2RX (NR_IRQS_LEGACY + 24)
102#define MX1_INT_UART1RTS 26 102#define MX1_INT_UART1PFERR (NR_IRQS_LEGACY + 25)
103#define MX1_INT_UART1DTR 27 103#define MX1_INT_UART1RTS (NR_IRQS_LEGACY + 26)
104#define MX1_INT_UART1UARTC 28 104#define MX1_INT_UART1DTR (NR_IRQS_LEGACY + 27)
105#define MX1_INT_UART1TX 29 105#define MX1_INT_UART1UARTC (NR_IRQS_LEGACY + 28)
106#define MX1_INT_UART1RX 30 106#define MX1_INT_UART1TX (NR_IRQS_LEGACY + 29)
107#define MX1_VOICE_DAC_INT 31 107#define MX1_INT_UART1RX (NR_IRQS_LEGACY + 30)
108#define MX1_VOICE_ADC_INT 32 108#define MX1_VOICE_DAC_INT (NR_IRQS_LEGACY + 31)
109#define MX1_PEN_DATA_INT 33 109#define MX1_VOICE_ADC_INT (NR_IRQS_LEGACY + 32)
110#define MX1_PWM_INT 34 110#define MX1_PEN_DATA_INT (NR_IRQS_LEGACY + 33)
111#define MX1_SDHC_INT 35 111#define MX1_PWM_INT (NR_IRQS_LEGACY + 34)
112#define MX1_INT_I2C 39 112#define MX1_SDHC_INT (NR_IRQS_LEGACY + 35)
113#define MX1_INT_CSPI2 40 113#define MX1_INT_I2C (NR_IRQS_LEGACY + 39)
114#define MX1_INT_CSPI1 41 114#define MX1_INT_CSPI2 (NR_IRQS_LEGACY + 40)
115#define MX1_SSI_TX_INT 42 115#define MX1_INT_CSPI1 (NR_IRQS_LEGACY + 41)
116#define MX1_SSI_TX_ERR_INT 43 116#define MX1_SSI_TX_INT (NR_IRQS_LEGACY + 42)
117#define MX1_SSI_RX_INT 44 117#define MX1_SSI_TX_ERR_INT (NR_IRQS_LEGACY + 43)
118#define MX1_SSI_RX_ERR_INT 45 118#define MX1_SSI_RX_INT (NR_IRQS_LEGACY + 44)
119#define MX1_TOUCH_INT 46 119#define MX1_SSI_RX_ERR_INT (NR_IRQS_LEGACY + 45)
120#define MX1_INT_USBD0 47 120#define MX1_TOUCH_INT (NR_IRQS_LEGACY + 46)
121#define MX1_INT_USBD1 48 121#define MX1_INT_USBD0 (NR_IRQS_LEGACY + 47)
122#define MX1_INT_USBD2 49 122#define MX1_INT_USBD1 (NR_IRQS_LEGACY + 48)
123#define MX1_INT_USBD3 50 123#define MX1_INT_USBD2 (NR_IRQS_LEGACY + 49)
124#define MX1_INT_USBD4 51 124#define MX1_INT_USBD3 (NR_IRQS_LEGACY + 50)
125#define MX1_INT_USBD5 52 125#define MX1_INT_USBD4 (NR_IRQS_LEGACY + 51)
126#define MX1_INT_USBD6 53 126#define MX1_INT_USBD5 (NR_IRQS_LEGACY + 52)
127#define MX1_BTSYS_INT 55 127#define MX1_INT_USBD6 (NR_IRQS_LEGACY + 53)
128#define MX1_BTTIM_INT 56 128#define MX1_BTSYS_INT (NR_IRQS_LEGACY + 55)
129#define MX1_BTWUI_INT 57 129#define MX1_BTTIM_INT (NR_IRQS_LEGACY + 56)
130#define MX1_TIM2_INT 58 130#define MX1_BTWUI_INT (NR_IRQS_LEGACY + 57)
131#define MX1_TIM1_INT 59 131#define MX1_TIM2_INT (NR_IRQS_LEGACY + 58)
132#define MX1_DMA_ERR 60 132#define MX1_TIM1_INT (NR_IRQS_LEGACY + 59)
133#define MX1_DMA_INT 61 133#define MX1_DMA_ERR (NR_IRQS_LEGACY + 60)
134#define MX1_GPIO_INT_PORTD 62 134#define MX1_DMA_INT (NR_IRQS_LEGACY + 61)
135#define MX1_WDT_INT 63 135#define MX1_GPIO_INT_PORTD (NR_IRQS_LEGACY + 62)
136#define MX1_WDT_INT (NR_IRQS_LEGACY + 63)
136 137
137/* DMA */ 138/* DMA */
138#define MX1_DMA_REQ_UART3_T 2 139#define MX1_DMA_REQ_UART3_T 2
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
index 6cd049ebbd8d..468738aa997f 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -99,59 +99,60 @@
99#define MX21_IO_ADDRESS(x) IOMEM(MX21_IO_P2V(x)) 99#define MX21_IO_ADDRESS(x) IOMEM(MX21_IO_P2V(x))
100 100
101/* fixed interrupt numbers */ 101/* fixed interrupt numbers */
102#define MX21_INT_CSPI3 6 102#include <asm/irq.h>
103#define MX21_INT_GPIO 8 103#define MX21_INT_CSPI3 (NR_IRQS_LEGACY + 6)
104#define MX21_INT_FIRI 9 104#define MX21_INT_GPIO (NR_IRQS_LEGACY + 8)
105#define MX21_INT_SDHC2 10 105#define MX21_INT_FIRI (NR_IRQS_LEGACY + 9)
106#define MX21_INT_SDHC1 11 106#define MX21_INT_SDHC2 (NR_IRQS_LEGACY + 10)
107#define MX21_INT_I2C 12 107#define MX21_INT_SDHC1 (NR_IRQS_LEGACY + 11)
108#define MX21_INT_SSI2 13 108#define MX21_INT_I2C (NR_IRQS_LEGACY + 12)
109#define MX21_INT_SSI1 14 109#define MX21_INT_SSI2 (NR_IRQS_LEGACY + 13)
110#define MX21_INT_CSPI2 15 110#define MX21_INT_SSI1 (NR_IRQS_LEGACY + 14)
111#define MX21_INT_CSPI1 16 111#define MX21_INT_CSPI2 (NR_IRQS_LEGACY + 15)
112#define MX21_INT_UART4 17 112#define MX21_INT_CSPI1 (NR_IRQS_LEGACY + 16)
113#define MX21_INT_UART3 18 113#define MX21_INT_UART4 (NR_IRQS_LEGACY + 17)
114#define MX21_INT_UART2 19 114#define MX21_INT_UART3 (NR_IRQS_LEGACY + 18)
115#define MX21_INT_UART1 20 115#define MX21_INT_UART2 (NR_IRQS_LEGACY + 19)
116#define MX21_INT_KPP 21 116#define MX21_INT_UART1 (NR_IRQS_LEGACY + 20)
117#define MX21_INT_RTC 22 117#define MX21_INT_KPP (NR_IRQS_LEGACY + 21)
118#define MX21_INT_PWM 23 118#define MX21_INT_RTC (NR_IRQS_LEGACY + 22)
119#define MX21_INT_GPT3 24 119#define MX21_INT_PWM (NR_IRQS_LEGACY + 23)
120#define MX21_INT_GPT2 25 120#define MX21_INT_GPT3 (NR_IRQS_LEGACY + 24)
121#define MX21_INT_GPT1 26 121#define MX21_INT_GPT2 (NR_IRQS_LEGACY + 25)
122#define MX21_INT_WDOG 27 122#define MX21_INT_GPT1 (NR_IRQS_LEGACY + 26)
123#define MX21_INT_PCMCIA 28 123#define MX21_INT_WDOG (NR_IRQS_LEGACY + 27)
124#define MX21_INT_NFC 29 124#define MX21_INT_PCMCIA (NR_IRQS_LEGACY + 28)
125#define MX21_INT_BMI 30 125#define MX21_INT_NFC (NR_IRQS_LEGACY + 29)
126#define MX21_INT_CSI 31 126#define MX21_INT_BMI (NR_IRQS_LEGACY + 30)
127#define MX21_INT_DMACH0 32 127#define MX21_INT_CSI (NR_IRQS_LEGACY + 31)
128#define MX21_INT_DMACH1 33 128#define MX21_INT_DMACH0 (NR_IRQS_LEGACY + 32)
129#define MX21_INT_DMACH2 34 129#define MX21_INT_DMACH1 (NR_IRQS_LEGACY + 33)
130#define MX21_INT_DMACH3 35 130#define MX21_INT_DMACH2 (NR_IRQS_LEGACY + 34)
131#define MX21_INT_DMACH4 36 131#define MX21_INT_DMACH3 (NR_IRQS_LEGACY + 35)
132#define MX21_INT_DMACH5 37 132#define MX21_INT_DMACH4 (NR_IRQS_LEGACY + 36)
133#define MX21_INT_DMACH6 38 133#define MX21_INT_DMACH5 (NR_IRQS_LEGACY + 37)
134#define MX21_INT_DMACH7 39 134#define MX21_INT_DMACH6 (NR_IRQS_LEGACY + 38)
135#define MX21_INT_DMACH8 40 135#define MX21_INT_DMACH7 (NR_IRQS_LEGACY + 39)
136#define MX21_INT_DMACH9 41 136#define MX21_INT_DMACH8 (NR_IRQS_LEGACY + 40)
137#define MX21_INT_DMACH10 42 137#define MX21_INT_DMACH9 (NR_IRQS_LEGACY + 41)
138#define MX21_INT_DMACH11 43 138#define MX21_INT_DMACH10 (NR_IRQS_LEGACY + 42)
139#define MX21_INT_DMACH12 44 139#define MX21_INT_DMACH11 (NR_IRQS_LEGACY + 43)
140#define MX21_INT_DMACH13 45 140#define MX21_INT_DMACH12 (NR_IRQS_LEGACY + 44)
141#define MX21_INT_DMACH14 46 141#define MX21_INT_DMACH13 (NR_IRQS_LEGACY + 45)
142#define MX21_INT_DMACH15 47 142#define MX21_INT_DMACH14 (NR_IRQS_LEGACY + 46)
143#define MX21_INT_EMMAENC 49 143#define MX21_INT_DMACH15 (NR_IRQS_LEGACY + 47)
144#define MX21_INT_EMMADEC 50 144#define MX21_INT_EMMAENC (NR_IRQS_LEGACY + 49)
145#define MX21_INT_EMMAPRP 51 145#define MX21_INT_EMMADEC (NR_IRQS_LEGACY + 50)
146#define MX21_INT_EMMAPP 52 146#define MX21_INT_EMMAPRP (NR_IRQS_LEGACY + 51)
147#define MX21_INT_USBWKUP 53 147#define MX21_INT_EMMAPP (NR_IRQS_LEGACY + 52)
148#define MX21_INT_USBDMA 54 148#define MX21_INT_USBWKUP (NR_IRQS_LEGACY + 53)
149#define MX21_INT_USBHOST 55 149#define MX21_INT_USBDMA (NR_IRQS_LEGACY + 54)
150#define MX21_INT_USBFUNC 56 150#define MX21_INT_USBHOST (NR_IRQS_LEGACY + 55)
151#define MX21_INT_USBMNP 57 151#define MX21_INT_USBFUNC (NR_IRQS_LEGACY + 56)
152#define MX21_INT_USBCTRL 58 152#define MX21_INT_USBMNP (NR_IRQS_LEGACY + 57)
153#define MX21_INT_SLCDC 60 153#define MX21_INT_USBCTRL (NR_IRQS_LEGACY + 58)
154#define MX21_INT_LCDC 61 154#define MX21_INT_SLCDC (NR_IRQS_LEGACY + 60)
155#define MX21_INT_LCDC (NR_IRQS_LEGACY + 61)
155 156
156/* fixed DMA request numbers */ 157/* fixed DMA request numbers */
157#define MX21_DMA_REQ_CSPI3_RX 1 158#define MX21_DMA_REQ_CSPI3_RX 1
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index ccebf5ba12f0..627d94f1b010 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -61,40 +61,44 @@
61#define MX25_IO_P2V(x) IMX_IO_P2V(x) 61#define MX25_IO_P2V(x) IMX_IO_P2V(x)
62#define MX25_IO_ADDRESS(x) IOMEM(MX25_IO_P2V(x)) 62#define MX25_IO_ADDRESS(x) IOMEM(MX25_IO_P2V(x))
63 63
64#define MX25_INT_CSPI3 0 64/*
65#define MX25_INT_I2C1 3 65 * Interrupt numbers
66#define MX25_INT_I2C2 4 66 */
67#define MX25_INT_UART4 5 67#include <asm/irq.h>
68#define MX25_INT_ESDHC2 8 68#define MX25_INT_CSPI3 (NR_IRQS_LEGACY + 0)
69#define MX25_INT_ESDHC1 9 69#define MX25_INT_I2C1 (NR_IRQS_LEGACY + 3)
70#define MX25_INT_I2C3 10 70#define MX25_INT_I2C2 (NR_IRQS_LEGACY + 4)
71#define MX25_INT_SSI2 11 71#define MX25_INT_UART4 (NR_IRQS_LEGACY + 5)
72#define MX25_INT_SSI1 12 72#define MX25_INT_ESDHC2 (NR_IRQS_LEGACY + 8)
73#define MX25_INT_CSPI2 13 73#define MX25_INT_ESDHC1 (NR_IRQS_LEGACY + 9)
74#define MX25_INT_CSPI1 14 74#define MX25_INT_I2C3 (NR_IRQS_LEGACY + 10)
75#define MX25_INT_GPIO3 16 75#define MX25_INT_SSI2 (NR_IRQS_LEGACY + 11)
76#define MX25_INT_CSI 17 76#define MX25_INT_SSI1 (NR_IRQS_LEGACY + 12)
77#define MX25_INT_UART3 18 77#define MX25_INT_CSPI2 (NR_IRQS_LEGACY + 13)
78#define MX25_INT_GPIO4 23 78#define MX25_INT_CSPI1 (NR_IRQS_LEGACY + 14)
79#define MX25_INT_KPP 24 79#define MX25_INT_GPIO3 (NR_IRQS_LEGACY + 16)
80#define MX25_INT_DRYICE 25 80#define MX25_INT_CSI (NR_IRQS_LEGACY + 17)
81#define MX25_INT_PWM1 26 81#define MX25_INT_UART3 (NR_IRQS_LEGACY + 18)
82#define MX25_INT_UART2 32 82#define MX25_INT_GPIO4 (NR_IRQS_LEGACY + 23)
83#define MX25_INT_NFC 33 83#define MX25_INT_KPP (NR_IRQS_LEGACY + 24)
84#define MX25_INT_SDMA 34 84#define MX25_INT_DRYICE (NR_IRQS_LEGACY + 25)
85#define MX25_INT_USB_HS 35 85#define MX25_INT_PWM1 (NR_IRQS_LEGACY + 26)
86#define MX25_INT_PWM2 36 86#define MX25_INT_UART2 (NR_IRQS_LEGACY + 32)
87#define MX25_INT_USB_OTG 37 87#define MX25_INT_NFC (NR_IRQS_LEGACY + 33)
88#define MX25_INT_LCDC 39 88#define MX25_INT_SDMA (NR_IRQS_LEGACY + 34)
89#define MX25_INT_UART5 40 89#define MX25_INT_USB_HS (NR_IRQS_LEGACY + 35)
90#define MX25_INT_PWM3 41 90#define MX25_INT_PWM2 (NR_IRQS_LEGACY + 36)
91#define MX25_INT_PWM4 42 91#define MX25_INT_USB_OTG (NR_IRQS_LEGACY + 37)
92#define MX25_INT_CAN1 43 92#define MX25_INT_LCDC (NR_IRQS_LEGACY + 39)
93#define MX25_INT_CAN2 44 93#define MX25_INT_UART5 (NR_IRQS_LEGACY + 40)
94#define MX25_INT_UART1 45 94#define MX25_INT_PWM3 (NR_IRQS_LEGACY + 41)
95#define MX25_INT_GPIO2 51 95#define MX25_INT_PWM4 (NR_IRQS_LEGACY + 42)
96#define MX25_INT_GPIO1 52 96#define MX25_INT_CAN1 (NR_IRQS_LEGACY + 43)
97#define MX25_INT_FEC 57 97#define MX25_INT_CAN2 (NR_IRQS_LEGACY + 44)
98#define MX25_INT_UART1 (NR_IRQS_LEGACY + 45)
99#define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51)
100#define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52)
101#define MX25_INT_FEC (NR_IRQS_LEGACY + 57)
98 102
99#define MX25_DMA_REQ_SSI2_RX1 22 103#define MX25_DMA_REQ_SSI2_RX1 22
100#define MX25_DMA_REQ_SSI2_TX1 23 104#define MX25_DMA_REQ_SSI2_TX1 23
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 6265357284d7..e074616d54ca 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -128,69 +128,70 @@
128#define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x)) 128#define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x))
129 129
130/* fixed interrupt numbers */ 130/* fixed interrupt numbers */
131#define MX27_INT_I2C2 1 131#include <asm/irq.h>
132#define MX27_INT_GPT6 2 132#define MX27_INT_I2C2 (NR_IRQS_LEGACY + 1)
133#define MX27_INT_GPT5 3 133#define MX27_INT_GPT6 (NR_IRQS_LEGACY + 2)
134#define MX27_INT_GPT4 4 134#define MX27_INT_GPT5 (NR_IRQS_LEGACY + 3)
135#define MX27_INT_RTIC 5 135#define MX27_INT_GPT4 (NR_IRQS_LEGACY + 4)
136#define MX27_INT_CSPI3 6 136#define MX27_INT_RTIC (NR_IRQS_LEGACY + 5)
137#define MX27_INT_SDHC 7 137#define MX27_INT_CSPI3 (NR_IRQS_LEGACY + 6)
138#define MX27_INT_GPIO 8 138#define MX27_INT_SDHC (NR_IRQS_LEGACY + 7)
139#define MX27_INT_SDHC3 9 139#define MX27_INT_GPIO (NR_IRQS_LEGACY + 8)
140#define MX27_INT_SDHC2 10 140#define MX27_INT_SDHC3 (NR_IRQS_LEGACY + 9)
141#define MX27_INT_SDHC1 11 141#define MX27_INT_SDHC2 (NR_IRQS_LEGACY + 10)
142#define MX27_INT_I2C1 12 142#define MX27_INT_SDHC1 (NR_IRQS_LEGACY + 11)
143#define MX27_INT_SSI2 13 143#define MX27_INT_I2C1 (NR_IRQS_LEGACY + 12)
144#define MX27_INT_SSI1 14 144#define MX27_INT_SSI2 (NR_IRQS_LEGACY + 13)
145#define MX27_INT_CSPI2 15 145#define MX27_INT_SSI1 (NR_IRQS_LEGACY + 14)
146#define MX27_INT_CSPI1 16 146#define MX27_INT_CSPI2 (NR_IRQS_LEGACY + 15)
147#define MX27_INT_UART4 17 147#define MX27_INT_CSPI1 (NR_IRQS_LEGACY + 16)
148#define MX27_INT_UART3 18 148#define MX27_INT_UART4 (NR_IRQS_LEGACY + 17)
149#define MX27_INT_UART2 19 149#define MX27_INT_UART3 (NR_IRQS_LEGACY + 18)
150#define MX27_INT_UART1 20 150#define MX27_INT_UART2 (NR_IRQS_LEGACY + 19)
151#define MX27_INT_KPP 21 151#define MX27_INT_UART1 (NR_IRQS_LEGACY + 20)
152#define MX27_INT_RTC 22 152#define MX27_INT_KPP (NR_IRQS_LEGACY + 21)
153#define MX27_INT_PWM 23 153#define MX27_INT_RTC (NR_IRQS_LEGACY + 22)
154#define MX27_INT_GPT3 24 154#define MX27_INT_PWM (NR_IRQS_LEGACY + 23)
155#define MX27_INT_GPT2 25 155#define MX27_INT_GPT3 (NR_IRQS_LEGACY + 24)
156#define MX27_INT_GPT1 26 156#define MX27_INT_GPT2 (NR_IRQS_LEGACY + 25)
157#define MX27_INT_WDOG 27 157#define MX27_INT_GPT1 (NR_IRQS_LEGACY + 26)
158#define MX27_INT_PCMCIA 28 158#define MX27_INT_WDOG (NR_IRQS_LEGACY + 27)
159#define MX27_INT_NFC 29 159#define MX27_INT_PCMCIA (NR_IRQS_LEGACY + 28)
160#define MX27_INT_ATA 30 160#define MX27_INT_NFC (NR_IRQS_LEGACY + 29)
161#define MX27_INT_CSI 31 161#define MX27_INT_ATA (NR_IRQS_LEGACY + 30)
162#define MX27_INT_DMACH0 32 162#define MX27_INT_CSI (NR_IRQS_LEGACY + 31)
163#define MX27_INT_DMACH1 33 163#define MX27_INT_DMACH0 (NR_IRQS_LEGACY + 32)
164#define MX27_INT_DMACH2 34 164#define MX27_INT_DMACH1 (NR_IRQS_LEGACY + 33)
165#define MX27_INT_DMACH3 35 165#define MX27_INT_DMACH2 (NR_IRQS_LEGACY + 34)
166#define MX27_INT_DMACH4 36 166#define MX27_INT_DMACH3 (NR_IRQS_LEGACY + 35)
167#define MX27_INT_DMACH5 37 167#define MX27_INT_DMACH4 (NR_IRQS_LEGACY + 36)
168#define MX27_INT_DMACH6 38 168#define MX27_INT_DMACH5 (NR_IRQS_LEGACY + 37)
169#define MX27_INT_DMACH7 39 169#define MX27_INT_DMACH6 (NR_IRQS_LEGACY + 38)
170#define MX27_INT_DMACH8 40 170#define MX27_INT_DMACH7 (NR_IRQS_LEGACY + 39)
171#define MX27_INT_DMACH9 41 171#define MX27_INT_DMACH8 (NR_IRQS_LEGACY + 40)
172#define MX27_INT_DMACH10 42 172#define MX27_INT_DMACH9 (NR_IRQS_LEGACY + 41)
173#define MX27_INT_DMACH11 43 173#define MX27_INT_DMACH10 (NR_IRQS_LEGACY + 42)
174#define MX27_INT_DMACH12 44 174#define MX27_INT_DMACH11 (NR_IRQS_LEGACY + 43)
175#define MX27_INT_DMACH13 45 175#define MX27_INT_DMACH12 (NR_IRQS_LEGACY + 44)
176#define MX27_INT_DMACH14 46 176#define MX27_INT_DMACH13 (NR_IRQS_LEGACY + 45)
177#define MX27_INT_DMACH15 47 177#define MX27_INT_DMACH14 (NR_IRQS_LEGACY + 46)
178#define MX27_INT_UART6 48 178#define MX27_INT_DMACH15 (NR_IRQS_LEGACY + 47)
179#define MX27_INT_UART5 49 179#define MX27_INT_UART6 (NR_IRQS_LEGACY + 48)
180#define MX27_INT_FEC 50 180#define MX27_INT_UART5 (NR_IRQS_LEGACY + 49)
181#define MX27_INT_EMMAPRP 51 181#define MX27_INT_FEC (NR_IRQS_LEGACY + 50)
182#define MX27_INT_EMMAPP 52 182#define MX27_INT_EMMAPRP (NR_IRQS_LEGACY + 51)
183#define MX27_INT_VPU 53 183#define MX27_INT_EMMAPP (NR_IRQS_LEGACY + 52)
184#define MX27_INT_USB_HS1 54 184#define MX27_INT_VPU (NR_IRQS_LEGACY + 53)
185#define MX27_INT_USB_HS2 55 185#define MX27_INT_USB_HS1 (NR_IRQS_LEGACY + 54)
186#define MX27_INT_USB_OTG 56 186#define MX27_INT_USB_HS2 (NR_IRQS_LEGACY + 55)
187#define MX27_INT_SCC_SMN 57 187#define MX27_INT_USB_OTG (NR_IRQS_LEGACY + 56)
188#define MX27_INT_SCC_SCM 58 188#define MX27_INT_SCC_SMN (NR_IRQS_LEGACY + 57)
189#define MX27_INT_SAHARA 59 189#define MX27_INT_SCC_SCM (NR_IRQS_LEGACY + 58)
190#define MX27_INT_SLCDC 60 190#define MX27_INT_SAHARA (NR_IRQS_LEGACY + 59)
191#define MX27_INT_LCDC 61 191#define MX27_INT_SLCDC (NR_IRQS_LEGACY + 60)
192#define MX27_INT_IIM 62 192#define MX27_INT_LCDC (NR_IRQS_LEGACY + 61)
193#define MX27_INT_CCM 63 193#define MX27_INT_IIM (NR_IRQS_LEGACY + 62)
194#define MX27_INT_CCM (NR_IRQS_LEGACY + 63)
194 195
195/* fixed DMA request numbers */ 196/* fixed DMA request numbers */
196#define MX27_DMA_REQ_CSPI3_RX 1 197#define MX27_DMA_REQ_CSPI3_RX 1
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
index 6d07839fdec2..11642f5b224c 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -68,49 +68,50 @@
68#define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000) 68#define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000)
69 69
70/* fixed interrupt numbers */ 70/* fixed interrupt numbers */
71#define MX2x_INT_CSPI3 6 71#include <asm/irq.h>
72#define MX2x_INT_GPIO 8 72#define MX2x_INT_CSPI3 (NR_IRQS_LEGACY + 6)
73#define MX2x_INT_SDHC2 10 73#define MX2x_INT_GPIO (NR_IRQS_LEGACY + 8)
74#define MX2x_INT_SDHC1 11 74#define MX2x_INT_SDHC2 (NR_IRQS_LEGACY + 10)
75#define MX2x_INT_I2C 12 75#define MX2x_INT_SDHC1 (NR_IRQS_LEGACY + 11)
76#define MX2x_INT_SSI2 13 76#define MX2x_INT_I2C (NR_IRQS_LEGACY + 12)
77#define MX2x_INT_SSI1 14 77#define MX2x_INT_SSI2 (NR_IRQS_LEGACY + 13)
78#define MX2x_INT_CSPI2 15 78#define MX2x_INT_SSI1 (NR_IRQS_LEGACY + 14)
79#define MX2x_INT_CSPI1 16 79#define MX2x_INT_CSPI2 (NR_IRQS_LEGACY + 15)
80#define MX2x_INT_UART4 17 80#define MX2x_INT_CSPI1 (NR_IRQS_LEGACY + 16)
81#define MX2x_INT_UART3 18 81#define MX2x_INT_UART4 (NR_IRQS_LEGACY + 17)
82#define MX2x_INT_UART2 19 82#define MX2x_INT_UART3 (NR_IRQS_LEGACY + 18)
83#define MX2x_INT_UART1 20 83#define MX2x_INT_UART2 (NR_IRQS_LEGACY + 19)
84#define MX2x_INT_KPP 21 84#define MX2x_INT_UART1 (NR_IRQS_LEGACY + 20)
85#define MX2x_INT_RTC 22 85#define MX2x_INT_KPP (NR_IRQS_LEGACY + 21)
86#define MX2x_INT_PWM 23 86#define MX2x_INT_RTC (NR_IRQS_LEGACY + 22)
87#define MX2x_INT_GPT3 24 87#define MX2x_INT_PWM (NR_IRQS_LEGACY + 23)
88#define MX2x_INT_GPT2 25 88#define MX2x_INT_GPT3 (NR_IRQS_LEGACY + 24)
89#define MX2x_INT_GPT1 26 89#define MX2x_INT_GPT2 (NR_IRQS_LEGACY + 25)
90#define MX2x_INT_WDOG 27 90#define MX2x_INT_GPT1 (NR_IRQS_LEGACY + 26)
91#define MX2x_INT_PCMCIA 28 91#define MX2x_INT_WDOG (NR_IRQS_LEGACY + 27)
92#define MX2x_INT_NANDFC 29 92#define MX2x_INT_PCMCIA (NR_IRQS_LEGACY + 28)
93#define MX2x_INT_CSI 31 93#define MX2x_INT_NANDFC (NR_IRQS_LEGACY + 29)
94#define MX2x_INT_DMACH0 32 94#define MX2x_INT_CSI (NR_IRQS_LEGACY + 31)
95#define MX2x_INT_DMACH1 33 95#define MX2x_INT_DMACH0 (NR_IRQS_LEGACY + 32)
96#define MX2x_INT_DMACH2 34 96#define MX2x_INT_DMACH1 (NR_IRQS_LEGACY + 33)
97#define MX2x_INT_DMACH3 35 97#define MX2x_INT_DMACH2 (NR_IRQS_LEGACY + 34)
98#define MX2x_INT_DMACH4 36 98#define MX2x_INT_DMACH3 (NR_IRQS_LEGACY + 35)
99#define MX2x_INT_DMACH5 37 99#define MX2x_INT_DMACH4 (NR_IRQS_LEGACY + 36)
100#define MX2x_INT_DMACH6 38 100#define MX2x_INT_DMACH5 (NR_IRQS_LEGACY + 37)
101#define MX2x_INT_DMACH7 39 101#define MX2x_INT_DMACH6 (NR_IRQS_LEGACY + 38)
102#define MX2x_INT_DMACH8 40 102#define MX2x_INT_DMACH7 (NR_IRQS_LEGACY + 39)
103#define MX2x_INT_DMACH9 41 103#define MX2x_INT_DMACH8 (NR_IRQS_LEGACY + 40)
104#define MX2x_INT_DMACH10 42 104#define MX2x_INT_DMACH9 (NR_IRQS_LEGACY + 41)
105#define MX2x_INT_DMACH11 43 105#define MX2x_INT_DMACH10 (NR_IRQS_LEGACY + 42)
106#define MX2x_INT_DMACH12 44 106#define MX2x_INT_DMACH11 (NR_IRQS_LEGACY + 43)
107#define MX2x_INT_DMACH13 45 107#define MX2x_INT_DMACH12 (NR_IRQS_LEGACY + 44)
108#define MX2x_INT_DMACH14 46 108#define MX2x_INT_DMACH13 (NR_IRQS_LEGACY + 45)
109#define MX2x_INT_DMACH15 47 109#define MX2x_INT_DMACH14 (NR_IRQS_LEGACY + 46)
110#define MX2x_INT_EMMAPRP 51 110#define MX2x_INT_DMACH15 (NR_IRQS_LEGACY + 47)
111#define MX2x_INT_EMMAPP 52 111#define MX2x_INT_EMMAPRP (NR_IRQS_LEGACY + 51)
112#define MX2x_INT_SLCDC 60 112#define MX2x_INT_EMMAPP (NR_IRQS_LEGACY + 52)
113#define MX2x_INT_LCDC 61 113#define MX2x_INT_SLCDC (NR_IRQS_LEGACY + 60)
114#define MX2x_INT_LCDC (NR_IRQS_LEGACY + 61)
114 115
115/* fixed DMA request numbers */ 116/* fixed DMA request numbers */
116#define MX2x_DMA_REQ_CSPI3_RX 1 117#define MX2x_DMA_REQ_CSPI3_RX 1
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index e27619e442c0..dbced61d9fda 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -118,63 +118,67 @@
118#define MX31_IO_P2V(x) IMX_IO_P2V(x) 118#define MX31_IO_P2V(x) IMX_IO_P2V(x)
119#define MX31_IO_ADDRESS(x) IOMEM(MX31_IO_P2V(x)) 119#define MX31_IO_ADDRESS(x) IOMEM(MX31_IO_P2V(x))
120 120
121#define MX31_INT_I2C3 3 121/*
122#define MX31_INT_I2C2 4 122 * Interrupt numbers
123#define MX31_INT_MPEG4_ENCODER 5 123 */
124#define MX31_INT_RTIC 6 124#include <asm/irq.h>
125#define MX31_INT_FIRI 7 125#define MX31_INT_I2C3 (NR_IRQS_LEGACY + 3)
126#define MX31_INT_SDHC2 8 126#define MX31_INT_I2C2 (NR_IRQS_LEGACY + 4)
127#define MX31_INT_SDHC1 9 127#define MX31_INT_MPEG4_ENCODER (NR_IRQS_LEGACY + 5)
128#define MX31_INT_I2C1 10 128#define MX31_INT_RTIC (NR_IRQS_LEGACY + 6)
129#define MX31_INT_SSI2 11 129#define MX31_INT_FIRI (NR_IRQS_LEGACY + 7)
130#define MX31_INT_SSI1 12 130#define MX31_INT_SDHC2 (NR_IRQS_LEGACY + 8)
131#define MX31_INT_CSPI2 13 131#define MX31_INT_SDHC1 (NR_IRQS_LEGACY + 9)
132#define MX31_INT_CSPI1 14 132#define MX31_INT_I2C1 (NR_IRQS_LEGACY + 10)
133#define MX31_INT_ATA 15 133#define MX31_INT_SSI2 (NR_IRQS_LEGACY + 11)
134#define MX31_INT_MBX 16 134#define MX31_INT_SSI1 (NR_IRQS_LEGACY + 12)
135#define MX31_INT_CSPI3 17 135#define MX31_INT_CSPI2 (NR_IRQS_LEGACY + 13)
136#define MX31_INT_UART3 18 136#define MX31_INT_CSPI1 (NR_IRQS_LEGACY + 14)
137#define MX31_INT_IIM 19 137#define MX31_INT_ATA (NR_IRQS_LEGACY + 15)
138#define MX31_INT_SIM2 20 138#define MX31_INT_MBX (NR_IRQS_LEGACY + 16)
139#define MX31_INT_SIM1 21 139#define MX31_INT_CSPI3 (NR_IRQS_LEGACY + 17)
140#define MX31_INT_RNGA 22 140#define MX31_INT_UART3 (NR_IRQS_LEGACY + 18)
141#define MX31_INT_EVTMON 23 141#define MX31_INT_IIM (NR_IRQS_LEGACY + 19)
142#define MX31_INT_KPP 24 142#define MX31_INT_SIM2 (NR_IRQS_LEGACY + 20)
143#define MX31_INT_RTC 25 143#define MX31_INT_SIM1 (NR_IRQS_LEGACY + 21)
144#define MX31_INT_PWM 26 144#define MX31_INT_RNGA (NR_IRQS_LEGACY + 22)
145#define MX31_INT_EPIT2 27 145#define MX31_INT_EVTMON (NR_IRQS_LEGACY + 23)
146#define MX31_INT_EPIT1 28 146#define MX31_INT_KPP (NR_IRQS_LEGACY + 24)
147#define MX31_INT_GPT 29 147#define MX31_INT_RTC (NR_IRQS_LEGACY + 25)
148#define MX31_INT_POWER_FAIL 30 148#define MX31_INT_PWM (NR_IRQS_LEGACY + 26)
149#define MX31_INT_CCM_DVFS 31 149#define MX31_INT_EPIT2 (NR_IRQS_LEGACY + 27)
150#define MX31_INT_UART2 32 150#define MX31_INT_EPIT1 (NR_IRQS_LEGACY + 28)
151#define MX31_INT_NFC 33 151#define MX31_INT_GPT (NR_IRQS_LEGACY + 29)
152#define MX31_INT_SDMA 34 152#define MX31_INT_POWER_FAIL (NR_IRQS_LEGACY + 30)
153#define MX31_INT_USB_HS1 35 153#define MX31_INT_CCM_DVFS (NR_IRQS_LEGACY + 31)
154#define MX31_INT_USB_HS2 36 154#define MX31_INT_UART2 (NR_IRQS_LEGACY + 32)
155#define MX31_INT_USB_OTG 37 155#define MX31_INT_NFC (NR_IRQS_LEGACY + 33)
156#define MX31_INT_MSHC1 39 156#define MX31_INT_SDMA (NR_IRQS_LEGACY + 34)
157#define MX31_INT_MSHC2 40 157#define MX31_INT_USB_HS1 (NR_IRQS_LEGACY + 35)
158#define MX31_INT_IPU_ERR 41 158#define MX31_INT_USB_HS2 (NR_IRQS_LEGACY + 36)
159#define MX31_INT_IPU_SYN 42 159#define MX31_INT_USB_OTG (NR_IRQS_LEGACY + 37)
160#define MX31_INT_UART1 45 160#define MX31_INT_MSHC1 (NR_IRQS_LEGACY + 39)
161#define MX31_INT_UART4 46 161#define MX31_INT_MSHC2 (NR_IRQS_LEGACY + 40)
162#define MX31_INT_UART5 47 162#define MX31_INT_IPU_ERR (NR_IRQS_LEGACY + 41)
163#define MX31_INT_ECT 48 163#define MX31_INT_IPU_SYN (NR_IRQS_LEGACY + 42)
164#define MX31_INT_SCC_SCM 49 164#define MX31_INT_UART1 (NR_IRQS_LEGACY + 45)
165#define MX31_INT_SCC_SMN 50 165#define MX31_INT_UART4 (NR_IRQS_LEGACY + 46)
166#define MX31_INT_GPIO2 51 166#define MX31_INT_UART5 (NR_IRQS_LEGACY + 47)
167#define MX31_INT_GPIO1 52 167#define MX31_INT_ECT (NR_IRQS_LEGACY + 48)
168#define MX31_INT_CCM 53 168#define MX31_INT_SCC_SCM (NR_IRQS_LEGACY + 49)
169#define MX31_INT_PCMCIA 54 169#define MX31_INT_SCC_SMN (NR_IRQS_LEGACY + 50)
170#define MX31_INT_WDOG 55 170#define MX31_INT_GPIO2 (NR_IRQS_LEGACY + 51)
171#define MX31_INT_GPIO3 56 171#define MX31_INT_GPIO1 (NR_IRQS_LEGACY + 52)
172#define MX31_INT_EXT_POWER 58 172#define MX31_INT_CCM (NR_IRQS_LEGACY + 53)
173#define MX31_INT_EXT_TEMPER 59 173#define MX31_INT_PCMCIA (NR_IRQS_LEGACY + 54)
174#define MX31_INT_EXT_SENSOR60 60 174#define MX31_INT_WDOG (NR_IRQS_LEGACY + 55)
175#define MX31_INT_EXT_SENSOR61 61 175#define MX31_INT_GPIO3 (NR_IRQS_LEGACY + 56)
176#define MX31_INT_EXT_WDOG 62 176#define MX31_INT_EXT_POWER (NR_IRQS_LEGACY + 58)
177#define MX31_INT_EXT_TV 63 177#define MX31_INT_EXT_TEMPER (NR_IRQS_LEGACY + 59)
178#define MX31_INT_EXT_SENSOR60 (NR_IRQS_LEGACY + 60)
179#define MX31_INT_EXT_SENSOR61 (NR_IRQS_LEGACY + 61)
180#define MX31_INT_EXT_WDOG (NR_IRQS_LEGACY + 62)
181#define MX31_INT_EXT_TV (NR_IRQS_LEGACY + 63)
178 182
179#define MX31_DMA_REQ_SDHC1 20 183#define MX31_DMA_REQ_SDHC1 20
180#define MX31_DMA_REQ_SDHC2 21 184#define MX31_DMA_REQ_SDHC2 21
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index 80965a99aa55..2af5d3a699c7 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -120,60 +120,61 @@
120/* 120/*
121 * Interrupt numbers 121 * Interrupt numbers
122 */ 122 */
123#define MX35_INT_OWIRE 2 123#include <asm/irq.h>
124#define MX35_INT_I2C3 3 124#define MX35_INT_OWIRE (NR_IRQS_LEGACY + 2)
125#define MX35_INT_I2C2 4 125#define MX35_INT_I2C3 (NR_IRQS_LEGACY + 3)
126#define MX35_INT_RTIC 6 126#define MX35_INT_I2C2 (NR_IRQS_LEGACY + 4)
127#define MX35_INT_ESDHC1 7 127#define MX35_INT_RTIC (NR_IRQS_LEGACY + 6)
128#define MX35_INT_ESDHC2 8 128#define MX35_INT_ESDHC1 (NR_IRQS_LEGACY + 7)
129#define MX35_INT_ESDHC3 9 129#define MX35_INT_ESDHC2 (NR_IRQS_LEGACY + 8)
130#define MX35_INT_I2C1 10 130#define MX35_INT_ESDHC3 (NR_IRQS_LEGACY + 9)
131#define MX35_INT_SSI1 11 131#define MX35_INT_I2C1 (NR_IRQS_LEGACY + 10)
132#define MX35_INT_SSI2 12 132#define MX35_INT_SSI1 (NR_IRQS_LEGACY + 11)
133#define MX35_INT_CSPI2 13 133#define MX35_INT_SSI2 (NR_IRQS_LEGACY + 12)
134#define MX35_INT_CSPI1 14 134#define MX35_INT_CSPI2 (NR_IRQS_LEGACY + 13)
135#define MX35_INT_ATA 15 135#define MX35_INT_CSPI1 (NR_IRQS_LEGACY + 14)
136#define MX35_INT_GPU2D 16 136#define MX35_INT_ATA (NR_IRQS_LEGACY + 15)
137#define MX35_INT_ASRC 17 137#define MX35_INT_GPU2D (NR_IRQS_LEGACY + 16)
138#define MX35_INT_UART3 18 138#define MX35_INT_ASRC (NR_IRQS_LEGACY + 17)
139#define MX35_INT_IIM 19 139#define MX35_INT_UART3 (NR_IRQS_LEGACY + 18)
140#define MX35_INT_RNGA 22 140#define MX35_INT_IIM (NR_IRQS_LEGACY + 19)
141#define MX35_INT_EVTMON 23 141#define MX35_INT_RNGA (NR_IRQS_LEGACY + 22)
142#define MX35_INT_KPP 24 142#define MX35_INT_EVTMON (NR_IRQS_LEGACY + 23)
143#define MX35_INT_RTC 25 143#define MX35_INT_KPP (NR_IRQS_LEGACY + 24)
144#define MX35_INT_PWM 26 144#define MX35_INT_RTC (NR_IRQS_LEGACY + 25)
145#define MX35_INT_EPIT2 27 145#define MX35_INT_PWM (NR_IRQS_LEGACY + 26)
146#define MX35_INT_EPIT1 28 146#define MX35_INT_EPIT2 (NR_IRQS_LEGACY + 27)
147#define MX35_INT_GPT 29 147#define MX35_INT_EPIT1 (NR_IRQS_LEGACY + 28)
148#define MX35_INT_POWER_FAIL 30 148#define MX35_INT_GPT (NR_IRQS_LEGACY + 29)
149#define MX35_INT_UART2 32 149#define MX35_INT_POWER_FAIL (NR_IRQS_LEGACY + 30)
150#define MX35_INT_NFC 33 150#define MX35_INT_UART2 (NR_IRQS_LEGACY + 32)
151#define MX35_INT_SDMA 34 151#define MX35_INT_NFC (NR_IRQS_LEGACY + 33)
152#define MX35_INT_USB_HS 35 152#define MX35_INT_SDMA (NR_IRQS_LEGACY + 34)
153#define MX35_INT_USB_OTG 37 153#define MX35_INT_USB_HS (NR_IRQS_LEGACY + 35)
154#define MX35_INT_MSHC1 39 154#define MX35_INT_USB_OTG (NR_IRQS_LEGACY + 37)
155#define MX35_INT_ESAI 40 155#define MX35_INT_MSHC1 (NR_IRQS_LEGACY + 39)
156#define MX35_INT_IPU_ERR 41 156#define MX35_INT_ESAI (NR_IRQS_LEGACY + 40)
157#define MX35_INT_IPU_SYN 42 157#define MX35_INT_IPU_ERR (NR_IRQS_LEGACY + 41)
158#define MX35_INT_CAN1 43 158#define MX35_INT_IPU_SYN (NR_IRQS_LEGACY + 42)
159#define MX35_INT_CAN2 44 159#define MX35_INT_CAN1 (NR_IRQS_LEGACY + 43)
160#define MX35_INT_UART1 45 160#define MX35_INT_CAN2 (NR_IRQS_LEGACY + 44)
161#define MX35_INT_MLB 46 161#define MX35_INT_UART1 (NR_IRQS_LEGACY + 45)
162#define MX35_INT_SPDIF 47 162#define MX35_INT_MLB (NR_IRQS_LEGACY + 46)
163#define MX35_INT_ECT 48 163#define MX35_INT_SPDIF (NR_IRQS_LEGACY + 47)
164#define MX35_INT_SCC_SCM 49 164#define MX35_INT_ECT (NR_IRQS_LEGACY + 48)
165#define MX35_INT_SCC_SMN 50 165#define MX35_INT_SCC_SCM (NR_IRQS_LEGACY + 49)
166#define MX35_INT_GPIO2 51 166#define MX35_INT_SCC_SMN (NR_IRQS_LEGACY + 50)
167#define MX35_INT_GPIO1 52 167#define MX35_INT_GPIO2 (NR_IRQS_LEGACY + 51)
168#define MX35_INT_WDOG 55 168#define MX35_INT_GPIO1 (NR_IRQS_LEGACY + 52)
169#define MX35_INT_GPIO3 56 169#define MX35_INT_WDOG (NR_IRQS_LEGACY + 55)
170#define MX35_INT_FEC 57 170#define MX35_INT_GPIO3 (NR_IRQS_LEGACY + 56)
171#define MX35_INT_EXT_POWER 58 171#define MX35_INT_FEC (NR_IRQS_LEGACY + 57)
172#define MX35_INT_EXT_TEMPER 59 172#define MX35_INT_EXT_POWER (NR_IRQS_LEGACY + 58)
173#define MX35_INT_EXT_SENSOR60 60 173#define MX35_INT_EXT_TEMPER (NR_IRQS_LEGACY + 59)
174#define MX35_INT_EXT_SENSOR61 61 174#define MX35_INT_EXT_SENSOR60 (NR_IRQS_LEGACY + 60)
175#define MX35_INT_EXT_WDOG 62 175#define MX35_INT_EXT_SENSOR61 (NR_IRQS_LEGACY + 61)
176#define MX35_INT_EXT_TV 63 176#define MX35_INT_EXT_WDOG (NR_IRQS_LEGACY + 62)
177#define MX35_INT_EXT_TV (NR_IRQS_LEGACY + 63)
177 178
178#define MX35_DMA_REQ_SSI2_RX1 22 179#define MX35_DMA_REQ_SSI2_RX1 22
179#define MX35_DMA_REQ_SSI2_TX1 23 180#define MX35_DMA_REQ_SSI2_TX1 23
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index 30dbf424583e..96fb4fbc8ad7 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -143,44 +143,45 @@
143/* 143/*
144 * Interrupt numbers 144 * Interrupt numbers
145 */ 145 */
146#define MX3x_INT_I2C3 3 146#include <asm/irq.h>
147#define MX3x_INT_I2C2 4 147#define MX3x_INT_I2C3 (NR_IRQS_LEGACY + 3)
148#define MX3x_INT_RTIC 6 148#define MX3x_INT_I2C2 (NR_IRQS_LEGACY + 4)
149#define MX3x_INT_I2C 10 149#define MX3x_INT_RTIC (NR_IRQS_LEGACY + 6)
150#define MX3x_INT_CSPI2 13 150#define MX3x_INT_I2C (NR_IRQS_LEGACY + 10)
151#define MX3x_INT_CSPI1 14 151#define MX3x_INT_CSPI2 (NR_IRQS_LEGACY + 13)
152#define MX3x_INT_ATA 15 152#define MX3x_INT_CSPI1 (NR_IRQS_LEGACY + 14)
153#define MX3x_INT_UART3 18 153#define MX3x_INT_ATA (NR_IRQS_LEGACY + 15)
154#define MX3x_INT_IIM 19 154#define MX3x_INT_UART3 (NR_IRQS_LEGACY + 18)
155#define MX3x_INT_RNGA 22 155#define MX3x_INT_IIM (NR_IRQS_LEGACY + 19)
156#define MX3x_INT_EVTMON 23 156#define MX3x_INT_RNGA (NR_IRQS_LEGACY + 22)
157#define MX3x_INT_KPP 24 157#define MX3x_INT_EVTMON (NR_IRQS_LEGACY + 23)
158#define MX3x_INT_RTC 25 158#define MX3x_INT_KPP (NR_IRQS_LEGACY + 24)
159#define MX3x_INT_PWM 26 159#define MX3x_INT_RTC (NR_IRQS_LEGACY + 25)
160#define MX3x_INT_EPIT2 27 160#define MX3x_INT_PWM (NR_IRQS_LEGACY + 26)
161#define MX3x_INT_EPIT1 28 161#define MX3x_INT_EPIT2 (NR_IRQS_LEGACY + 27)
162#define MX3x_INT_GPT 29 162#define MX3x_INT_EPIT1 (NR_IRQS_LEGACY + 28)
163#define MX3x_INT_POWER_FAIL 30 163#define MX3x_INT_GPT (NR_IRQS_LEGACY + 29)
164#define MX3x_INT_UART2 32 164#define MX3x_INT_POWER_FAIL (NR_IRQS_LEGACY + 30)
165#define MX3x_INT_NANDFC 33 165#define MX3x_INT_UART2 (NR_IRQS_LEGACY + 32)
166#define MX3x_INT_SDMA 34 166#define MX3x_INT_NANDFC (NR_IRQS_LEGACY + 33)
167#define MX3x_INT_MSHC1 39 167#define MX3x_INT_SDMA (NR_IRQS_LEGACY + 34)
168#define MX3x_INT_IPU_ERR 41 168#define MX3x_INT_MSHC1 (NR_IRQS_LEGACY + 39)
169#define MX3x_INT_IPU_SYN 42 169#define MX3x_INT_IPU_ERR (NR_IRQS_LEGACY + 41)
170#define MX3x_INT_UART1 45 170#define MX3x_INT_IPU_SYN (NR_IRQS_LEGACY + 42)
171#define MX3x_INT_ECT 48 171#define MX3x_INT_UART1 (NR_IRQS_LEGACY + 45)
172#define MX3x_INT_SCC_SCM 49 172#define MX3x_INT_ECT (NR_IRQS_LEGACY + 48)
173#define MX3x_INT_SCC_SMN 50 173#define MX3x_INT_SCC_SCM (NR_IRQS_LEGACY + 49)
174#define MX3x_INT_GPIO2 51 174#define MX3x_INT_SCC_SMN (NR_IRQS_LEGACY + 50)
175#define MX3x_INT_GPIO1 52 175#define MX3x_INT_GPIO2 (NR_IRQS_LEGACY + 51)
176#define MX3x_INT_WDOG 55 176#define MX3x_INT_GPIO1 (NR_IRQS_LEGACY + 52)
177#define MX3x_INT_GPIO3 56 177#define MX3x_INT_WDOG (NR_IRQS_LEGACY + 55)
178#define MX3x_INT_EXT_POWER 58 178#define MX3x_INT_GPIO3 (NR_IRQS_LEGACY + 56)
179#define MX3x_INT_EXT_TEMPER 59 179#define MX3x_INT_EXT_POWER (NR_IRQS_LEGACY + 58)
180#define MX3x_INT_EXT_SENSOR60 60 180#define MX3x_INT_EXT_TEMPER (NR_IRQS_LEGACY + 59)
181#define MX3x_INT_EXT_SENSOR61 61 181#define MX3x_INT_EXT_SENSOR60 (NR_IRQS_LEGACY + 60)
182#define MX3x_INT_EXT_WDOG 62 182#define MX3x_INT_EXT_SENSOR61 (NR_IRQS_LEGACY + 61)
183#define MX3x_INT_EXT_TV 63 183#define MX3x_INT_EXT_WDOG (NR_IRQS_LEGACY + 62)
184#define MX3x_INT_EXT_TV (NR_IRQS_LEGACY + 63)
184 185
185#define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */ 186#define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */
186 187
diff --git a/arch/arm/plat-mxc/include/mach/mx50.h b/arch/arm/plat-mxc/include/mach/mx50.h
index 5f2da75a47f4..09ac19c1570c 100644
--- a/arch/arm/plat-mxc/include/mach/mx50.h
+++ b/arch/arm/plat-mxc/include/mach/mx50.h
@@ -188,99 +188,100 @@
188/* 188/*
189 * Interrupt numbers 189 * Interrupt numbers
190 */ 190 */
191#define MX50_INT_MMC_SDHC1 1 191#include <asm/irq.h>
192#define MX50_INT_MMC_SDHC2 2 192#define MX50_INT_MMC_SDHC1 (NR_IRQS_LEGACY + 1)
193#define MX50_INT_MMC_SDHC3 3 193#define MX50_INT_MMC_SDHC2 (NR_IRQS_LEGACY + 2)
194#define MX50_INT_MMC_SDHC4 4 194#define MX50_INT_MMC_SDHC3 (NR_IRQS_LEGACY + 3)
195#define MX50_INT_DAP 5 195#define MX50_INT_MMC_SDHC4 (NR_IRQS_LEGACY + 4)
196#define MX50_INT_SDMA 6 196#define MX50_INT_DAP (NR_IRQS_LEGACY + 5)
197#define MX50_INT_IOMUX 7 197#define MX50_INT_SDMA (NR_IRQS_LEGACY + 6)
198#define MX50_INT_UART4 13 198#define MX50_INT_IOMUX (NR_IRQS_LEGACY + 7)
199#define MX50_INT_USB_H1 14 199#define MX50_INT_UART4 (NR_IRQS_LEGACY + 13)
200#define MX50_INT_USB_OTG 18 200#define MX50_INT_USB_H1 (NR_IRQS_LEGACY + 14)
201#define MX50_INT_DATABAHN 19 201#define MX50_INT_USB_OTG (NR_IRQS_LEGACY + 18)
202#define MX50_INT_ELCDIF 20 202#define MX50_INT_DATABAHN (NR_IRQS_LEGACY + 19)
203#define MX50_INT_EPXP 21 203#define MX50_INT_ELCDIF (NR_IRQS_LEGACY + 20)
204#define MX50_INT_SRTC_NTZ 24 204#define MX50_INT_EPXP (NR_IRQS_LEGACY + 21)
205#define MX50_INT_SRTC_TZ 25 205#define MX50_INT_SRTC_NTZ (NR_IRQS_LEGACY + 24)
206#define MX50_INT_EPDC 27 206#define MX50_INT_SRTC_TZ (NR_IRQS_LEGACY + 25)
207#define MX50_INT_NIC 28 207#define MX50_INT_EPDC (NR_IRQS_LEGACY + 27)
208#define MX50_INT_SSI1 29 208#define MX50_INT_NIC (NR_IRQS_LEGACY + 28)
209#define MX50_INT_SSI2 30 209#define MX50_INT_SSI1 (NR_IRQS_LEGACY + 29)
210#define MX50_INT_UART1 31 210#define MX50_INT_SSI2 (NR_IRQS_LEGACY + 30)
211#define MX50_INT_UART2 32 211#define MX50_INT_UART1 (NR_IRQS_LEGACY + 31)
212#define MX50_INT_UART3 33 212#define MX50_INT_UART2 (NR_IRQS_LEGACY + 32)
213#define MX50_INT_RESV34 34 213#define MX50_INT_UART3 (NR_IRQS_LEGACY + 33)
214#define MX50_INT_RESV35 35 214#define MX50_INT_RESV34 (NR_IRQS_LEGACY + 34)
215#define MX50_INT_CSPI1 36 215#define MX50_INT_RESV35 (NR_IRQS_LEGACY + 35)
216#define MX50_INT_CSPI2 37 216#define MX50_INT_CSPI1 (NR_IRQS_LEGACY + 36)
217#define MX50_INT_CSPI 38 217#define MX50_INT_CSPI2 (NR_IRQS_LEGACY + 37)
218#define MX50_INT_GPT 39 218#define MX50_INT_CSPI (NR_IRQS_LEGACY + 38)
219#define MX50_INT_EPIT1 40 219#define MX50_INT_GPT (NR_IRQS_LEGACY + 39)
220#define MX50_INT_GPIO1_INT7 42 220#define MX50_INT_EPIT1 (NR_IRQS_LEGACY + 40)
221#define MX50_INT_GPIO1_INT6 43 221#define MX50_INT_GPIO1_INT7 (NR_IRQS_LEGACY + 42)
222#define MX50_INT_GPIO1_INT5 44 222#define MX50_INT_GPIO1_INT6 (NR_IRQS_LEGACY + 43)
223#define MX50_INT_GPIO1_INT4 45 223#define MX50_INT_GPIO1_INT5 (NR_IRQS_LEGACY + 44)
224#define MX50_INT_GPIO1_INT3 46 224#define MX50_INT_GPIO1_INT4 (NR_IRQS_LEGACY + 45)
225#define MX50_INT_GPIO1_INT2 47 225#define MX50_INT_GPIO1_INT3 (NR_IRQS_LEGACY + 46)
226#define MX50_INT_GPIO1_INT1 48 226#define MX50_INT_GPIO1_INT2 (NR_IRQS_LEGACY + 47)
227#define MX50_INT_GPIO1_INT0 49 227#define MX50_INT_GPIO1_INT1 (NR_IRQS_LEGACY + 48)
228#define MX50_INT_GPIO1_LOW 50 228#define MX50_INT_GPIO1_INT0 (NR_IRQS_LEGACY + 49)
229#define MX50_INT_GPIO1_HIGH 51 229#define MX50_INT_GPIO1_LOW (NR_IRQS_LEGACY + 50)
230#define MX50_INT_GPIO2_LOW 52 230#define MX50_INT_GPIO1_HIGH (NR_IRQS_LEGACY + 51)
231#define MX50_INT_GPIO2_HIGH 53 231#define MX50_INT_GPIO2_LOW (NR_IRQS_LEGACY + 52)
232#define MX50_INT_GPIO3_LOW 54 232#define MX50_INT_GPIO2_HIGH (NR_IRQS_LEGACY + 53)
233#define MX50_INT_GPIO3_HIGH 55 233#define MX50_INT_GPIO3_LOW (NR_IRQS_LEGACY + 54)
234#define MX50_INT_GPIO4_LOW 56 234#define MX50_INT_GPIO3_HIGH (NR_IRQS_LEGACY + 55)
235#define MX50_INT_GPIO4_HIGH 57 235#define MX50_INT_GPIO4_LOW (NR_IRQS_LEGACY + 56)
236#define MX50_INT_WDOG1 58 236#define MX50_INT_GPIO4_HIGH (NR_IRQS_LEGACY + 57)
237#define MX50_INT_KPP 60 237#define MX50_INT_WDOG1 (NR_IRQS_LEGACY + 58)
238#define MX50_INT_PWM1 61 238#define MX50_INT_KPP (NR_IRQS_LEGACY + 60)
239#define MX50_INT_I2C1 62 239#define MX50_INT_PWM1 (NR_IRQS_LEGACY + 61)
240#define MX50_INT_I2C2 63 240#define MX50_INT_I2C1 (NR_IRQS_LEGACY + 62)
241#define MX50_INT_I2C3 64 241#define MX50_INT_I2C2 (NR_IRQS_LEGACY + 63)
242#define MX50_INT_RESV65 65 242#define MX50_INT_I2C3 (NR_IRQS_LEGACY + 64)
243#define MX50_INT_DCDC 66 243#define MX50_INT_RESV65 (NR_IRQS_LEGACY + 65)
244#define MX50_INT_THERMAL_ALARM 67 244#define MX50_INT_DCDC (NR_IRQS_LEGACY + 66)
245#define MX50_INT_ANA3 68 245#define MX50_INT_THERMAL_ALARM (NR_IRQS_LEGACY + 67)
246#define MX50_INT_ANA4 69 246#define MX50_INT_ANA3 (NR_IRQS_LEGACY + 68)
247#define MX50_INT_CCM1 71 247#define MX50_INT_ANA4 (NR_IRQS_LEGACY + 69)
248#define MX50_INT_CCM2 72 248#define MX50_INT_CCM1 (NR_IRQS_LEGACY + 71)
249#define MX50_INT_GPC1 73 249#define MX50_INT_CCM2 (NR_IRQS_LEGACY + 72)
250#define MX50_INT_GPC2 74 250#define MX50_INT_GPC1 (NR_IRQS_LEGACY + 73)
251#define MX50_INT_SRC 75 251#define MX50_INT_GPC2 (NR_IRQS_LEGACY + 74)
252#define MX50_INT_NM 76 252#define MX50_INT_SRC (NR_IRQS_LEGACY + 75)
253#define MX50_INT_PMU 77 253#define MX50_INT_NM (NR_IRQS_LEGACY + 76)
254#define MX50_INT_CTI_IRQ 78 254#define MX50_INT_PMU (NR_IRQS_LEGACY + 77)
255#define MX50_INT_CTI1_TG0 79 255#define MX50_INT_CTI_IRQ (NR_IRQS_LEGACY + 78)
256#define MX50_INT_CTI1_TG1 80 256#define MX50_INT_CTI1_TG0 (NR_IRQS_LEGACY + 79)
257#define MX50_INT_GPU2_IRQ 84 257#define MX50_INT_CTI1_TG1 (NR_IRQS_LEGACY + 80)
258#define MX50_INT_GPU2_BUSY 85 258#define MX50_INT_GPU2_IRQ (NR_IRQS_LEGACY + 84)
259#define MX50_INT_UART5 86 259#define MX50_INT_GPU2_BUSY (NR_IRQS_LEGACY + 85)
260#define MX50_INT_FEC 87 260#define MX50_INT_UART5 (NR_IRQS_LEGACY + 86)
261#define MX50_INT_OWIRE 88 261#define MX50_INT_FEC (NR_IRQS_LEGACY + 87)
262#define MX50_INT_CTI1_TG2 89 262#define MX50_INT_OWIRE (NR_IRQS_LEGACY + 88)
263#define MX50_INT_SJC 90 263#define MX50_INT_CTI1_TG2 (NR_IRQS_LEGACY + 89)
264#define MX50_INT_DCP_CHAN1_3 91 264#define MX50_INT_SJC (NR_IRQS_LEGACY + 90)
265#define MX50_INT_DCP_CHAN0 92 265#define MX50_INT_DCP_CHAN1_3 (NR_IRQS_LEGACY + 91)
266#define MX50_INT_PWM2 94 266#define MX50_INT_DCP_CHAN0 (NR_IRQS_LEGACY + 92)
267#define MX50_INT_RNGB 97 267#define MX50_INT_PWM2 (NR_IRQS_LEGACY + 94)
268#define MX50_INT_CTI1_TG3 98 268#define MX50_INT_RNGB (NR_IRQS_LEGACY + 97)
269#define MX50_INT_RAWNAND_BCH 100 269#define MX50_INT_CTI1_TG3 (NR_IRQS_LEGACY + 98)
270#define MX50_INT_RAWNAND_GPMI 102 270#define MX50_INT_RAWNAND_BCH (NR_IRQS_LEGACY + 100)
271#define MX50_INT_GPIO5_LOW 103 271#define MX50_INT_RAWNAND_GPMI (NR_IRQS_LEGACY + 102)
272#define MX50_INT_GPIO5_HIGH 104 272#define MX50_INT_GPIO5_LOW (NR_IRQS_LEGACY + 103)
273#define MX50_INT_GPIO6_LOW 105 273#define MX50_INT_GPIO5_HIGH (NR_IRQS_LEGACY + 104)
274#define MX50_INT_GPIO6_HIGH 106 274#define MX50_INT_GPIO6_LOW (NR_IRQS_LEGACY + 105)
275#define MX50_INT_MSHC 109 275#define MX50_INT_GPIO6_HIGH (NR_IRQS_LEGACY + 106)
276#define MX50_INT_APBHDMA_CHAN0 110 276#define MX50_INT_MSHC (NR_IRQS_LEGACY + 109)
277#define MX50_INT_APBHDMA_CHAN1 111 277#define MX50_INT_APBHDMA_CHAN0 (NR_IRQS_LEGACY + 110)
278#define MX50_INT_APBHDMA_CHAN2 112 278#define MX50_INT_APBHDMA_CHAN1 (NR_IRQS_LEGACY + 111)
279#define MX50_INT_APBHDMA_CHAN3 113 279#define MX50_INT_APBHDMA_CHAN2 (NR_IRQS_LEGACY + 112)
280#define MX50_INT_APBHDMA_CHAN4 114 280#define MX50_INT_APBHDMA_CHAN3 (NR_IRQS_LEGACY + 113)
281#define MX50_INT_APBHDMA_CHAN5 115 281#define MX50_INT_APBHDMA_CHAN4 (NR_IRQS_LEGACY + 114)
282#define MX50_INT_APBHDMA_CHAN6 116 282#define MX50_INT_APBHDMA_CHAN5 (NR_IRQS_LEGACY + 115)
283#define MX50_INT_APBHDMA_CHAN7 117 283#define MX50_INT_APBHDMA_CHAN6 (NR_IRQS_LEGACY + 116)
284#define MX50_INT_APBHDMA_CHAN7 (NR_IRQS_LEGACY + 117)
284 285
285#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 286#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
286extern int mx50_revision(void); 287extern int mx50_revision(void);
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
index cdf07c65ec1e..af844f76261a 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -232,110 +232,111 @@
232/* 232/*
233 * Interrupt numbers 233 * Interrupt numbers
234 */ 234 */
235#define MX51_INT_BASE 0 235#include <asm/irq.h>
236#define MX51_INT_RESV0 0 236#define MX51_INT_BASE (NR_IRQS_LEGACY + 0)
237#define MX51_INT_ESDHC1 1 237#define MX51_INT_RESV0 (NR_IRQS_LEGACY + 0)
238#define MX51_INT_ESDHC2 2 238#define MX51_INT_ESDHC1 (NR_IRQS_LEGACY + 1)
239#define MX51_INT_ESDHC3 3 239#define MX51_INT_ESDHC2 (NR_IRQS_LEGACY + 2)
240#define MX51_INT_ESDHC4 4 240#define MX51_INT_ESDHC3 (NR_IRQS_LEGACY + 3)
241#define MX51_INT_RESV5 5 241#define MX51_INT_ESDHC4 (NR_IRQS_LEGACY + 4)
242#define MX51_INT_SDMA 6 242#define MX51_INT_RESV5 (NR_IRQS_LEGACY + 5)
243#define MX51_INT_IOMUX 7 243#define MX51_INT_SDMA (NR_IRQS_LEGACY + 6)
244#define MX51_INT_NFC 8 244#define MX51_INT_IOMUX (NR_IRQS_LEGACY + 7)
245#define MX51_INT_VPU 9 245#define MX51_INT_NFC (NR_IRQS_LEGACY + 8)
246#define MX51_INT_IPU_ERR 10 246#define MX51_INT_VPU (NR_IRQS_LEGACY + 9)
247#define MX51_INT_IPU_SYN 11 247#define MX51_INT_IPU_ERR (NR_IRQS_LEGACY + 10)
248#define MX51_INT_GPU 12 248#define MX51_INT_IPU_SYN (NR_IRQS_LEGACY + 11)
249#define MX51_INT_RESV13 13 249#define MX51_INT_GPU (NR_IRQS_LEGACY + 12)
250#define MX51_INT_USB_HS1 14 250#define MX51_INT_RESV13 (NR_IRQS_LEGACY + 13)
251#define MX51_INT_EMI 15 251#define MX51_INT_USB_HS1 (NR_IRQS_LEGACY + 14)
252#define MX51_INT_USB_HS2 16 252#define MX51_INT_EMI (NR_IRQS_LEGACY + 15)
253#define MX51_INT_USB_HS3 17 253#define MX51_INT_USB_HS2 (NR_IRQS_LEGACY + 16)
254#define MX51_INT_USB_OTG 18 254#define MX51_INT_USB_HS3 (NR_IRQS_LEGACY + 17)
255#define MX51_INT_SAHARA_H0 19 255#define MX51_INT_USB_OTG (NR_IRQS_LEGACY + 18)
256#define MX51_INT_SAHARA_H1 20 256#define MX51_INT_SAHARA_H0 (NR_IRQS_LEGACY + 19)
257#define MX51_INT_SCC_SMN 21 257#define MX51_INT_SAHARA_H1 (NR_IRQS_LEGACY + 20)
258#define MX51_INT_SCC_STZ 22 258#define MX51_INT_SCC_SMN (NR_IRQS_LEGACY + 21)
259#define MX51_INT_SCC_SCM 23 259#define MX51_INT_SCC_STZ (NR_IRQS_LEGACY + 22)
260#define MX51_INT_SRTC_NTZ 24 260#define MX51_INT_SCC_SCM (NR_IRQS_LEGACY + 23)
261#define MX51_INT_SRTC_TZ 25 261#define MX51_INT_SRTC_NTZ (NR_IRQS_LEGACY + 24)
262#define MX51_INT_RTIC 26 262#define MX51_INT_SRTC_TZ (NR_IRQS_LEGACY + 25)
263#define MX51_INT_CSU 27 263#define MX51_INT_RTIC (NR_IRQS_LEGACY + 26)
264#define MX51_INT_SLIM_B 28 264#define MX51_INT_CSU (NR_IRQS_LEGACY + 27)
265#define MX51_INT_SSI1 29 265#define MX51_INT_SLIM_B (NR_IRQS_LEGACY + 28)
266#define MX51_INT_SSI2 30 266#define MX51_INT_SSI1 (NR_IRQS_LEGACY + 29)
267#define MX51_INT_UART1 31 267#define MX51_INT_SSI2 (NR_IRQS_LEGACY + 30)
268#define MX51_INT_UART2 32 268#define MX51_INT_UART1 (NR_IRQS_LEGACY + 31)
269#define MX51_INT_UART3 33 269#define MX51_INT_UART2 (NR_IRQS_LEGACY + 32)
270#define MX51_INT_RESV34 34 270#define MX51_INT_UART3 (NR_IRQS_LEGACY + 33)
271#define MX51_INT_RESV35 35 271#define MX51_INT_RESV34 (NR_IRQS_LEGACY + 34)
272#define MX51_INT_ECSPI1 36 272#define MX51_INT_RESV35 (NR_IRQS_LEGACY + 35)
273#define MX51_INT_ECSPI2 37 273#define MX51_INT_ECSPI1 (NR_IRQS_LEGACY + 36)
274#define MX51_INT_CSPI 38 274#define MX51_INT_ECSPI2 (NR_IRQS_LEGACY + 37)
275#define MX51_INT_GPT 39 275#define MX51_INT_CSPI (NR_IRQS_LEGACY + 38)
276#define MX51_INT_EPIT1 40 276#define MX51_INT_GPT (NR_IRQS_LEGACY + 39)
277#define MX51_INT_EPIT2 41 277#define MX51_INT_EPIT1 (NR_IRQS_LEGACY + 40)
278#define MX51_INT_GPIO1_INT7 42 278#define MX51_INT_EPIT2 (NR_IRQS_LEGACY + 41)
279#define MX51_INT_GPIO1_INT6 43 279#define MX51_INT_GPIO1_INT7 (NR_IRQS_LEGACY + 42)
280#define MX51_INT_GPIO1_INT5 44 280#define MX51_INT_GPIO1_INT6 (NR_IRQS_LEGACY + 43)
281#define MX51_INT_GPIO1_INT4 45 281#define MX51_INT_GPIO1_INT5 (NR_IRQS_LEGACY + 44)
282#define MX51_INT_GPIO1_INT3 46 282#define MX51_INT_GPIO1_INT4 (NR_IRQS_LEGACY + 45)
283#define MX51_INT_GPIO1_INT2 47 283#define MX51_INT_GPIO1_INT3 (NR_IRQS_LEGACY + 46)
284#define MX51_INT_GPIO1_INT1 48 284#define MX51_INT_GPIO1_INT2 (NR_IRQS_LEGACY + 47)
285#define MX51_INT_GPIO1_INT0 49 285#define MX51_INT_GPIO1_INT1 (NR_IRQS_LEGACY + 48)
286#define MX51_INT_GPIO1_LOW 50 286#define MX51_INT_GPIO1_INT0 (NR_IRQS_LEGACY + 49)
287#define MX51_INT_GPIO1_HIGH 51 287#define MX51_INT_GPIO1_LOW (NR_IRQS_LEGACY + 50)
288#define MX51_INT_GPIO2_LOW 52 288#define MX51_INT_GPIO1_HIGH (NR_IRQS_LEGACY + 51)
289#define MX51_INT_GPIO2_HIGH 53 289#define MX51_INT_GPIO2_LOW (NR_IRQS_LEGACY + 52)
290#define MX51_INT_GPIO3_LOW 54 290#define MX51_INT_GPIO2_HIGH (NR_IRQS_LEGACY + 53)
291#define MX51_INT_GPIO3_HIGH 55 291#define MX51_INT_GPIO3_LOW (NR_IRQS_LEGACY + 54)
292#define MX51_INT_GPIO4_LOW 56 292#define MX51_INT_GPIO3_HIGH (NR_IRQS_LEGACY + 55)
293#define MX51_INT_GPIO4_HIGH 57 293#define MX51_INT_GPIO4_LOW (NR_IRQS_LEGACY + 56)
294#define MX51_INT_WDOG1 58 294#define MX51_INT_GPIO4_HIGH (NR_IRQS_LEGACY + 57)
295#define MX51_INT_WDOG2 59 295#define MX51_INT_WDOG1 (NR_IRQS_LEGACY + 58)
296#define MX51_INT_KPP 60 296#define MX51_INT_WDOG2 (NR_IRQS_LEGACY + 59)
297#define MX51_INT_PWM1 61 297#define MX51_INT_KPP (NR_IRQS_LEGACY + 60)
298#define MX51_INT_I2C1 62 298#define MX51_INT_PWM1 (NR_IRQS_LEGACY + 61)
299#define MX51_INT_I2C2 63 299#define MX51_INT_I2C1 (NR_IRQS_LEGACY + 62)
300#define MX51_INT_HS_I2C 64 300#define MX51_INT_I2C2 (NR_IRQS_LEGACY + 63)
301#define MX51_INT_RESV65 65 301#define MX51_INT_HS_I2C (NR_IRQS_LEGACY + 64)
302#define MX51_INT_RESV66 66 302#define MX51_INT_RESV65 (NR_IRQS_LEGACY + 65)
303#define MX51_INT_SIM_IPB 67 303#define MX51_INT_RESV66 (NR_IRQS_LEGACY + 66)
304#define MX51_INT_SIM_DAT 68 304#define MX51_INT_SIM_IPB (NR_IRQS_LEGACY + 67)
305#define MX51_INT_IIM 69 305#define MX51_INT_SIM_DAT (NR_IRQS_LEGACY + 68)
306#define MX51_INT_ATA 70 306#define MX51_INT_IIM (NR_IRQS_LEGACY + 69)
307#define MX51_INT_CCM1 71 307#define MX51_INT_ATA (NR_IRQS_LEGACY + 70)
308#define MX51_INT_CCM2 72 308#define MX51_INT_CCM1 (NR_IRQS_LEGACY + 71)
309#define MX51_INT_GPC1 73 309#define MX51_INT_CCM2 (NR_IRQS_LEGACY + 72)
310#define MX51_INT_GPC2 74 310#define MX51_INT_GPC1 (NR_IRQS_LEGACY + 73)
311#define MX51_INT_SRC 75 311#define MX51_INT_GPC2 (NR_IRQS_LEGACY + 74)
312#define MX51_INT_NM 76 312#define MX51_INT_SRC (NR_IRQS_LEGACY + 75)
313#define MX51_INT_PMU 77 313#define MX51_INT_NM (NR_IRQS_LEGACY + 76)
314#define MX51_INT_CTI_IRQ 78 314#define MX51_INT_PMU (NR_IRQS_LEGACY + 77)
315#define MX51_INT_CTI1_TG0 79 315#define MX51_INT_CTI_IRQ (NR_IRQS_LEGACY + 78)
316#define MX51_INT_CTI1_TG1 80 316#define MX51_INT_CTI1_TG0 (NR_IRQS_LEGACY + 79)
317#define MX51_INT_MCG_ERR 81 317#define MX51_INT_CTI1_TG1 (NR_IRQS_LEGACY + 80)
318#define MX51_INT_MCG_TMR 82 318#define MX51_INT_MCG_ERR (NR_IRQS_LEGACY + 81)
319#define MX51_INT_MCG_FUNC 83 319#define MX51_INT_MCG_TMR (NR_IRQS_LEGACY + 82)
320#define MX51_INT_GPU2_IRQ 84 320#define MX51_INT_MCG_FUNC (NR_IRQS_LEGACY + 83)
321#define MX51_INT_GPU2_BUSY 85 321#define MX51_INT_GPU2_IRQ (NR_IRQS_LEGACY + 84)
322#define MX51_INT_RESV86 86 322#define MX51_INT_GPU2_BUSY (NR_IRQS_LEGACY + 85)
323#define MX51_INT_FEC 87 323#define MX51_INT_RESV86 (NR_IRQS_LEGACY + 86)
324#define MX51_INT_OWIRE 88 324#define MX51_INT_FEC (NR_IRQS_LEGACY + 87)
325#define MX51_INT_CTI1_TG2 89 325#define MX51_INT_OWIRE (NR_IRQS_LEGACY + 88)
326#define MX51_INT_SJC 90 326#define MX51_INT_CTI1_TG2 (NR_IRQS_LEGACY + 89)
327#define MX51_INT_SPDIF 91 327#define MX51_INT_SJC (NR_IRQS_LEGACY + 90)
328#define MX51_INT_TVE 92 328#define MX51_INT_SPDIF (NR_IRQS_LEGACY + 91)
329#define MX51_INT_FIRI 93 329#define MX51_INT_TVE (NR_IRQS_LEGACY + 92)
330#define MX51_INT_PWM2 94 330#define MX51_INT_FIRI (NR_IRQS_LEGACY + 93)
331#define MX51_INT_SLIM_EXP 95 331#define MX51_INT_PWM2 (NR_IRQS_LEGACY + 94)
332#define MX51_INT_SSI3 96 332#define MX51_INT_SLIM_EXP (NR_IRQS_LEGACY + 95)
333#define MX51_INT_EMI_BOOT 97 333#define MX51_INT_SSI3 (NR_IRQS_LEGACY + 96)
334#define MX51_INT_CTI1_TG3 98 334#define MX51_INT_EMI_BOOT (NR_IRQS_LEGACY + 97)
335#define MX51_INT_SMC_RX 99 335#define MX51_INT_CTI1_TG3 (NR_IRQS_LEGACY + 98)
336#define MX51_INT_VPU_IDLE 100 336#define MX51_INT_SMC_RX (NR_IRQS_LEGACY + 99)
337#define MX51_INT_EMI_NFC 101 337#define MX51_INT_VPU_IDLE (NR_IRQS_LEGACY + 100)
338#define MX51_INT_GPU_IDLE 102 338#define MX51_INT_EMI_NFC (NR_IRQS_LEGACY + 101)
339#define MX51_INT_GPU_IDLE (NR_IRQS_LEGACY + 102)
339 340
340#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 341#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
341extern int mx51_revision(void); 342extern int mx51_revision(void);
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index a37e8c353994..f829d1c22501 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -229,113 +229,114 @@
229/* 229/*
230 * Interrupt numbers 230 * Interrupt numbers
231 */ 231 */
232#define MX53_INT_RESV0 0 232#include <asm/irq.h>
233#define MX53_INT_ESDHC1 1 233#define MX53_INT_RESV0 (NR_IRQS_LEGACY + 0)
234#define MX53_INT_ESDHC2 2 234#define MX53_INT_ESDHC1 (NR_IRQS_LEGACY + 1)
235#define MX53_INT_ESDHC3 3 235#define MX53_INT_ESDHC2 (NR_IRQS_LEGACY + 2)
236#define MX53_INT_ESDHC4 4 236#define MX53_INT_ESDHC3 (NR_IRQS_LEGACY + 3)
237#define MX53_INT_DAP 5 237#define MX53_INT_ESDHC4 (NR_IRQS_LEGACY + 4)
238#define MX53_INT_SDMA 6 238#define MX53_INT_DAP (NR_IRQS_LEGACY + 5)
239#define MX53_INT_IOMUX 7 239#define MX53_INT_SDMA (NR_IRQS_LEGACY + 6)
240#define MX53_INT_NFC 8 240#define MX53_INT_IOMUX (NR_IRQS_LEGACY + 7)
241#define MX53_INT_VPU 9 241#define MX53_INT_NFC (NR_IRQS_LEGACY + 8)
242#define MX53_INT_IPU_ERR 10 242#define MX53_INT_VPU (NR_IRQS_LEGACY + 9)
243#define MX53_INT_IPU_SYN 11 243#define MX53_INT_IPU_ERR (NR_IRQS_LEGACY + 10)
244#define MX53_INT_GPU 12 244#define MX53_INT_IPU_SYN (NR_IRQS_LEGACY + 11)
245#define MX53_INT_UART4 13 245#define MX53_INT_GPU (NR_IRQS_LEGACY + 12)
246#define MX53_INT_USB_H1 14 246#define MX53_INT_UART4 (NR_IRQS_LEGACY + 13)
247#define MX53_INT_EMI 15 247#define MX53_INT_USB_H1 (NR_IRQS_LEGACY + 14)
248#define MX53_INT_USB_H2 16 248#define MX53_INT_EMI (NR_IRQS_LEGACY + 15)
249#define MX53_INT_USB_H3 17 249#define MX53_INT_USB_H2 (NR_IRQS_LEGACY + 16)
250#define MX53_INT_USB_OTG 18 250#define MX53_INT_USB_H3 (NR_IRQS_LEGACY + 17)
251#define MX53_INT_SAHARA_H0 19 251#define MX53_INT_USB_OTG (NR_IRQS_LEGACY + 18)
252#define MX53_INT_SAHARA_H1 20 252#define MX53_INT_SAHARA_H0 (NR_IRQS_LEGACY + 19)
253#define MX53_INT_SCC_SMN 21 253#define MX53_INT_SAHARA_H1 (NR_IRQS_LEGACY + 20)
254#define MX53_INT_SCC_STZ 22 254#define MX53_INT_SCC_SMN (NR_IRQS_LEGACY + 21)
255#define MX53_INT_SCC_SCM 23 255#define MX53_INT_SCC_STZ (NR_IRQS_LEGACY + 22)
256#define MX53_INT_SRTC_NTZ 24 256#define MX53_INT_SCC_SCM (NR_IRQS_LEGACY + 23)
257#define MX53_INT_SRTC_TZ 25 257#define MX53_INT_SRTC_NTZ (NR_IRQS_LEGACY + 24)
258#define MX53_INT_RTIC 26 258#define MX53_INT_SRTC_TZ (NR_IRQS_LEGACY + 25)
259#define MX53_INT_CSU 27 259#define MX53_INT_RTIC (NR_IRQS_LEGACY + 26)
260#define MX53_INT_SATA 28 260#define MX53_INT_CSU (NR_IRQS_LEGACY + 27)
261#define MX53_INT_SSI1 29 261#define MX53_INT_SATA (NR_IRQS_LEGACY + 28)
262#define MX53_INT_SSI2 30 262#define MX53_INT_SSI1 (NR_IRQS_LEGACY + 29)
263#define MX53_INT_UART1 31 263#define MX53_INT_SSI2 (NR_IRQS_LEGACY + 30)
264#define MX53_INT_UART2 32 264#define MX53_INT_UART1 (NR_IRQS_LEGACY + 31)
265#define MX53_INT_UART3 33 265#define MX53_INT_UART2 (NR_IRQS_LEGACY + 32)
266#define MX53_INT_RTC 34 266#define MX53_INT_UART3 (NR_IRQS_LEGACY + 33)
267#define MX53_INT_PTP 35 267#define MX53_INT_RTC (NR_IRQS_LEGACY + 34)
268#define MX53_INT_ECSPI1 36 268#define MX53_INT_PTP (NR_IRQS_LEGACY + 35)
269#define MX53_INT_ECSPI2 37 269#define MX53_INT_ECSPI1 (NR_IRQS_LEGACY + 36)
270#define MX53_INT_CSPI 38 270#define MX53_INT_ECSPI2 (NR_IRQS_LEGACY + 37)
271#define MX53_INT_GPT 39 271#define MX53_INT_CSPI (NR_IRQS_LEGACY + 38)
272#define MX53_INT_EPIT1 40 272#define MX53_INT_GPT (NR_IRQS_LEGACY + 39)
273#define MX53_INT_EPIT2 41 273#define MX53_INT_EPIT1 (NR_IRQS_LEGACY + 40)
274#define MX53_INT_GPIO1_INT7 42 274#define MX53_INT_EPIT2 (NR_IRQS_LEGACY + 41)
275#define MX53_INT_GPIO1_INT6 43 275#define MX53_INT_GPIO1_INT7 (NR_IRQS_LEGACY + 42)
276#define MX53_INT_GPIO1_INT5 44 276#define MX53_INT_GPIO1_INT6 (NR_IRQS_LEGACY + 43)
277#define MX53_INT_GPIO1_INT4 45 277#define MX53_INT_GPIO1_INT5 (NR_IRQS_LEGACY + 44)
278#define MX53_INT_GPIO1_INT3 46 278#define MX53_INT_GPIO1_INT4 (NR_IRQS_LEGACY + 45)
279#define MX53_INT_GPIO1_INT2 47 279#define MX53_INT_GPIO1_INT3 (NR_IRQS_LEGACY + 46)
280#define MX53_INT_GPIO1_INT1 48 280#define MX53_INT_GPIO1_INT2 (NR_IRQS_LEGACY + 47)
281#define MX53_INT_GPIO1_INT0 49 281#define MX53_INT_GPIO1_INT1 (NR_IRQS_LEGACY + 48)
282#define MX53_INT_GPIO1_LOW 50 282#define MX53_INT_GPIO1_INT0 (NR_IRQS_LEGACY + 49)
283#define MX53_INT_GPIO1_HIGH 51 283#define MX53_INT_GPIO1_LOW (NR_IRQS_LEGACY + 50)
284#define MX53_INT_GPIO2_LOW 52 284#define MX53_INT_GPIO1_HIGH (NR_IRQS_LEGACY + 51)
285#define MX53_INT_GPIO2_HIGH 53 285#define MX53_INT_GPIO2_LOW (NR_IRQS_LEGACY + 52)
286#define MX53_INT_GPIO3_LOW 54 286#define MX53_INT_GPIO2_HIGH (NR_IRQS_LEGACY + 53)
287#define MX53_INT_GPIO3_HIGH 55 287#define MX53_INT_GPIO3_LOW (NR_IRQS_LEGACY + 54)
288#define MX53_INT_GPIO4_LOW 56 288#define MX53_INT_GPIO3_HIGH (NR_IRQS_LEGACY + 55)
289#define MX53_INT_GPIO4_HIGH 57 289#define MX53_INT_GPIO4_LOW (NR_IRQS_LEGACY + 56)
290#define MX53_INT_WDOG1 58 290#define MX53_INT_GPIO4_HIGH (NR_IRQS_LEGACY + 57)
291#define MX53_INT_WDOG2 59 291#define MX53_INT_WDOG1 (NR_IRQS_LEGACY + 58)
292#define MX53_INT_KPP 60 292#define MX53_INT_WDOG2 (NR_IRQS_LEGACY + 59)
293#define MX53_INT_PWM1 61 293#define MX53_INT_KPP (NR_IRQS_LEGACY + 60)
294#define MX53_INT_I2C1 62 294#define MX53_INT_PWM1 (NR_IRQS_LEGACY + 61)
295#define MX53_INT_I2C2 63 295#define MX53_INT_I2C1 (NR_IRQS_LEGACY + 62)
296#define MX53_INT_I2C3 64 296#define MX53_INT_I2C2 (NR_IRQS_LEGACY + 63)
297#define MX53_INT_MLB 65 297#define MX53_INT_I2C3 (NR_IRQS_LEGACY + 64)
298#define MX53_INT_ASRC 66 298#define MX53_INT_MLB (NR_IRQS_LEGACY + 65)
299#define MX53_INT_SPDIF 67 299#define MX53_INT_ASRC (NR_IRQS_LEGACY + 66)
300#define MX53_INT_SIM_DAT 68 300#define MX53_INT_SPDIF (NR_IRQS_LEGACY + 67)
301#define MX53_INT_IIM 69 301#define MX53_INT_SIM_DAT (NR_IRQS_LEGACY + 68)
302#define MX53_INT_ATA 70 302#define MX53_INT_IIM (NR_IRQS_LEGACY + 69)
303#define MX53_INT_CCM1 71 303#define MX53_INT_ATA (NR_IRQS_LEGACY + 70)
304#define MX53_INT_CCM2 72 304#define MX53_INT_CCM1 (NR_IRQS_LEGACY + 71)
305#define MX53_INT_GPC1 73 305#define MX53_INT_CCM2 (NR_IRQS_LEGACY + 72)
306#define MX53_INT_GPC2 74 306#define MX53_INT_GPC1 (NR_IRQS_LEGACY + 73)
307#define MX53_INT_SRC 75 307#define MX53_INT_GPC2 (NR_IRQS_LEGACY + 74)
308#define MX53_INT_NM 76 308#define MX53_INT_SRC (NR_IRQS_LEGACY + 75)
309#define MX53_INT_PMU 77 309#define MX53_INT_NM (NR_IRQS_LEGACY + 76)
310#define MX53_INT_CTI_IRQ 78 310#define MX53_INT_PMU (NR_IRQS_LEGACY + 77)
311#define MX53_INT_CTI1_TG0 79 311#define MX53_INT_CTI_IRQ (NR_IRQS_LEGACY + 78)
312#define MX53_INT_CTI1_TG1 80 312#define MX53_INT_CTI1_TG0 (NR_IRQS_LEGACY + 79)
313#define MX53_INT_ESAI 81 313#define MX53_INT_CTI1_TG1 (NR_IRQS_LEGACY + 80)
314#define MX53_INT_CAN1 82 314#define MX53_INT_ESAI (NR_IRQS_LEGACY + 81)
315#define MX53_INT_CAN2 83 315#define MX53_INT_CAN1 (NR_IRQS_LEGACY + 82)
316#define MX53_INT_GPU2_IRQ 84 316#define MX53_INT_CAN2 (NR_IRQS_LEGACY + 83)
317#define MX53_INT_GPU2_BUSY 85 317#define MX53_INT_GPU2_IRQ (NR_IRQS_LEGACY + 84)
318#define MX53_INT_UART5 86 318#define MX53_INT_GPU2_BUSY (NR_IRQS_LEGACY + 85)
319#define MX53_INT_FEC 87 319#define MX53_INT_UART5 (NR_IRQS_LEGACY + 86)
320#define MX53_INT_OWIRE 88 320#define MX53_INT_FEC (NR_IRQS_LEGACY + 87)
321#define MX53_INT_CTI1_TG2 89 321#define MX53_INT_OWIRE (NR_IRQS_LEGACY + 88)
322#define MX53_INT_SJC 90 322#define MX53_INT_CTI1_TG2 (NR_IRQS_LEGACY + 89)
323#define MX53_INT_TVE 92 323#define MX53_INT_SJC (NR_IRQS_LEGACY + 90)
324#define MX53_INT_FIRI 93 324#define MX53_INT_TVE (NR_IRQS_LEGACY + 92)
325#define MX53_INT_PWM2 94 325#define MX53_INT_FIRI (NR_IRQS_LEGACY + 93)
326#define MX53_INT_SLIM_EXP 95 326#define MX53_INT_PWM2 (NR_IRQS_LEGACY + 94)
327#define MX53_INT_SSI3 96 327#define MX53_INT_SLIM_EXP (NR_IRQS_LEGACY + 95)
328#define MX53_INT_EMI_BOOT 97 328#define MX53_INT_SSI3 (NR_IRQS_LEGACY + 96)
329#define MX53_INT_CTI1_TG3 98 329#define MX53_INT_EMI_BOOT (NR_IRQS_LEGACY + 97)
330#define MX53_INT_SMC_RX 99 330#define MX53_INT_CTI1_TG3 (NR_IRQS_LEGACY + 98)
331#define MX53_INT_VPU_IDLE 100 331#define MX53_INT_SMC_RX (NR_IRQS_LEGACY + 99)
332#define MX53_INT_EMI_NFC 101 332#define MX53_INT_VPU_IDLE (NR_IRQS_LEGACY + 100)
333#define MX53_INT_GPU_IDLE 102 333#define MX53_INT_EMI_NFC (NR_IRQS_LEGACY + 101)
334#define MX53_INT_GPIO5_LOW 103 334#define MX53_INT_GPU_IDLE (NR_IRQS_LEGACY + 102)
335#define MX53_INT_GPIO5_HIGH 104 335#define MX53_INT_GPIO5_LOW (NR_IRQS_LEGACY + 103)
336#define MX53_INT_GPIO6_LOW 105 336#define MX53_INT_GPIO5_HIGH (NR_IRQS_LEGACY + 104)
337#define MX53_INT_GPIO6_HIGH 106 337#define MX53_INT_GPIO6_LOW (NR_IRQS_LEGACY + 105)
338#define MX53_INT_GPIO7_LOW 107 338#define MX53_INT_GPIO6_HIGH (NR_IRQS_LEGACY + 106)
339#define MX53_INT_GPIO7_HIGH 108 339#define MX53_INT_GPIO7_LOW (NR_IRQS_LEGACY + 107)
340#define MX53_INT_GPIO7_HIGH (NR_IRQS_LEGACY + 108)
340 341
341#endif /* ifndef __MACH_MX53_H__ */ 342#endif /* ifndef __MACH_MX53_H__ */
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c
index 98308ec1f321..c60a7e416385 100644
--- a/arch/arm/plat-mxc/tzic.c
+++ b/arch/arm/plat-mxc/tzic.c
@@ -15,6 +15,8 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/irqdomain.h>
19#include <linux/of.h>
18 20
19#include <asm/mach/irq.h> 21#include <asm/mach/irq.h>
20#include <asm/exception.h> 22#include <asm/exception.h>
@@ -49,6 +51,7 @@
49#define TZIC_ID0 0x0FD0 /* Indentification Register 0 */ 51#define TZIC_ID0 0x0FD0 /* Indentification Register 0 */
50 52
51void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */ 53void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */
54static struct irq_domain *domain;
52 55
53#define TZIC_NUM_IRQS 128 56#define TZIC_NUM_IRQS 128
54 57
@@ -77,15 +80,14 @@ static int tzic_set_irq_fiq(unsigned int irq, unsigned int type)
77static void tzic_irq_suspend(struct irq_data *d) 80static void tzic_irq_suspend(struct irq_data *d)
78{ 81{
79 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 82 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
80 int idx = gc->irq_base >> 5; 83 int idx = d->hwirq >> 5;
81 84
82 __raw_writel(gc->wake_active, tzic_base + TZIC_WAKEUP0(idx)); 85 __raw_writel(gc->wake_active, tzic_base + TZIC_WAKEUP0(idx));
83} 86}
84 87
85static void tzic_irq_resume(struct irq_data *d) 88static void tzic_irq_resume(struct irq_data *d)
86{ 89{
87 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 90 int idx = d->hwirq >> 5;
88 int idx = gc->irq_base >> 5;
89 91
90 __raw_writel(__raw_readl(tzic_base + TZIC_ENSET0(idx)), 92 __raw_writel(__raw_readl(tzic_base + TZIC_ENSET0(idx)),
91 tzic_base + TZIC_WAKEUP0(idx)); 93 tzic_base + TZIC_WAKEUP0(idx));
@@ -102,11 +104,10 @@ static struct mxc_extra_irq tzic_extra_irq = {
102#endif 104#endif
103}; 105};
104 106
105static __init void tzic_init_gc(unsigned int irq_start) 107static __init void tzic_init_gc(int idx, unsigned int irq_start)
106{ 108{
107 struct irq_chip_generic *gc; 109 struct irq_chip_generic *gc;
108 struct irq_chip_type *ct; 110 struct irq_chip_type *ct;
109 int idx = irq_start >> 5;
110 111
111 gc = irq_alloc_generic_chip("tzic", 1, irq_start, tzic_base, 112 gc = irq_alloc_generic_chip("tzic", 1, irq_start, tzic_base,
112 handle_level_irq); 113 handle_level_irq);
@@ -140,7 +141,8 @@ asmlinkage void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
140 while (stat) { 141 while (stat) {
141 handled = 1; 142 handled = 1;
142 irqofs = fls(stat) - 1; 143 irqofs = fls(stat) - 1;
143 handle_IRQ(irqofs + i * 32, regs); 144 handle_IRQ(irq_find_mapping(domain,
145 irqofs + i * 32), regs);
144 stat &= ~(1 << irqofs); 146 stat &= ~(1 << irqofs);
145 } 147 }
146 } 148 }
@@ -154,6 +156,8 @@ asmlinkage void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
154 */ 156 */
155void __init tzic_init_irq(void __iomem *irqbase) 157void __init tzic_init_irq(void __iomem *irqbase)
156{ 158{
159 struct device_node *np;
160 int irq_base;
157 int i; 161 int i;
158 162
159 tzic_base = irqbase; 163 tzic_base = irqbase;
@@ -175,12 +179,20 @@ void __init tzic_init_irq(void __iomem *irqbase)
175 179
176 /* all IRQ no FIQ Warning :: No selection */ 180 /* all IRQ no FIQ Warning :: No selection */
177 181
178 for (i = 0; i < TZIC_NUM_IRQS; i += 32) 182 irq_base = irq_alloc_descs(-1, 0, TZIC_NUM_IRQS, numa_node_id());
179 tzic_init_gc(i); 183 WARN_ON(irq_base < 0);
184
185 np = of_find_compatible_node(NULL, NULL, "fsl,tzic");
186 domain = irq_domain_add_legacy(np, TZIC_NUM_IRQS, irq_base, 0,
187 &irq_domain_simple_ops, NULL);
188 WARN_ON(!domain);
189
190 for (i = 0; i < 4; i++, irq_base += 32)
191 tzic_init_gc(i, irq_base);
180 192
181#ifdef CONFIG_FIQ 193#ifdef CONFIG_FIQ
182 /* Initialize FIQ */ 194 /* Initialize FIQ */
183 init_FIQ(); 195 init_FIQ(FIQ_START);
184#endif 196#endif
185 197
186 pr_info("TrustZone Interrupt Controller (TZIC) initialized\n"); 198 pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index bc42c04091fd..fe57bbbf166b 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -533,7 +533,7 @@ void __init s3c24xx_init_irq(void)
533 int i; 533 int i;
534 534
535#ifdef CONFIG_FIQ 535#ifdef CONFIG_FIQ
536 init_FIQ(); 536 init_FIQ(FIQ_START);
537#endif 537#endif
538 538
539 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); 539 irqdbf("s3c2410_init_irq: clearing interrupt status flags\n");
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c
index 5ec72044ea4c..c7573e50aa14 100644
--- a/drivers/dma/ipu/ipu_idmac.c
+++ b/drivers/dma/ipu/ipu_idmac.c
@@ -1663,7 +1663,6 @@ static void __exit ipu_idmac_exit(struct ipu *ipu)
1663 1663
1664static int __init ipu_probe(struct platform_device *pdev) 1664static int __init ipu_probe(struct platform_device *pdev)
1665{ 1665{
1666 struct ipu_platform_data *pdata = pdev->dev.platform_data;
1667 struct resource *mem_ipu, *mem_ic; 1666 struct resource *mem_ipu, *mem_ic;
1668 int ret; 1667 int ret;
1669 1668
@@ -1671,7 +1670,7 @@ static int __init ipu_probe(struct platform_device *pdev)
1671 1670
1672 mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1671 mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1673 mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1); 1672 mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1674 if (!pdata || !mem_ipu || !mem_ic) 1673 if (!mem_ipu || !mem_ic)
1675 return -EINVAL; 1674 return -EINVAL;
1676 1675
1677 ipu_data.dev = &pdev->dev; 1676 ipu_data.dev = &pdev->dev;
@@ -1688,10 +1687,9 @@ static int __init ipu_probe(struct platform_device *pdev)
1688 goto err_noirq; 1687 goto err_noirq;
1689 1688
1690 ipu_data.irq_err = ret; 1689 ipu_data.irq_err = ret;
1691 ipu_data.irq_base = pdata->irq_base;
1692 1690
1693 dev_dbg(&pdev->dev, "fn irq %u, err irq %u, irq-base %u\n", 1691 dev_dbg(&pdev->dev, "fn irq %u, err irq %u\n",
1694 ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base); 1692 ipu_data.irq_fn, ipu_data.irq_err);
1695 1693
1696 /* Remap IPU common registers */ 1694 /* Remap IPU common registers */
1697 ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu)); 1695 ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu));
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index a71f55e72be9..fa95bcc3de1f 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -14,6 +14,7 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/module.h>
17 18
18#include <mach/ipu.h> 19#include <mach/ipu.h>
19 20
@@ -354,10 +355,12 @@ static struct irq_chip ipu_irq_chip = {
354/* Install the IRQ handler */ 355/* Install the IRQ handler */
355int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) 356int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
356{ 357{
357 struct ipu_platform_data *pdata = dev->dev.platform_data; 358 unsigned int irq, i;
358 unsigned int irq, irq_base, i; 359 int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS,
360 numa_node_id());
359 361
360 irq_base = pdata->irq_base; 362 if (irq_base < 0)
363 return irq_base;
361 364
362 for (i = 0; i < IPU_IRQ_NR_BANKS; i++) 365 for (i = 0; i < IPU_IRQ_NR_BANKS; i++)
363 irq_bank[i].ipu = ipu; 366 irq_bank[i].ipu = ipu;
@@ -387,15 +390,16 @@ int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev)
387 irq_set_handler_data(ipu->irq_err, ipu); 390 irq_set_handler_data(ipu->irq_err, ipu);
388 irq_set_chained_handler(ipu->irq_err, ipu_irq_err); 391 irq_set_chained_handler(ipu->irq_err, ipu_irq_err);
389 392
393 ipu->irq_base = irq_base;
394
390 return 0; 395 return 0;
391} 396}
392 397
393void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev) 398void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev)
394{ 399{
395 struct ipu_platform_data *pdata = dev->dev.platform_data;
396 unsigned int irq, irq_base; 400 unsigned int irq, irq_base;
397 401
398 irq_base = pdata->irq_base; 402 irq_base = ipu->irq_base;
399 403
400 irq_set_chained_handler(ipu->irq_fn, NULL); 404 irq_set_chained_handler(ipu->irq_fn, NULL);
401 irq_set_handler_data(ipu->irq_fn, NULL); 405 irq_set_handler_data(ipu->irq_fn, NULL);
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index c89c4c1e668d..04691d3abe60 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/irqdomain.h>
26#include <linux/gpio.h> 27#include <linux/gpio.h>
27#include <linux/platform_device.h> 28#include <linux/platform_device.h>
28#include <linux/slab.h> 29#include <linux/slab.h>
@@ -33,8 +34,6 @@
33#include <asm-generic/bug.h> 34#include <asm-generic/bug.h>
34#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
35 36
36#define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
37
38enum mxc_gpio_hwtype { 37enum mxc_gpio_hwtype {
39 IMX1_GPIO, /* runs on i.mx1 */ 38 IMX1_GPIO, /* runs on i.mx1 */
40 IMX21_GPIO, /* runs on i.mx21 and i.mx27 */ 39 IMX21_GPIO, /* runs on i.mx21 and i.mx27 */
@@ -61,7 +60,7 @@ struct mxc_gpio_port {
61 void __iomem *base; 60 void __iomem *base;
62 int irq; 61 int irq;
63 int irq_high; 62 int irq_high;
64 int virtual_irq_start; 63 struct irq_domain *domain;
65 struct bgpio_chip bgc; 64 struct bgpio_chip bgc;
66 u32 both_edges; 65 u32 both_edges;
67}; 66};
@@ -144,14 +143,15 @@ static LIST_HEAD(mxc_gpio_ports);
144 143
145static int gpio_set_irq_type(struct irq_data *d, u32 type) 144static int gpio_set_irq_type(struct irq_data *d, u32 type)
146{ 145{
147 u32 gpio = irq_to_gpio(d->irq);
148 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 146 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
149 struct mxc_gpio_port *port = gc->private; 147 struct mxc_gpio_port *port = gc->private;
150 u32 bit, val; 148 u32 bit, val;
149 u32 gpio_idx = d->hwirq;
150 u32 gpio = port->bgc.gc.base + gpio_idx;
151 int edge; 151 int edge;
152 void __iomem *reg = port->base; 152 void __iomem *reg = port->base;
153 153
154 port->both_edges &= ~(1 << (gpio & 31)); 154 port->both_edges &= ~(1 << gpio_idx);
155 switch (type) { 155 switch (type) {
156 case IRQ_TYPE_EDGE_RISING: 156 case IRQ_TYPE_EDGE_RISING:
157 edge = GPIO_INT_RISE_EDGE; 157 edge = GPIO_INT_RISE_EDGE;
@@ -168,7 +168,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
168 edge = GPIO_INT_HIGH_LEV; 168 edge = GPIO_INT_HIGH_LEV;
169 pr_debug("mxc: set GPIO %d to high trigger\n", gpio); 169 pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
170 } 170 }
171 port->both_edges |= 1 << (gpio & 31); 171 port->both_edges |= 1 << gpio_idx;
172 break; 172 break;
173 case IRQ_TYPE_LEVEL_LOW: 173 case IRQ_TYPE_LEVEL_LOW:
174 edge = GPIO_INT_LOW_LEV; 174 edge = GPIO_INT_LOW_LEV;
@@ -180,11 +180,11 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
180 return -EINVAL; 180 return -EINVAL;
181 } 181 }
182 182
183 reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */ 183 reg += GPIO_ICR1 + ((gpio_idx & 0x10) >> 2); /* ICR1 or ICR2 */
184 bit = gpio & 0xf; 184 bit = gpio_idx & 0xf;
185 val = readl(reg) & ~(0x3 << (bit << 1)); 185 val = readl(reg) & ~(0x3 << (bit << 1));
186 writel(val | (edge << (bit << 1)), reg); 186 writel(val | (edge << (bit << 1)), reg);
187 writel(1 << (gpio & 0x1f), port->base + GPIO_ISR); 187 writel(1 << gpio_idx, port->base + GPIO_ISR);
188 188
189 return 0; 189 return 0;
190} 190}
@@ -217,15 +217,13 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
217/* handle 32 interrupts in one status register */ 217/* handle 32 interrupts in one status register */
218static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat) 218static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
219{ 219{
220 u32 gpio_irq_no_base = port->virtual_irq_start;
221
222 while (irq_stat != 0) { 220 while (irq_stat != 0) {
223 int irqoffset = fls(irq_stat) - 1; 221 int irqoffset = fls(irq_stat) - 1;
224 222
225 if (port->both_edges & (1 << irqoffset)) 223 if (port->both_edges & (1 << irqoffset))
226 mxc_flip_edge(port, irqoffset); 224 mxc_flip_edge(port, irqoffset);
227 225
228 generic_handle_irq(gpio_irq_no_base + irqoffset); 226 generic_handle_irq(irq_find_mapping(port->domain, irqoffset));
229 227
230 irq_stat &= ~(1 << irqoffset); 228 irq_stat &= ~(1 << irqoffset);
231 } 229 }
@@ -276,10 +274,9 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
276 */ 274 */
277static int gpio_set_wake_irq(struct irq_data *d, u32 enable) 275static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
278{ 276{
279 u32 gpio = irq_to_gpio(d->irq);
280 u32 gpio_idx = gpio & 0x1F;
281 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 277 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
282 struct mxc_gpio_port *port = gc->private; 278 struct mxc_gpio_port *port = gc->private;
279 u32 gpio_idx = d->hwirq;
283 280
284 if (enable) { 281 if (enable) {
285 if (port->irq_high && (gpio_idx >= 16)) 282 if (port->irq_high && (gpio_idx >= 16))
@@ -296,12 +293,12 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
296 return 0; 293 return 0;
297} 294}
298 295
299static void __init mxc_gpio_init_gc(struct mxc_gpio_port *port) 296static void __init mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
300{ 297{
301 struct irq_chip_generic *gc; 298 struct irq_chip_generic *gc;
302 struct irq_chip_type *ct; 299 struct irq_chip_type *ct;
303 300
304 gc = irq_alloc_generic_chip("gpio-mxc", 1, port->virtual_irq_start, 301 gc = irq_alloc_generic_chip("gpio-mxc", 1, irq_base,
305 port->base, handle_level_irq); 302 port->base, handle_level_irq);
306 gc->private = port; 303 gc->private = port;
307 304
@@ -352,7 +349,7 @@ static int mxc_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
352 struct mxc_gpio_port *port = 349 struct mxc_gpio_port *port =
353 container_of(bgc, struct mxc_gpio_port, bgc); 350 container_of(bgc, struct mxc_gpio_port, bgc);
354 351
355 return port->virtual_irq_start + offset; 352 return irq_find_mapping(port->domain, offset);
356} 353}
357 354
358static int __devinit mxc_gpio_probe(struct platform_device *pdev) 355static int __devinit mxc_gpio_probe(struct platform_device *pdev)
@@ -360,6 +357,7 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
360 struct device_node *np = pdev->dev.of_node; 357 struct device_node *np = pdev->dev.of_node;
361 struct mxc_gpio_port *port; 358 struct mxc_gpio_port *port;
362 struct resource *iores; 359 struct resource *iores;
360 int irq_base;
363 int err; 361 int err;
364 362
365 mxc_gpio_get_hw(pdev); 363 mxc_gpio_get_hw(pdev);
@@ -432,20 +430,30 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
432 if (err) 430 if (err)
433 goto out_bgpio_remove; 431 goto out_bgpio_remove;
434 432
435 /* 433 irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
436 * In dt case, we use gpio number range dynamically 434 if (irq_base < 0) {
437 * allocated by gpio core. 435 err = irq_base;
438 */ 436 goto out_gpiochip_remove;
439 port->virtual_irq_start = MXC_GPIO_IRQ_START + (np ? port->bgc.gc.base : 437 }
440 pdev->id * 32); 438
439 port->domain = irq_domain_add_legacy(np, 32, irq_base, 0,
440 &irq_domain_simple_ops, NULL);
441 if (!port->domain) {
442 err = -ENODEV;
443 goto out_irqdesc_free;
444 }
441 445
442 /* gpio-mxc can be a generic irq chip */ 446 /* gpio-mxc can be a generic irq chip */
443 mxc_gpio_init_gc(port); 447 mxc_gpio_init_gc(port, irq_base);
444 448
445 list_add_tail(&port->node, &mxc_gpio_ports); 449 list_add_tail(&port->node, &mxc_gpio_ports);
446 450
447 return 0; 451 return 0;
448 452
453out_irqdesc_free:
454 irq_free_descs(irq_base, 32);
455out_gpiochip_remove:
456 WARN_ON(gpiochip_remove(&port->bgc.gc) < 0);
449out_bgpio_remove: 457out_bgpio_remove:
450 bgpio_remove(&port->bgc); 458 bgpio_remove(&port->bgc);
451out_iounmap: 459out_iounmap:
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 8d6b504d65c4..370031ac8200 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -53,7 +53,6 @@
53#include <linux/of_i2c.h> 53#include <linux/of_i2c.h>
54#include <linux/pinctrl/consumer.h> 54#include <linux/pinctrl/consumer.h>
55 55
56#include <mach/irqs.h>
57#include <mach/hardware.h> 56#include <mach/hardware.h>
58#include <mach/i2c.h> 57#include <mach/i2c.h>
59 58
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 4296a8350298..d2e6f82ecfac 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -43,6 +43,7 @@
43#include <asm/fiq.h> 43#include <asm/fiq.h>
44#include <mach/dma-mx1-mx2.h> 44#include <mach/dma-mx1-mx2.h>
45#include <mach/hardware.h> 45#include <mach/hardware.h>
46#include <mach/irqs.h>
46#include <mach/mx1_camera.h> 47#include <mach/mx1_camera.h>
47 48
48/* 49/*
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef747307ecb..d5c689d6217e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -169,7 +169,6 @@
169#define SERIAL_IMX_MAJOR 207 169#define SERIAL_IMX_MAJOR 207
170#define MINOR_START 16 170#define MINOR_START 16
171#define DEV_NAME "ttymxc" 171#define DEV_NAME "ttymxc"
172#define MAX_INTERNAL_IRQ MXC_INTERNAL_IRQS
173 172
174/* 173/*
175 * This determines how often we check the modem status signals 174 * This determines how often we check the modem status signals
@@ -741,10 +740,7 @@ static int imx_startup(struct uart_port *port)
741 740
742 /* do not use RTS IRQ on IrDA */ 741 /* do not use RTS IRQ on IrDA */
743 if (!USE_IRDA(sport)) { 742 if (!USE_IRDA(sport)) {
744 retval = request_irq(sport->rtsirq, imx_rtsint, 743 retval = request_irq(sport->rtsirq, imx_rtsint, 0,
745 (sport->rtsirq < MAX_INTERNAL_IRQ) ? 0 :
746 IRQF_TRIGGER_FALLING |
747 IRQF_TRIGGER_RISING,
748 DRIVER_NAME, sport); 744 DRIVER_NAME, sport);
749 if (retval) 745 if (retval)
750 goto error_out3; 746 goto error_out3;
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 456b7d723d66..ee27ba3933bd 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -29,6 +29,7 @@
29 29
30#include <asm/fiq.h> 30#include <asm/fiq.h>
31 31
32#include <mach/irqs.h>
32#include <mach/ssi.h> 33#include <mach/ssi.h>
33 34
34#include "imx-ssi.h" 35#include "imx-ssi.h"