diff options
author | Cyril Chemparathy <cyril@ti.com> | 2010-09-15 10:11:22 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-09-24 10:40:29 -0400 |
commit | d22960c8bbb8f685c2d8c4051e1f335ab13dca24 (patch) | |
tree | 7e0dd3bc31197293ef242180100f5c7093e3fbb0 /arch/arm/mach-davinci/devices-da8xx.c | |
parent | f20136eb03a1dbdfb04f3c62fd11c0d02d02b726 (diff) |
davinci: add mdio platform devices
This patch adds mdio platform devices on SoCs that have the necessary
hardware. Clock lookup entries (aliases) have also been added, so that the
MDIO and EMAC drivers can independently enable/disable a shared underlying
clock. Further, the EMAC MMR region has been split down into separate MDIO
and EMAC regions.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: David S. Miller <davem@davemloft.net>
Tested-by: Michael Williamson <michael.williamson@criticallink.com>
Tested-by: Caglar Akyuz <caglarakyuz@gmail.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index caeb7f4a3a6d..9039221649d4 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -352,7 +352,7 @@ int __init da8xx_register_watchdog(void) | |||
352 | static struct resource da8xx_emac_resources[] = { | 352 | static struct resource da8xx_emac_resources[] = { |
353 | { | 353 | { |
354 | .start = DA8XX_EMAC_CPPI_PORT_BASE, | 354 | .start = DA8XX_EMAC_CPPI_PORT_BASE, |
355 | .end = DA8XX_EMAC_CPPI_PORT_BASE + 0x5000 - 1, | 355 | .end = DA8XX_EMAC_CPPI_PORT_BASE + SZ_16K - 1, |
356 | .flags = IORESOURCE_MEM, | 356 | .flags = IORESOURCE_MEM, |
357 | }, | 357 | }, |
358 | { | 358 | { |
@@ -396,9 +396,34 @@ static struct platform_device da8xx_emac_device = { | |||
396 | .resource = da8xx_emac_resources, | 396 | .resource = da8xx_emac_resources, |
397 | }; | 397 | }; |
398 | 398 | ||
399 | static struct resource da8xx_mdio_resources[] = { | ||
400 | { | ||
401 | .start = DA8XX_EMAC_MDIO_BASE, | ||
402 | .end = DA8XX_EMAC_MDIO_BASE + SZ_4K - 1, | ||
403 | .flags = IORESOURCE_MEM, | ||
404 | }, | ||
405 | }; | ||
406 | |||
407 | static struct platform_device da8xx_mdio_device = { | ||
408 | .name = "davinci_mdio", | ||
409 | .id = 0, | ||
410 | .num_resources = ARRAY_SIZE(da8xx_mdio_resources), | ||
411 | .resource = da8xx_mdio_resources, | ||
412 | }; | ||
413 | |||
399 | int __init da8xx_register_emac(void) | 414 | int __init da8xx_register_emac(void) |
400 | { | 415 | { |
401 | return platform_device_register(&da8xx_emac_device); | 416 | int ret; |
417 | |||
418 | ret = platform_device_register(&da8xx_mdio_device); | ||
419 | if (ret < 0) | ||
420 | return ret; | ||
421 | ret = platform_device_register(&da8xx_emac_device); | ||
422 | if (ret < 0) | ||
423 | return ret; | ||
424 | ret = clk_add_alias(NULL, dev_name(&da8xx_mdio_device.dev), | ||
425 | NULL, &da8xx_emac_device.dev); | ||
426 | return ret; | ||
402 | } | 427 | } |
403 | 428 | ||
404 | static struct resource da830_mcasp1_resources[] = { | 429 | static struct resource da830_mcasp1_resources[] = { |