summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-12 00:18:41 (GMT)
committerWolfgang Denk <wd@denx.de>2009-03-20 21:39:11 (GMT)
commit6bacfa6a8e9b264d37c1262fc1f3e948d1feab81 (patch)
tree0e5d0e6e20b9265f68bc67c4bb0930566d05c658 /cpu/ppc4xx
parent03f3d8d3b39cf85c0ce7ca903b436701e8aa610b (diff)
downloadu-boot-6bacfa6a8e9b264d37c1262fc1f3e948d1feab81.tar.xz
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/ppc4xx')
-rw-r--r--cpu/ppc4xx/cpu_init.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/cpu/ppc4xx/cpu_init.c b/cpu/ppc4xx/cpu_init.c
index b5d81f2..a8f589a 100644
--- a/cpu/ppc4xx/cpu_init.c
+++ b/cpu/ppc4xx/cpu_init.c
@@ -324,6 +324,7 @@ int cpu_init_r (void)
#if defined(CONFIG_405GP) || defined(CONFIG_405EP)
bd_t *bd = gd->bd;
unsigned long reg;
+ uchar enetaddr[6];
#if defined(CONFIG_405GP)
uint pvr = get_pvr();
#endif
@@ -332,19 +333,20 @@ int cpu_init_r (void)
* Write Ethernetaddress into on-chip register
*/
reg = 0x00000000;
- reg |= bd->bi_enetaddr[0]; /* set high address */
+ eth_getenv_enetaddr("ethaddr", enetaddr);
+ reg |= enetaddr[0]; /* set high address */
reg = reg << 8;
- reg |= bd->bi_enetaddr[1];
+ reg |= enetaddr[1];
out32 (EMAC_IAH, reg);
reg = 0x00000000;
- reg |= bd->bi_enetaddr[2]; /* set low address */
+ reg |= enetaddr[2]; /* set low address */
reg = reg << 8;
- reg |= bd->bi_enetaddr[3];
+ reg |= enetaddr[3];
reg = reg << 8;
- reg |= bd->bi_enetaddr[4];
+ reg |= enetaddr[4];
reg = reg << 8;
- reg |= bd->bi_enetaddr[5];
+ reg |= enetaddr[5];
out32 (EMAC_IAL, reg);
#if defined(CONFIG_405GP)