diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-06-04 03:32:11 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-11 02:14:34 -0400 |
commit | bc49b6eaac6eff86f902a36d846c310e1e0beedf (patch) | |
tree | 82fd2cd451c39edad84567a0bf1d0962bd4c581a /arch/sh/kernel/cpu/sh4a/clock-sh7722.c | |
parent | b621370a3505f8bd42acc41736cae47d5ce8bd06 (diff) |
sh: sh7343 clock framework rewrite
This patch rewrites the sh7343 clock framework code.
The new code makes use of the recently merged div4,
div6 and mstp32 helper code. Both extal and dll are
supported as input clocks to the pll.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7722.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c index 5e08504da3a6..8aaaac240ada 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 2 | * arch/sh/kernel/cpu/sh4a/clock-sh7722.c |
3 | * | 3 | * |
4 | * SH7343, SH7722 & SH7366 support for the clock framework | 4 | * SH7722 & SH7366 support for the clock framework |
5 | * | 5 | * |
6 | * Copyright (c) 2006-2007 Nomad Global Solutions Inc | 6 | * Copyright (c) 2006-2007 Nomad Global Solutions Inc |
7 | * Based on code for sh7343 by Paul Mundt | 7 | * Based on code for sh7343 by Paul Mundt |
@@ -417,7 +417,6 @@ static struct clk_ops sh7722_frqcr_clk_ops = { | |||
417 | /* | 417 | /* |
418 | * clock ops methods for SIU A/B and IrDA clock | 418 | * clock ops methods for SIU A/B and IrDA clock |
419 | */ | 419 | */ |
420 | #ifndef CONFIG_CPU_SUBTYPE_SH7343 | ||
421 | static int sh7722_siu_set_rate(struct clk *clk, unsigned long rate, int algo_id) | 420 | static int sh7722_siu_set_rate(struct clk *clk, unsigned long rate, int algo_id) |
422 | { | 421 | { |
423 | unsigned long r; | 422 | unsigned long r; |
@@ -469,8 +468,6 @@ static struct clk_ops sh7722_siu_clk_ops = { | |||
469 | .disable = sh7722_siu_disable, | 468 | .disable = sh7722_siu_disable, |
470 | }; | 469 | }; |
471 | 470 | ||
472 | #endif /* CONFIG_CPU_SUBTYPE_SH7343 */ | ||
473 | |||
474 | static int sh7722_video_enable(struct clk *clk) | 471 | static int sh7722_video_enable(struct clk *clk) |
475 | { | 472 | { |
476 | unsigned long r; | 473 | unsigned long r; |
@@ -542,7 +539,6 @@ static struct clk sh7722_r_clock = { | |||
542 | .rate = 32768, | 539 | .rate = 32768, |
543 | }; | 540 | }; |
544 | 541 | ||
545 | #if !defined(CONFIG_CPU_SUBTYPE_SH7343) | ||
546 | /* | 542 | /* |
547 | * these three clocks - SIU A, SIU B, IrDA - share the same clk_ops | 543 | * these three clocks - SIU A, SIU B, IrDA - share the same clk_ops |
548 | * methods of clk_ops determine which register they should access by | 544 | * methods of clk_ops determine which register they should access by |
@@ -559,7 +555,6 @@ static struct clk sh7722_siu_b_clock = { | |||
559 | .arch_flags = SCLKBCR, | 555 | .arch_flags = SCLKBCR, |
560 | .ops = &sh7722_siu_clk_ops, | 556 | .ops = &sh7722_siu_clk_ops, |
561 | }; | 557 | }; |
562 | #endif /* CONFIG_CPU_SUBTYPE_SH7343 */ | ||
563 | 558 | ||
564 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) | 559 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) |
565 | static struct clk sh7722_irda_clock = { | 560 | static struct clk sh7722_irda_clock = { |
@@ -659,30 +654,6 @@ static struct clk sh7722_mstpcr_clocks[] = { | |||
659 | MSTPCR("vpu0", "bus_clk", 2, 1, CLK_ENABLE_ON_INIT), | 654 | MSTPCR("vpu0", "bus_clk", 2, 1, CLK_ENABLE_ON_INIT), |
660 | MSTPCR("lcdc0", "bus_clk", 2, 0, 0), | 655 | MSTPCR("lcdc0", "bus_clk", 2, 0, 0), |
661 | #endif | 656 | #endif |
662 | #if defined(CONFIG_CPU_SUBTYPE_SH7343) | ||
663 | MSTPCR("uram0", "umem_clk", 0, 28, CLK_ENABLE_ON_INIT), | ||
664 | MSTPCR("xymem0", "bus_clk", 0, 26, CLK_ENABLE_ON_INIT), | ||
665 | MSTPCR("tmu0", "peripheral_clk", 0, 15, 0), | ||
666 | MSTPCR("cmt0", "r_clk", 0, 14, 0), | ||
667 | MSTPCR("rwdt0", "r_clk", 0, 13, 0), | ||
668 | MSTPCR("scif0", "peripheral_clk", 0, 7, 0), | ||
669 | MSTPCR("scif1", "peripheral_clk", 0, 6, 0), | ||
670 | MSTPCR("scif2", "peripheral_clk", 0, 5, 0), | ||
671 | MSTPCR("scif3", "peripheral_clk", 0, 4, 0), | ||
672 | MSTPCR("i2c0", "peripheral_clk", 1, 9, 0), | ||
673 | MSTPCR("i2c1", "peripheral_clk", 1, 8, 0), | ||
674 | MSTPCR("sdhi0", "peripheral_clk", 2, 18, 0), | ||
675 | MSTPCR("keysc0", "r_clk", 2, 14, 0), | ||
676 | MSTPCR("usbf0", "peripheral_clk", 2, 11, 0), | ||
677 | MSTPCR("siu0", "bus_clk", 2, 8, 0), | ||
678 | MSTPCR("jpu0", "bus_clk", 2, 6, CLK_ENABLE_ON_INIT), | ||
679 | MSTPCR("vou0", "bus_clk", 2, 5, 0), | ||
680 | MSTPCR("beu0", "bus_clk", 2, 4, 0), | ||
681 | MSTPCR("ceu0", "bus_clk", 2, 3, 0), | ||
682 | MSTPCR("veu0", "bus_clk", 2, 2, CLK_ENABLE_ON_INIT), | ||
683 | MSTPCR("vpu0", "bus_clk", 2, 1, CLK_ENABLE_ON_INIT), | ||
684 | MSTPCR("lcdc0", "bus_clk", 2, 0, 0), | ||
685 | #endif | ||
686 | #if defined(CONFIG_CPU_SUBTYPE_SH7366) | 657 | #if defined(CONFIG_CPU_SUBTYPE_SH7366) |
687 | /* See page 52 of Datasheet V0.40: Overview -> Block Diagram */ | 658 | /* See page 52 of Datasheet V0.40: Overview -> Block Diagram */ |
688 | MSTPCR("tlb0", "cpu_clk", 0, 31, 0), | 659 | MSTPCR("tlb0", "cpu_clk", 0, 31, 0), |
@@ -730,10 +701,8 @@ static struct clk *sh7722_clocks[] = { | |||
730 | &sh7722_sh_clock, | 701 | &sh7722_sh_clock, |
731 | &sh7722_peripheral_clock, | 702 | &sh7722_peripheral_clock, |
732 | &sh7722_sdram_clock, | 703 | &sh7722_sdram_clock, |
733 | #if !defined(CONFIG_CPU_SUBTYPE_SH7343) | ||
734 | &sh7722_siu_a_clock, | 704 | &sh7722_siu_a_clock, |
735 | &sh7722_siu_b_clock, | 705 | &sh7722_siu_b_clock, |
736 | #endif | ||
737 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) | 706 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) |
738 | &sh7722_irda_clock, | 707 | &sh7722_irda_clock, |
739 | #endif | 708 | #endif |