summaryrefslogtreecommitdiff
path: root/board/mpl
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-11 18:38:38 -0500
committerWolfgang Denk <wd@denx.de>2009-03-20 22:39:10 +0100
commitb6b4625d175019e387e5b0f65a17322a78f6bb90 (patch)
treeb2ce2171c2fc2138f4a7d2f93a03e17559fd5b0a /board/mpl
parent06a0c4381a65ed500c816a05b9ae7b207c3b1d4b (diff)
downloadu-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.zip
u-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.tar.gz
u-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.tar.bz2
boards: get mac address from environment
The boards that get converted here to use the environment for the mac address rather than global data: debris mgcoge mgsuvd muas3001 netstal pn62 sixnet vcma9 xilinx (the ones that use xilinx_enet) Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com> CC: Sangmoon Kim <dogoil@etinsys.com> CC: Heiko Schocher <hs@denx.de> CC: David Mueller <d.mueller@elsoft.ch> CC: Niklaus Giger <niklaus.giger@netstal.com> CC: Wolfgang Grandegger <wg@denx.de> CC: Dave Ellis <DGE@sixnetio.com> CC: Ricardo Ribalda <ricardo.ribalda@uam.es>
Diffstat (limited to 'board/mpl')
-rw-r--r--board/mpl/vcma9/cmd_vcma9.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/board/mpl/vcma9/cmd_vcma9.c b/board/mpl/vcma9/cmd_vcma9.c
index 2748fa9..7d2aa3c 100644
--- a/board/mpl/vcma9/cmd_vcma9.c
+++ b/board/mpl/vcma9/cmd_vcma9.c
@@ -76,21 +76,18 @@ int do_vcma9(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
cs8900_e2prom_write(addr, data);
} else if (strcmp(argv[2], "setaddr") == 0) {
uchar addr, i, csum; ushort data;
+ uchar ethaddr[6];
/* check for valid ethaddr */
- for (i = 0; i < 6; i++)
- if (gd->bd->bi_enetaddr[i] != 0)
- break;
-
- if (i < 6) {
+ if (eth_getenv_enetaddr("ethaddr", ethaddr)) {
addr = 1;
data = 0x2158;
cs8900_e2prom_write(addr, data);
csum = cs8900_chksum(data);
addr++;
for (i = 0; i < 6; i+=2) {
- data = gd->bd->bi_enetaddr[i+1] << 8 |
- gd->bd->bi_enetaddr[i];
+ data = enetaddr[i+1] << 8 |
+ enetaddr[i];
cs8900_e2prom_write(addr, data);
csum += cs8900_chksum(data);
addr++;