[U-Boot] [PATCH 25/27] ppc: do not initialize bi_enet*addr in global data

Mike Frysinger
2009-02-14T07:23:08Z

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.

Also stop calling load_sernum_ethaddr() since all boards now implement
this as a stub.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Ben Warren <biggerbadderben@gmail.com>
---
lib_ppc/board.c | 92 -------------------------------------------------------
1 files changed, 0 insertions(+), 92 deletions(-)

diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 1235514..444e804 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -879,20 +879,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
mac_read_from_eeprom();
#endif

- s = getenv ("ethaddr");
-#if defined (CONFIG_MBX) || \
- defined (CONFIG_RPXCLASSIC) || \
- defined(CONFIG_IAD210) || \
- defined(CONFIG_V38B)
- if (s == NULL)
- board_get_enetaddr (bd->bi_enetaddr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
#ifdef CONFIG_HERMES
if ((gd->board_type >> 16) == 2)
bd->bi_ethspeed = gd->board_type & 0xFFFF;
@@ -900,84 +886,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
bd->bi_ethspeed = 0xFFFF;
#endif

-#ifdef CONFIG_HAS_ETH1
- /* handle the 2nd ethernet address */
-
- s = getenv ("eth1addr");
-
- for (i = 0; i < 6; ++i) {
- bd->bi_enet1addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-#ifdef CONFIG_HAS_ETH2
- /* handle the 3rd ethernet address */
-
- s = getenv ("eth2addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet2addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#ifdef CONFIG_HAS_ETH3
- /* handle 4th ethernet address */
- s = getenv("eth3addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet3addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet3addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#ifdef CONFIG_HAS_ETH4
- /* handle 5th ethernet address */
- s = getenv("eth4addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet4addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet4addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#ifdef CONFIG_HAS_ETH5
- /* handle 6th ethernet address */
- s = getenv("eth5addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet5addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet5addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#if defined(CONFIG_TQM8xxL) || defined(CONFIG_TQM8260) || \
- defined(CONFIG_TQM8272) || \
- defined(CONFIG_CCM) || defined(CONFIG_KUP4K) || \
- defined(CONFIG_KUP4X) || defined(CONFIG_PCS440EP)
- load_sernum_ethaddr ();
-#endif
/* IP Address */
bd->bi_ip_addr = getenv_IPaddr ("ipaddr");

--
1.6.1.3