aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-dm644x-evm.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:41:27 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-28 18:17:47 -0400
commitb14dc0f9942a9c318c6c49f29511d88b3642e2d0 (patch)
treeef9a9f0502c62a059de7ef7bb4949d5f51f8c8d1 /arch/arm/mach-davinci/board-dm644x-evm.c
parentc97909fcf1611645f0fe235b332e39623588d84c (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-dm644x-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 987d27fcacb0..d9d40450bdc5 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -44,6 +44,7 @@
44#include <mach/psc.h> 44#include <mach/psc.h>
45#include <mach/nand.h> 45#include <mach/nand.h>
46#include <mach/mmc.h> 46#include <mach/mmc.h>
47#include <mach/emac.h>
47#include <mach/common.h> 48#include <mach/common.h>
48 49
49#define DM644X_EVM_PHY_MASK (0x2) 50#define DM644X_EVM_PHY_MASK (0x2)
@@ -437,28 +438,13 @@ static struct pcf857x_platform_data pcf_data_u35 = {
437 * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL) 438 * - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
438 * - ... newer boards may have more 439 * - ... newer boards may have more
439 */ 440 */
440static struct memory_accessor *at24_mem_acc;
441
442static void at24_setup(struct memory_accessor *mem_acc, void *context)
443{
444 char mac_addr[ETH_ALEN];
445 struct davinci_soc_info *soc_info = &davinci_soc_info;
446
447 at24_mem_acc = mem_acc;
448
449 /* Read MAC addr from EEPROM */
450 if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, ETH_ALEN) ==
451 ETH_ALEN) {
452 printk(KERN_INFO "Read MAC addr from EEPROM: %pM\n", mac_addr);
453 memcpy(soc_info->emac_pdata->mac_addr, mac_addr, ETH_ALEN);
454 }
455}
456 441
457static struct at24_platform_data eeprom_info = { 442static struct at24_platform_data eeprom_info = {
458 .byte_len = (256*1024) / 8, 443 .byte_len = (256*1024) / 8,
459 .page_size = 64, 444 .page_size = 64,
460 .flags = AT24_FLAG_ADDR16, 445 .flags = AT24_FLAG_ADDR16,
461 .setup = at24_setup, 446 .setup = davinci_get_mac_addr,
447 .context = (void *)0x7f00,
462}; 448};
463 449
464/* 450/*
@@ -684,7 +670,6 @@ static __init void davinci_evm_init(void)
684 670
685 soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK; 671 soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK;
686 soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY; 672 soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY;
687 dm644x_init_emac(soc_info->emac_pdata);
688 673
689 /* Register the fixup for PHY on DaVinci */ 674 /* Register the fixup for PHY on DaVinci */
690 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, 675 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,