[U-Boot] [PATCH 1/2] km/ivm: always set ethaddr after reading IVM
Holger Brunck
holger.brunck at keymile.com
Thu Jul 13 09:15:40 UTC 2017
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 at denx.de>
Signed-off-by: Holger Brunck <holger.brunck at 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
More information about the U-Boot
mailing list