aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-orion
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-12-23 19:24:24 -0500
committerMike Turquette <mturquette@linaro.org>2012-05-08 19:33:56 -0400
commit452503ebc7cc4cce5b9e52cf2f03255365a53234 (patch)
treeecf09f091b74cad5d40e1d10cbf6df35ad97ef15 /arch/arm/plat-orion
parent4574b886698dfad6209102fed6136622b5fe1c21 (diff)
ARM: Orion: Eth: Add clk/clkdev support.
The t_clk is moved from the shared part of the ethernet driver into the per port section. Each port can have its own gated clock, which it needs to enable/disable, as oppossed to there being one clock shared by all ports. In practice, only kirkwood supports this at the moment. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r--arch/arm/plat-orion/common.c26
-rw-r--r--arch/arm/plat-orion/include/plat/common.h13
2 files changed, 17 insertions, 22 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index bbe50a948710..a33733bb380d 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -43,6 +43,10 @@ void __init orion_clkdev_init(struct clk *tclk)
43{ 43{
44 orion_clkdev_add(NULL, "orion_spi.0", tclk); 44 orion_clkdev_add(NULL, "orion_spi.0", tclk);
45 orion_clkdev_add(NULL, "orion_spi.1", tclk); 45 orion_clkdev_add(NULL, "orion_spi.1", tclk);
46 orion_clkdev_add(NULL, MV643XX_ETH_NAME ".0", tclk);
47 orion_clkdev_add(NULL, MV643XX_ETH_NAME ".1", tclk);
48 orion_clkdev_add(NULL, MV643XX_ETH_NAME ".2", tclk);
49 orion_clkdev_add(NULL, MV643XX_ETH_NAME ".3", tclk);
46} 50}
47 51
48/* Fill in the resources structure and link it into the platform 52/* Fill in the resources structure and link it into the platform
@@ -225,13 +229,11 @@ void __init orion_rtc_init(unsigned long mapbase,
225 ****************************************************************************/ 229 ****************************************************************************/
226static __init void ge_complete( 230static __init void ge_complete(
227 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data, 231 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data,
228 int tclk,
229 struct resource *orion_ge_resource, unsigned long irq, 232 struct resource *orion_ge_resource, unsigned long irq,
230 struct platform_device *orion_ge_shared, 233 struct platform_device *orion_ge_shared,
231 struct mv643xx_eth_platform_data *eth_data, 234 struct mv643xx_eth_platform_data *eth_data,
232 struct platform_device *orion_ge) 235 struct platform_device *orion_ge)
233{ 236{
234 orion_ge_shared_data->t_clk = tclk;
235 orion_ge_resource->start = irq; 237 orion_ge_resource->start = irq;
236 orion_ge_resource->end = irq; 238 orion_ge_resource->end = irq;
237 eth_data->shared = orion_ge_shared; 239 eth_data->shared = orion_ge_shared;
@@ -282,12 +284,11 @@ static struct platform_device orion_ge00 = {
282void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, 284void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
283 unsigned long mapbase, 285 unsigned long mapbase,
284 unsigned long irq, 286 unsigned long irq,
285 unsigned long irq_err, 287 unsigned long irq_err)
286 int tclk)
287{ 288{
288 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, 289 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
289 mapbase + 0x2000, SZ_16K - 1, irq_err); 290 mapbase + 0x2000, SZ_16K - 1, irq_err);
290 ge_complete(&orion_ge00_shared_data, tclk, 291 ge_complete(&orion_ge00_shared_data,
291 orion_ge00_resources, irq, &orion_ge00_shared, 292 orion_ge00_resources, irq, &orion_ge00_shared,
292 eth_data, &orion_ge00); 293 eth_data, &orion_ge00);
293} 294}
@@ -335,12 +336,11 @@ static struct platform_device orion_ge01 = {
335void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, 336void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
336 unsigned long mapbase, 337 unsigned long mapbase,
337 unsigned long irq, 338 unsigned long irq,
338 unsigned long irq_err, 339 unsigned long irq_err)
339 int tclk)
340{ 340{
341 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, 341 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
342 mapbase + 0x2000, SZ_16K - 1, irq_err); 342 mapbase + 0x2000, SZ_16K - 1, irq_err);
343 ge_complete(&orion_ge01_shared_data, tclk, 343 ge_complete(&orion_ge01_shared_data,
344 orion_ge01_resources, irq, &orion_ge01_shared, 344 orion_ge01_resources, irq, &orion_ge01_shared,
345 eth_data, &orion_ge01); 345 eth_data, &orion_ge01);
346} 346}
@@ -388,12 +388,11 @@ static struct platform_device orion_ge10 = {
388void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, 388void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
389 unsigned long mapbase, 389 unsigned long mapbase,
390 unsigned long irq, 390 unsigned long irq,
391 unsigned long irq_err, 391 unsigned long irq_err)
392 int tclk)
393{ 392{
394 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources, 393 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
395 mapbase + 0x2000, SZ_16K - 1, irq_err); 394 mapbase + 0x2000, SZ_16K - 1, irq_err);
396 ge_complete(&orion_ge10_shared_data, tclk, 395 ge_complete(&orion_ge10_shared_data,
397 orion_ge10_resources, irq, &orion_ge10_shared, 396 orion_ge10_resources, irq, &orion_ge10_shared,
398 eth_data, &orion_ge10); 397 eth_data, &orion_ge10);
399} 398}
@@ -441,12 +440,11 @@ static struct platform_device orion_ge11 = {
441void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, 440void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
442 unsigned long mapbase, 441 unsigned long mapbase,
443 unsigned long irq, 442 unsigned long irq,
444 unsigned long irq_err, 443 unsigned long irq_err)
445 int tclk)
446{ 444{
447 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources, 445 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
448 mapbase + 0x2000, SZ_16K - 1, irq_err); 446 mapbase + 0x2000, SZ_16K - 1, irq_err);
449 ge_complete(&orion_ge11_shared_data, tclk, 447 ge_complete(&orion_ge11_shared_data,
450 orion_ge11_resources, irq, &orion_ge11_shared, 448 orion_ge11_resources, irq, &orion_ge11_shared,
451 eth_data, &orion_ge11); 449 eth_data, &orion_ge11);
452} 450}
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h
index d188a1aa6f56..00d8761c7d28 100644
--- a/arch/arm/plat-orion/include/plat/common.h
+++ b/arch/arm/plat-orion/include/plat/common.h
@@ -39,29 +39,26 @@ void __init orion_rtc_init(unsigned long mapbase,
39void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, 39void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
40 unsigned long mapbase, 40 unsigned long mapbase,
41 unsigned long irq, 41 unsigned long irq,
42 unsigned long irq_err, 42 unsigned long irq_err);
43 int tclk);
44 43
45void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, 44void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
46 unsigned long mapbase, 45 unsigned long mapbase,
47 unsigned long irq, 46 unsigned long irq,
48 unsigned long irq_err, 47 unsigned long irq_err);
49 int tclk);
50 48
51void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, 49void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
52 unsigned long mapbase, 50 unsigned long mapbase,
53 unsigned long irq, 51 unsigned long irq,
54 unsigned long irq_err, 52 unsigned long irq_err);
55 int tclk);
56 53
57void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, 54void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
58 unsigned long mapbase, 55 unsigned long mapbase,
59 unsigned long irq, 56 unsigned long irq,
60 unsigned long irq_err, 57 unsigned long irq_err);
61 int tclk);
62 58
63void __init orion_ge00_switch_init(struct dsa_platform_data *d, 59void __init orion_ge00_switch_init(struct dsa_platform_data *d,
64 int irq); 60 int irq);
61
65void __init orion_i2c_init(unsigned long mapbase, 62void __init orion_i2c_init(unsigned long mapbase,
66 unsigned long irq, 63 unsigned long irq,
67 unsigned long freq_m); 64 unsigned long freq_m);