Hello,
> If someone has access to the PCI specifications, and can tell me whether
> (at least in some standards fantasyland) there's a reliable way of
> finding out that information, that would be useful. Until then, the
> hard-coded table is going to be safer, so any kind of hueristics is
> going to have to be under a #ifdef, so we can remove it easily if it
> locks up people's systems.
The PCI specs (revision 2.2) say:
Base Class 07h
This base class is defined for all types of simple communications
controllers. Several sub-class values are defined, some of these having
specific well-known register-level programming interfaces.
subclass prog-if meaning
00 00 Generic XT-compatible serial controller
01 16450-compatible serial controller
02 16550
03 16650
04 16750
05 16850
06 16950
01 * parallel port
02 00 Multiport serial controller
03 00 Generic modem
01 Hayes compatible modem with 16450
compatible interface
02 16550
03 16650
04 16750
80 00 Other communications device
For Hayes-compatible modems, the first base address register (at offset
10h) maps the appropriate compatible (i.e., 16450, 16550, etc.) register
set for the serial controller at the beginning of the mapped space. Note
that these registers can be either memory or I/O mapped depending on
what kind of BAR is used.
If the devices you've seen behave sanely (i.e., they don't use the standard
class numbers if they have non-standard interface), I think the following
approach would be reliable enough to be used by the driver by default:
If a device has class 0700 and prog-if 00 to 06 or class 0703 and prog-if
01 to 04, use the first resource not depending on whether it's memory or I/O.
Maybe we could reject the device if it has more than one region defined.
Have a nice fortnight
-- Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/ "And on the seventh day, He exited from append mode."- 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 : Sat Jan 15 2000 - 21:00:25 EST