diff options
author | Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> | 2014-04-05 17:57:45 +0200 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-04-30 13:40:28 +0800 |
commit | 876292d66791c0f635333bf8d31efd11701fe495 (patch) | |
tree | ed7bed8d90e21ea240cba2406f6a609ce2b10833 /arch/arm/mach-imx/time.c | |
parent | bc02cd69821f3610422d26987f1cdef25c87a7b2 (diff) |
ARM: imx: factor device tree timer initialization
Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx/time.c')
-rw-r--r-- | arch/arm/mach-imx/time.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index 65222ea0df6d..bed081e58262 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -28,6 +28,9 @@ #include <linux/delay.h> #include <linux/err.h> #include <linux/sched_clock.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> #include <asm/mach/time.h> @@ -328,3 +331,15 @@ void __init mxc_timer_init(void __iomem *base, int irq) /* Make irqs happen */ setup_irq(irq, &mxc_timer_irq); } + +void __init mxc_timer_init_dt(struct device_node *np) +{ + void __iomem *base; + int irq; + + base = of_iomap(np, 0); + WARN_ON(!base); + irq = irq_of_parse_and_map(np, 0); + + mxc_timer_init(base, irq); +} |