aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/common.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/common.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/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 d72d517d090c..169ec73f8d76 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -10,12 +10,14 @@
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/etherdevice.h>
13 14
14#include <asm/tlb.h> 15#include <asm/tlb.h>
15#include <asm/mach/map.h> 16#include <asm/mach/map.h>
16 17
17#include <mach/common.h> 18#include <mach/common.h>
18#include <mach/cputype.h> 19#include <mach/cputype.h>
20#include <mach/emac.h>
19 21
20#include "clock.h" 22#include "clock.h"
21 23
@@ -24,6 +26,16 @@ EXPORT_SYMBOL(davinci_soc_info);
24 26
25void __iomem *davinci_intc_base; 27void __iomem *davinci_intc_base;
26 28
29void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context)
30{
31 char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
32 off_t offset = (off_t)context;
33
34 /* Read MAC addr from EEPROM */
35 if (mem_acc->read(mem_acc, mac_addr, offset, ETH_ALEN) == ETH_ALEN)
36 pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
37}
38
27static struct davinci_id * __init davinci_get_id(u32 jtag_id) 39static struct davinci_id * __init davinci_get_id(u32 jtag_id)
28{ 40{
29 int i; 41 int i;