summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-07-08 21:26:36 +0800
committerTerry Lv <r65388@freescale.com>2010-07-16 11:18:57 +0800
commitc5f6bfc5b71f455171b22e7291c75da3a7704974 (patch)
tree0009f7e5289daa73f2c100b593c1da26a738eb0f /net
parentacce438960d7ba5312e5d26d828fd2875901304b (diff)
downloadu-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.zip
u-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.tar.gz
u-boot-imx-c5f6bfc5b71f455171b22e7291c75da3a7704974.tar.bz2
ENGR00123924: Reconstructure fuse files and add fuse to mx53.
1. Reconstructure fuse. Move fuse files to common directory. 2. Read mac from fuse in fec. 3. Remove scc and srk command from fuse command. 4. Change fuse to iim. 5. Add fuse for mx53. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/net/eth.c b/net/eth.c
index 2200767..7adc9e6 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -1,9 +1,7 @@
/*
- * (C) Copyright 2001-2004
+ * (C) Copyright 2001-2010
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
- * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
- *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -28,7 +26,6 @@
#include <net.h>
#include <miiphy.h>
-#ifdef CONFIG_CMD_NET
void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
{
char *end;
@@ -62,9 +59,16 @@ int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr)
sprintf(enetvar, index ? "eth%daddr" : "ethaddr", index);
return eth_getenv_enetaddr(enetvar, enetaddr);
}
-#endif
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#ifdef CONFIG_NET_MULTI
+
+static int eth_mac_skip(int index)
+{
+ char enetvar[15];
+ char *skip_state;
+ sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index);
+ return ((skip_state = getenv(enetvar)) != NULL);
+}
/*
* CPU and board-specific Ethernet initializations. Aliased function
@@ -177,7 +181,8 @@ int eth_register(struct eth_device* dev)
}
#endif
} else {
- for (d=eth_devices; d->next!=eth_devices; d=d->next);
+ for (d = eth_devices; d->next != eth_devices; d = d->next)
+ ;
d->next = dev;
}
@@ -245,6 +250,11 @@ int eth_initialize(bd_t *bis)
memcpy(dev->enetaddr, env_enetaddr, 6);
}
+ if (dev->write_hwaddr &&
+ !eth_mac_skip(eth_number) &&
+ is_valid_ether_addr(dev->enetaddr)) {
+ dev->write_hwaddr(dev);
+ }
eth_number++;
dev = dev->next;
@@ -494,7 +504,8 @@ char *eth_get_name (void)
{
return (eth_current ? eth_current->name : "unknown");
}
-#elif defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_MULTI)
+
+#else /* !CONFIG_NET_MULTI */
#warning Ethernet driver is deprecated. Please update to use CONFIG_NET_MULTI
@@ -518,9 +529,6 @@ int eth_initialize(bd_t *bis)
#if defined(CONFIG_DRIVER_NS7520_ETHERNET)
ns7520_miiphy_initialize(bis);
#endif
-#if defined(CONFIG_SMC911X)
- smc911x_initialize(0, CONFIG_SMC911X_BASE);
-#endif
return 0;
}
#endif