Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191607
b: refs/heads/master
c: f4cff0d
h: refs/heads/master
i:
  191605: 2f310c0
  191603: 2ea1586
  191599: c7e868a
v: v3
  • Loading branch information
Paul Mundt committed Mar 30, 2010
1 parent f1e5090 commit 85bb0e7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4221802ea3a28f7c16d157ac6f697d58267cb58
refs/heads/master: f4cff0d0ffc0162636357d0475409ecf1304f854
44 changes: 41 additions & 3 deletions trunk/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <asm/clkdev.h>
#include <asm/clock.h>
#include <asm/hwblk.h>
#include <cpu/sh7724.h>
Expand Down Expand Up @@ -189,11 +191,11 @@ static struct clk mstp_clks[] = {
SH_HWBLK_CLK("sh0", -1, SH_CLK, HWBLK_SHYWAY, CLK_ENABLE_ON_INIT),
SH_HWBLK_CLK("hudi0", -1, P_CLK, HWBLK_HUDI, 0),
SH_HWBLK_CLK("ubc0", -1, I_CLK, HWBLK_UBC, 0),
SH_HWBLK_CLK("tmu0", -1, P_CLK, HWBLK_TMU0, 0),
SH_HWBLK_CLK("cmt0", -1, R_CLK, HWBLK_CMT, 0),
SH_HWBLK_CLK("tmu012_fck", -1, P_CLK, HWBLK_TMU0, 0),
SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0),
SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0),
SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0),
SH_HWBLK_CLK("tmu1", -1, P_CLK, HWBLK_TMU1, 0),
SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0),
SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0),
SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0),
SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0),
Expand Down Expand Up @@ -233,6 +235,40 @@ static struct clk mstp_clks[] = {
SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0),
};

static struct clk_lookup lookups[] = {
{
/* TMU0 */
.dev_id = "sh_tmu.0",
.con_id = "tmu_fck",
.clk = &mstp_clks[12], /* tmu012_fck */
}, {
/* TMU1 */
.dev_id = "sh_tmu.1",
.con_id = "tmu_fck",
.clk = &mstp_clks[12],
}, {
/* TMU2 */
.dev_id = "sh_tmu.2",
.con_id = "tmu_fck",
.clk = &mstp_clks[12],
}, {
/* TMU3 */
.dev_id = "sh_tmu.3",
.con_id = "tmu_fck",
.clk = &mstp_clks[16], /* tmu345_fck */
}, {
/* TMU4 */
.dev_id = "sh_tmu.4",
.con_id = "tmu_fck",
.clk = &mstp_clks[16],
}, {
/* TMU5 */
.dev_id = "sh_tmu.5",
.con_id = "tmu_fck",
.clk = &mstp_clks[16],
},
};

int __init arch_clk_init(void)
{
int k, ret = 0;
Expand All @@ -246,6 +282,8 @@ int __init arch_clk_init(void)
for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
ret = clk_register(main_clks[k]);

clkdev_add_table(lookups, ARRAY_SIZE(lookups));

if (!ret)
ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);

Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ static struct platform_device veu1_device = {
static struct sh_timer_config cmt_platform_data = {
.channel_offset = 0x60,
.timer_bit = 5,
.clk = "cmt0",
.clockevent_rating = 125,
.clocksource_rating = 200,
};
Expand Down Expand Up @@ -514,7 +513,6 @@ static struct platform_device cmt_device = {
static struct sh_timer_config tmu0_platform_data = {
.channel_offset = 0x04,
.timer_bit = 0,
.clk = "tmu0",
.clockevent_rating = 200,
};

Expand Down Expand Up @@ -546,7 +544,6 @@ static struct platform_device tmu0_device = {
static struct sh_timer_config tmu1_platform_data = {
.channel_offset = 0x10,
.timer_bit = 1,
.clk = "tmu0",
.clocksource_rating = 200,
};

Expand Down Expand Up @@ -578,7 +575,6 @@ static struct platform_device tmu1_device = {
static struct sh_timer_config tmu2_platform_data = {
.channel_offset = 0x1c,
.timer_bit = 2,
.clk = "tmu0",
};

static struct resource tmu2_resources[] = {
Expand Down Expand Up @@ -610,7 +606,6 @@ static struct platform_device tmu2_device = {
static struct sh_timer_config tmu3_platform_data = {
.channel_offset = 0x04,
.timer_bit = 0,
.clk = "tmu1",
};

static struct resource tmu3_resources[] = {
Expand Down Expand Up @@ -641,7 +636,6 @@ static struct platform_device tmu3_device = {
static struct sh_timer_config tmu4_platform_data = {
.channel_offset = 0x10,
.timer_bit = 1,
.clk = "tmu1",
};

static struct resource tmu4_resources[] = {
Expand Down Expand Up @@ -672,7 +666,6 @@ static struct platform_device tmu4_device = {
static struct sh_timer_config tmu5_platform_data = {
.channel_offset = 0x1c,
.timer_bit = 2,
.clk = "tmu1",
};

static struct resource tmu5_resources[] = {
Expand Down

0 comments on commit 85bb0e7

Please sign in to comment.