ARM: gemini: convert to MULTI_IRQ_HANDLER
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 13 Jan 2017 22:55:54 +0000 (23:55 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 12 Mar 2017 11:27:04 +0000 (12:27 +0100)
In order to enable device tree boot on this machine we must first
convert it to runtime-manage its irq handler, so do this.

Cc: Janos Laube <janos.dev@gmail.com>
Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/Kconfig
arch/arm/mach-gemini/include/mach/entry-macro.S [deleted file]
arch/arm/mach-gemini/irq.c

index 0d4e71b42c77da986a2dc471a1f335be5e958527..6c2b72b173c8d4968286d034ae6bbf56cca481af 100644 (file)
@@ -365,6 +365,7 @@ config ARCH_GEMINI
        select CPU_FA526
        select GENERIC_CLOCKEVENTS
        select GPIOLIB
+       select MULTI_IRQ_HANDLER
        help
          Support for the Cortina Systems Gemini family SoCs
 
diff --git a/arch/arm/mach-gemini/include/mach/entry-macro.S b/arch/arm/mach-gemini/include/mach/entry-macro.S
deleted file mode 100644 (file)
index f044e43..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Low-level IRQ helper macros for Gemini platform.
- *
- *  Copyright (C) 2001-2006 Storlink, Corp.
- *  Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-#include <mach/hardware.h>
-
-#define IRQ_STATUS     0x14
-
-       .macro  get_irqnr_preamble, base, tmp
-       .endm
-
-       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-       ldr     \irqstat, =IO_ADDRESS(GEMINI_INTERRUPT_BASE + IRQ_STATUS)
-       ldr     \irqnr, [\irqstat]
-       cmp     \irqnr, #0
-       beq     2313f
-       mov     \tmp, \irqnr
-       mov     \irqnr, #0
-2312:
-       tst     \tmp, #1
-       bne     2313f
-       add     \irqnr, \irqnr, #1
-       mov     \tmp, \tmp, lsr #1
-       cmp     \irqnr, #31
-       bcc     2312b
-2313:
-       .endm
index d929b3ff18fdf3da2b605f0617c4898a3f9358e8..37d52e3724566bd3d5f374c31744ba5184a15efd 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/sched.h>
 #include <linux/cpu.h>
 
+#include <asm/exception.h>
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 #include <asm/system_misc.h>
@@ -65,6 +66,18 @@ static struct irq_chip gemini_irq_chip = {
        .irq_unmask     = gemini_unmask_irq,
 };
 
+
+asmlinkage void __exception_irq_entry gemini_handle_irq(struct pt_regs *regs)
+{
+       int irq;
+       unsigned status;
+
+       while ((status = __raw_readl(IRQ_STATUS(IO_ADDRESS(GEMINI_INTERRUPT_BASE))))) {
+               irq = ffs(status) - 1;
+               handle_domain_irq(NULL, irq, regs);
+       }
+}
+
 static struct resource irq_resource = {
        .name   = "irq_handler",
        .start  = GEMINI_INTERRUPT_BASE,
@@ -102,4 +115,6 @@ void __init gemini_init_irq(void)
        /* Set interrupt mode */
        __raw_writel(mode, IRQ_TMODE(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
        __raw_writel(level, IRQ_TLEVEL(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
+
+       set_handle_irq(gemini_handle_irq);
 }