diff options
author | Florian Fainelli <florian@openwrt.org> | 2012-11-16 16:32:55 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2012-11-16 16:32:55 +0000 |
commit | a4c205011b62f45e116eb26c974fa3bd771ce194 (patch) | |
tree | 123b05cb192785d0fc45c1f0acd0e6f8cba68144 /target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch | |
parent | 974b9f5c9a7322424d5127dbe45236a0658c69ba (diff) | |
download | upstream-a4c205011b62f45e116eb26c974fa3bd771ce194.tar.gz upstream-a4c205011b62f45e116eb26c974fa3bd771ce194.tar.bz2 upstream-a4c205011b62f45e116eb26c974fa3bd771ce194.zip |
move patches to patches-2.6.36
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 34220
Diffstat (limited to 'target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch')
-rw-r--r-- | target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch b/target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch new file mode 100644 index 0000000000..18d7f8beac --- /dev/null +++ b/target/linux/leon/patches-2.6.36/001-find_irq_and_timer_via_of.patch @@ -0,0 +1,48 @@ +From af1da1d5a8701f39cdbae4a0ab8e04b450eef298 Mon Sep 17 00:00:00 2001 +From: Daniel Hellstrom <daniel@gaisler.com> +Date: Wed, 8 Sep 2010 18:05:38 +0200 +Subject: [PATCH] SPARC/LEON: find IRQ and Timer via OF-Tree, instead of hardcoded. + +Signed-off-by: Daniel Hellstrom <daniel@gaisler.com> +--- + arch/sparc/kernel/leon_kernel.c | 23 ++++++++++++++++++++++- + 1 files changed, 22 insertions(+), 1 deletions(-) + +--- a/arch/sparc/kernel/leon_kernel.c ++++ b/arch/sparc/kernel/leon_kernel.c +@@ -105,13 +105,34 @@ static void leon_disable_irq(unsigned in + void __init leon_init_timers(irq_handler_t counter_fn) + { + int irq; ++ struct device_node *rootnp, *np; ++ struct property *pp; ++ int len; + + leondebug_irq_disable = 0; + leon_debug_irqout = 0; + master_l10_counter = (unsigned int *)&dummy_master_l10_counter; + dummy_master_l10_counter = 0; + +- if (leon3_gptimer_regs && leon3_irqctrl_regs) { ++ /* Find IRQMP IRQ Controller Registers base address otherwise bail out. */ ++ rootnp = of_find_node_by_path("/ambapp0"); ++ if (rootnp && (np=of_find_node_by_name(rootnp, "GAISLER_IRQMP"))) { ++ pp = of_find_property(np, "reg", &len); ++ if (pp) ++ leon3_irqctrl_regs = *(struct leon3_irqctrl_regs_map **)pp->value; ++ } ++ ++ /* Find GPTIMER Timer Registers base address otherwise bail out. */ ++ if (rootnp && (np=of_find_node_by_name(rootnp, "GAISLER_GPTIMER"))) { ++ pp = of_find_property(np, "reg", &len); ++ if (pp) ++ leon3_gptimer_regs = *(struct leon3_gptimer_regs_map **)pp->value; ++ pp = of_find_property(np, "interrupts", &len); ++ if (pp) ++ leon3_gptimer_irq = *(unsigned int *)pp->value; ++ } ++ ++ if (leon3_gptimer_regs && leon3_irqctrl_regs && leon3_gptimer_irq) { + LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0); + LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld, + (((1000000 / HZ) - 1))); |