Subject: Re: WD8013 died (SMC howto fix)
To: William O Ferry <WOFerry+@CMU.EDU>
From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
List: port-i386
Date: 03/17/1996 06:23:58
I've moved this discussion to port-i386...

Re: getting a utility written to fix the SMC eeprom lossage:

William Ferry said:
> I said:
> >         (1) somebody wrote up a little program to do this, probably by
> >                 (a) taking (as an option) the ethernet address of the
> >                     card, or prompting for it,
> >                 (b) taking (as an option) a name that indicates the
> >                     board type,
> >                 (c) turning (b) into a number (there should be
> >                     enough information in dev/isa/if_edreg.h to do
> >                     this, i think),
> >                 (d) prompting to confirm that it should be done
> >                     (prompt should be overridable by a -f flag 8-), and
> >                 (e) using the appropriate inb and outb sequence to
> >                     DTRT.
>
> I could probably figure most of the
> RAM-poking stuff out from the i386 sources), and if somebody could tell
> me just what 1(e) means...  =)

well, that, in particular is the ram-poking stuff.

The WD/SMC 8xxx boards' registers, node ID, etc., are accessible via
the i386 I/O space, i.e. via inb() and outb().  The instructions that
the person gave, re: how to fix it, actually more or less boiled down
to: "cause the following inb() and outb() instructions to happen."


Re: using inb() and outb(), from user-land, there are two things to know:

	(1) the <machine/pio.h> header defines the I/O instructions,
	    on the i386 port.  (There really should be some better
	    interfaces to these, but that's another issue, and hard,
	    and something that i'll probably still be squawking
	    a long time from now... 8-)

	(2) to enable access to the i386 I/O ports, you need to use
	    the i386_iopl() function, which is documented (rather
	    sparsely) by the i386_iopl(2) manual page.

	    I have no idea what the various possible IOPLs are, and if
	    you don't, you could probably figure it out by looking
	    in the i386 kernel sources.  The i386_iopl man page
	    should really be more verbose about that (just like the
	    i386_get_ioperm man page should be more specific about
	    what an I/O permission bitmap is).

Actually, given what you already know (from the post that explained
how to fix the card), i figure that doing the right set of inb()'s and
outb()'s will be pretty easy...


chris