diff options
author | Wolfgang Denk <wd@denx.de> | 2009-03-21 22:15:49 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-03-21 22:15:49 +0100 |
commit | ee1702d75a30d076139d1841383a1fa7220a0e11 (patch) | |
tree | b008c231b7d5e4e52ac49aec9a49bc73413aaf30 /drivers/net/xilinx_emac.c | |
parent | e60beb13cf0135dc71c541021487b5ccc4d269cb (diff) | |
parent | faac4fd852e39cb1d7a740801b060e41aeacef1f (diff) | |
download | u-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.zip u-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.tar.gz u-boot-imx-ee1702d75a30d076139d1841383a1fa7220a0e11.tar.bz2 |
Merge branch 'next' of ../next
Diffstat (limited to 'drivers/net/xilinx_emac.c')
-rw-r--r-- | drivers/net/xilinx_emac.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/xilinx_emac.c b/drivers/net/xilinx_emac.c index c7f1a2a..a489aa9 100644 --- a/drivers/net/xilinx_emac.c +++ b/drivers/net/xilinx_emac.c @@ -166,6 +166,7 @@ void eth_halt(void) int eth_init(bd_t * bis) { + uchar enetaddr[6]; u32 helpreg; debug ("EMAC Initialization Started\n\r"); @@ -200,15 +201,16 @@ int eth_init(bd_t * bis) helpreg &= ~(XEM_ECR_XMIT_ENABLE_MASK | XEM_ECR_RECV_ENABLE_MASK); out_be32 (emac.baseaddress + XEM_ECR_OFFSET, helpreg); - if (!getenv("ethaddr")) { - memcpy(bis->bi_enetaddr, emacaddr, ENET_ADDR_LENGTH); + if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { + memcpy(enetaddr, emacaddr, ENET_ADDR_LENGTH); + eth_setenv_enetaddr("ethaddr", enetaddr); } /* Set the device station address high and low registers */ - helpreg = (bis->bi_enetaddr[0] << 8) | bis->bi_enetaddr[1]; + helpreg = (enetaddr[0] << 8) | enetaddr[1]; out_be32 (emac.baseaddress + XEM_SAH_OFFSET, helpreg); - helpreg = (bis->bi_enetaddr[2] << 24) | (bis->bi_enetaddr[3] << 16) | - (bis->bi_enetaddr[4] << 8) | bis->bi_enetaddr[5]; + helpreg = (enetaddr[2] << 24) | (enetaddr[3] << 16) | + (enetaddr[4] << 8) | enetaddr[5]; out_be32 (emac.baseaddress + XEM_SAL_OFFSET, helpreg); helpreg = XEM_ECR_UNICAST_ENABLE_MASK | XEM_ECR_BROAD_ENABLE_MASK | |