diff options
author | Holger Brunck <holger.brunck@keymile.com> | 2017-07-13 11:15:40 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-07-22 22:22:46 -0400 |
commit | b63d4f34d06e1d08571a9a2649d9f9ec0dbd806c (patch) | |
tree | 9c7cb1eb9fd58107e1e80faaf5892a60442c66c4 | |
parent | 6821a7457c8a12bb4d378275807c1ea26e87d97f (diff) |
km/ivm: always set ethaddr after reading IVM
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>
-rw-r--r-- | board/keymile/common/ivm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index 42db54221bb..3495fafffe6 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; |