aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/dm646x.c')
-rw-r--r--arch/arm/mach-davinci/dm646x.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 544658e58854..5185ad55fc50 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -286,7 +286,15 @@ struct davinci_clk dm646x_clks[] = {
286 CLK(NULL, NULL, NULL), 286 CLK(NULL, NULL, NULL),
287}; 287};
288 288
289#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE) 289static struct emac_platform_data dm646x_emac_pdata = {
290 .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET,
291 .ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET,
292 .ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET,
293 .mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET,
294 .ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE,
295 .version = EMAC_VERSION_2,
296};
297
290static struct resource dm646x_emac_resources[] = { 298static struct resource dm646x_emac_resources[] = {
291 { 299 {
292 .start = DM646X_EMAC_BASE, 300 .start = DM646X_EMAC_BASE,
@@ -318,12 +326,13 @@ static struct resource dm646x_emac_resources[] = {
318static struct platform_device dm646x_emac_device = { 326static struct platform_device dm646x_emac_device = {
319 .name = "davinci_emac", 327 .name = "davinci_emac",
320 .id = 1, 328 .id = 1,
329 .dev = {
330 .platform_data = &dm646x_emac_pdata,
331 },
321 .num_resources = ARRAY_SIZE(dm646x_emac_resources), 332 .num_resources = ARRAY_SIZE(dm646x_emac_resources),
322 .resource = dm646x_emac_resources, 333 .resource = dm646x_emac_resources,
323}; 334};
324 335
325#endif
326
327/* 336/*
328 * Device specific mux setup 337 * Device specific mux setup
329 * 338 *
@@ -499,25 +508,6 @@ static struct platform_device dm646x_edma_device = {
499 508
500/*----------------------------------------------------------------------*/ 509/*----------------------------------------------------------------------*/
501 510
502#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
503
504void dm646x_init_emac(struct emac_platform_data *pdata)
505{
506 pdata->ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET;
507 pdata->ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET;
508 pdata->ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET;
509 pdata->mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET;
510 pdata->ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE;
511 pdata->version = EMAC_VERSION_2;
512 dm646x_emac_device.dev.platform_data = pdata;
513 platform_device_register(&dm646x_emac_device);
514}
515#else
516
517void dm646x_init_emac(struct emac_platform_data *unused) {}
518
519#endif
520
521static struct map_desc dm646x_io_desc[] = { 511static struct map_desc dm646x_io_desc[] = {
522 { 512 {
523 .virtual = IO_VIRT, 513 .virtual = IO_VIRT,
@@ -614,6 +604,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
614 .gpio_num = 43, /* Only 33 usable */ 604 .gpio_num = 43, /* Only 33 usable */
615 .gpio_irq = IRQ_DM646X_GPIOBNK0, 605 .gpio_irq = IRQ_DM646X_GPIOBNK0,
616 .serial_dev = &dm646x_serial_device, 606 .serial_dev = &dm646x_serial_device,
607 .emac_pdata = &dm646x_emac_pdata,
617}; 608};
618 609
619void __init dm646x_init(void) 610void __init dm646x_init(void)
@@ -627,6 +618,7 @@ static int __init dm646x_init_devices(void)
627 return 0; 618 return 0;
628 619
629 platform_device_register(&dm646x_edma_device); 620 platform_device_register(&dm646x_edma_device);
621 platform_device_register(&dm646x_emac_device);
630 return 0; 622 return 0;
631} 623}
632postcore_initcall(dm646x_init_devices); 624postcore_initcall(dm646x_init_devices);