Subject: Re: The trouble with Tulips
To: Dieter <netbsd@sopwith.solgatos.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-help
Date: 05/19/2004 22:21:32
--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, May 18, 2004 at 07:05:27PM +0100, Dieter wrote:
> Having some trouble with Tulips.
> 
> Attempting to upgrade from NetBSD 1.5.1 to 1.6.2.
> System has 2 Tulip boards (1 network/board), which
> work in 1.5.1.  In 1.6.2 tlp0 seems to work (ping works)
> but tlp1 doesn't work.  Tried the de driver (which works
> in 1.5.1) but now de0 doesn't work.  Diffed if_de.c between
> 1.5.1 and 1.6.2 but didn't find anything too exciting.
> 
> Google found the following in current-users:
> 
> >Thanks to Matt Thomas, who provided me with a whole slew of DEC Tulip
> >boards, I was able to test and fix the 21040 multi-port board support.
> >
> >So far, I've confirmed it on a ZNYX ZX314:
> >
> >ppb0 at pci0 dev 8 function 0: Digital Equipment DECchip 21050 PCI-PCI Bridge (rev. 0x01)
> >pci1 at ppb0 bus 1
> >pci1: memory enabled
> >tlp4 at pci1 dev 4 function 0: DECchip 21040 Ethernet, pass 2.3
> >tlp4: interrupting at kn20aa irq 16
> >tlp4: ZNYX ZX314, Ethernet address 00:c0:95:f0:09:d8
> >tlp4: 10baseT, 10baseT-FDX, default 10baseT
> >tlp5 at pci1 dev 5 function 0: DECchip 21040 Ethernet, pass 2.3
> >tlp5: sharing interrupt with tlp4
> >tlp5: ZNYX ZX314, Ethernet address 00:c0:95:f0:09:d9
> >tlp5: 10baseT, 10baseT-FDX, default 10baseT
> >tlp6 at pci1 dev 6 function 0: DECchip 21040 Ethernet, pass 2.3
> >tlp6: sharing interrupt with tlp4
> >tlp6: ZNYX ZX314, Ethernet address 00:c0:95:f0:09:da
> >tlp6: 10baseT, 10baseT-FDX, default 10baseT
> >tlp7 at pci1 dev 7 function 0: DECchip 21040 Ethernet, pass 2.3
> >tlp7: sharing interrupt with tlp4
> >tlp7: ZNYX ZX314, Ethernet address 00:c0:95:f0:09:db
> >tlp7: 10baseT, 10baseT-FDX, default 10baseT
> >
> >I've nearly finished basic 21041 support, and also got some tips regarding
> >the 2114x, and will be working more on that support as well.
> >
> >Also, Bill Paul of FreeBSD was kind enough to send me a Matrox NIC-100/1,
> >which uses the original Lite-On 82c168 PNIC, and uses the built-in NWay
> >support, and the ENDEC/PCS/scrambler functions, rather than MII and a PHY.
> >So, I'll be able to finish up that code as well.
> >
> >        -- Jason R. Thorpe <thorpej@nas.nasa.gov>
> 
> Is sharing interrupts supposed to work between boards, or only
> within a multi-network board?
> 
> 1.5.1:
> 
>  /netbsd: de0 at pci0 dev 6 function 0
>  /netbsd: de0: interrupting at eb164 irq 0
>  /netbsd: de0: Cogent 21040 [10Mb/s] pass 2.3
> 
>  /netbsd: de1 at pci0 dev 7 function 0
>  /netbsd: de1: interrupting at eb164 irq 1
>  /netbsd: de1: Cogent 21040 [10Mb/s] pass 2.4
> 
>  /netbsd: de0: enabling AUI/BNC port
>  /netbsd: de0: abnormal interrupt: receive process stopped	[[ works anyway ]]
>  /netbsd: de1: abnormal interrupt: receive process stopped	[[ works anyway ]]
> 
> --------------------------------
> 
> 1.6.2:
> 
>  /netbsd: de0 at pci0 dev 6 function 0
>  /netbsd: de0: interrupting at eb164 irq 0
>  /netbsd: de0: Cogent 21040 [10Mb/s] pass 2.3
> 
>  /netbsd: de1 at pci0 dev 7 function 0
>  /netbsd: de1: interrupting at eb164 irq 1
>  /netbsd: de1: Cogent 21040 [10Mb/s] pass 2.4
> 
>  /netbsd: de0: enabling AUI/BNC port				[[ de0 doesn't work ]]
>  /netbsd: de1: abnormal interrupt: receive process stopped	[[ de1 works anyway ]]
> 
> --------------------------------
> 
> 1.6.2:
> 
>  /netbsd: tlp0 at pci0 dev 6 function 0: DECchip 21040 Ethernet, pass 2.3
>  /netbsd: tlp0: interrupting at eb164 irq 0
>  /netbsd: tlp0: Cogent multi-port, [[ WRONG ?  one network per board ]]
>  /netbsd: tlp0: 10baseT, 10baseT-FDX, 10base5, manual
> 
>  /netbsd: tlp1 at pci0 dev 7 function 0: DECchip 21040 Ethernet, pass 2.4
>  /netbsd: tlp1: sharing interrupt with tlp0
>  /netbsd: tlp1: Cogent multi-port,  [[ WRONG ?  one network per board ]]
>  /netbsd: tlp1: 10baseT, 10baseT-FDX, 10base5, manual
> 
>  /netbsd: tlp1: filter setup and transmit timeout		[[ tlp1 doesn't work ]]

Obviously it gets it wrong, and as interrupts are not shared in reality,
tlp1 never gets interrupts.
The attached diff should make it work, but I don't know what the real fix
would be.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: if_tlp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_tlp_pci.c,v
retrieving revision 1.65
diff -u -r1.65 if_tlp_pci.c
--- if_tlp_pci.c	17 Apr 2002 02:19:14 -0000	1.65
+++ if_tlp_pci.c	19 May 2004 20:21:11 -0000
@@ -204,7 +204,7 @@
 const struct tlp_pci_quirks tlp_pci_21040_quirks[] = {
 	{ tlp_pci_znyx_21040_quirks,	{ 0x00, 0xc0, 0x95 } },
 	{ tlp_pci_smc_21040_quirks,	{ 0x00, 0x00, 0xc0 } },
-	{ tlp_pci_cogent_21040_quirks,	{ 0x00, 0x00, 0x92 } },
+/*	{ tlp_pci_cogent_21040_quirks,	{ 0x00, 0x00, 0x92 } }, */
 	{ tlp_pci_accton_21040_quirks,	{ 0x00, 0x00, 0xe8 } },
 	{ NULL,				{ 0, 0, 0 } }
 };

--dDRMvlgZJXvWKvBx--