[vortex] The mysteries of on-chip MII.

Bogdan Costescu bogdan.costescu@iwr.uni-heidelberg.de
Thu Mar 14 12:00:04 2002


Sorry for the late reply, I had some hardware problems to take care of 
since I came back...

On Fri, 1 Mar 2002, Bill Cattey wrote:

> I registered myself on the 3com web site as a developer, and fetched
> the  "3C90xC NICsTechnical Reference", apparently published 9/99.

That's the one that I have.

> There's a pretty explicit set of pseudo code starting at page 193.  It says to 
> set xcvrSelect to "Auto-Negotiation" in the internal configuration, and
> then try PHY 24 (0x18) first before doing any scanning for other PHY
> addresses.

You're on to something. I also discovered last week based on your previous 
words "attempt to guess at an interpretation of the documentation" that 
the documentation doesn't really say that the InternalConfig register 
should or shouldn't be written. Somewhere talking about the AutoSelect 
sequence (in the text, not in the description of the AutoSelect sequence), 
it's written something along the lines: "if AutoSelect sequence fails, the 
value previously found in InternalConfig register should be restored" - 
which hints that this register should actually be written. Now, there is 
nothing to suggest that by doing this the transceiver would be activated - 
and I went through the whole documentation looking especially for 
something like this - but it's the only thing that I have found related to 
the problem.

The 3c59x driver does write to this register but too late in _open/_up, 
while the MII scanning happens in _probe. OTOH, I thought that the 3c90x 
driver did implement the recommended AutoSelect sequence - and you 
reported that it doesn't work. So it's somehow unclear whether this is 
really the fix we are looking for.

If you're still willing to work on this (and have one affected machine to 
test on), let's try the following:

0. Get the machine to the state where the network does not work properly.

1. modify the driver such that in vortex_probe1() the code looks like:

(start at line 1247 in 3c59x 1.1.16 from 2.4.18, sorry I don't have time 
right now for a proper patch)

	if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
		int phy, phy_idx = 0;
		EL3WINDOW(3);
		config = BFINS(config, dev->if_port, 20, 4);
		outl(config, ioaddr + Wn3_Config);
		printk(KERN_INFO "%s: Activating tranceiver ?\n",
			print_name);
		EL3WINDOW(4);
		mii_preamble_required++;
		mii_preamble_required++;
 		...

(That's the writting to InternalConfig taken from vortex_up).

2. insert the module with something like:

insmod 3c59x options=8 debug=2

to force NWAY (and ignore the EEPROM setting) and set a higher debug level 
to have some media related debug messages.

That should be all... Send back everything that the driver spits out and 
tell us whether or not this works. Good luck !

-- 
Bogdan Costescu

IWR - Interdisziplinaeres Zentrum fuer Wissenschaftliches Rechnen
Universitaet Heidelberg, INF 368, D-69120 Heidelberg, GERMANY
Telephone: +49 6221 54 8869, Telefax: +49 6221 54 8868
E-mail: Bogdan.Costescu@IWR.Uni-Heidelberg.De