From: Holger Brunck <holger.brunck@keymile.com>
Date: Tue, 13 Sep 2011 23:06:10 +0000 (+0000)
Subject: km/common: force set ethaddr only for KM kirkwood boards
X-Git-Tag: v2025.01-rc5-pxa1908~18794
X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=0eb0e59ed3955cd73548c8769bf594c665025dd5;p=u-boot.git

km/common: force set ethaddr only for KM kirkwood boards

This prevents u-boot to print out "Can't overwrite "ethaddr""
each time a powerpc board starts.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Wolfgang Denk <wd@denx.de>
---

diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index bcf3aed97e..70d78457f2 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -221,7 +221,12 @@ static int ivm_analyze_block2(unsigned char *buf, int len)
 		sprintf((char *)valbuf, "%pM", buf);
 	}
 #endif
+#ifdef MACH_TYPE_KM_KIRKWOOD
 	setenv((char *)"ethaddr", (char *)valbuf);
+#else
+	if (getenv("ethaddr") == NULL)
+		setenv((char *)"ethaddr", (char *)valbuf);
+#endif
 
 	/* IVM_MacCount */
 	count = (buf[10] << 24) +