aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2011-09-21 17:30:31 -0400
committerBenoit Cousson <b-cousson@ti.com>2012-02-27 04:33:20 -0500
commitfbf75da733e82bb17a01e1b907b0e40d9c028823 (patch)
treeb99adf5a2671db3b5821e63e439ff14b74b0b31c /arch
parentd65c5423544d2d5a66dcd1c7a8630d3e32ff595b (diff)
ARM: OMAP2+: board-generic: Use of_irq_init API
Use the of_irq_init API introduced in 3.2 to handle interrupt-controller with DT. Update the irq_match table to map the proper XXX_of_init functions for INTC and GIC drivers. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-generic.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 02d7e828a14b..12f4c5ff23bb 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -12,6 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/of_irq.h>
15#include <linux/of_platform.h> 16#include <linux/of_platform.h>
16#include <linux/irqdomain.h> 17#include <linux/irqdomain.h>
17#include <linux/i2c/twl.h> 18#include <linux/i2c/twl.h>
@@ -24,6 +25,17 @@
24#include "common.h" 25#include "common.h"
25#include "common-board-devices.h" 26#include "common-board-devices.h"
26 27
28static struct of_device_id irq_match[] __initdata = {
29 { .compatible = "ti,omap2-intc", .data = omap_intc_of_init, },
30 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
31 { }
32};
33
34static void __init omap_init_irq(void)
35{
36 of_irq_init(irq_match);
37}
38
27/* 39/*
28 * XXX: Still needed to boot until the i2c & twl driver is adapted to 40 * XXX: Still needed to boot until the i2c & twl driver is adapted to
29 * device-tree 41 * device-tree
@@ -58,18 +70,8 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
58 { } 70 { }
59}; 71};
60 72
61static struct of_device_id intc_match[] __initdata = {
62 { .compatible = "ti,omap3-intc", },
63 { .compatible = "arm,cortex-a9-gic", },
64 { }
65};
66
67static void __init omap_generic_init(void) 73static void __init omap_generic_init(void)
68{ 74{
69 struct device_node *node = of_find_matching_node(NULL, intc_match);
70 if (node)
71 irq_domain_add_legacy(node, 32, 0, 0, &irq_domain_simple_ops, NULL);
72
73 omap_sdrc_init(NULL, NULL); 75 omap_sdrc_init(NULL, NULL);
74 76
75 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); 77 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
@@ -101,7 +103,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
101 .reserve = omap_reserve, 103 .reserve = omap_reserve,
102 .map_io = omap242x_map_io, 104 .map_io = omap242x_map_io,
103 .init_early = omap2420_init_early, 105 .init_early = omap2420_init_early,
104 .init_irq = omap2_init_irq, 106 .init_irq = omap_init_irq,
105 .handle_irq = omap2_intc_handle_irq, 107 .handle_irq = omap2_intc_handle_irq,
106 .init_machine = omap_generic_init, 108 .init_machine = omap_generic_init,
107 .timer = &omap2_timer, 109 .timer = &omap2_timer,
@@ -120,7 +122,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
120 .reserve = omap_reserve, 122 .reserve = omap_reserve,
121 .map_io = omap243x_map_io, 123 .map_io = omap243x_map_io,
122 .init_early = omap2430_init_early, 124 .init_early = omap2430_init_early,
123 .init_irq = omap2_init_irq, 125 .init_irq = omap_init_irq,
124 .handle_irq = omap2_intc_handle_irq, 126 .handle_irq = omap2_intc_handle_irq,
125 .init_machine = omap_generic_init, 127 .init_machine = omap_generic_init,
126 .timer = &omap2_timer, 128 .timer = &omap2_timer,
@@ -139,7 +141,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
139 .reserve = omap_reserve, 141 .reserve = omap_reserve,
140 .map_io = omap3_map_io, 142 .map_io = omap3_map_io,
141 .init_early = omap3430_init_early, 143 .init_early = omap3430_init_early,
142 .init_irq = omap3_init_irq, 144 .init_irq = omap_init_irq,
143 .handle_irq = omap3_intc_handle_irq, 145 .handle_irq = omap3_intc_handle_irq,
144 .init_machine = omap3_init, 146 .init_machine = omap3_init,
145 .timer = &omap3_timer, 147 .timer = &omap3_timer,
@@ -158,7 +160,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
158 .reserve = omap_reserve, 160 .reserve = omap_reserve,
159 .map_io = omap4_map_io, 161 .map_io = omap4_map_io,
160 .init_early = omap4430_init_early, 162 .init_early = omap4430_init_early,
161 .init_irq = gic_init_irq, 163 .init_irq = omap_init_irq,
162 .handle_irq = gic_handle_irq, 164 .handle_irq = gic_handle_irq,
163 .init_machine = omap4_init, 165 .init_machine = omap4_init,
164 .timer = &omap4_timer, 166 .timer = &omap4_timer,