diff options
author | Mark A. Greer <mgreer@mvista.com> | 2009-04-15 15:40:56 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-28 18:17:45 -0400 |
commit | 972412b648dcf0c4303dca7e515d5c24ce3cd1d5 (patch) | |
tree | 2531253bcc50ef71665405ad1aa0f8f2f035f41f /arch/arm/mach-davinci/dm646x.c | |
parent | 65e866a9741126c678e6dcd5d4fa8c9eca18e945 (diff) |
davinci: Move emac platform_data to SoC-specific files
Since most of the emac platform_data is really SoC specific
and not board specific, move it to the SoC-specific files.
Put a pointer to the platform_data in the soc_info structure
so the board-specific code can set some of the platform_data
if it needs to.
Signed-off-by: Mark A. Greer <mgreer@mvista.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.c | 36 |
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) | 289 | static 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 | |||
290 | static struct resource dm646x_emac_resources[] = { | 298 | static 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[] = { | |||
318 | static struct platform_device dm646x_emac_device = { | 326 | static 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 | |||
504 | void 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 | |||
517 | void dm646x_init_emac(struct emac_platform_data *unused) {} | ||
518 | |||
519 | #endif | ||
520 | |||
521 | static struct map_desc dm646x_io_desc[] = { | 511 | static 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 | ||
619 | void __init dm646x_init(void) | 610 | void __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 | } |
632 | postcore_initcall(dm646x_init_devices); | 624 | postcore_initcall(dm646x_init_devices); |