public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] km/ivm: always set ethaddr after reading IVM
@ 2017-07-13  9:15 Holger Brunck
  2017-07-13  9:15 ` [U-Boot] [PATCH 2/2] km/ivm: allow to set locally administred MAC addresses Holger Brunck
  2017-07-25  0:43 ` [U-Boot] [U-Boot, 1/2] km/ivm: always set ethaddr after reading IVM Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Holger Brunck @ 2017-07-13  9:15 UTC (permalink / raw)
  To: u-boot

If we rebrand the IVM and ethaddr was set previously we need to change
ethaddr. Otherwise we end up with a wrong MAC adress for the ethernet
interface.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
---
 board/keymile/common/ivm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 42db54221b..3495fafffe 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -302,14 +302,11 @@ static int ivm_populate_env(unsigned char *buf, int len)
 
 	/* if an offset is defined, add it */
 	process_mac(valbuf, page2, CONFIG_PIGGY_MAC_ADRESS_OFFSET);
-	if (getenv("ethaddr") == NULL)
-		setenv((char *)"ethaddr", (char *)valbuf);
+	setenv((char *)"ethaddr", (char *)valbuf);
 #ifdef CONFIG_KMVECT1
 /* KMVECT1 has two ethernet interfaces */
-	if (getenv("eth1addr") == NULL) {
-		process_mac(valbuf, page2, 1);
-		setenv((char *)"eth1addr", (char *)valbuf);
-	}
+	process_mac(valbuf, page2, 1);
+	setenv((char *)"eth1addr", (char *)valbuf);
 #endif
 
 	return 0;
-- 
2.12.0.rc1

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

end of thread, other threads:[~2017-07-25  0:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13  9:15 [U-Boot] [PATCH 1/2] km/ivm: always set ethaddr after reading IVM Holger Brunck
2017-07-13  9:15 ` [U-Boot] [PATCH 2/2] km/ivm: allow to set locally administred MAC addresses Holger Brunck
2017-07-25  0:43   ` [U-Boot] [U-Boot, " Tom Rini
2017-07-25  0:43 ` [U-Boot] [U-Boot, 1/2] km/ivm: always set ethaddr after reading IVM Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox