diff options
Diffstat (limited to 'board/mpl/vcma9/cmd_vcma9.c')
-rw-r--r-- | board/mpl/vcma9/cmd_vcma9.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/board/mpl/vcma9/cmd_vcma9.c b/board/mpl/vcma9/cmd_vcma9.c index 2748fa97f8..7d2aa3ccee 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++; |