[vortex] The mysteries of on-chip MII.

Bill Cattey wdc@MIT.EDU
Tue Mar 26 16:07:01 2002


On Mon, 2002-03-25 at 10:58, Bogdan Costescu wrote:
> I'm a bit surprised that the 3c90x driver (if it's the 3Com one) does this 
> as it was supposed to only support Cyclone and later chips where "use MII"
> (=6) doesn't make sense, the right value for external MII transceivers is 
> 9 (if it makes sense at all to use this as default media...)

The driver that is doing this heinous thing is the 3c90x driver included
in the Etherboot distribution
	http://etherboot.berlios.de/distribution.html
Looking at the latest production release (5.0.5) we learn from
3c90x.txt:

The authors:
	Original 3C905B support by:
	Greg Beeley (Greg.Beeley@LightSys.org),
	LightSys Technology Services, Inc.
	February 11, 1999

	Updates for 3C90X family by:
	Steve Smith (steve.smith@juno.com)

The rationale for the setting:

    The 3c905B cards have a significant 'bug' that relates to the flash
    prom: unless the card is set internally to the MII transceiver, it
    will onlyread the first 8k of the PROM image.  Don't ask why -- it
    seems really obscure, but it has to do with the way they mux'd the
    address lines from the PCI bus to the ROM.  Unfortunately, most of
    us are not using MII transceivers, and even the .lzrom image ends up
    being just a little bit larger than 8k.  Note that the workaround
    for this is disabled by default, because the Windows NT 4.0 driver
    does not like it (no packets are transmitted).
    
    So, the solution that I've used is to internally set the card's
    nvram configuration to use MII when it boots.  The 3c905b driver
    does this automatically.  This way, the 16k prom image can be loaded
    into memory, and then the 3c905b driver can set the temporary
    configuration of the card to an appropriate value, either
    configurable by the user or chosen by the driver.
    
    To enable the 3c905B bugfix, which is necessary for these cards when
    booting from the Flash ROM, define -DCFG_3C90X_BOOTROM_FIX when
    building, create a floppy image and boot it once.
    
    Thereafter, the card should accept the larger prom image.
    
The actual code in 3c90x.c that does the dirty deed is:

#ifdef	CFG_3C90X_BOOTROM_FIX
	/** Set xcvrSelect in InternalConfig in eeprom. **/
	/* only necessary for 3c905b revision cards with boot PROM bug!!! */
	a3c90x_internal_WriteEeprom(INF_3C90X.IOAddr, 0x13, 0x0160);
#endif

Apparently the former employee of mine who cooked the etherboot floppies
we've used for the past two years enabled this by default.

So this answers the "why".  I'll suggest what I think is the right next
steps in my next note.

-wdc