diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap4-common.c')
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index b7cb44abe49b..cc30e49a4cc2 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c | |||
@@ -256,6 +256,38 @@ static int __init omap4_sar_ram_init(void) | |||
256 | } | 256 | } |
257 | omap_early_initcall(omap4_sar_ram_init); | 257 | omap_early_initcall(omap4_sar_ram_init); |
258 | 258 | ||
259 | static struct of_device_id gic_match[] = { | ||
260 | { .compatible = "arm,cortex-a9-gic", }, | ||
261 | { .compatible = "arm,cortex-a15-gic", }, | ||
262 | { }, | ||
263 | }; | ||
264 | |||
265 | static struct device_node *gic_node; | ||
266 | |||
267 | unsigned int omap4_xlate_irq(unsigned int hwirq) | ||
268 | { | ||
269 | struct of_phandle_args irq_data; | ||
270 | unsigned int irq; | ||
271 | |||
272 | if (!gic_node) | ||
273 | gic_node = of_find_matching_node(NULL, gic_match); | ||
274 | |||
275 | if (WARN_ON(!gic_node)) | ||
276 | return hwirq; | ||
277 | |||
278 | irq_data.np = gic_node; | ||
279 | irq_data.args_count = 3; | ||
280 | irq_data.args[0] = 0; | ||
281 | irq_data.args[1] = hwirq - OMAP44XX_IRQ_GIC_START; | ||
282 | irq_data.args[2] = IRQ_TYPE_LEVEL_HIGH; | ||
283 | |||
284 | irq = irq_create_of_mapping(&irq_data); | ||
285 | if (WARN_ON(!irq)) | ||
286 | irq = hwirq; | ||
287 | |||
288 | return irq; | ||
289 | } | ||
290 | |||
259 | void __init omap_gic_of_init(void) | 291 | void __init omap_gic_of_init(void) |
260 | { | 292 | { |
261 | struct device_node *np; | 293 | struct device_node *np; |