[vortex] The mysteries of on-chip MII.
Bill Cattey
wdc@MIT.EDU
Wed Mar 20 17:26:02 2002
Summary:
The change you suggest DOES enable a system that previously complained
of no MII's present to find them.
Alas the fix is not complete. Full duplex is not being properly negotiated.
(Symptoms are:
change from "No MII's found" to clearly successful init.
allegation of full duplex operation
terribly slow network throughput
)
I think, perhaps that's because the EEPROM value at 0x0d is 0x0000 and
that it is somehow forcing half duplex unless we set it to 0x8000 but
this is a WILD guess.
Detail:
Used a hand-hacked version of vortex-diag to set eeprom values
to pathological ones:
0x0d: 0x0000
0x13: 0x0160
0x15: 0x0005
Confirmed that network was unhappy and slow.
(v 1.1.16 complained of no MII's, throughput was 4.75 KB/sec.)
Power cycled with new driver 1.1.16 with changes
did
insmod 3c59x.o options=8, debug=2
from single user mode then hit ^D to bring up normal mode.
dmesg output:
PCI: Found IRQ 11 for device 02:0c.0
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
See Documentation/networking/vortex.txt
02:0c.0: 3Com PCI 3c905C Tornado at 0xec80. Vers LK1.1.16
00:06:5b:47:d0:78, IRQ 11
product code 0000 rev 00.3 date 06-10-00
Internal config register is 1600000, transceivers 0xa.
8K byte-wide RAM 5:3 Rx:Tx split, autoselect/MII interface.
02:0c.0: Media override to transceiver type 8 (Autonegotiate).
02:0c.0: Activating tranceiver ?
MII transceiver found at address 24, status 782d.
Enabling bus-master transmits and whole-frame receives.
02:0c.0: scatter/gather enabled. h/w checksums enabled
<stuff on initializing the parallel port elided>
ip_conntrack (4087 buckets, 32696 max)
eth0: Media override to transceiver 8 (Autonegotiate).
eth0: Initial media type Autonegotiate.
eth0: MII #24 status 782d, link partner capability 45e1, info1 0000, setting full-duplex.
eth0: vortex_up() InternalConfig 01800000.
eth0: vortex_up() irq 11 media status 8880.
So it looks like it found the MII just fine!
But there's STILL a problem!
My throughput is a horrible 4.3 KB/sec.
symptomatic of having mis-negotiated full-duplex.
bash-2.04# ./vortex-diag -eva
vortex-diag.c:v2.05 5/15/2001 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/index.html
Index #1: Found a 3c905C Tornado 100baseTx adapter at 0xec80.
The Vortex chip may be active, so FIFO registers will not be read.
To see all register values use the '-f' flag.
Initial window 7, registers values by window:
Window 0: 0000 0000 0000 0000 adad 00bf ffff 0000.
Window 1: FIFO FIFO 0700 0000 0000 003f 0000 2000.
Window 2: 0600 475b 78d0 0000 0000 0000 0052 4000.
Window 3: 0000 0180 05ea 0020 000a 0800 0800 6000.
Window 4: 0000 0000 0000 0cc6 0001 8880 0600 8000.
Window 5: 1ffc 0000 0000 0600 0807 06ce 06c6 a000.
Window 6: 0000 0000 0000 6201 1100 cb49 318c c000.
Window 7: 0000 0000 0000 0000 0000 0000 0000 e000.
Vortex chip registers at 0xec80
0xEC90: **FIFO** 00000000 00000010 *STATUS*
0xECA0: 00000020 00000000 00080000 00000004
0xECB0: 00000000 12dced24 1f1ae150 00080004
Indication enable is 06c6, interrupt enable is 06ce.
No interrupt sources are pending.
Transceiver/media interfaces available: 100baseTx 10baseT.
Transceiver type in use: Autonegotiate.
MAC settings: full-duplex.
Station address set to 00:06:5b:47:d0:78.
Configuration options 0052.
EEPROM contents (64 words, offset 0):
0x000: 0006 5b47 d078 9200 00ca 0000 0000 6d50
0x008: 2940 0001 0006 5b47 d078 0000 0000 00aa
0x010: 72a2 0000 0000 0160 0000 0005 0c21 1028
0x018: 00be 000a 0002 6300 ff68 6868 0000 0030
0x020: 00b0 1030 70f0 0000 0000 0000 0000 0000
0x028: 0000 0000 0000 0000 0000 0000 0000 0000
0x030: 0000 0000 ffff ffff ffff ffff ffff ffff
0x038: ffff ffff ffff ffff ffff ffff ffff ffff
The word-wide EEPROM checksum is 0x5f6b.
Saved EEPROM settings of a 3Com Vortex/Boomerang:
3Com Node Address 00:06:5B:47:D0:78 (used as a unique ID only).
OEM Station address 00:06:5B:47:D0:78 (used as the ethernet address).
Manufacture date (MM/DD/YYYY) 6/10/2000, division , product .
Options: negotiated duplex, link beat required.
Vortex format checksum is incorrect (0013 vs. 1028).
Cyclone format checksum is incorrect (0xb2 vs. 0xb0).
Hurricane format checksum is incorrect (0x74 vs. 0xb0).
MII PHY found at address 1, status 0024.
MII PHY found at address 2, status 0024.
MII PHY found at address 3, status 0024.
MII PHY found at address 4, status 0024.
MII PHY 0 at #1 transceiver registers:
0000 0024 0000 0000 01e0 45e1 0003 0800
0000 0000 0000 0000 0000 0000 0000 0000
0600 8711 0000 4000 0000 0000 0000 0000
0000 0800 0000 0000 0000 0aa9 0000 0000.
MII PHY 1 at #2 transceiver registers:
0000 0024 0000 0000 01e0 45e1 0003 0800
0000 0000 0000 0000 0000 0000 0000 0000
0600 8711 0000 4000 0000 0000 0000 0000
0000 0800 0000 0000 0000 0aa9 0000 0000.
MII PHY 2 at #3 transceiver registers:
0000 0024 0000 0000 01e0 45e1 0003 0800
0000 0000 0000 0000 0000 0000 0000 0000
0600 8711 0000 4000 0000 0000 0000 0000
0000 0800 0000 0000 0000 0aa9 0000 0000.
MII PHY 3 at #4 transceiver registers:
0000 0024 0000 0000 01e0 45e1 0003 0800
0000 0000 0000 0000 0000 0000 0000 0000
0600 8711 0000 4000 0000 0000 0000 0000
0000 0800 0000 0000 0000 0aa9 0000 0000.
bash-2.04# ./mii-diag -v
mii-diag.c:v2.02 5/21/2001 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/index.html
Using the default interface 'eth0'.
The autonegotiated capability is 01e0.
The autonegotiated media type is 100baseTx-FD.
Basic mode control register 0x3000: Auto-negotiation enabled.
You have link beat, and everything is working OK.
This transceiver is capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT.
Able to perform Auto-negotiation, negotiation complete.
Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control.
End of basic transceiver information.
MII PHY #24 transceiver registers:
3000 782d 0041 6800 05e1 45e1 0007 2801
0000 0000 0000 0000 0000 0000 0000 0000
0618 8711 0030 4001 40c8 a000 0000 0000
d300 0820 8084 9119 0065 1aa9 7fff 0000.
Basic mode control register 0x3000: Auto-negotiation enabled.
Basic mode status register 0x782d ... 782d.
Link status: established.
Capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT.
Able to perform Auto-negotiation, negotiation complete.
Vendor ID is 00:10:5a:--:--:--, model 0 rev. 0.
No specific information is known about this transceiver type.
I'm advertising 05e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT
Advertising no additional info pages.
IEEE 802.3 CSMA/CD protocol.
Link partner capability is 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT.
Negotiation completed.