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>
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index becae51..0de0637 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -52,11 +52,6 @@
#define DM646X_EVM_PHY_MASK (0x2)
#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
-static struct emac_platform_data dm646x_evm_emac_pdata = {
- .phy_mask = DM646X_EVM_PHY_MASK,
- .mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY,
-};
-
static struct davinci_uart_config uart_config __initdata = {
.enabled_uarts = (1 << 0),
};
@@ -208,6 +203,7 @@
static void at24_setup(struct memory_accessor *mem_acc, void *context)
{
char mac_addr[ETH_ALEN];
+ struct davinci_soc_info *soc_info = &davinci_soc_info;
at24_mem_acc = mem_acc;
@@ -215,7 +211,7 @@
if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, ETH_ALEN) ==
ETH_ALEN) {
pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
- memcpy(dm646x_evm_emac_pdata.mac_addr, mac_addr, ETH_ALEN);
+ memcpy(soc_info->emac_pdata->mac_addr, mac_addr, ETH_ALEN);
}
}
@@ -271,9 +267,14 @@
static __init void evm_init(void)
{
+ struct davinci_soc_info *soc_info = &davinci_soc_info;
+
evm_init_i2c();
davinci_serial_init(&uart_config);
- dm646x_init_emac(&dm646x_evm_emac_pdata);
+
+ soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
+ soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
+ dm646x_init_emac(soc_info->emac_pdata);
}
static __init void davinci_dm646x_evm_irq_init(void)