summaryrefslogtreecommitdiffstats
path: root/lib_ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-11 20:07:19 -0500
committerWolfgang Denk <wd@denx.de>2009-03-20 22:39:12 +0100
commiteb85aa594c1b57a1e3be9689b65171a137a36432 (patch)
treed7cc386d275918a7abfe0e4328913fc2eab054b7 /lib_ppc
parent9c150102bc1de375d36d97a1cc2dd0e9639b15df (diff)
downloadu-boot-eb85aa594c1b57a1e3be9689b65171a137a36432.tar.gz
u-boot-eb85aa594c1b57a1e3be9689b65171a137a36432.tar.xz
u-boot-eb85aa594c1b57a1e3be9689b65171a137a36432.zip
ppc: mark global bi_enet*addr as legacy
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. In the ppc case, these things are part of the legacy ABI, so keep them around but mark them as legacy so no new code will touch them. 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>
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/board.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 10a4d37e29..a63f4b3016 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -878,12 +878,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
mac_read_from_eeprom();
#endif
- s = getenv ("ethaddr");
- 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;
@@ -891,56 +885,22 @@ void board_init_r (gd_t *id, ulong dest_addr)
bd->bi_ethspeed = 0xFFFF;
#endif
+ /* kept around for legacy kernels only ... ignore the next section */
+ eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr);
#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;
- }
+ eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr);
#endif
#ifdef CONFIG_HAS_ETH2
- /* handle the 3rd ethernet address */
-
- s = getenv ("eth2addr");
- for (i = 0; i < 6; ++i) {
- bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
+ eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr);
#endif
-
#ifdef CONFIG_HAS_ETH3
- /* handle 4th ethernet address */
- s = getenv("eth3addr");
- for (i = 0; i < 6; ++i) {
- bd->bi_enet3addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
+ eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr);
#endif
-
#ifdef CONFIG_HAS_ETH4
- /* handle 5th ethernet address */
- s = getenv("eth4addr");
- for (i = 0; i < 6; ++i) {
- bd->bi_enet4addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
+ eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr);
#endif
-
#ifdef CONFIG_HAS_ETH5
- /* handle 6th ethernet address */
- s = getenv("eth5addr");
- for (i = 0; i < 6; ++i) {
- bd->bi_enet5addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
+ eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr);
#endif
/* IP Address */