All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] net, kirkwood_egiga: init mac address before using network commands
@ 2010-03-30  5:38 Heiko Schocher
  2010-03-30  7:35 ` Mike Frysinger
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Heiko Schocher @ 2010-03-30  5:38 UTC (permalink / raw)
  To: u-boot

initialize mac address with the value from "ethaddr", before
doing some network commands. This is not in line with u-boot
design principle "not to initalize not used devices", and
maybe should go away, if there is a solution for passing
the mac address to arm linux kernels.

Tested on the suen3 board.

Signed-off-by: Heiko Schocher <hs@denx.de>
---
posting this patch as a result of this discussion:

http://lists.denx.de/pipermail/u-boot/2010-March/069025.html

 drivers/net/kirkwood_egiga.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index 2ad7fea..e8b3777 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -678,7 +678,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
 			return -1;
 		}

-		while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
+		if (!eth_getenv_enetaddr(s, dev->enetaddr)) {
 			/* Generate Random Private MAC addr if not set */
 			dev->enetaddr[0] = 0x02;
 			dev->enetaddr[1] = 0x50;
@@ -688,6 +688,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
 			dev->enetaddr[5] = get_random_hex();
 			eth_setenv_enetaddr(s, dev->enetaddr);
 		}
+		port_uc_addr_set(dkwgbe->regs, dev->enetaddr);

 		dev->init = (void *)kwgbe_init;
 		dev->halt = (void *)kwgbe_halt;
-- 
1.6.2.5

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-30  9:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30  5:38 [U-Boot] net, kirkwood_egiga: init mac address before using network commands Heiko Schocher
2010-03-30  7:35 ` Mike Frysinger
2010-03-30  7:43 ` Simon Kagstrom
2010-03-30  7:52 ` Detlev Zundel
2010-03-30  8:01   ` Simon Kagstrom
2010-03-30  8:26     ` Wolfgang Denk
2010-03-30  9:01       ` Simon Kagstrom
2010-03-30  9:42         ` Detlev Zundel
2010-03-30  8:01 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.