aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm644x.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:40:56 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-28 18:17:45 -0400
commit972412b648dcf0c4303dca7e515d5c24ce3cd1d5 (patch)
tree2531253bcc50ef71665405ad1aa0f8f2f035f41f /arch/arm/mach-davinci/dm644x.c
parent65e866a9741126c678e6dcd5d4fa8c9eca18e945 (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/dm644x.c')
-rw-r--r--arch/arm/mach-davinci/dm644x.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index a5629864d02..3844fc34cbb 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -319,7 +319,14 @@ struct davinci_clk dm644x_clks[] = {
319 CLK(NULL, NULL, NULL), 319 CLK(NULL, NULL, NULL),
320}; 320};
321 321
322#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE) 322static struct emac_platform_data dm644x_emac_pdata = {
323 .ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET,
324 .ctrl_mod_reg_offset = DM644X_EMAC_CNTRL_MOD_OFFSET,
325 .ctrl_ram_offset = DM644X_EMAC_CNTRL_RAM_OFFSET,
326 .mdio_reg_offset = DM644X_EMAC_MDIO_OFFSET,
327 .ctrl_ram_size = DM644X_EMAC_CNTRL_RAM_SIZE,
328 .version = EMAC_VERSION_1,
329};
323 330
324static struct resource dm644x_emac_resources[] = { 331static struct resource dm644x_emac_resources[] = {
325 { 332 {
@@ -337,12 +344,13 @@ static struct resource dm644x_emac_resources[] = {
337static struct platform_device dm644x_emac_device = { 344static struct platform_device dm644x_emac_device = {
338 .name = "davinci_emac", 345 .name = "davinci_emac",
339 .id = 1, 346 .id = 1,
347 .dev = {
348 .platform_data = &dm644x_emac_pdata,
349 },
340 .num_resources = ARRAY_SIZE(dm644x_emac_resources), 350 .num_resources = ARRAY_SIZE(dm644x_emac_resources),
341 .resource = dm644x_emac_resources, 351 .resource = dm644x_emac_resources,
342}; 352};
343 353
344#endif
345
346/* 354/*
347 * Device specific mux setup 355 * Device specific mux setup
348 * 356 *
@@ -520,24 +528,6 @@ static struct platform_device dm644x_edma_device = {
520}; 528};
521 529
522/*----------------------------------------------------------------------*/ 530/*----------------------------------------------------------------------*/
523#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
524
525void dm644x_init_emac(struct emac_platform_data *pdata)
526{
527 pdata->ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET;
528 pdata->ctrl_mod_reg_offset = DM644X_EMAC_CNTRL_MOD_OFFSET;
529 pdata->ctrl_ram_offset = DM644X_EMAC_CNTRL_RAM_OFFSET;
530 pdata->mdio_reg_offset = DM644X_EMAC_MDIO_OFFSET;
531 pdata->ctrl_ram_size = DM644X_EMAC_CNTRL_RAM_SIZE;
532 pdata->version = EMAC_VERSION_1;
533 dm644x_emac_device.dev.platform_data = pdata;
534 platform_device_register(&dm644x_emac_device);
535}
536#else
537
538void dm644x_init_emac(struct emac_platform_data *unused) {}
539
540#endif
541 531
542static struct map_desc dm644x_io_desc[] = { 532static struct map_desc dm644x_io_desc[] = {
543 { 533 {
@@ -635,6 +625,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
635 .gpio_num = 71, 625 .gpio_num = 71,
636 .gpio_irq = IRQ_GPIOBNK0, 626 .gpio_irq = IRQ_GPIOBNK0,
637 .serial_dev = &dm644x_serial_device, 627 .serial_dev = &dm644x_serial_device,
628 .emac_pdata = &dm644x_emac_pdata,
638}; 629};
639 630
640void __init dm644x_init(void) 631void __init dm644x_init(void)
@@ -648,6 +639,7 @@ static int __init dm644x_init_devices(void)
648 return 0; 639 return 0;
649 640
650 platform_device_register(&dm644x_edma_device); 641 platform_device_register(&dm644x_edma_device);
642 platform_device_register(&dm644x_emac_device);
651 return 0; 643 return 0;
652} 644}
653postcore_initcall(dm644x_init_devices); 645postcore_initcall(dm644x_init_devices);