summaryrefslogtreecommitdiff
path: root/board/mbx8xx/mbx8xx.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-16 18:03:14 -0500
committerWolfgang Denk <wd@denx.de>2009-03-20 22:39:12 +0100
commitd8d21e699d7fcfb6ab11635110266dd09b7edc62 (patch)
treeec591b9aaf82e817558bde954ba6dc616bc908fd /board/mbx8xx/mbx8xx.c
parentf11e6ff5b1859d9213f0d501b3309e065f487543 (diff)
downloadu-boot-imx-d8d21e699d7fcfb6ab11635110266dd09b7edc62.zip
u-boot-imx-d8d21e699d7fcfb6ab11635110266dd09b7edc62.tar.gz
u-boot-imx-d8d21e699d7fcfb6ab11635110266dd09b7edc62.tar.bz2
boards: move board_get_enetaddr() into board-specific init
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. Rather than have the common ppc code have board-specific hooks, move the board_get_enetaddr() function into the board-specific init functions. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'board/mbx8xx/mbx8xx.c')
-rw-r--r--board/mbx8xx/mbx8xx.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/board/mbx8xx/mbx8xx.c b/board/mbx8xx/mbx8xx.c
index af4f57d..a3bf1f7 100644
--- a/board/mbx8xx/mbx8xx.c
+++ b/board/mbx8xx/mbx8xx.c
@@ -241,7 +241,7 @@ static unsigned int get_reffreq (void)
return *((ulong *) packet->data);
}
-void board_get_enetaddr (uchar * addr)
+static void board_get_enetaddr(uchar *addr)
{
int i;
vpd_packet_t *packet;
@@ -251,6 +251,18 @@ void board_get_enetaddr (uchar * addr)
addr[i] = packet->data[i];
}
+int misc_init_r(void)
+{
+ uchar enetaddr[6];
+
+ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+ board_get_enetaddr(enetaddr);
+ eth_putenv_enetaddr("ethaddr", enetaddr);
+ }
+
+ return 0;
+}
+
/*
* Check Board Identity:
*/