From 07c46c0d285d2c9d4f0ec4406a80a18f2f65fe0c Mon Sep 17 00:00:00 2001
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Date: Wed, 15 Jan 2014 20:34:08 +0100
Subject: [PATCH 2/2] ARM: kirkwood: set C-style handle_irq if
 MULTI_IRQ_HANDLER is set

Compiling with both non-DT and DT support enabled, will break ASM
irq handler used by non-DT boards. This fixes a regression for
those kernels by installing a corresponding C-style handle_irq
callback if MULTI_IRQ_HANDLER is set.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
 arch/arm/mach-kirkwood/d2net_v2-setup.c      |  4 ++++
 arch/arm/mach-kirkwood/netxbig_v2-setup.c    |  7 +++++++
 arch/arm/mach-kirkwood/openrd-setup.c        | 10 ++++++++++
 arch/arm/mach-kirkwood/rd88f6192-nas-setup.c |  4 ++++
 arch/arm/mach-kirkwood/rd88f6281-setup.c     |  4 ++++
 arch/arm/mach-kirkwood/t5325-setup.c         |  4 ++++
 arch/arm/mach-kirkwood/ts219-setup.c         |  4 ++++
 arch/arm/mach-kirkwood/ts41x-setup.c         |  4 ++++
 8 files changed, 41 insertions(+)

diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index 453418063c1e..7b475af4f904 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -32,6 +32,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include <linux/platform_data/leds-kirkwood-ns2.h>
 #include "common.h"
 #include "mpp.h"
@@ -225,6 +226,9 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
 	.init_machine	= d2net_v2_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index 913d032cdb19..edcd8071a359 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -32,6 +32,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include <linux/platform_data/leds-kirkwood-netxbig.h>
 #include "common.h"
 #include "mpp.h"
@@ -403,6 +404,9 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
 	.init_machine	= netxbig_v2_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
@@ -415,6 +419,9 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
 	.init_machine	= netxbig_v2_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index e5cf84103583..86a0e77ff695 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -20,6 +20,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -222,6 +223,9 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
 	.init_machine	= openrd_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
@@ -235,6 +239,9 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.init_machine	= openrd_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
@@ -248,6 +255,9 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
 	.init_machine	= openrd_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index e4fd3129d36f..57c347987ba5 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include <plat/orion-gpio.h>
 #include "common.h"
 
@@ -83,6 +84,9 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
 	.init_machine	= rd88f6192_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 5154bd2a3ad3..723d9a64ec0e 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -20,6 +20,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -122,6 +123,9 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
 	.init_machine	= rd88f6281_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c
index 8736f8c97518..7ffe94403079 100644
--- a/arch/arm/mach-kirkwood/t5325-setup.c
+++ b/arch/arm/mach-kirkwood/t5325-setup.c
@@ -26,6 +26,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -210,6 +211,9 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
 	.init_machine	= hp_t5325_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index e1267d6b468f..5c4772fcbe60 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -22,6 +22,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include "common.h"
 #include "mpp.h"
 #include "tsx1x-common.h"
@@ -136,6 +137,9 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
 	.init_machine	= qnap_ts219_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index 81d585806b2f..3256a7933c74 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -24,6 +24,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <plat/irq.h>
 #include "common.h"
 #include "mpp.h"
 #include "tsx1x-common.h"
@@ -180,6 +181,9 @@ MACHINE_START(TS41X, "QNAP TS-41x")
 	.init_machine	= qnap_ts41x_init,
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+	.handle_irq	= orion_legacy_handle_irq,
+#endif
 	.init_irq	= kirkwood_init_irq,
 	.init_time	= kirkwood_timer_init,
 	.restart	= kirkwood_restart,
-- 
1.8.5.2

