[U-Boot] [PATCH 13/27] Blackfin: setup bi_enetaddr for single nets
Mike Frysinger
vapier at gentoo.org
Thu Jan 29 01:03:22 CET 2009
For systems with CONFIG_NET_MULTI disabled, bi_enetaddr does not get setup
based on $ethaddr, so set it up.
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
lib_blackfin/board.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c
index 03827b7..76b095a 100644
--- a/lib_blackfin/board.c
+++ b/lib_blackfin/board.c
@@ -364,10 +364,19 @@ void board_init_r(gd_t * id, ulong dest_addr)
bd->bi_ip_addr = getenv_IPaddr("ipaddr");
printf("Net: ");
eth_initialize(gd->bd);
- if (getenv("ethaddr"))
+ if ((s = getenv("ethaddr"))) {
+# ifndef CONFIG_NET_MULTI
+ size_t i;
+ char *e;
+ for (i = 0; i < 6; ++i) {
+ bd->bi_enetaddr[i] = simple_strtoul(s, &e, 16);
+ s = (*e) ? e + 1 : e;
+ }
+# endif
printf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
bd->bi_enetaddr[0], bd->bi_enetaddr[1], bd->bi_enetaddr[2],
bd->bi_enetaddr[3], bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
+ }
#endif
display_global_data();
--
1.6.1.1
More information about the U-Boot
mailing list