summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 21:40:56 +0200
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-29 00:17:45 +0200
commit972412b648dcf0c4303dca7e515d5c24ce3cd1d5 (patch)
tree2531253bcc50ef71665405ad1aa0f8f2f035f41f /arch/arm/mach-davinci/dm646x.c
parentdavinci: Move serial platform_device into SoC-specific files (diff)
downloadlinux-972412b648dcf0c4303dca7e515d5c24ce3cd1d5.tar.xz
linux-972412b648dcf0c4303dca7e515d5c24ce3cd1d5.zip
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.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[] = {
CLK(NULL, NULL, NULL),
};
-#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
+static struct emac_platform_data dm646x_emac_pdata = {
+ .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET,
+ .ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET,
+ .ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET,
+ .mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET,
+ .ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE,
+ .version = EMAC_VERSION_2,
+};
+
static struct resource dm646x_emac_resources[] = {
{
.start = DM646X_EMAC_BASE,
@@ -318,12 +326,13 @@ static struct resource dm646x_emac_resources[] = {
static struct platform_device dm646x_emac_device = {
.name = "davinci_emac",
.id = 1,
+ .dev = {
+ .platform_data = &dm646x_emac_pdata,
+ },
.num_resources = ARRAY_SIZE(dm646x_emac_resources),
.resource = dm646x_emac_resources,
};
-#endif
-
/*
* Device specific mux setup
*
@@ -499,25 +508,6 @@ static struct platform_device dm646x_edma_device = {
/*----------------------------------------------------------------------*/
-#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
-
-void dm646x_init_emac(struct emac_platform_data *pdata)
-{
- pdata->ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET;
- pdata->ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET;
- pdata->ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET;
- pdata->mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET;
- pdata->ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE;
- pdata->version = EMAC_VERSION_2;
- dm646x_emac_device.dev.platform_data = pdata;
- platform_device_register(&dm646x_emac_device);
-}
-#else
-
-void dm646x_init_emac(struct emac_platform_data *unused) {}
-
-#endif
-
static struct map_desc dm646x_io_desc[] = {
{
.virtual = IO_VIRT,
@@ -614,6 +604,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
.gpio_num = 43, /* Only 33 usable */
.gpio_irq = IRQ_DM646X_GPIOBNK0,
.serial_dev = &dm646x_serial_device,
+ .emac_pdata = &dm646x_emac_pdata,
};
void __init dm646x_init(void)
@@ -627,6 +618,7 @@ static int __init dm646x_init_devices(void)
return 0;
platform_device_register(&dm646x_edma_device);
+ platform_device_register(&dm646x_emac_device);
return 0;
}
postcore_initcall(dm646x_init_devices);