Subject: port-sparc/4823: Dead eeprom screws ethernet on sparc
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/14/1998 15:20:00
>Number:         4823
>Category:       port-sparc
>Synopsis:       Dead eeprom screws ethernet on sparc
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 14 15:35:00 1998
>Originator:     David Brownlee
<a href="">Monochrome</a>
>Release:        1.3
System: NetBSD 1.3 NetBSD 1.3 (_SUBLIMATION_)

	If the eeprom fails on a sparc (at least on a sun4c) the ethernet
	address is read as ff:ff:ff:ff:ff:ff.
	Under earlier versions of NetBSD this still worked, however probably
	since the arp new world order it no longer does. This is probably
	a Good Thing from an objective viewpoint, but it does leave the
	owner SOL under they get a new eeprom.

	Boot a sparc with a dead eeprom, watch ethernet address get set to
	ff:ff:ff:ff:ff:ff, be unable to use the network interface.

	The below patch catches this and sets the first three octets to Sun's
	reserved range 08:00:20, leaving the last three ff:ff:ff. This is
	obviously still not a good situation, but it at least allows the
	machine to use the network pending a new eeprom (unless another
	machine on the same network suffered a similar fate :).

	If this is not wanted by default, would it be possible to put it
	in (or something similar) as an option?

Index: clock.c
RCS file: /cvsroot/src/sys/arch/sparc/sparc/clock.c,v
retrieving revision
diff -u -r1.54.2.2 clock.c
--- clock.c	1997/12/20 23:06:07
+++ clock.c	1998/01/14 23:13:30
@@ -633,6 +633,12 @@
 	cp[3] = idp->id_ether[3];
 	cp[4] = idp->id_ether[4];
 	cp[5] = idp->id_ether[5];
+	if( cp[0] + cp[1] + cp[2] + cp[3] + cp[4] + cp[5] + cp[6] == 255*6 ) {
+		printf(" (reset from ff:ff:ff:ff:ff)");
+		cp[0] = 0x08;
+		cp[1] = 0x00;
+		cp[2] = 0x20;
+	}