Subject: Re: Trouble with CyberPro PCI 2S dual serial card
To: None <port-i386@NetBSD.org>
From: Frederick Bruckman <fredb@immanent.net>
List: port-i386
Date: 12/29/2004 09:23:39
In article <200412282251.iBSMpYGR021663@plectere.com>,
track@Plectere.com (List Mail User) writes:
> jfw@jfwhome.funhouse.com wrote at Tue Dec 28 13:24:51 2004,
> ...
>>
>>Now to figure out how to add 16C950 mode so I can take advantage of those
>>huge FIFOs. (And to figure out why my gigabit PHY now fails to probe if
>>the ethernet is plugged in, but that isn't the fault of the serial card...)
>
> Using the large FIFOs is trivial, actually detecting then properly
> is the difficulty.
There's a actually a documented way (registers you can read) for the
'650, '750, '850, '950 distinction, but a '950 in '650 mode should scale
up transparently (the fifo settings are automatically multiplied by four).
The driver shouldn't need to care about the fifolen -- receive doesn't know
about the fifolen, and transmit just gets some free headroom.
[Oxford Semiconductor has good docs for their chips, and I find Philips has
the best docs for the older ones.]
I started to implement an idea about setting the trigger levels dynamically
with NetBSD 1.6.2, but I ended up re-arranging the com driver a lot because
of a bug in 1.6.2 (which was since fixed a different way). I've since pulled
this up to current, and the com driver from current also builds on 2.0. So,
I've been running with this for several months now:
ftp://ftp.netbsd.org/pub/NetBSD/misc/fredb/com-enhanced-hwflow.cdiff
ftp://ftp.netbsd.org/pub/NetBSD/misc/fredb/com-enhanced-hwflow.udiff
[They're the same patch. The udiff is just hard to read because of the way
"diff" matches on blank lines.]
Besides the dynamic trigger level adjustment (which requires the kernel to
be built with "options COM_DTL"), I also included a fix (hack) for my old
USR ISDN T/A, and the ability to turn on or off hardware AUTORTS/AUTOCTS
separately, by port, at kernel configure time, so that the '650 detection
can be made by a GENERIC kernel. The USR hack can also be turned on or off
by port. I haven't actually tested it with a '950 yet, nor with PPS
discipline. (It really won't do the right thing with a '650, which would be
to disable the fifo completely, but with a plain '550, the rx trigger level
should simply drop down to one.)
As far as the main idea (COM_DTL), the callout is probably interrupting
too often, but on a heavily loaded K6-2 on ISDN, it doesn't seem to have
any impact.
I'd be interested in comments or reports, if anyone would care to test.
Thanks,
Frederick