]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - arch/arm/mach-omap2/omap4-common.c
ARM: OMAP4: Fix the init code to have OMAP4460 errata available in DT build
[linux-imx.git] / arch / arm / mach-omap2 / omap4-common.c
index 708bb115a27ff8e54f0e760eaebaf2c10c9f4af1..20bf3c754bfde25b20cb12469a94dc21e6b4384e 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/of_platform.h>
 #include <linux/export.h>
 #include <linux/irqchip/arm-gic.h>
+#include <linux/of_address.h>
 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/map.h>
@@ -258,6 +259,21 @@ omap_early_initcall(omap4_sar_ram_init);
 
 void __init omap_gic_of_init(void)
 {
+       struct device_node *np;
+
+       /* Extract GIC distributor and TWD bases for OMAP4460 ROM Errata WA */
+       if (!cpu_is_omap446x())
+               goto skip_errata_init;
+
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
+       gic_dist_base_addr = of_iomap(np, 0);
+       WARN_ON(!gic_dist_base_addr);
+
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
+       twd_base = of_iomap(np, 0);
+       WARN_ON(!twd_base);
+
+skip_errata_init:
        omap_wakeupgen_init();
        irqchip_init();
 }