diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-11 19:01:26 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-03-20 22:39:10 +0100 |
commit | d3f871482f06f6a4eaf4a3fafde84846bad87b4f (patch) | |
tree | 992dd06b484d20eabb22d2a3d549b661f85dc9ea /drivers/net/4xx_enet.c | |
parent | b6b4625d175019e387e5b0f65a17322a78f6bb90 (diff) | |
download | u-boot-imx-d3f871482f06f6a4eaf4a3fafde84846bad87b4f.zip u-boot-imx-d3f871482f06f6a4eaf4a3fafde84846bad87b4f.tar.gz u-boot-imx-d3f871482f06f6a4eaf4a3fafde84846bad87b4f.tar.bz2 |
drivers/net/: get mac address from environment
The environment is the canonical storage location of the mac address, so
we're killing off the global data location and moving everything to
querying the env directly.
The drivers that get converted here:
3c589
4xx_enet
dc2114x
dm9000x
enc28j60
fsl_mcdmafec
ks8695eth
mcffec
rtl8019
rtl8169
s3c4510b_eth
xilinx_emac
xilinx_emaclite
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
CC: Rolf Offermanns <rof@sysgo.de>
CC: Stefan Roese <sr@denx.de>
CC: Sascha Hauer <saschahauer@web.de>
CC: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
CC: Greg Ungerer <greg.ungerer@opengear.com>
CC: Xue Ligong <lgxue@hotmail.com>
CC: Masami Komiya <mkomiya@sonare.it>
CC: Curt Brune <curt@cucy.com>
CC: Michal SIMEK <monstr@monstr.eu>
Diffstat (limited to 'drivers/net/4xx_enet.c')
-rw-r--r-- | drivers/net/4xx_enet.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 1978269..918373b 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1927,24 +1927,22 @@ int ppc_4xx_eth_initialize (bd_t * bis) memcpy(ethaddr[eth_num], "\0\0\0\0\0\0", 6); for (eth_num = 0; eth_num < LAST_EMAC_NUM; eth_num++) { + int ethaddr_idx = eth_num + CONFIG_EMAC_NR_START; switch (eth_num) { default: /* fall through */ case 0: - memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START], - bis->bi_enetaddr, 6); + eth_getenv_enetaddr("ethaddr", ethaddr[ethaddr_idx]); hw_addr[eth_num] = 0x0; break; #ifdef CONFIG_HAS_ETH1 case 1: - memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START], - bis->bi_enet1addr, 6); + eth_getenv_enetaddr("eth1addr", ethaddr[ethaddr_idx]); hw_addr[eth_num] = 0x100; break; #endif #ifdef CONFIG_HAS_ETH2 case 2: - memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START], - bis->bi_enet2addr, 6); + eth_getenv_enetaddr("eth2addr", ethaddr[ethaddr_idx]); #if defined(CONFIG_460GT) hw_addr[eth_num] = 0x300; #else @@ -1954,8 +1952,7 @@ int ppc_4xx_eth_initialize (bd_t * bis) #endif #ifdef CONFIG_HAS_ETH3 case 3: - memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START], - bis->bi_enet3addr, 6); + eth_getenv_enetaddr("eth3addr", ethaddr[ethaddr_idx]); #if defined(CONFIG_460GT) hw_addr[eth_num] = 0x400; #else |