[U-Boot] [PATCH 01/27 v3] Blackfin: bfin_mac: force boards to setup the MAC themselves

Mike Frysinger vapier at gentoo.org
Fri Jan 30 02:09:50 CET 2009


Since the on-chip MAC does not have an eeprom or similar interface, force
all Blackfin boards that use this driver to setup the board data with a
proper MAC.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
CC: Ben Warren <biggerbadderben at gmail.com>
---
v3
	- do no work -- make the boards do it themselves

v2
	- drop CONFIG_ETHADDR handling

 lib_blackfin/board.c |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c
index 01b71d4..c1fa61b 100644
--- a/lib_blackfin/board.c
+++ b/lib_blackfin/board.c
@@ -378,35 +378,6 @@ void board_init_r(gd_t * id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate();
 
-#ifdef CONFIG_CMD_NET
-	/* board MAC address */
-	s = getenv("ethaddr");
-	if (s == NULL) {
-# ifndef CONFIG_ETHADDR
-#  if 0
-		if (!board_get_enetaddr(bd->bi_enetaddr)) {
-			char nid[20];
-			sprintf(nid, "%02X:%02X:%02X:%02X:%02X:%02X",
-				bd->bi_enetaddr[0], bd->bi_enetaddr[1],
-				bd->bi_enetaddr[2], bd->bi_enetaddr[3],
-				bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
-			setenv("ethaddr", nid);
-		}
-#  endif
-# endif
-	} else {
-		int i;
-		char *e;
-		for (i = 0; i < 6; ++i) {
-			bd->bi_enetaddr[i] = simple_strtoul(s, &e, 16);
-			s = (*e) ? e + 1 : e;
-		}
-	}
-
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-#endif
-
 	/* Initialize devices */
 	devices_init();
 	jumptable_init();
@@ -433,6 +404,8 @@ void board_init_r(gd_t * id, ulong dest_addr)
 #endif
 
 #ifdef CONFIG_CMD_NET
+	/* IP Address */
+	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 	if (getenv("ethaddr"))
-- 
1.6.1.1



More information about the U-Boot mailing list