]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/arm/mach-davinci/dm644x.c
davinci: add mdio platform devices
[net-next-2.6.git] / arch / arm / mach-davinci / dm644x.c
index 7ad15208b841fece3d50823a2d9be687ccc5aa14..c103b2c8caff28ad4cc7cc2012a10bd9d19aa9a7 100644 (file)
@@ -330,7 +330,7 @@ static struct emac_platform_data dm644x_emac_pdata = {
 static struct resource dm644x_emac_resources[] = {
        {
                .start  = DM644X_EMAC_BASE,
-               .end    = DM644X_EMAC_BASE + 0x47ff,
+               .end    = DM644X_EMAC_BASE + SZ_16K - 1,
                .flags  = IORESOURCE_MEM,
        },
        {
@@ -350,6 +350,21 @@ static struct platform_device dm644x_emac_device = {
        .resource       = dm644x_emac_resources,
 };
 
+static struct resource dm644x_mdio_resources[] = {
+       {
+               .start  = DM644X_EMAC_MDIO_BASE,
+               .end    = DM644X_EMAC_MDIO_BASE + SZ_4K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device dm644x_mdio_device = {
+       .name           = "davinci_mdio",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(dm644x_mdio_resources),
+       .resource       = dm644x_mdio_resources,
+};
+
 /*
  * Device specific mux setup
  *
@@ -492,16 +507,18 @@ queue_priority_mapping[][2] = {
        {-1, -1},
 };
 
-static struct edma_soc_info dm644x_edma_info[] = {
-       {
-               .n_channel              = 64,
-               .n_region               = 4,
-               .n_slot                 = 128,
-               .n_tc                   = 2,
-               .n_cc                   = 1,
-               .queue_tc_mapping       = queue_tc_mapping,
-               .queue_priority_mapping = queue_priority_mapping,
-       },
+static struct edma_soc_info edma_cc0_info = {
+       .n_channel              = 64,
+       .n_region               = 4,
+       .n_slot                 = 128,
+       .n_tc                   = 2,
+       .n_cc                   = 1,
+       .queue_tc_mapping       = queue_tc_mapping,
+       .queue_priority_mapping = queue_priority_mapping,
+};
+
+static struct edma_soc_info *dm644x_edma_info[EDMA_MAX_CC] = {
+       &edma_cc0_info,
 };
 
 static struct resource edma_resources[] = {
@@ -775,7 +792,12 @@ static int __init dm644x_init_devices(void)
        clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
        clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
        platform_device_register(&dm644x_edma_device);
+
+       platform_device_register(&dm644x_mdio_device);
        platform_device_register(&dm644x_emac_device);
+       clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev),
+                     NULL, &dm644x_emac_device.dev);
+
        platform_device_register(&dm644x_vpss_device);
        platform_device_register(&dm644x_ccdc_dev);
        platform_device_register(&vpfe_capture_dev);