aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-07-13 01:34:00 -0400
committerShawn Guo <shawn.guo@freescale.com>2014-07-18 04:11:39 -0400
commitfd4959d8779a8e7099c6ecf4f7c854dbf34890e9 (patch)
tree6a26d8b527816a9c59e36e07378e85c60fa33cbb /arch/arm/mach-imx
parent6befda9a272b98bfb1dc772efc3564644cbfb270 (diff)
ARM: i.MX: Use CLOCKSOURCE_OF_DECLARE() for DT targets
This patch uses clocksource_of_init() call for DT targets. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/clk-imx1.c2
-rw-r--r--arch/arm/mach-imx/clk-imx21.c2
-rw-r--r--arch/arm/mach-imx/clk-imx25.c2
-rw-r--r--arch/arm/mach-imx/clk-imx27.c2
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c7
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c2
-rw-r--r--arch/arm/mach-imx/clk-imx6sl.c3
-rw-r--r--arch/arm/mach-imx/clk-imx6sx.c3
-rw-r--r--arch/arm/mach-imx/common.h1
-rw-r--r--arch/arm/mach-imx/time.c13
10 files changed, 12 insertions, 25 deletions
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 42017e2c3aa7..37c307a8d896 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -113,7 +113,5 @@ static void __init mx1_clocks_init_dt(struct device_node *np)
113 clk_data.clks = clk; 113 clk_data.clks = clk;
114 clk_data.clk_num = ARRAY_SIZE(clk); 114 clk_data.clk_num = ARRAY_SIZE(clk);
115 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 115 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
116
117 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx1-gpt"));
118} 116}
119CLK_OF_DECLARE(imx1_ccm, "fsl,imx1-ccm", mx1_clocks_init_dt); 117CLK_OF_DECLARE(imx1_ccm, "fsl,imx1-ccm", mx1_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index 6b36738b170d..4b4c75339aa6 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -167,7 +167,5 @@ static void __init mx21_clocks_init_dt(struct device_node *np)
167 clk_data.clks = clk; 167 clk_data.clks = clk;
168 clk_data.clk_num = ARRAY_SIZE(clk); 168 clk_data.clk_num = ARRAY_SIZE(clk);
169 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 169 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
170
171 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx1-gpt"));
172} 170}
173CLK_OF_DECLARE(imx27_ccm, "fsl,imx21-ccm", mx21_clocks_init_dt); 171CLK_OF_DECLARE(imx27_ccm, "fsl,imx21-ccm", mx21_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index cab34c3e820b..59c0c8558c6b 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -335,7 +335,5 @@ static void __init mx25_clocks_init_dt(struct device_node *np)
335 clk_data.clks = clk; 335 clk_data.clks = clk;
336 clk_data.clk_num = ARRAY_SIZE(clk); 336 clk_data.clk_num = ARRAY_SIZE(clk);
337 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 337 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
338
339 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx25-gpt"));
340} 338}
341CLK_OF_DECLARE(imx25_ccm, "fsl,imx25-ccm", mx25_clocks_init_dt); 339CLK_OF_DECLARE(imx25_ccm, "fsl,imx25-ccm", mx25_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 07bc32cbcdd9..ab6349ec23b9 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -254,7 +254,5 @@ static void __init mx27_clocks_init_dt(struct device_node *np)
254 clk_data.clks = clk; 254 clk_data.clks = clk;
255 clk_data.clk_num = ARRAY_SIZE(clk); 255 clk_data.clk_num = ARRAY_SIZE(clk);
256 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 256 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
257
258 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx1-gpt"));
259} 257}
260CLK_OF_DECLARE(imx27_ccm, "fsl,imx27-ccm", mx27_clocks_init_dt); 258CLK_OF_DECLARE(imx27_ccm, "fsl,imx27-ccm", mx27_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index ee579718941c..72d65214223e 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -370,8 +370,6 @@ static void __init mx50_clocks_init(struct device_node *np)
370 370
371 r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000); 371 r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
372 clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r); 372 clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
373
374 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx50-gpt"));
375} 373}
376CLK_OF_DECLARE(imx50_ccm, "fsl,imx50-ccm", mx50_clocks_init); 374CLK_OF_DECLARE(imx50_ccm, "fsl,imx50-ccm", mx50_clocks_init);
377 375
@@ -443,9 +441,6 @@ static void __init mx51_clocks_init(struct device_node *np)
443 clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 166250000); 441 clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 166250000);
444 clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 166250000); 442 clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 166250000);
445 443
446 /* System timer */
447 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx51-gpt"));
448
449 clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]); 444 clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
450 imx_print_silicon_rev("i.MX51", mx51_revision()); 445 imx_print_silicon_rev("i.MX51", mx51_revision());
451 clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]); 446 clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
@@ -562,7 +557,5 @@ static void __init mx53_clocks_init(struct device_node *np)
562 557
563 r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000); 558 r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
564 clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r); 559 clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
565
566 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx53-gpt"));
567} 560}
568CLK_OF_DECLARE(imx53_ccm, "fsl,imx53-ccm", mx53_clocks_init); 561CLK_OF_DECLARE(imx53_ccm, "fsl,imx53-ccm", mx53_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 8a827acdde70..6cceb7765c14 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -455,7 +455,5 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
455 455
456 /* Set initial power mode */ 456 /* Set initial power mode */
457 imx6q_set_lpm(WAIT_CLOCKED); 457 imx6q_set_lpm(WAIT_CLOCKED);
458
459 mxc_timer_init_dt(of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"));
460} 458}
461CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init); 459CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 460241852418..fef46faf692f 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -377,8 +377,5 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
377 377
378 /* Set initial power mode */ 378 /* Set initial power mode */
379 imx6q_set_lpm(WAIT_CLOCKED); 379 imx6q_set_lpm(WAIT_CLOCKED);
380
381 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-gpt");
382 mxc_timer_init_dt(np);
383} 380}
384CLK_OF_DECLARE(imx6sl, "fsl,imx6sl-ccm", imx6sl_clocks_init); 381CLK_OF_DECLARE(imx6sl, "fsl,imx6sl-ccm", imx6sl_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c
index 7cd3f03a63c0..ecde72bdfe88 100644
--- a/arch/arm/mach-imx/clk-imx6sx.c
+++ b/arch/arm/mach-imx/clk-imx6sx.c
@@ -515,8 +515,5 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
515 515
516 /* Set initial power mode */ 516 /* Set initial power mode */
517 imx6q_set_lpm(WAIT_CLOCKED); 517 imx6q_set_lpm(WAIT_CLOCKED);
518
519 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sx-gpt");
520 mxc_timer_init_dt(np);
521} 518}
522CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init); 519CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init);
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index f7189bc461ad..22ba8973bcb9 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -49,7 +49,6 @@ void imx31_soc_init(void);
49void imx35_soc_init(void); 49void imx35_soc_init(void);
50void epit_timer_init(void __iomem *base, int irq); 50void epit_timer_init(void __iomem *base, int irq);
51void mxc_timer_init(void __iomem *, int); 51void mxc_timer_init(void __iomem *, int);
52void mxc_timer_init_dt(struct device_node *);
53int mx1_clocks_init(unsigned long fref); 52int mx1_clocks_init(unsigned long fref);
54int mx21_clocks_init(unsigned long lref, unsigned long fref); 53int mx21_clocks_init(unsigned long lref, unsigned long fref);
55int mx25_clocks_init(void); 54int mx25_clocks_init(void);
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 1da2270f5716..bf92e5a351c0 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -337,11 +337,14 @@ void __init mxc_timer_init(void __iomem *base, int irq)
337 _mxc_timer_init(irq, clk_per, clk_ipg); 337 _mxc_timer_init(irq, clk_per, clk_ipg);
338} 338}
339 339
340void __init mxc_timer_init_dt(struct device_node *np) 340static void __init mxc_timer_init_dt(struct device_node *np)
341{ 341{
342 struct clk *clk_per, *clk_ipg; 342 struct clk *clk_per, *clk_ipg;
343 int irq; 343 int irq;
344 344
345 if (timer_base)
346 return;
347
345 timer_base = of_iomap(np, 0); 348 timer_base = of_iomap(np, 0);
346 WARN_ON(!timer_base); 349 WARN_ON(!timer_base);
347 irq = irq_of_parse_and_map(np, 0); 350 irq = irq_of_parse_and_map(np, 0);
@@ -351,3 +354,11 @@ void __init mxc_timer_init_dt(struct device_node *np)
351 354
352 _mxc_timer_init(irq, clk_per, clk_ipg); 355 _mxc_timer_init(irq, clk_per, clk_ipg);
353} 356}
357CLOCKSOURCE_OF_DECLARE(mx1_timer, "fsl,imx1-gpt", mxc_timer_init_dt);
358CLOCKSOURCE_OF_DECLARE(mx25_timer, "fsl,imx25-gpt", mxc_timer_init_dt);
359CLOCKSOURCE_OF_DECLARE(mx50_timer, "fsl,imx50-gpt", mxc_timer_init_dt);
360CLOCKSOURCE_OF_DECLARE(mx51_timer, "fsl,imx51-gpt", mxc_timer_init_dt);
361CLOCKSOURCE_OF_DECLARE(mx53_timer, "fsl,imx53-gpt", mxc_timer_init_dt);
362CLOCKSOURCE_OF_DECLARE(mx6q_timer, "fsl,imx6q-gpt", mxc_timer_init_dt);
363CLOCKSOURCE_OF_DECLARE(mx6sl_timer, "fsl,imx6sl-gpt", mxc_timer_init_dt);
364CLOCKSOURCE_OF_DECLARE(mx6sx_timer, "fsl,imx6sx-gpt", mxc_timer_init_dt);