From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/9] mvgbe: Support preserving the existing MAC address
Date: Sat, 30 Apr 2011 00:21:29 -0400 [thread overview]
Message-ID: <201104300021.31020.vapier@gentoo.org> (raw)
In-Reply-To: <1300391223-11879-3-git-send-email-mspang@csclub.uwaterloo.ca>
On Thursday, March 17, 2011 15:46:56 Michael Spang wrote:
> while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
this logic in the mvgbe is plain broken. it should not be touching the env at
all. if there is no eeprom to read, then the mvgbe driver should leave dev-
>enetaddr alone. let the boards take care of setting things up.
i.e. this patch:
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index c701f43..4c0d5bf 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -645,7 +645,6 @@ int mvgbe_initialize(bd_t *bis)
struct mvgbe_device *dmvgbe;
struct eth_device *dev;
int devnum;
- char *s;
u8 used_ports[MAX_MVGBE_DEVS] = CONFIG_MVGBE_PORTS;
for (devnum = 0; devnum < MAX_MVGBE_DEVS; devnum++) {
@@ -700,16 +699,13 @@ error1:
/* must be less than NAMESIZE (16) */
sprintf(dev->name, "egiga%d", devnum);
- /* Extract the MAC address from the environment */
switch (devnum) {
case 0:
dmvgbe->regs = (void *)MVGBE0_BASE;
- s = "ethaddr";
break;
#if defined(MVGBE1_BASE)
case 1:
dmvgbe->regs = (void *)MVGBE1_BASE;
- s = "eth1addr";
break;
#endif
default: /* this should never happen */
@@ -718,30 +714,11 @@ error1:
return -1;
}
- while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
- /* Generate Private MAC addr if not set */
- dev->enetaddr[0] = 0x02;
- dev->enetaddr[1] = 0x50;
- dev->enetaddr[2] = 0x43;
-#if defined (CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION)
- /* Generate fixed lower MAC half using devnum */
- dev->enetaddr[3] = 0;
- dev->enetaddr[4] = 0;
- dev->enetaddr[5] = devnum;
-#else
- /* Generate random lower MAC half */
- dev->enetaddr[3] = get_random_hex();
- dev->enetaddr[4] = get_random_hex();
- dev->enetaddr[5] = get_random_hex();
-#endif
- eth_setenv_enetaddr(s, dev->enetaddr);
- }
-
- dev->init = (void *)mvgbe_init;
- dev->halt = (void *)mvgbe_halt;
- dev->send = (void *)mvgbe_send;
- dev->recv = (void *)mvgbe_recv;
- dev->write_hwaddr = (void *)mvgbe_write_hwaddr;
+ dev->init = mvgbe_init;
+ dev->halt = mvgbe_halt;
+ dev->send = mvgbe_send;
+ dev->recv = mvgbe_recv;
+ dev->write_hwaddr = mvgbe_write_hwaddr;
eth_register(dev);
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110430/da21294c/attachment-0001.pgp
next prev parent reply other threads:[~2011-04-30 4:21 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 19:46 [U-Boot] [PATCH 0/9] TS-7800 port for U-Boot Michael Spang
2011-03-17 19:46 ` [U-Boot] [PATCH 1/9] arm926ej-s: Invalidate instruction cache in flush_cache Michael Spang
2011-03-20 2:30 ` arden jay
2011-03-20 3:44 ` Michael Spang
2011-03-20 5:36 ` arden jay
2011-03-20 8:18 ` Albert ARIBAUD
2011-03-20 14:14 ` arden jay
2011-03-20 18:26 ` Michael Spang
2011-03-21 5:44 ` Aneesh V
2011-03-21 14:14 ` arden jay
2013-07-29 7:19 ` Albert ARIBAUD
2013-07-29 12:57 ` Michael Spang
2013-07-29 14:09 ` Albert ARIBAUD
2013-07-29 14:22 ` Michael Spang
2011-03-17 19:46 ` [U-Boot] [PATCH 2/9] mvgbe: Support preserving the existing MAC address Michael Spang
2011-04-24 23:50 ` Wolfgang Denk
2011-04-25 11:37 ` Tabi Timur-B04825
2011-04-26 4:23 ` Michael Spang
2011-04-30 4:17 ` Mike Frysinger
2011-04-30 14:34 ` Tabi Timur-B04825
2011-05-01 5:40 ` Mike Frysinger
2011-04-26 4:20 ` Michael Spang
2011-04-30 4:21 ` Mike Frysinger [this message]
2011-03-17 19:46 ` [U-Boot] [PATCH 3/9] orion5x: Increase maximum bank size to 128M Michael Spang
2011-03-17 19:46 ` [U-Boot] [PATCH 4/9] orion5x: Fix wrong address in orion5x_sdram_bar Michael Spang
2011-03-17 19:46 ` [U-Boot] [PATCH 5/9] ARM: Rename CONFIG_SKIP_LOWLEVEL_INIT to CONFIG_SKIP_CPU_INIT_CRIT Michael Spang
2011-04-24 23:53 ` Wolfgang Denk
2011-04-26 3:44 ` Michael Spang
2011-03-17 19:47 ` [U-Boot] [PATCH 6/9] ARM: Implement CONFIG_SKIP_LOWLEVEL_INIT for arm926ej-s Michael Spang
2011-04-24 23:55 ` Wolfgang Denk
2011-04-25 7:30 ` Albert ARIBAUD
2011-04-26 4:44 ` Michael Spang
2011-03-17 19:47 ` [U-Boot] [PATCH 7/9] Add board support for TS-7800 Michael Spang
2011-04-24 23:57 ` Wolfgang Denk
2011-04-26 3:38 ` Michael Spang
2011-03-17 19:47 ` [U-Boot] [PATCH 8/9] Add NAND " Michael Spang
2011-03-17 20:22 ` Scott Wood
2011-04-24 23:59 ` Wolfgang Denk
2011-04-26 4:01 ` Michael Spang
2011-04-26 4:27 ` Wolfgang Denk
2011-03-17 19:47 ` [U-Boot] [PATCH 9/9] Add README " Michael Spang
2011-04-25 0:01 ` Wolfgang Denk
2011-04-26 4:03 ` Michael Spang
2011-03-17 19:53 ` [U-Boot] [PATCH 0/9] TS-7800 port for U-Boot Michael Spang
2011-03-17 20:01 ` Albert ARIBAUD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201104300021.31020.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox