Re: [patch] Support for 3Com PCI modem + Generic PCI serials

From: Rogier Wolff (R.E.Wolff@BitWizard.nl)
Date: Wed Jan 19 2000 - 08:10:27 EST


Theodore Y. Ts'o wrote:
> I suppose we can just make the wild guess that it uses 115200 base baud,
> and that there's only one port supported by the board (unless it's
> overridden by the table). I don't think this is justified by the PCI
> spec (which I consider a massive defect in the PCI spec), but it might
> be the best we can do. The question is how accurate this guess will be
> for PCI modems. I don't have an adequate sample size of PCI modems that
> are real modems and not winmodems.

Ted,

if you'd start by guessing a 115200 base baud. That doesn't lead to
problems if you guess wrong. Users can always adjust that later.

Next, how about probing for another uart at address +8, addres +16,
address+32 etcetc until address +256? If you find one at address +128,
you continue probing at address+256, address+384, until you find
"nothing".

(I'm afraid that the BIOS knew what IOsize the card requested but that
this info isn't available in Linux right?)

Next, you'd ideally set the uart to "loopback mode" (i.e. that
externally this is not visible!) and send say 5 chars at 50 baud. That
should take about 1 second. If it takes around 0.25 seconds, base_baud
was wrong by a factor of 4. Adjust base_baud, and do the measurement
again.

A problem arises if you measure a base_baud of about 15MHz. Then the
chip can be powered by a 14.31 MHz crystal, 15MHz or 16MHz.

If you measure a 115100 base_baud, then you can be confident that it
actually WAS 115200. But if you measure 14.78 MHz it is hard to round
that to either 15MHz or 14.31 which are both likely candidates.

Now haven't we detected all serial ports, and even autodetected the
base_baud?

                                Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
 "I didn't say it was your fault. I said I was going to blame it on you."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:20 EST