diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-16 23:03:14 (GMT) |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-03-20 21:39:12 (GMT) |
commit | d8d21e699d7fcfb6ab11635110266dd09b7edc62 (patch) | |
tree | ec591b9aaf82e817558bde954ba6dc616bc908fd /board/sandburst/metrobox | |
parent | f11e6ff5b1859d9213f0d501b3309e065f487543 (diff) | |
download | u-boot-fsl-qoriq-d8d21e699d7fcfb6ab11635110266dd09b7edc62.tar.xz |
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/sandburst/metrobox')
-rw-r--r-- | board/sandburst/metrobox/metrobox.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/board/sandburst/metrobox/metrobox.c b/board/sandburst/metrobox/metrobox.c index ec4c451..8bb8c02 100644 --- a/board/sandburst/metrobox/metrobox.c +++ b/board/sandburst/metrobox/metrobox.c @@ -321,6 +321,7 @@ int misc_init_r (void) { unsigned short sernum; char envstr[255]; + uchar enetaddr[6]; unsigned char opto_rev; OPTO_FPGA_REGS_ST *opto_ps; @@ -379,6 +380,34 @@ int misc_init_r (void) } } +#ifdef CONFIG_HAS_ETH0 + if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { + board_get_enetaddr(0, enetaddr); + eth_putenv_enetaddr("ethaddr", enetaddr); + } +#endif + +#ifdef CONFIG_HAS_ETH1 + if (!eth_getenv_enetaddr("eth1addr", enetaddr)) { + board_get_enetaddr(1, enetaddr); + eth_putenv_enetaddr("eth1addr", enetaddr); + } +#endif + +#ifdef CONFIG_HAS_ETH2 + if (!eth_getenv_enetaddr("eth2addr", enetaddr)) { + board_get_enetaddr(2, enetaddr); + eth_putenv_enetaddr("eth2addr", enetaddr); + } +#endif + +#ifdef CONFIG_HAS_ETH3 + if (!eth_getenv_enetaddr("eth3addr", enetaddr)) { + board_get_enetaddr(3, enetaddr); + eth_putenv_enetaddr("eth3addr", enetaddr); + } +#endif + return (0); } |