MIPS: JZ4740: read intc base address from DT
authorPaul Burton <paul.burton@imgtec.com>
Sun, 24 May 2015 15:11:28 +0000 (16:11 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 21 Jun 2015 19:53:05 +0000 (21:53 +0200)
Read the base address of the SoC interrupt controller from the device
tree rather than relying upon the JZ4740_INTC_BASE_ADDR macro, in order
to remove the dependency on the asm/mach-jz4740/base.h header.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Brian Norris <computersforpeace@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/10145/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/jz4740/irq.c

index 7ad6688f371b95258343ede2a1de9454f3b52355..8b7df9a581c272676c6d2cad201c1f6a0f26804a 100644 (file)
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
+#include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/timex.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 
 #include <asm/io.h>
-
-#include <asm/mach-jz4740/base.h>
 #include <asm/mach-jz4740/irq.h>
 
 #include "irq.h"
@@ -114,7 +113,11 @@ static int __init ingenic_intc_of_init(struct device_node *node,
                goto out_unmap_irq;
 
        intc->num_chips = num_chips;
-       intc->base = ioremap(JZ4740_INTC_BASE_ADDR, 0x14);
+       intc->base = of_iomap(node, 0);
+       if (!intc->base) {
+               err = -ENODEV;
+               goto out_unmap_irq;
+       }
 
        for (i = 0; i < num_chips; i++) {
                /* Mask all irqs */