Last update:

       Active development of my own driver has ceased. I sent my patches to the maintainer of the serial driver,
       and my changes are going to be merged into the 2.3 tree, in addition to even more general PCI support.

General purpose PCI support for the Linux serial driver

The patch below provides general purpose PCI support for the Linux serial driver. It was written on a Power Mac running LinuxPPC 2.2.10. I expect that this patch will also work on i386. On other PCI supporting Linux systems it may work with some modifications. Currently this patch is only tested on a LinuxPPC machine with a single serial PCI card, so expect to find some problems and to have to make card definitions yourself.
I like to thank Stuart MacDonald for providing XR16C850 and ST16C654 UART support. He also made a start with general purpose PCI support. It was nice to have a flying start!
 

The goal

The ultimate goal of this extension is to provide support for any "dumb" PCI serial card with a UART from the original 8250 family. The most well known member of this family is the 16650A, found on PC motherboards. A lot of PCI serial cards use UARTs like the 16650A.
The exact same driver will be usable on any PCI supporting hardware running Linux. The current state of affairs is that the driver is principle capable of doing that, but it has been tested on very few systems and configurations.
 

The patch

The patch does apply cleanly on a 2.2.5 and a 2.2.10  tree and almost cleanly on a 2.2.11 tree. It could be the case that the patch complains about a file called include/asm-ppc/serial.h if you do not have a kernel source that includes all platforms. If so, you can safely ignore this part of the patch.
Since I do not have a anonymous ftp site, I decided to uuencode the patch and provide it as a text file, to circumvent binary HTML download problems:
patch-pci-serial-support-3.gz.uue
Do not forget to enable auto detection of PCI serial cards in your config after applying the patch. It is an new option in the serial driver subsection of the char drivers section.
If you previously applied an older version of the patch, you can use the -R flag of patch to reverse the old patch, and then apply the new patch.

History

Wednesday, Aug. 25. Third version posted. Bugs fixed and enhancements: Tuesday, Aug. 24. Second version posted. Bugs fixed: Sunday, Aug. 22. First version of patch posted.

Platforms

The following tables lists the platforms the driver is tested on.
 
Platform Linux kernel Status
LinuxPPC 2.2.10 Compiled and tested with Keyspan SX2 card, both in the kernel and as a module.
i386 2.2.5 Compiled and tested, but not yet with a PCI serial card in the machine.

Supported serial cards

In general, any "dumb" PCI serial can be supported by this patch. A dumb serial card does not have its own processor. Cards like the Cyclades or the Stallion do have their own processor, so this patch will not work for those cards. Use the already available drivers for thoise cards.
Mostly a "dumb" PCI serial card consists of a PCI bridge chip and one or more UART chips. The type of UART will be detected automatically by the driver.
Take a look at serial_board_defs[] in drivers/char/serial.c. If your card is listed, you are all set to test the card. If your card is not listed, you have to determine the following data: The above data can be found by looking at the output of a lspci -v or lspci -vn command. This command is part of the pciutils package. Furthermore, the following data is needed: Once you have entered the data into the table using the REGULAR_CARD macro, you are all set to compile the kernel and test the card. I like to see test results and card definitions! Some cards will not work, since they require more special settings, like memory mapped access or special purpose initialization. For more information, take a look at the example Keyspan SX2 card or contact me. Following is a list of test results.

Successfully Tested

Will probably work

Here I list some cards that have definitions in the driver. These cards will probably work without modifying any code or table.

Need PCI vendor, device, subvendor and subdevice data

The following cards will probably work once I (or you!) supply the correct entries for the PCI serial card table definitions.

Yet unknown

The following cards I know by name, but I do not know if they are "dumb" serial cards that can be supported by a general purpose driver or not. Any info is welcome!

Back to my homepage.
Please send comment to Otto Moerbeek