summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2011-06-16 17:27:58 +0200
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-17 13:42:18 +0200
commitc4c5a5734f48935dae6bbefae0d68c37b3d0a19f (patch)
tree3e6fa1d8ce7128a314977dfc57d715b9bfa8bc1b
parent27e26b25350b3a44fb5e131408555a0c247313b0 (diff)
ux500: irq: Fix multi boards support & put board common parts to mach/irqs.h
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
-rw-r--r--arch/arm/mach-ux500/board-mop500-wlan.c2
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-board-mop500.h39
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs-board-u5500.h7
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs.h37
4 files changed, 45 insertions, 40 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c
index e73a35e7c76..65863efc78c 100644
--- a/arch/arm/mach-ux500/board-mop500-wlan.c
+++ b/arch/arm/mach-ux500/board-mop500-wlan.c
@@ -10,7 +10,7 @@
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <asm/mach-types.h>
-#include <mach/irqs-board-mop500.h>
+#include <mach/irqs.h>
#include <plat/pincfg.h>
#include "pins.h"
#include "../drivers/staging/cw1200/cw1200_plat.h"
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
index 4c7d188cbc0..973bae33263 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
+++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
@@ -10,39 +10,6 @@
/* Number of AB8500 irqs is taken from header file */
#include <linux/mfd/ab8500.h>
-#include <linux/gpio.h>
-
-#define IRQ_LOCALTIMER 29
-#define IRQ_LOCALWDOG 30
-
-/* Shared Peripheral Interrupt (SHPI) */
-#define IRQ_SHPI_START 32
-
-/*
- * MTU0 preserved for now until plat-nomadik is taught not to use it. Don't
- * add any other IRQs here, use the irqs-dbx500.h files.
- */
-#define IRQ_MTU0 (IRQ_SHPI_START + 4)
-
-#define DBX500_NR_INTERNAL_IRQS 160
-
-/* After chip-specific IRQ numbers we have the GPIO ones */
-#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS)
-#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS)
-#define IRQ_GPIO_END NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
-
-#define IRQ_SOC_START IRQ_GPIO_END
-/* This will be overridden by SoC-specific irq headers */
-#define IRQ_SOC_END IRQ_SOC_START
-
-#define IRQ_BOARD_START IRQ_SOC_END
-/* This will be overridden by board-specific irq headers */
-#define IRQ_BOARD_END IRQ_BOARD_START
-
-#include <mach/irqs-db5500.h>
-#include <mach/irqs-db8500.h>
-
-/*********************************************************************/
#define MOP500_AB8500_IRQ_BASE IRQ_BOARD_START
#define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \
@@ -90,11 +57,7 @@
*/
#if MOP500_IRQ_END > IRQ_BOARD_END
#undef IRQ_BOARD_END
-#define IRQ_BOARD_END MOP500_IRQ_END
+#define IRQ_BOARD_END MOP500_IRQ_END
#endif
-/*********************************************************************/
-
-#define NR_IRQS IRQ_BOARD_END
-
#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-u5500.h b/arch/arm/mach-ux500/include/mach/irqs-board-u5500.h
index 48f9f382b29..f40508b5730 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-board-u5500.h
+++ b/arch/arm/mach-ux500/include/mach/irqs-board-u5500.h
@@ -13,7 +13,12 @@
#define U5500_IRQ_END IRQ_AB5500_END
-#if IRQ_BOARD_END < U5500_IRQ_END
+/*
+ * We may have several boards, but only one will run at a
+ * time, so the one with most IRQs will bump this ahead,
+ * but the IRQ_BOARD_START remains the same for either board.
+ */
+#if U5500_IRQ_END > IRQ_BOARD_END
#undef IRQ_BOARD_END
#define IRQ_BOARD_END U5500_IRQ_END
#endif
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h
index 28bc323cfdd..5144323d5aa 100644
--- a/arch/arm/mach-ux500/include/mach/irqs.h
+++ b/arch/arm/mach-ux500/include/mach/irqs.h
@@ -11,6 +11,39 @@
#define ASM_ARCH_IRQS_H
#include <mach/hardware.h>
+#include <linux/gpio.h>
+
+/* Shared Peripheral Interrupt (SHPI) */
+#define IRQ_SHPI_START 32
+
+/*
+ * MTU0 preserved for now until plat-nomadik is taught not to use it. Don't
+ * add any other IRQs here, use the irqs-dbx500.h files.
+ */
+#define IRQ_MTU0 (IRQ_SHPI_START + 4)
+
+#define IRQ_LOCALTIMER 29
+#define IRQ_LOCALWDOG 30
+
+/*********************************************************************/
+
+#define DBX500_NR_INTERNAL_IRQS 160
+
+/* After chip-specific IRQ numbers we have the GPIO ones */
+#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS)
+#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS)
+#define IRQ_GPIO_END NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
+
+#define IRQ_SOC_START IRQ_GPIO_END
+/* This will be overridden by SoC-specific irq headers */
+#define IRQ_SOC_END IRQ_SOC_START
+
+#define IRQ_BOARD_START IRQ_SOC_END
+/* This will be overridden by board-specific irq headers */
+#define IRQ_BOARD_END IRQ_BOARD_START
+
+#include <mach/irqs-db5500.h>
+#include <mach/irqs-db8500.h>
#ifdef CONFIG_MACH_U8500
#include <mach/irqs-board-mop500.h>
@@ -20,4 +53,8 @@
#include <mach/irqs-board-u5500.h>
#endif
+#ifndef NR_IRQS
+#define NR_IRQS IRQ_BOARD_END
+#endif
+
#endif /* ASM_ARCH_IRQS_H */