ARM: ux500: Enable Cortex-A9 GIC (Generic Interrupt Controller) in Device Tree
authorLee Jones <lee.jones@linaro.org>
Wed, 7 Mar 2012 17:22:30 +0000 (17:22 +0000)
committerArnd Bergmann <arnd@arndb.de>
Fri, 16 Mar 2012 19:48:31 +0000 (19:48 +0000)
This enables the embedded GIC on all u8500 based hardware using DT.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/boot/dts/db8500.dtsi
arch/arm/mach-ux500/cpu.c

index 67423e4..614a471 100644 (file)
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "stericsson,db8500";
+               interrupt-parent = <&intc>;
                ranges;
 
+               intc: interrupt-controller@a0411000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <1>;
+                       interrupt-controller;
+                       interrupt-parent;
+                       reg = <0xa0411000 0x1000>,
+                             <0xa0410100 0x100>;
+               };
+
                pmu {
                        compatible = "arm,cortex-a9-pmu";
                        interrupts = <0 7 0x4>;
index 6242e88..d11f389 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 
 void __iomem *_PRCMU_BASE;
 
+static const struct of_device_id ux500_dt_irq_match[] = {
+       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
+       {},
+};
+
 void __init ux500_init_irq(void)
 {
        void __iomem *dist_base;
@@ -42,7 +49,12 @@ void __init ux500_init_irq(void)
        } else
                ux500_unknown_soc();
 
-       gic_init(0, 29, dist_base, cpu_base);
+#ifdef CONFIG_OF
+       if (of_have_populated_dt())
+               of_irq_init(ux500_dt_irq_match);
+       else
+#endif
+               gic_init(0, 29, dist_base, cpu_base);
 
        /*
         * Init clocks here so that they are available for system timer