diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-16 18:03:14 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-03-20 22:39:12 +0100 |
commit | d8d21e699d7fcfb6ab11635110266dd09b7edc62 (patch) | |
tree | ec591b9aaf82e817558bde954ba6dc616bc908fd /board/RPXClassic | |
parent | f11e6ff5b1859d9213f0d501b3309e065f487543 (diff) | |
download | u-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/RPXClassic')
-rw-r--r-- | board/RPXClassic/RPXClassic.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/board/RPXClassic/RPXClassic.c b/board/RPXClassic/RPXClassic.c index 9fdf700..5aa713f 100644 --- a/board/RPXClassic/RPXClassic.c +++ b/board/RPXClassic/RPXClassic.c @@ -105,7 +105,7 @@ int checkboard (void) * board_get_enetaddr -- Read the MAC Address in the I2C EEPROM *----------------------------------------------------------------------------- */ -void board_get_enetaddr (uchar * enet) +static void board_get_enetaddr(uchar *enet) { int i; char buff[256], *cp; @@ -142,9 +142,19 @@ void board_get_enetaddr (uchar * enet) enet[3] |= 0x80; #endif - printf ("MAC address = %02x:%02x:%02x:%02x:%02x:%02x\n", - enet[0], enet[1], enet[2], enet[3], enet[4], enet[5]); + printf("MAC address = %pM\n", enet); +} + +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; } void rpxclassic_init (void) |