<br><div class="gmail_quote">On Fri, Mar 23, 2012 at 7:49 AM, Viresh Kumar <span dir="ltr"><<a href="mailto:viresh.kumar@st.com">viresh.kumar@st.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Few platforms define there own struct of_device_id[] for GIC. They don't<br>
do anything specific in init_irq() other than of_irq_init().<br>
<br>
This patch creates this struct array in gic.c and make other platforms use it.<br>
<br>
Signed-off-by: Viresh Kumar <<a href="mailto:viresh.kumar@st.com">viresh.kumar@st.com</a>><br>
---<br>
arch/arm/common/gic.c | 10 ++++++++++<br>
arch/arm/include/asm/hardware/gic.h | 1 +<br>
arch/arm/mach-exynos/common.c | 9 +--------<br>
arch/arm/mach-highbank/highbank.c | 7 +------<br>
arch/arm/mach-imx/mach-imx6q.c | 2 +-<br>
arch/arm/mach-tegra/common.c | 7 +------<br>
arch/arm/mach-ux500/cpu.c | 7 +------<br>
arch/arm/mach-vexpress/v2m.c | 12 +-----------<br>
8 files changed, 17 insertions(+), 38 deletions(-)<br>
<br>
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c<br>
index aa52699..77afdae 100644<br>
--- a/arch/arm/common/gic.c<br>
+++ b/arch/arm/common/gic.c<br>
@@ -781,4 +781,14 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)<br>
gic_cnt++;<br>
return 0;<br>
}<br>
+<br>
+static const struct of_device_id gic_of_match[] __initconst = {<br>
+ { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
+ { /* Sentinel */ }<br>
+};<br>
+<br>
+void __init gic_init_irq(void)<br>
+{<br>
+ of_irq_init(gic_of_match);<br>
+}<br>
#endif<br>
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h<br>
index 4b1ce6c..7bce4bd 100644<br>
--- a/arch/arm/include/asm/hardware/gic.h<br>
+++ b/arch/arm/include/asm/hardware/gic.h<br>
@@ -42,6 +42,7 @@ void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,<br>
u32 offset, struct device_node *);<br>
int gic_of_init(struct device_node *node, struct device_node *parent);<br>
void gic_secondary_init(unsigned int);<br>
+void __init gic_init_irq(void);<br>
void gic_handle_irq(struct pt_regs *regs);<br>
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);<br>
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);<br>
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c<br>
index 85ed8b5..76f6079 100644<br>
--- a/arch/arm/mach-exynos/common.c<br>
+++ b/arch/arm/mach-exynos/common.c<br>
@@ -502,13 +502,6 @@ static void __init combiner_init(unsigned int combiner_nr, void __iomem *base,<br>
}<br>
}<br>
<br>
-#ifdef CONFIG_OF<br>
-static const struct of_device_id exynos4_dt_irq_match[] = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
- {},<br>
-};<br>
-#endif<br>
-<br>
void __init exynos4_init_irq(void)<br>
{<br>
int irq;<br>
@@ -520,7 +513,7 @@ void __init exynos4_init_irq(void)<br>
gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);<br>
#ifdef CONFIG_OF<br>
else<br>
- of_irq_init(exynos4_dt_irq_match);<br>
+ gic_init_irq();<br>
#endif<br>
<br>
for (irq = 0; irq < EXYNOS4_MAX_COMBINER_NR; irq++) {<br>
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c<br>
index 410a112..42b30c6 100644<br>
--- a/arch/arm/mach-highbank/highbank.c<br>
+++ b/arch/arm/mach-highbank/highbank.c<br>
@@ -80,14 +80,9 @@ void highbank_set_cpu_jump(int cpu, void *jump_addr)<br>
HB_JUMP_TABLE_PHYS(cpu) + 15);<br>
}<br>
<br>
-const static struct of_device_id irq_match[] = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
- {}<br>
-};<br>
-<br>
static void __init highbank_init_irq(void)<br>
{<br>
- of_irq_init(irq_match);<br>
+ gic_init_irq();<br>
l2x0_of_init(0, ~0UL);<br>
}<br>
<br>
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c<br>
index 7696dfa..ebaf6c5 100644<br>
--- a/arch/arm/mach-imx/mach-imx6q.c<br>
+++ b/arch/arm/mach-imx/mach-imx6q.c<br>
@@ -105,7 +105,6 @@ static int __init imx6q_gpio_add_irq_domain(struct device_node *np,<br>
}<br>
<br>
static const struct of_device_id imx6q_irq_match[] __initconst = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
{ .compatible = "fsl,imx6q-gpio", .data = imx6q_gpio_add_irq_domain, },<br>
{ /* sentinel */ }<br>
};<br>
@@ -115,6 +114,7 @@ static void __init imx6q_init_irq(void)<br>
l2x0_of_init(0, ~0UL);<br>
imx_src_init();<br>
imx_gpc_init();<br>
+ gic_init_irq();<br>
of_irq_init(imx6q_irq_match);<br>
}<br>
<br>
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c<br>
index 22df10f..c8d6208 100644<br>
--- a/arch/arm/mach-tegra/common.c<br>
+++ b/arch/arm/mach-tegra/common.c<br>
@@ -52,15 +52,10 @@ u32 tegra_uart_config[3] = {<br>
};<br>
<br>
#ifdef CONFIG_OF<br>
-static const struct of_device_id tegra_dt_irq_match[] __initconst = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },<br>
- { }<br>
-};<br>
-<br>
void __init tegra_dt_init_irq(void)<br>
{<br>
tegra_init_irq();<br>
- of_irq_init(tegra_dt_irq_match);<br>
+ gic_init_irq();<br>
}<br>
#endif<br>
<br>
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c<br>
index d11f389..3bb6f13 100644<br>
--- a/arch/arm/mach-ux500/cpu.c<br>
+++ b/arch/arm/mach-ux500/cpu.c<br>
@@ -30,11 +30,6 @@<br>
<br>
void __iomem *_PRCMU_BASE;<br>
<br>
-static const struct of_device_id ux500_dt_irq_match[] = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
- {},<br>
-};<br>
-<br>
void __init ux500_init_irq(void)<br>
{<br>
void __iomem *dist_base;<br>
@@ -51,7 +46,7 @@ void __init ux500_init_irq(void)<br>
<br>
#ifdef CONFIG_OF<br>
if (of_have_populated_dt())<br>
- of_irq_init(ux500_dt_irq_match);<br>
+ gic_init_irq();<br>
else<br>
#endif<br>
gic_init(0, 29, dist_base, cpu_base);<br>
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c<br>
index 47cdcca..3d875f2 100644<br>
--- a/arch/arm/mach-vexpress/v2m.c<br>
+++ b/arch/arm/mach-vexpress/v2m.c<br>
@@ -619,16 +619,6 @@ void __init v2m_dt_init_early(void)<br>
versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000);<br>
}<br>
<br>
-static struct of_device_id vexpress_irq_match[] __initdata = {<br>
- { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },<br>
- {}<br>
-};<br>
-<br>
-static void __init v2m_dt_init_irq(void)<br>
-{<br>
- of_irq_init(vexpress_irq_match);<br>
-}<br>
-<br>
static void __init v2m_dt_timer_init(void)<br>
{<br>
struct device_node *node;<br>
@@ -677,7 +667,7 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")<br>
.dt_compat = v2m_dt_match,<br>
.map_io = v2m_dt_map_io,<br>
.init_early = v2m_dt_init_early,<br>
- .init_irq = v2m_dt_init_irq,<br>
+ .init_irq = gic_init_irq,<br>
.timer = &v2m_dt_timer,<br>
.init_machine = v2m_dt_init,<br>
.handle_irq = gic_handle_irq,</blockquote><div><br></div><div>Looks sensible.</div><div><br></div><div>For the ux500 stuff:</div><div><br></div><div>Acked-by: Lee Jones <<a href="mailto:lee.jones@linaro.org">lee.jones@linaro.org</a>></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote></div><br>