diff options
author | Mark A. Greer <mgreer@mvista.com> | 2009-04-15 15:41:27 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-28 18:17:47 -0400 |
commit | b14dc0f9942a9c318c6c49f29511d88b3642e2d0 (patch) | |
tree | ef9a9f0502c62a059de7ef7bb4949d5f51f8c8d1 /arch/arm/mach-davinci/board-dm646x-evm.c | |
parent | c97909fcf1611645f0fe235b332e39623588d84c (diff) |
davinci: Factor out emac mac address handling
Factor out the code to extract that mac address from
i2c eeprom.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-dm646x-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm646x-evm.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 44e2ab665af5..e17de6352624 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -198,28 +198,13 @@ static struct pcf857x_platform_data pcf_data = { | |||
198 | * - 0x7f00, 6 bytes Ethernet Address | 198 | * - 0x7f00, 6 bytes Ethernet Address |
199 | * - ... newer boards may have more | 199 | * - ... newer boards may have more |
200 | */ | 200 | */ |
201 | static struct memory_accessor *at24_mem_acc; | ||
202 | |||
203 | static void at24_setup(struct memory_accessor *mem_acc, void *context) | ||
204 | { | ||
205 | char mac_addr[ETH_ALEN]; | ||
206 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
207 | |||
208 | at24_mem_acc = mem_acc; | ||
209 | |||
210 | /* Read MAC addr from EEPROM */ | ||
211 | if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, ETH_ALEN) == | ||
212 | ETH_ALEN) { | ||
213 | pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr); | ||
214 | memcpy(soc_info->emac_pdata->mac_addr, mac_addr, ETH_ALEN); | ||
215 | } | ||
216 | } | ||
217 | 201 | ||
218 | static struct at24_platform_data eeprom_info = { | 202 | static struct at24_platform_data eeprom_info = { |
219 | .byte_len = (256*1024) / 8, | 203 | .byte_len = (256*1024) / 8, |
220 | .page_size = 64, | 204 | .page_size = 64, |
221 | .flags = AT24_FLAG_ADDR16, | 205 | .flags = AT24_FLAG_ADDR16, |
222 | .setup = at24_setup, | 206 | .setup = davinci_get_mac_addr, |
207 | .context = (void *)0x7f00, | ||
223 | }; | 208 | }; |
224 | 209 | ||
225 | static struct i2c_board_info __initdata i2c_info[] = { | 210 | static struct i2c_board_info __initdata i2c_info[] = { |
@@ -258,7 +243,6 @@ static __init void evm_init(void) | |||
258 | 243 | ||
259 | soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK; | 244 | soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK; |
260 | soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY; | 245 | soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY; |
261 | dm646x_init_emac(soc_info->emac_pdata); | ||
262 | } | 246 | } |
263 | 247 | ||
264 | static __init void davinci_dm646x_evm_irq_init(void) | 248 | static __init void davinci_dm646x_evm_irq_init(void) |