diff options
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 44 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 7 |
2 files changed, 41 insertions, 10 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index bcf2b97db300..f1583a23b3a5 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/clk.h> | ||
25 | #include <asm/clkdev.h> | ||
24 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
25 | #include <asm/hwblk.h> | 27 | #include <asm/hwblk.h> |
26 | #include <cpu/sh7724.h> | 28 | #include <cpu/sh7724.h> |
@@ -189,11 +191,11 @@ static struct clk mstp_clks[] = { | |||
189 | SH_HWBLK_CLK("sh0", -1, SH_CLK, HWBLK_SHYWAY, CLK_ENABLE_ON_INIT), | 191 | SH_HWBLK_CLK("sh0", -1, SH_CLK, HWBLK_SHYWAY, CLK_ENABLE_ON_INIT), |
190 | SH_HWBLK_CLK("hudi0", -1, P_CLK, HWBLK_HUDI, 0), | 192 | SH_HWBLK_CLK("hudi0", -1, P_CLK, HWBLK_HUDI, 0), |
191 | SH_HWBLK_CLK("ubc0", -1, I_CLK, HWBLK_UBC, 0), | 193 | SH_HWBLK_CLK("ubc0", -1, I_CLK, HWBLK_UBC, 0), |
192 | SH_HWBLK_CLK("tmu0", -1, P_CLK, HWBLK_TMU0, 0), | 194 | SH_HWBLK_CLK("tmu012_fck", -1, P_CLK, HWBLK_TMU0, 0), |
193 | SH_HWBLK_CLK("cmt0", -1, R_CLK, HWBLK_CMT, 0), | 195 | SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0), |
194 | SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), | 196 | SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), |
195 | SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), | 197 | SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), |
196 | SH_HWBLK_CLK("tmu1", -1, P_CLK, HWBLK_TMU1, 0), | 198 | SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0), |
197 | SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), | 199 | SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), |
198 | SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), | 200 | SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), |
199 | SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), | 201 | SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), |
@@ -233,6 +235,40 @@ static struct clk mstp_clks[] = { | |||
233 | SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), | 235 | SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), |
234 | }; | 236 | }; |
235 | 237 | ||
238 | static struct clk_lookup lookups[] = { | ||
239 | { | ||
240 | /* TMU0 */ | ||
241 | .dev_id = "sh_tmu.0", | ||
242 | .con_id = "tmu_fck", | ||
243 | .clk = &mstp_clks[12], /* tmu012_fck */ | ||
244 | }, { | ||
245 | /* TMU1 */ | ||
246 | .dev_id = "sh_tmu.1", | ||
247 | .con_id = "tmu_fck", | ||
248 | .clk = &mstp_clks[12], | ||
249 | }, { | ||
250 | /* TMU2 */ | ||
251 | .dev_id = "sh_tmu.2", | ||
252 | .con_id = "tmu_fck", | ||
253 | .clk = &mstp_clks[12], | ||
254 | }, { | ||
255 | /* TMU3 */ | ||
256 | .dev_id = "sh_tmu.3", | ||
257 | .con_id = "tmu_fck", | ||
258 | .clk = &mstp_clks[16], /* tmu345_fck */ | ||
259 | }, { | ||
260 | /* TMU4 */ | ||
261 | .dev_id = "sh_tmu.4", | ||
262 | .con_id = "tmu_fck", | ||
263 | .clk = &mstp_clks[16], | ||
264 | }, { | ||
265 | /* TMU5 */ | ||
266 | .dev_id = "sh_tmu.5", | ||
267 | .con_id = "tmu_fck", | ||
268 | .clk = &mstp_clks[16], | ||
269 | }, | ||
270 | }; | ||
271 | |||
236 | int __init arch_clk_init(void) | 272 | int __init arch_clk_init(void) |
237 | { | 273 | { |
238 | int k, ret = 0; | 274 | int k, ret = 0; |
@@ -246,6 +282,8 @@ int __init arch_clk_init(void) | |||
246 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) | 282 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) |
247 | ret = clk_register(main_clks[k]); | 283 | ret = clk_register(main_clks[k]); |
248 | 284 | ||
285 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
286 | |||
249 | if (!ret) | 287 | if (!ret) |
250 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); | 288 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); |
251 | 289 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index ee9789003193..8a0a4a99f86b 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
@@ -481,7 +481,6 @@ static struct platform_device veu1_device = { | |||
481 | static struct sh_timer_config cmt_platform_data = { | 481 | static struct sh_timer_config cmt_platform_data = { |
482 | .channel_offset = 0x60, | 482 | .channel_offset = 0x60, |
483 | .timer_bit = 5, | 483 | .timer_bit = 5, |
484 | .clk = "cmt0", | ||
485 | .clockevent_rating = 125, | 484 | .clockevent_rating = 125, |
486 | .clocksource_rating = 200, | 485 | .clocksource_rating = 200, |
487 | }; | 486 | }; |
@@ -514,7 +513,6 @@ static struct platform_device cmt_device = { | |||
514 | static struct sh_timer_config tmu0_platform_data = { | 513 | static struct sh_timer_config tmu0_platform_data = { |
515 | .channel_offset = 0x04, | 514 | .channel_offset = 0x04, |
516 | .timer_bit = 0, | 515 | .timer_bit = 0, |
517 | .clk = "tmu0", | ||
518 | .clockevent_rating = 200, | 516 | .clockevent_rating = 200, |
519 | }; | 517 | }; |
520 | 518 | ||
@@ -546,7 +544,6 @@ static struct platform_device tmu0_device = { | |||
546 | static struct sh_timer_config tmu1_platform_data = { | 544 | static struct sh_timer_config tmu1_platform_data = { |
547 | .channel_offset = 0x10, | 545 | .channel_offset = 0x10, |
548 | .timer_bit = 1, | 546 | .timer_bit = 1, |
549 | .clk = "tmu0", | ||
550 | .clocksource_rating = 200, | 547 | .clocksource_rating = 200, |
551 | }; | 548 | }; |
552 | 549 | ||
@@ -578,7 +575,6 @@ static struct platform_device tmu1_device = { | |||
578 | static struct sh_timer_config tmu2_platform_data = { | 575 | static struct sh_timer_config tmu2_platform_data = { |
579 | .channel_offset = 0x1c, | 576 | .channel_offset = 0x1c, |
580 | .timer_bit = 2, | 577 | .timer_bit = 2, |
581 | .clk = "tmu0", | ||
582 | }; | 578 | }; |
583 | 579 | ||
584 | static struct resource tmu2_resources[] = { | 580 | static struct resource tmu2_resources[] = { |
@@ -610,7 +606,6 @@ static struct platform_device tmu2_device = { | |||
610 | static struct sh_timer_config tmu3_platform_data = { | 606 | static struct sh_timer_config tmu3_platform_data = { |
611 | .channel_offset = 0x04, | 607 | .channel_offset = 0x04, |
612 | .timer_bit = 0, | 608 | .timer_bit = 0, |
613 | .clk = "tmu1", | ||
614 | }; | 609 | }; |
615 | 610 | ||
616 | static struct resource tmu3_resources[] = { | 611 | static struct resource tmu3_resources[] = { |
@@ -641,7 +636,6 @@ static struct platform_device tmu3_device = { | |||
641 | static struct sh_timer_config tmu4_platform_data = { | 636 | static struct sh_timer_config tmu4_platform_data = { |
642 | .channel_offset = 0x10, | 637 | .channel_offset = 0x10, |
643 | .timer_bit = 1, | 638 | .timer_bit = 1, |
644 | .clk = "tmu1", | ||
645 | }; | 639 | }; |
646 | 640 | ||
647 | static struct resource tmu4_resources[] = { | 641 | static struct resource tmu4_resources[] = { |
@@ -672,7 +666,6 @@ static struct platform_device tmu4_device = { | |||
672 | static struct sh_timer_config tmu5_platform_data = { | 666 | static struct sh_timer_config tmu5_platform_data = { |
673 | .channel_offset = 0x1c, | 667 | .channel_offset = 0x1c, |
674 | .timer_bit = 2, | 668 | .timer_bit = 2, |
675 | .clk = "tmu1", | ||
676 | }; | 669 | }; |
677 | 670 | ||
678 | static struct resource tmu5_resources[] = { | 671 | static struct resource tmu5_resources[] = { |