aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-08-19 20:51:45 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-09-02 21:31:50 -0400
commiteeca6e604032af8336baafef84144dd47f5a0f99 (patch)
treecff564b1bf3de3ead8186fac9dec332a0cf3a170 /arch/arm
parent0b76c5412146c1c9e8aef495d2926f31351bc3c0 (diff)
ARM: mxs: retrieve timer irq from device tree
Rather than using the static timer irq definition, we should retrieve timer irq from device tree for better. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/imx23.dtsi3
-rw-r--r--arch/arm/boot/dts/imx28.dtsi3
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h2
-rw-r--r--arch/arm/mach-mxs/timer.c13
4 files changed, 17 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index e6138310e5ce..573066bc4c51 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -389,8 +389,9 @@
389 }; 389 };
390 390
391 timrot@80068000 { 391 timrot@80068000 {
392 compatible = "fsl,imx23-timrot", "fsl,timrot";
392 reg = <0x80068000 0x2000>; 393 reg = <0x80068000 0x2000>;
393 status = "disabled"; 394 interrupts = <28 29 30 31>;
394 }; 395 };
395 396
396 auart0: serial@8006c000 { 397 auart0: serial@8006c000 {
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 3fa6d190fab4..183fc65faa56 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -683,8 +683,9 @@
683 }; 683 };
684 684
685 timrot@80068000 { 685 timrot@80068000 {
686 compatible = "fsl,imx28-timrot", "fsl,timrot";
686 reg = <0x80068000 0x2000>; 687 reg = <0x80068000 0x2000>;
687 status = "disabled"; 688 interrupts = <48 49 50 51>;
688 }; 689 };
689 690
690 auart0: serial@8006a000 { 691 auart0: serial@8006a000 {
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index de6c7ba42544..a7416c8a85ff 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -13,7 +13,7 @@
13 13
14extern const u32 *mxs_get_ocotp(void); 14extern const u32 *mxs_get_ocotp(void);
15extern int mxs_reset_block(void __iomem *); 15extern int mxs_reset_block(void __iomem *);
16extern void mxs_timer_init(int); 16extern void mxs_timer_init(void);
17extern void mxs_restart(char, const char *); 17extern void mxs_restart(char, const char *);
18extern int mxs_saif_clkmux_select(unsigned int clkmux); 18extern int mxs_saif_clkmux_select(unsigned int clkmux);
19 19
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 02d36de9c4e8..7c3792613392 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -25,6 +25,8 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/of.h>
29#include <linux/of_irq.h>
28 30
29#include <asm/mach/time.h> 31#include <asm/mach/time.h>
30#include <mach/mxs.h> 32#include <mach/mxs.h>
@@ -244,9 +246,17 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
244 return 0; 246 return 0;
245} 247}
246 248
247void __init mxs_timer_init(int irq) 249void __init mxs_timer_init(void)
248{ 250{
251 struct device_node *np;
249 struct clk *timer_clk; 252 struct clk *timer_clk;
253 int irq;
254
255 np = of_find_compatible_node(NULL, NULL, "fsl,timrot");
256 if (!np) {
257 pr_err("%s: failed find timrot node\n", __func__);
258 return;
259 }
250 260
251 timer_clk = clk_get_sys("timrot", NULL); 261 timer_clk = clk_get_sys("timrot", NULL);
252 if (IS_ERR(timer_clk)) { 262 if (IS_ERR(timer_clk)) {
@@ -295,5 +305,6 @@ void __init mxs_timer_init(int irq)
295 mxs_clockevent_init(timer_clk); 305 mxs_clockevent_init(timer_clk);
296 306
297 /* Make irqs happen */ 307 /* Make irqs happen */
308 irq = irq_of_parse_and_map(np, 0);
298 setup_irq(irq, &mxs_timer_irq); 309 setup_irq(irq, &mxs_timer_irq);
299} 310}