Subject: PROBLEM SOLVED: SMC card disappears after booting 1.1 INSTADP
To: None <port-i386@NetBSD.ORG>
From: Marc Unangst <mju@cs.cmu.edu>
List: port-i386
Date: 12/21/1995 01:16:51
As some people have noticed, if you have an SMC Ethernet card
configured for I/O address 0x300, it won't work after you boot either
of the NetBSD 1.1 installation kernels.  It's not the old problem that
could be fixed by a cold boot; this time, your card is (apparently)
dead.  None of the SMC utilities can see the card, and the kernel
can't recognize it.

The problem is that the el and wt driver probe routines cooperate to
overwrite the card's LAN address PROM, and then save the new settings
to the card's NVRAM.  Because this corrupts the PROM checksum,
everything assumes that no card is installed.  And because the
settings get written to NVRAM, a cold boot doesn't fix it.

However, it is possible to fix this manually.  Here's what to do if
your SMC card got toasted like mine did.  IMPORTANT: I figured this
out by reading the ed, el, and wt driver source.  I don't guarantee
that this is safe, or that it does the right thing.  However, it did
fix my card...

You'll need to know your card's Ethernet address, and the card type
code.  For the SMC Elite16, it's 0x28.  Look in
/sys/dev/isa/if_edreg.h for the others if you need it.  To get the
Ethernet address, you can either look at the sticker on the card, or
(if you don't feel like opening your machine) find an old
/var/log/messages from when your card used to work, and read it out of
there.

Next, boot DOS and run DEBUG.  Note that all the numbers you type have
to be in hex.  At the "-" prompt, type:

o 308 <addr0>
o 30e <type>

Where <addr0> is the first byte of your Ethernet address, and <type>
is the type code.  These two steps restore the portions of the address
PROM that got mangled.  Next, type

i 301

Take the number it prints, and add 0x80 to it.  Then type

o 301 <num+0x80>
o 301 <num>

This step writes the contents of the address PROM to NVRAM, so they
are saved across the next cold boot.

If you like, you can use "i 308", "i 309", etc. (through 30f) to read
the 8-byte address PROM and verify that the other entries are correct.
The first 6 are the Ethernet address, the 7th is the card type, and
the 8th is a checksum byte.  The 8 bytes should sum to 255 mod 256; if
they do, then you've probably successfully restored your
configuration.

Finally, quit DEBUG (type "q"), and then run EZSETUP to reset the
card's soft configuration.  (It's likely that your card's IRQ will
have been stomped on, and possibly the shared memory address.)
Presto, you should have a working card again!

As a side note, I'd like to drag out and shoot whoever was responsible
for the decision to include the el and wt drivers in the distribution
kernel, especially configured to probe at 0x300.  It's been known for
a while that the el driver stomps on the SMC card's address PROM;
we've just been lucky up until now, since it also takes the wt
driver's probe to actually save the mangled address.  IMHO these
drivers should either be removed from the distribution kernel, or
moved so as to not conflict with the SMC card's default config.

-Marc