diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-11 19:18:41 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-03-20 22:39:11 +0100 |
commit | 6bacfa6a8e9b264d37c1262fc1f3e948d1feab81 (patch) | |
tree | 0e5d0e6e20b9265f68bc67c4bb0930566d05c658 /cpu/arm920t/at91rm9200/ether.c | |
parent | 03f3d8d3b39cf85c0ce7ca903b436701e8aa610b (diff) | |
download | u-boot-imx-6bacfa6a8e9b264d37c1262fc1f3e948d1feab81.zip u-boot-imx-6bacfa6a8e9b264d37c1262fc1f3e948d1feab81.tar.gz u-boot-imx-6bacfa6a8e9b264d37c1262fc1f3e948d1feab81.tar.bz2 |
cpu/: 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 cpus that get converted here:
at91rm9200
mpc512x
mpc5xxx
mpc8260
mpc8xx
ppc4xx
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
CC: John Rigby <jrigby@freescale.com>
CC: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cpu/arm920t/at91rm9200/ether.c')
-rw-r--r-- | cpu/arm920t/at91rm9200/ether.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cpu/arm920t/at91rm9200/ether.c b/cpu/arm920t/at91rm9200/ether.c index f20e070..b00b948 100644 --- a/cpu/arm920t/at91rm9200/ether.c +++ b/cpu/arm920t/at91rm9200/ether.c @@ -155,6 +155,7 @@ int eth_init (bd_t * bd) { int ret; int i; + uchar enetaddr[6]; p_mac = AT91C_BASE_EMAC; @@ -190,9 +191,10 @@ int eth_init (bd_t * bd) rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP; rbfp = &rbfdt[0]; - p_mac->EMAC_SA2L = (bd->bi_enetaddr[3] << 24) | (bd->bi_enetaddr[2] << 16) - | (bd->bi_enetaddr[1] << 8) | (bd->bi_enetaddr[0]); - p_mac->EMAC_SA2H = (bd->bi_enetaddr[5] << 8) | (bd->bi_enetaddr[4]); + eth_getenv_enetaddr("ethaddr", enetaddr); + p_mac->EMAC_SA2L = (enetaddr[3] << 24) | (enetaddr[2] << 16) + | (enetaddr[1] << 8) | (enetaddr[0]); + p_mac->EMAC_SA2H = (enetaddr[5] << 8) | (enetaddr[4]); p_mac->EMAC_RBQP = (long) (&rbfdt[0]); p_mac->EMAC_RSR &= ~(AT91C_EMAC_RSR_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA); |