diff options
author | R Sricharan <r.sricharan@ti.com> | 2012-06-05 07:01:06 -0400 |
---|---|---|
committer | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2012-07-09 09:44:39 -0400 |
commit | c4082d499fa2c90c089830700e34b64e3b924bb8 (patch) | |
tree | a044ec9fffafdf79b258aa928892bc1408822107 /arch | |
parent | 283f708ca846903ee045e9f9374d627f7b47a711 (diff) |
ARM: omap2+: board-generic: clean up the irq data from board file
Move the irq_match arrays and the irq init functions of OMAP 2,3
and 4 based boards out of board-generic.c file and also rename the
irq init function to match the interrupt controller present in
the SOCs.
This is a preparatory patch to add the OMAP5 evm board's irq init
support with device tree.
Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/irq.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 13 |
4 files changed, 35 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 2f2abfb82d84..716e6b1a41de 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -25,23 +25,12 @@ | |||
25 | #include "common-board-devices.h" | 25 | #include "common-board-devices.h" |
26 | 26 | ||
27 | #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) | 27 | #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) |
28 | #define omap_intc_of_init NULL | 28 | #define intc_of_init NULL |
29 | #endif | 29 | #endif |
30 | #ifndef CONFIG_ARCH_OMAP4 | 30 | #ifndef CONFIG_ARCH_OMAP4 |
31 | #define gic_of_init NULL | 31 | #define gic_of_init NULL |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | static struct of_device_id irq_match[] __initdata = { | ||
35 | { .compatible = "ti,omap2-intc", .data = omap_intc_of_init, }, | ||
36 | { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, | ||
37 | { } | ||
38 | }; | ||
39 | |||
40 | static void __init omap_init_irq(void) | ||
41 | { | ||
42 | of_irq_init(irq_match); | ||
43 | } | ||
44 | |||
45 | static struct of_device_id omap_dt_match_table[] __initdata = { | 34 | static struct of_device_id omap_dt_match_table[] __initdata = { |
46 | { .compatible = "simple-bus", }, | 35 | { .compatible = "simple-bus", }, |
47 | { .compatible = "ti,omap-infra", }, | 36 | { .compatible = "ti,omap-infra", }, |
@@ -65,7 +54,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") | |||
65 | .reserve = omap_reserve, | 54 | .reserve = omap_reserve, |
66 | .map_io = omap242x_map_io, | 55 | .map_io = omap242x_map_io, |
67 | .init_early = omap2420_init_early, | 56 | .init_early = omap2420_init_early, |
68 | .init_irq = omap_init_irq, | 57 | .init_irq = omap_intc_of_init, |
69 | .handle_irq = omap2_intc_handle_irq, | 58 | .handle_irq = omap2_intc_handle_irq, |
70 | .init_machine = omap_generic_init, | 59 | .init_machine = omap_generic_init, |
71 | .timer = &omap2_timer, | 60 | .timer = &omap2_timer, |
@@ -84,7 +73,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") | |||
84 | .reserve = omap_reserve, | 73 | .reserve = omap_reserve, |
85 | .map_io = omap243x_map_io, | 74 | .map_io = omap243x_map_io, |
86 | .init_early = omap2430_init_early, | 75 | .init_early = omap2430_init_early, |
87 | .init_irq = omap_init_irq, | 76 | .init_irq = omap_intc_of_init, |
88 | .handle_irq = omap2_intc_handle_irq, | 77 | .handle_irq = omap2_intc_handle_irq, |
89 | .init_machine = omap_generic_init, | 78 | .init_machine = omap_generic_init, |
90 | .timer = &omap2_timer, | 79 | .timer = &omap2_timer, |
@@ -103,7 +92,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") | |||
103 | .reserve = omap_reserve, | 92 | .reserve = omap_reserve, |
104 | .map_io = omap3_map_io, | 93 | .map_io = omap3_map_io, |
105 | .init_early = omap3430_init_early, | 94 | .init_early = omap3430_init_early, |
106 | .init_irq = omap_init_irq, | 95 | .init_irq = omap_intc_of_init, |
107 | .handle_irq = omap3_intc_handle_irq, | 96 | .handle_irq = omap3_intc_handle_irq, |
108 | .init_machine = omap_generic_init, | 97 | .init_machine = omap_generic_init, |
109 | .timer = &omap3_timer, | 98 | .timer = &omap3_timer, |
@@ -122,7 +111,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") | |||
122 | .reserve = omap_reserve, | 111 | .reserve = omap_reserve, |
123 | .map_io = am33xx_map_io, | 112 | .map_io = am33xx_map_io, |
124 | .init_early = am33xx_init_early, | 113 | .init_early = am33xx_init_early, |
125 | .init_irq = omap_init_irq, | 114 | .init_irq = omap_intc_of_init, |
126 | .handle_irq = omap3_intc_handle_irq, | 115 | .handle_irq = omap3_intc_handle_irq, |
127 | .init_machine = omap_generic_init, | 116 | .init_machine = omap_generic_init, |
128 | .timer = &omap3_am33xx_timer, | 117 | .timer = &omap3_am33xx_timer, |
@@ -140,7 +129,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") | |||
140 | .reserve = omap_reserve, | 129 | .reserve = omap_reserve, |
141 | .map_io = omap4_map_io, | 130 | .map_io = omap4_map_io, |
142 | .init_early = omap4430_init_early, | 131 | .init_early = omap4430_init_early, |
143 | .init_irq = omap_init_irq, | 132 | .init_irq = omap_gic_of_init, |
144 | .handle_irq = gic_handle_irq, | 133 | .handle_irq = gic_handle_irq, |
145 | .init_machine = omap_generic_init, | 134 | .init_machine = omap_generic_init, |
146 | .init_late = omap4430_init_late, | 135 | .init_late = omap4430_init_late, |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 960f98451a2e..1f65b1871c23 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -239,6 +239,8 @@ void omap3_intc_prepare_idle(void); | |||
239 | void omap3_intc_resume_idle(void); | 239 | void omap3_intc_resume_idle(void); |
240 | void omap2_intc_handle_irq(struct pt_regs *regs); | 240 | void omap2_intc_handle_irq(struct pt_regs *regs); |
241 | void omap3_intc_handle_irq(struct pt_regs *regs); | 241 | void omap3_intc_handle_irq(struct pt_regs *regs); |
242 | void omap_intc_of_init(void); | ||
243 | void omap_gic_of_init(void); | ||
242 | 244 | ||
243 | #ifdef CONFIG_CACHE_L2X0 | 245 | #ifdef CONFIG_CACHE_L2X0 |
244 | extern void __iomem *omap4_get_l2cache_base(void); | 246 | extern void __iomem *omap4_get_l2cache_base(void); |
@@ -246,10 +248,10 @@ extern void __iomem *omap4_get_l2cache_base(void); | |||
246 | 248 | ||
247 | struct device_node; | 249 | struct device_node; |
248 | #ifdef CONFIG_OF | 250 | #ifdef CONFIG_OF |
249 | int __init omap_intc_of_init(struct device_node *node, | 251 | int __init intc_of_init(struct device_node *node, |
250 | struct device_node *parent); | 252 | struct device_node *parent); |
251 | #else | 253 | #else |
252 | int __init omap_intc_of_init(struct device_node *node, | 254 | int __init intc_of_init(struct device_node *node, |
253 | struct device_node *parent) | 255 | struct device_node *parent) |
254 | { | 256 | { |
255 | return 0; | 257 | return 0; |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index d5b34febd82d..8467beb122b5 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/irqdomain.h> | 21 | #include <linux/irqdomain.h> |
22 | #include <linux/of.h> | 22 | #include <linux/of.h> |
23 | #include <linux/of_address.h> | 23 | #include <linux/of_address.h> |
24 | #include <linux/of_irq.h> | ||
24 | 25 | ||
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | 27 | ||
@@ -258,7 +259,7 @@ asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs | |||
258 | omap_intc_handle_irq(base_addr, regs); | 259 | omap_intc_handle_irq(base_addr, regs); |
259 | } | 260 | } |
260 | 261 | ||
261 | int __init omap_intc_of_init(struct device_node *node, | 262 | int __init intc_of_init(struct device_node *node, |
262 | struct device_node *parent) | 263 | struct device_node *parent) |
263 | { | 264 | { |
264 | struct resource res; | 265 | struct resource res; |
@@ -280,6 +281,16 @@ int __init omap_intc_of_init(struct device_node *node, | |||
280 | return 0; | 281 | return 0; |
281 | } | 282 | } |
282 | 283 | ||
284 | static struct of_device_id irq_match[] __initdata = { | ||
285 | { .compatible = "ti,omap2-intc", .data = intc_of_init, }, | ||
286 | { } | ||
287 | }; | ||
288 | |||
289 | void __init omap_intc_of_init(void) | ||
290 | { | ||
291 | of_irq_init(irq_match); | ||
292 | } | ||
293 | |||
283 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) | 294 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) |
284 | static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; | 295 | static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; |
285 | 296 | ||
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index a8161e5f3204..f38d659869da 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <asm/hardware/cache-l2x0.h> | 21 | #include <asm/hardware/cache-l2x0.h> |
22 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
23 | #include <asm/memblock.h> | 23 | #include <asm/memblock.h> |
24 | #include <linux/of_irq.h> | ||
25 | #include <linux/of_platform.h> | ||
24 | 26 | ||
25 | #include <plat/irqs.h> | 27 | #include <plat/irqs.h> |
26 | #include <plat/sram.h> | 28 | #include <plat/sram.h> |
@@ -210,6 +212,17 @@ static int __init omap4_sar_ram_init(void) | |||
210 | } | 212 | } |
211 | early_initcall(omap4_sar_ram_init); | 213 | early_initcall(omap4_sar_ram_init); |
212 | 214 | ||
215 | static struct of_device_id irq_match[] __initdata = { | ||
216 | { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, | ||
217 | { } | ||
218 | }; | ||
219 | |||
220 | void __init omap_gic_of_init(void) | ||
221 | { | ||
222 | omap_wakeupgen_init(); | ||
223 | of_irq_init(irq_match); | ||
224 | } | ||
225 | |||
213 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | 226 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
214 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 227 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
215 | { | 228 | { |