Subject: Re: DEC 21142 Ethernet not working at 100Mb/S
To: None <port-alpha@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-alpha
Date: 04/17/2000 18:59:36
On Fri, Mar 17, 2000 at 04:51:26PM -0800, Bill Dorsey wrote:

Sorry it's taken me so long to reply to this.  Find it in your heart
to forgive me.

 > I've got a 21142 ethernet card in my PWS433a:
 > 
 > de0 at pic0 dev 3 function 0
 > de0: interrupting at dec 550 irq 8
 > de0: DEC 21142 [10-100Mb/s] pass 1.1
 > de0: address 00:00:f8:xx:xx:xx
 > de0: enabling 10baseT port
 > 
 > It's connected to a Netgear 10/100 hub.  When I boot the machine,
 > it comes up in 10baseT mode:
 > 
 > media: Ethernet 10baseT
 > 
 > And when I use "ifconfig -m de0" I get:
 > 
 > media: Ethernet 10baseT
 > status: active
 > supported Ethernet media:
 >      media 10base5
 >      media 10base2
 >      media 10baseT mediaopt full-duplex
 >      media 10baseT
 > 
 > How can I enable 100baseT mode?  I have a friend with an identical
 > computer/configuration, and his computer comes up in 100baseT mode
 > and seems to work fine.

Right, so the biggest issue here is the way the PWS's Tulip interface
represents media.

The baseboard includes a 21142 with a 10Mb/s output, and transcievers
for 10base5 and 10base2.  The 21142 chip is capable of doing 100Mb/s,
but only in MII mode -- they apparently didn't have the appropriate
things available at the time the chip came out to stuff 100base PCS
support into the 21142 (ignore the fact they had done it in the
21140, but the chips are likely quite different inside).

The major feature added with the release of the 21143 was built-in
100base PCS.

Now, to get 100baseTX on the PWS, you add a riser card to the system.
The riser card connects to the MII interface of the 21142; the 21142
is capable of signalling at 100Mb/s over the MII interface.  The riser
card has a National Semiconductor DP83840 PHY on it, which is capable
of doing both 10baseT and 100baseTX.  The output of this PHY is sent
back to the RJ45 connector on the *mainboard*, and the inputs of the
connector are selected via a relay which is toggled by programming
the GPIO pins with the appropriate magic sequence.

Now, for the scary part.  It appears that the drivers that Digital
supplies for this configuration use the following media attachments
of the 21142 for the various media on the card:

	10base2: internal 10base ENDEC, relay routes ENDEC output to
	         BNC connector
	10base5: internal 10base ENDEC, relay routes ENDEC output to
		 AUI connector
	10baseT: internal 10base ENDEC, relay routes ENDEC output to
		 UTP connector
	100baseT-FDX: same as 10baseT
	100baseTX: MII, relay routes PHY output to UTP connector
	100baseTX-FDX: same as 100baseTX
	autosense: software state machine cycles in the following order:

		- NWAY on PHY via MII routed to UTP connector, advertising
		  100baseTX and 100baseTX-FDX capability
		- Internal NWAY via ENDEC routed to UTP connector,
		  advertising 10baseT and 10baseT-FDX capability
		- SQE test on 10base2
		- SQE test on 10base5

As you can see, this is a fairly complicated big hairy mess.

However, careful readers will note that the PHY on the MII is actually
capable of handling all of the UTP media!  Why DEC just didn't do the
less complicated thing, I think I'll never know, but they must have had
a reason (even if it wasn't a good one :-).  Actually, I can think of
a good reason: they didn't have to update the media information in the
SROM when the riser card was added.

I would like to handle this properly in the `tlp' driver, and Matt Thomas
was even kind enough to loan me a PCI board that basically does exactly
what the PWS mainboard does (i.e. it has an add-on riser card with the
100base support logic on it).  It's just a matter of finding time to
work on it.

Hope that provides a ... reasonable explanation :-)

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>