summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/common.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 19:41:27 (GMT)
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-28 22:17:47 (GMT)
commitb14dc0f9942a9c318c6c49f29511d88b3642e2d0 (patch)
treeef9a9f0502c62a059de7ef7bb4949d5f51f8c8d1 /arch/arm/mach-davinci/common.c
parentc97909fcf1611645f0fe235b332e39623588d84c (diff)
downloadlinux-b14dc0f9942a9c318c6c49f29511d88b3642e2d0.tar.xz
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/common.c')
-rw-r--r--arch/arm/mach-davinci/common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index d72d517..169ec73 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -10,12 +10,14 @@
*/
#include <linux/module.h>
#include <linux/io.h>
+#include <linux/etherdevice.h>
#include <asm/tlb.h>
#include <asm/mach/map.h>
#include <mach/common.h>
#include <mach/cputype.h>
+#include <mach/emac.h>
#include "clock.h"
@@ -24,6 +26,16 @@ EXPORT_SYMBOL(davinci_soc_info);
void __iomem *davinci_intc_base;
+void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context)
+{
+ char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
+ off_t offset = (off_t)context;
+
+ /* Read MAC addr from EEPROM */
+ if (mem_acc->read(mem_acc, mac_addr, offset, ETH_ALEN) == ETH_ALEN)
+ pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
+}
+
static struct davinci_id * __init davinci_get_id(u32 jtag_id)
{
int i;