aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-12-18 05:08:55 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2008-12-18 10:40:11 -0500
commit9d631b835f518848b7f3ce803bfd00dc1bb8a5b1 (patch)
tree06fbe8adf4b7959454c07f1e6cc86a8bbb04a67c /arch/arm/plat-mxc/include
parent7c99502383713f1a59c35fbe14db8364e4052286 (diff)
[ARM] MXC: remove dependency to other include files from irqs.h
This patch removes the inclusion of mach/hardware.h from mach/irqs.h and switches to more meaningful names for the irq related macros. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/include')
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h27
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h17
9 files changed, 33 insertions, 35 deletions
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27ads.h b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
index 0c748a8e157b..8f34a05afc87 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
@@ -15,7 +15,7 @@
15#define __ASM_ARCH_MXC_BOARD_MX27ADS_H__ 15#define __ASM_ARCH_MXC_BOARD_MX27ADS_H__
16 16
17/* external interrupt multiplexer */ 17/* external interrupt multiplexer */
18#define MXC_EXP_IO_BASE (MXC_GPIO_BASE + MXC_MAX_GPIO_LINES) 18#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
19 19
20#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES) 20#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
21#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE 21#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 745b48864f93..451d510d08c3 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -90,7 +90,7 @@
90#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) 90#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
91#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4) 91#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
92 92
93#define MXC_EXP_IO_BASE (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES) 93#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)
94#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) 94#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
95 95
96#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0) 96#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 65eedc0d196f..ea509f1090fb 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -27,8 +27,8 @@
27#define gpio_set_value __gpio_set_value 27#define gpio_set_value __gpio_set_value
28#define gpio_cansleep __gpio_cansleep 28#define gpio_cansleep __gpio_cansleep
29 29
30#define gpio_to_irq(gpio) (MXC_MAX_INT_LINES + (gpio)) 30#define gpio_to_irq(gpio) (MXC_GPIO_IRQ_START + (gpio))
31#define irq_to_gpio(irq) ((irq) - MXC_MAX_INT_LINES) 31#define irq_to_gpio(irq) ((irq) - MXC_GPIO_IRQ_START)
32 32
33struct mxc_gpio_port { 33struct mxc_gpio_port {
34 void __iomem *base; 34 void __iomem *base;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
index 60b3c9b6ef7d..95a383be628e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
@@ -405,9 +405,9 @@ extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
405#endif 405#endif
406 406
407/* decode irq number to use with IMR(x), ISR(x) and friends */ 407/* decode irq number to use with IMR(x), ISR(x) and friends */
408#define IRQ_TO_REG(irq) ((irq - MXC_MAX_INT_LINES) >> 5) 408#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
409 409
410#define IRQ_GPIOA(x) (MXC_MAX_INT_LINES + x) 410#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
411#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x) 411#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
412#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) 412#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
413#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) 413#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 20e5c4c63314..c9198c0aea18 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -141,7 +141,7 @@ void mxc_iomux_set_gpr(enum iomux_gp_func, bool);
141 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) 141 ((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT)
142#define IOMUX_TO_IRQ(iomux_pin) \ 142#define IOMUX_TO_IRQ(iomux_pin) \
143 (((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) + \ 143 (((iomux_pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT) + \
144 MXC_GPIO_INT_BASE) 144 MXC_GPIO_IRQ_START)
145 145
146/* 146/*
147 * This enumeration is constructed based on the Section 147 * This enumeration is constructed based on the Section
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index b8ac91608a4f..e06d3cb0ee11 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -11,7 +11,32 @@
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 <mach/hardware.h> 14/*
15 * So far all i.MX SoCs have 64 internal interrupts
16 */
17#define MXC_INTERNAL_IRQS 64
18
19#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
20
21#if defined CONFIG_ARCH_MX1
22#define MXC_GPIO_IRQS (32 * 4)
23#elif defined CONFIG_ARCH_MX2
24#define MXC_GPIO_IRQS (32 * 6)
25#elif defined CONFIG_ARCH_MX3
26#define MXC_GPIO_IRQS (32 * 3)
27#endif
28
29/*
30 * The next 16 interrupts are for board specific purposes. Since
31 * the kernel can only run on one machine at a time, we can re-use
32 * these. If you need more, increase MXC_BOARD_IRQS, but keep it
33 * within sensible limits.
34 */
35#define MXC_BOARD_IRQ_START (MXC_INTERNAL_IRQS + MXC_GPIO_IRQS)
36#define MXC_BOARD_IRQS 16
37
38#define NR_IRQS (MXC_BOARD_IRQ_START + MXC_BOARD_IRQS)
39
15extern void imx_irq_set_priority(unsigned char irq, unsigned char prio); 40extern void imx_irq_set_priority(unsigned char irq, unsigned char prio);
16 41
17/* all normal IRQs can be FIQs */ 42/* 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 e7f6d00009a7..c45bf5f5b90c 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -145,10 +145,6 @@
145#define GPIO_INT_PORTD 62 145#define GPIO_INT_PORTD 62
146#define WDT_INT 63 146#define WDT_INT 63
147 147
148#define MXC_MAX_INT_LINES 64
149
150#define NR_IRQS 256
151
152/* gpio and gpio based interrupt handling */ 148/* gpio and gpio based interrupt handling */
153#define GPIO_DR 0x1C 149#define GPIO_DR 0x1C
154#define GPIO_GDIR 0x00 150#define GPIO_GDIR 0x00
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index aade46d90e73..55bcbd5e073a 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -295,10 +295,4 @@ extern int mx27_revision(void);
295/* Start of RAM */ 295/* Start of RAM */
296#define PHYS_OFFSET SDRAM_BASE_ADDR 296#define PHYS_OFFSET SDRAM_BASE_ADDR
297 297
298/* max interrupt lines count */
299#define NR_IRQS 256
300
301/* count of internal interrupt sources */
302#define MXC_MAX_INT_LINES 64
303
304#endif /* __ASM_ARCH_MXC_MX27_H__ */ 298#endif /* __ASM_ARCH_MXC_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 0536f8917bc0..65c3109b5192 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -315,23 +315,6 @@
315#define MXC_INT_EXT_WDOG 62 315#define MXC_INT_EXT_WDOG 62
316#define MXC_INT_EXT_TV 63 316#define MXC_INT_EXT_TV 63
317 317
318#define MXC_MAX_INT_LINES 64
319
320#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
321#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
322#define MXC_MAX_VIRTUAL_INTS 16
323
324#define NR_IRQS (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES + MXC_MAX_VIRTUAL_INTS)
325
326/*!
327 * Number of GPIO port as defined in the IC Spec
328 */
329#define GPIO_PORT_NUM 3
330/*!
331 * Number of GPIO pins per port
332 */
333#define GPIO_NUM_PIN 32
334
335#define PROD_SIGNATURE 0x1 /* For MX31 */ 318#define PROD_SIGNATURE 0x1 /* For MX31 */
336 319
337/* silicon revisions specific to i.MX31 */ 320/* silicon revisions specific to i.MX31 */