From 972412b648dcf0c4303dca7e515d5c24ce3cd1d5 Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Wed, 15 Apr 2009 12:40:56 -0700 Subject: 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 Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/board-dm646x-evm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'arch/arm/mach-davinci/board-dm646x-evm.c') diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index becae51d6dd1..0de0637aed5e 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 struct memory_accessor *at24_mem_acc; 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 @@ static void at24_setup(struct memory_accessor *mem_acc, void *context) 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 void __init davinci_map_io(void) 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) -- cgit v1.2.2