@@ -82,19 +82,23 @@
void ks8695_getmac(void)
{
- unsigned char *fp;
- int i;
+ if (!eth_getenv_enetaddr("ethaddr", ð_mac[0])) {
+ /* no mac in environment - fallback to old */
+ /* code which reads the mac from memory. */
+ unsigned char *fp;
+ int i;
+
+ /* Check if flash MAC is valid */
+ fp = (unsigned char *) 0x0201c000;
+ for (i = 0; (i < 6); i++) {
+ if ((fp[i] != 0) && (fp[i] != 0xff))
+ break;
+ }
- /* Check if flash MAC is valid */
- fp = (unsigned char *) 0x0201c000;
- for (i = 0; (i < 6); i++) {
- if ((fp[i] != 0) && (fp[i] != 0xff))
- break;
+ /* If we found a valid looking MAC address then use it */
+ if (i < 6)
+ memcpy(ð_mac[0], fp, 6);
}
-
- /* If we found a valid looking MAC address then use it */
- if (i < 6)
- memcpy(ð_mac[0], fp, 6);
}
/****************************************************************************/
@@ -137,7 +141,7 @@
ks8695_rx[i].addr = (uint32_t) &ks8695_bufs[(i+TXDESCS)*BUFSIZE];
ks8695_rx[i].next = (uint32_t) &ks8695_rx[i+1];
}
- ks8695_rx[RXDESCS-1].ctrl |= 0x00080000;
+ ks8695_rx[RXDESCS-1].ctrl |= 0x02000000;
ks8695_rx[RXDESCS-1].next = (uint32_t) &ks8695_rx[0];
/* The KS8695 is pretty slow reseting the ethernets... */
Hello, Use MAC from the environment instead of read a hard coded address in the ethernet driver of the KS8695. Signed-off-by: Michael Bernstein <Michael.Bernstein@controlware.de> --- --