Skip to content

Commit

Permalink
ARM: omap2+: board-generic: clean up the irq data from board file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
R Sricharan authored and Santosh Shilimkar committed Jul 9, 2012
1 parent 283f708 commit c4082d4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
23 changes: 6 additions & 17 deletions arch/arm/mach-omap2/board-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,12 @@
#include "common-board-devices.h"

#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
#define omap_intc_of_init NULL
#define intc_of_init NULL
#endif
#ifndef CONFIG_ARCH_OMAP4
#define gic_of_init NULL
#endif

static struct of_device_id irq_match[] __initdata = {
{ .compatible = "ti,omap2-intc", .data = omap_intc_of_init, },
{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
{ }
};

static void __init omap_init_irq(void)
{
of_irq_init(irq_match);
}

static struct of_device_id omap_dt_match_table[] __initdata = {
{ .compatible = "simple-bus", },
{ .compatible = "ti,omap-infra", },
Expand All @@ -65,7 +54,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap242x_map_io,
.init_early = omap2420_init_early,
.init_irq = omap_init_irq,
.init_irq = omap_intc_of_init,
.handle_irq = omap2_intc_handle_irq,
.init_machine = omap_generic_init,
.timer = &omap2_timer,
Expand All @@ -84,7 +73,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap243x_map_io,
.init_early = omap2430_init_early,
.init_irq = omap_init_irq,
.init_irq = omap_intc_of_init,
.handle_irq = omap2_intc_handle_irq,
.init_machine = omap_generic_init,
.timer = &omap2_timer,
Expand All @@ -103,7 +92,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3430_init_early,
.init_irq = omap_init_irq,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
.timer = &omap3_timer,
Expand All @@ -122,7 +111,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = am33xx_map_io,
.init_early = am33xx_init_early,
.init_irq = omap_init_irq,
.init_irq = omap_intc_of_init,
.handle_irq = omap3_intc_handle_irq,
.init_machine = omap_generic_init,
.timer = &omap3_am33xx_timer,
Expand All @@ -140,7 +129,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
.reserve = omap_reserve,
.map_io = omap4_map_io,
.init_early = omap4430_init_early,
.init_irq = omap_init_irq,
.init_irq = omap_gic_of_init,
.handle_irq = gic_handle_irq,
.init_machine = omap_generic_init,
.init_late = omap4430_init_late,
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-omap2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,19 @@ void omap3_intc_prepare_idle(void);
void omap3_intc_resume_idle(void);
void omap2_intc_handle_irq(struct pt_regs *regs);
void omap3_intc_handle_irq(struct pt_regs *regs);
void omap_intc_of_init(void);
void omap_gic_of_init(void);

#ifdef CONFIG_CACHE_L2X0
extern void __iomem *omap4_get_l2cache_base(void);
#endif

struct device_node;
#ifdef CONFIG_OF
int __init omap_intc_of_init(struct device_node *node,
int __init intc_of_init(struct device_node *node,
struct device_node *parent);
#else
int __init omap_intc_of_init(struct device_node *node,
int __init intc_of_init(struct device_node *node,
struct device_node *parent)
{
return 0;
Expand Down
13 changes: 12 additions & 1 deletion arch/arm/mach-omap2/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/irqdomain.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>

#include <mach/hardware.h>

Expand Down Expand Up @@ -258,7 +259,7 @@ asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs
omap_intc_handle_irq(base_addr, regs);
}

int __init omap_intc_of_init(struct device_node *node,
int __init intc_of_init(struct device_node *node,
struct device_node *parent)
{
struct resource res;
Expand All @@ -280,6 +281,16 @@ int __init omap_intc_of_init(struct device_node *node,
return 0;
}

static struct of_device_id irq_match[] __initdata = {
{ .compatible = "ti,omap2-intc", .data = intc_of_init, },
{ }
};

void __init omap_intc_of_init(void)
{
of_irq_init(irq_match);
}

#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];

Expand Down
13 changes: 13 additions & 0 deletions arch/arm/mach-omap2/omap4-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/map.h>
#include <asm/memblock.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>

#include <plat/irqs.h>
#include <plat/sram.h>
Expand Down Expand Up @@ -210,6 +212,17 @@ static int __init omap4_sar_ram_init(void)
}
early_initcall(omap4_sar_ram_init);

static struct of_device_id irq_match[] __initdata = {
{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
{ }
};

void __init omap_gic_of_init(void)
{
omap_wakeupgen_init();
of_irq_init(irq_match);
}

#if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
static int omap4_twl6030_hsmmc_late_init(struct device *dev)
{
Expand Down

0 comments on commit c4082d4

Please sign in to comment.