aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2010-09-15 10:11:22 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-24 10:40:29 -0400
commitd22960c8bbb8f685c2d8c4051e1f335ab13dca24 (patch)
tree7e0dd3bc31197293ef242180100f5c7093e3fbb0 /arch/arm/mach-davinci/dm646x.c
parentf20136eb03a1dbdfb04f3c62fd11c0d02d02b726 (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/dm646x.c')
-rw-r--r--arch/arm/mach-davinci/dm646x.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index e4a3df1872ac..8da886bc6df5 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -366,7 +366,7 @@ static struct emac_platform_data dm646x_emac_pdata = {
366static struct resource dm646x_emac_resources[] = { 366static struct resource dm646x_emac_resources[] = {
367 { 367 {
368 .start = DM646X_EMAC_BASE, 368 .start = DM646X_EMAC_BASE,
369 .end = DM646X_EMAC_BASE + 0x47ff, 369 .end = DM646X_EMAC_BASE + SZ_16K - 1,
370 .flags = IORESOURCE_MEM, 370 .flags = IORESOURCE_MEM,
371 }, 371 },
372 { 372 {
@@ -401,6 +401,21 @@ static struct platform_device dm646x_emac_device = {
401 .resource = dm646x_emac_resources, 401 .resource = dm646x_emac_resources,
402}; 402};
403 403
404static struct resource dm646x_mdio_resources[] = {
405 {
406 .start = DM646X_EMAC_MDIO_BASE,
407 .end = DM646X_EMAC_MDIO_BASE + SZ_4K - 1,
408 .flags = IORESOURCE_MEM,
409 },
410};
411
412static struct platform_device dm646x_mdio_device = {
413 .name = "davinci_mdio",
414 .id = 0,
415 .num_resources = ARRAY_SIZE(dm646x_mdio_resources),
416 .resource = dm646x_mdio_resources,
417};
418
404/* 419/*
405 * Device specific mux setup 420 * Device specific mux setup
406 * 421 *
@@ -897,7 +912,11 @@ static int __init dm646x_init_devices(void)
897 if (!cpu_is_davinci_dm646x()) 912 if (!cpu_is_davinci_dm646x())
898 return 0; 913 return 0;
899 914
915 platform_device_register(&dm646x_mdio_device);
900 platform_device_register(&dm646x_emac_device); 916 platform_device_register(&dm646x_emac_device);
917 clk_add_alias(NULL, dev_name(&dm646x_mdio_device.dev),
918 NULL, &dm646x_emac_device.dev);
919
901 return 0; 920 return 0;
902} 921}
903postcore_initcall(dm646x_init_devices); 922postcore_initcall(dm646x_init_devices);