diff options
author | Steven Miao <realmz6@gmail.com> | 2013-07-05 02:36:09 -0400 |
---|---|---|
committer | Steven Miao <realmz6@gmail.com> | 2013-09-12 22:42:32 -0400 |
commit | 3036dccf2c2a5186bb50939f412c54c6c74a0fb0 (patch) | |
tree | 8c45d555bcacd1bd7ecb63c37e5781107692f970 /arch | |
parent | 206f060c21503f33f9716710715cabba602355d5 (diff) |
clock: add stmmac clock for ethernet driver
Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/mach-bf609/clock.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c index 437d56c82281..dab8849af884 100644 --- a/arch/blackfin/mach-bf609/clock.c +++ b/arch/blackfin/mach-bf609/clock.c | |||
@@ -220,6 +220,12 @@ unsigned long sys_clk_get_rate(struct clk *clk) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | unsigned long dummy_get_rate(struct clk *clk) | ||
224 | { | ||
225 | clk->parent->rate = clk_get_rate(clk->parent); | ||
226 | return clk->parent->rate; | ||
227 | } | ||
228 | |||
223 | unsigned long sys_clk_round_rate(struct clk *clk, unsigned long rate) | 229 | unsigned long sys_clk_round_rate(struct clk *clk, unsigned long rate) |
224 | { | 230 | { |
225 | unsigned long max_rate; | 231 | unsigned long max_rate; |
@@ -283,6 +289,10 @@ static struct clk_ops sys_clk_ops = { | |||
283 | .round_rate = sys_clk_round_rate, | 289 | .round_rate = sys_clk_round_rate, |
284 | }; | 290 | }; |
285 | 291 | ||
292 | static struct clk_ops dummy_clk_ops = { | ||
293 | .get_rate = dummy_get_rate, | ||
294 | }; | ||
295 | |||
286 | static struct clk sys_clkin = { | 296 | static struct clk sys_clkin = { |
287 | .name = "SYS_CLKIN", | 297 | .name = "SYS_CLKIN", |
288 | .rate = CONFIG_CLKIN_HZ, | 298 | .rate = CONFIG_CLKIN_HZ, |
@@ -364,6 +374,12 @@ static struct clk oclk = { | |||
364 | .parent = &pll_clk, | 374 | .parent = &pll_clk, |
365 | }; | 375 | }; |
366 | 376 | ||
377 | static struct clk ethclk = { | ||
378 | .name = "stmmaceth", | ||
379 | .parent = &sclk0, | ||
380 | .ops = &dummy_clk_ops, | ||
381 | }; | ||
382 | |||
367 | static struct clk_lookup bf609_clks[] = { | 383 | static struct clk_lookup bf609_clks[] = { |
368 | CLK(sys_clkin, NULL, "SYS_CLKIN"), | 384 | CLK(sys_clkin, NULL, "SYS_CLKIN"), |
369 | CLK(pll_clk, NULL, "PLLCLK"), | 385 | CLK(pll_clk, NULL, "PLLCLK"), |
@@ -375,6 +391,7 @@ static struct clk_lookup bf609_clks[] = { | |||
375 | CLK(sclk1, NULL, "SCLK1"), | 391 | CLK(sclk1, NULL, "SCLK1"), |
376 | CLK(dclk, NULL, "DCLK"), | 392 | CLK(dclk, NULL, "DCLK"), |
377 | CLK(oclk, NULL, "OCLK"), | 393 | CLK(oclk, NULL, "OCLK"), |
394 | CLK(ethclk, NULL, "stmmaceth"), | ||
378 | }; | 395 | }; |
379 | 396 | ||
380 | int __init clk_init(void) | 397 | int __init clk_init(void) |