2 * linux/drivers/char/8250_pci.c
4 * Probe module for 8250/16550-type PCI serial ports.
6 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
8 * Copyright (C) 2001 Russell King, All Rights Reserved.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License.
14 * $Id: 8250_pci.c,v 1.28 2002/11/02 11:14:18 rmk Exp $
16 #include <linux/module.h>
17 #include <linux/init.h>
18 #include <linux/pci.h>
19 #include <linux/sched.h>
20 #include <linux/string.h>
21 #include <linux/kernel.h>
22 #include <linux/slab.h>
23 #include <linux/delay.h>
24 #include <linux/tty.h>
25 #include <linux/serial_core.h>
26 #include <linux/8250_pci.h>
27 #include <linux/bitops.h>
29 #include <asm/byteorder.h>
34 #undef SERIAL_DEBUG_PCI
37 * Definitions for PCI support.
39 #define FL_BASE_MASK 0x0007
40 #define FL_BASE0 0x0000
41 #define FL_BASE1 0x0001
42 #define FL_BASE2 0x0002
43 #define FL_BASE3 0x0003
44 #define FL_BASE4 0x0004
45 #define FL_GET_BASE(x) (x & FL_BASE_MASK)
47 /* Use successive BARs (PCI base address registers),
48 else use offset into some specified BAR */
49 #define FL_BASE_BARS 0x0008
51 /* do not assign an irq */
52 #define FL_NOIRQ 0x0080
54 /* Use the Base address register size to cap number of ports */
55 #define FL_REGION_SZ_CAP 0x0100
59 unsigned int num_ports;
60 unsigned int base_baud;
61 unsigned int uart_offset;
62 unsigned int reg_shift;
63 unsigned int first_offset;
67 * init function returns:
68 * > 0 - number of ports
69 * = 0 - use board->num_ports
72 struct pci_serial_quirk {
77 int (*init)(struct pci_dev *dev);
78 int (*setup)(struct pci_dev *dev, struct pci_board *board,
79 struct uart_port *port, int idx);
80 void (*exit)(struct pci_dev *dev);
83 #define PCI_NUM_BAR_RESOURCES 6
85 struct serial_private {
87 void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
88 struct pci_serial_quirk *quirk;
92 static void moan_device(const char *str, struct pci_dev *dev)
94 printk(KERN_WARNING "%s: %s\n"
95 KERN_WARNING "Please send the output of lspci -vv, this\n"
96 KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
97 KERN_WARNING "manufacturer and name of serial board or\n"
98 KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
99 pci_name(dev), str, dev->vendor, dev->device,
100 dev->subsystem_vendor, dev->subsystem_device);
104 setup_port(struct pci_dev *dev, struct uart_port *port,
105 int bar, int offset, int regshift)
107 struct serial_private *priv = pci_get_drvdata(dev);
108 unsigned long base, len;
110 if (bar >= PCI_NUM_BAR_RESOURCES)
113 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
114 base = pci_resource_start(dev, bar);
115 len = pci_resource_len(dev, bar);
117 if (!priv->remapped_bar[bar])
118 priv->remapped_bar[bar] = ioremap(base, len);
119 if (!priv->remapped_bar[bar])
122 port->iotype = UPIO_MEM;
123 port->mapbase = base + offset;
124 port->membase = priv->remapped_bar[bar] + offset;
125 port->regshift = regshift;
127 base = pci_resource_start(dev, bar) + offset;
128 port->iotype = UPIO_PORT;
135 * AFAVLAB uses a different mixture of BARs and offsets
136 * Not that ugly ;) -- HW
139 afavlab_setup(struct pci_dev *dev, struct pci_board *board,
140 struct uart_port *port, int idx)
142 unsigned int bar, offset = board->first_offset;
144 bar = FL_GET_BASE(board->flags);
149 offset += (idx - 4) * board->uart_offset;
152 return setup_port(dev, port, bar, offset, board->reg_shift);
156 * HP's Remote Management Console. The Diva chip came in several
157 * different versions. N-class, L2000 and A500 have two Diva chips, each
158 * with 3 UARTs (the third UART on the second chip is unused). Superdome
159 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
160 * one Diva chip, but it has been expanded to 5 UARTs.
162 static int __devinit pci_hp_diva_init(struct pci_dev *dev)
166 switch (dev->subsystem_device) {
167 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
168 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
169 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
170 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
173 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
176 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
179 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
188 * HP's Diva chip puts the 4th/5th serial port further out, and
189 * some serial ports are supposed to be hidden on certain models.
192 pci_hp_diva_setup(struct pci_dev *dev, struct pci_board *board,
193 struct uart_port *port, int idx)
195 unsigned int offset = board->first_offset;
196 unsigned int bar = FL_GET_BASE(board->flags);
198 switch (dev->subsystem_device) {
199 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
203 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
213 offset += idx * board->uart_offset;
215 return setup_port(dev, port, bar, offset, board->reg_shift);
219 * Added for EKF Intel i960 serial boards
221 static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
223 unsigned long oldval;
225 if (!(dev->subsystem_device & 0x1000))
228 /* is firmware started? */
229 pci_read_config_dword(dev, 0x44, (void*) &oldval);
230 if (oldval == 0x00001000L) { /* RESET value */
231 printk(KERN_DEBUG "Local i960 firmware missing");
238 * Some PCI serial cards using the PLX 9050 PCI interface chip require
239 * that the card interrupt be explicitly enabled or disabled. This
240 * seems to be mainly needed on card using the PLX which also use I/O
243 static int __devinit pci_plx9050_init(struct pci_dev *dev)
248 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
249 moan_device("no memory in bar 0", dev);
254 if (dev->vendor == PCI_VENDOR_ID_PANACOM)
256 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
257 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS)) {
259 * As the megawolf cards have the int pins active
260 * high, and have 2 UART chips, both ints must be
261 * enabled on the 9050. Also, the UARTS are set in
262 * 16450 mode by default, so we have to enable the
263 * 16C950 'enhanced' mode so that we can use the
270 * enable/disable interrupts
272 p = ioremap(pci_resource_start(dev, 0), 0x80);
275 writel(irq_config, p + 0x4c);
278 * Read the register back to ensure that it took effect.
286 static void __devexit pci_plx9050_exit(struct pci_dev *dev)
290 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
296 p = ioremap(pci_resource_start(dev, 0), 0x80);
301 * Read the register back to ensure that it took effect.
308 /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
310 sbs_setup(struct pci_dev *dev, struct pci_board *board,
311 struct uart_port *port, int idx)
313 unsigned int bar, offset = board->first_offset;
318 /* first four channels map to 0, 0x100, 0x200, 0x300 */
319 offset += idx * board->uart_offset;
320 } else if (idx < 8) {
321 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
322 offset += idx * board->uart_offset + 0xC00;
323 } else /* we have only 8 ports on PMC-OCTALPRO */
326 return setup_port(dev, port, bar, offset, board->reg_shift);
330 * This does initialization for PMC OCTALPRO cards:
331 * maps the device memory, resets the UARTs (needed, bc
332 * if the module is removed and inserted again, the card
333 * is in the sleep mode) and enables global interrupt.
336 /* global control register offset for SBS PMC-OctalPro */
337 #define OCT_REG_CR_OFF 0x500
339 static int __devinit sbs_init(struct pci_dev *dev)
343 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
347 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
348 writeb(0x10,p + OCT_REG_CR_OFF);
350 writeb(0x0,p + OCT_REG_CR_OFF);
352 /* Set bit-2 (INTENABLE) of Control Register */
353 writeb(0x4, p + OCT_REG_CR_OFF);
360 * Disables the global interrupt of PMC-OctalPro
363 static void __devexit sbs_exit(struct pci_dev *dev)
367 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
369 writeb(0, p + OCT_REG_CR_OFF);
375 * SIIG serial cards have an PCI interface chip which also controls
376 * the UART clocking frequency. Each UART can be clocked independently
377 * (except cards equiped with 4 UARTs) and initial clocking settings
378 * are stored in the EEPROM chip. It can cause problems because this
379 * version of serial driver doesn't support differently clocked UART's
380 * on single PCI card. To prevent this, initialization functions set
381 * high frequency clocking for all UART's on given card. It is safe (I
382 * hope) because it doesn't touch EEPROM settings to prevent conflicts
383 * with other OSes (like M$ DOS).
385 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
387 * There is two family of SIIG serial cards with different PCI
388 * interface chip and different configuration methods:
389 * - 10x cards have control registers in IO and/or memory space;
390 * - 20x cards have control registers in standard PCI configuration space.
392 * There are also Quartet Serial cards which use Oxford Semiconductor
393 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
395 * Note: some SIIG cards are probed by the parport_serial object.
398 #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
399 #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
401 static int pci_siig10x_init(struct pci_dev *dev)
406 switch (dev->device & 0xfff8) {
407 case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
410 case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
413 default: /* 1S1P, 4S */
418 p = ioremap(pci_resource_start(dev, 0), 0x80);
422 writew(readw(p + 0x28) & data, p + 0x28);
428 #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
429 #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
431 static int pci_siig20x_init(struct pci_dev *dev)
435 /* Change clock frequency for the first UART. */
436 pci_read_config_byte(dev, 0x6f, &data);
437 pci_write_config_byte(dev, 0x6f, data & 0xef);
439 /* If this card has 2 UART, we have to do the same with second UART. */
440 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
441 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
442 pci_read_config_byte(dev, 0x73, &data);
443 pci_write_config_byte(dev, 0x73, data & 0xef);
448 int pci_siig10x_fn(struct pci_dev *dev, int enable)
452 ret = pci_siig10x_init(dev);
456 int pci_siig20x_fn(struct pci_dev *dev, int enable)
460 ret = pci_siig20x_init(dev);
464 EXPORT_SYMBOL(pci_siig10x_fn);
465 EXPORT_SYMBOL(pci_siig20x_fn);
468 * Timedia has an explosion of boards, and to avoid the PCI table from
469 * growing *huge*, we use this function to collapse some 70 entries
470 * in the PCI table into one, for sanity's and compactness's sake.
472 static unsigned short timedia_single_port[] = {
473 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
476 static unsigned short timedia_dual_port[] = {
477 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
478 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
479 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
480 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
484 static unsigned short timedia_quad_port[] = {
485 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
486 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
487 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
491 static unsigned short timedia_eight_port[] = {
492 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
493 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
496 static struct timedia_struct {
500 { 1, timedia_single_port },
501 { 2, timedia_dual_port },
502 { 4, timedia_quad_port },
503 { 8, timedia_eight_port },
507 static int __devinit pci_timedia_init(struct pci_dev *dev)
512 for (i = 0; timedia_data[i].num; i++) {
513 ids = timedia_data[i].ids;
514 for (j = 0; ids[j]; j++)
515 if (dev->subsystem_device == ids[j])
516 return timedia_data[i].num;
522 * Timedia/SUNIX uses a mixture of BARs and offsets
523 * Ugh, this is ugly as all hell --- TYT
526 pci_timedia_setup(struct pci_dev *dev, struct pci_board *board,
527 struct uart_port *port, int idx)
529 unsigned int bar = 0, offset = board->first_offset;
536 offset = board->uart_offset;
543 offset = board->uart_offset;
552 return setup_port(dev, port, bar, offset, board->reg_shift);
556 * Some Titan cards are also a little weird
559 titan_400l_800l_setup(struct pci_dev *dev, struct pci_board *board,
560 struct uart_port *port, int idx)
562 unsigned int bar, offset = board->first_offset;
573 offset = (idx - 2) * board->uart_offset;
576 return setup_port(dev, port, bar, offset, board->reg_shift);
579 static int __devinit pci_xircom_init(struct pci_dev *dev)
585 static int __devinit pci_netmos_init(struct pci_dev *dev)
587 /* subdevice 0x00PS means <P> parallel, <S> serial */
588 unsigned int num_serial = dev->subsystem_device & 0xf;
596 pci_default_setup(struct pci_dev *dev, struct pci_board *board,
597 struct uart_port *port, int idx)
599 unsigned int bar, offset = board->first_offset, maxnr;
601 bar = FL_GET_BASE(board->flags);
602 if (board->flags & FL_BASE_BARS)
605 offset += idx * board->uart_offset;
607 maxnr = (pci_resource_len(dev, bar) - board->first_offset) /
608 (8 << board->reg_shift);
610 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
613 return setup_port(dev, port, bar, offset, board->reg_shift);
616 /* This should be in linux/pci_ids.h */
617 #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
618 #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
619 #define PCI_DEVICE_ID_OCTPRO 0x0001
620 #define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
621 #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
622 #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
623 #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
626 * Master list of serial port init/setup/exit quirks.
627 * This does not describe the general nature of the port.
628 * (ie, baud base, number and location of ports, etc)
630 * This list is ordered alphabetically by vendor then device.
631 * Specific entries must come before more generic entries.
633 static struct pci_serial_quirk pci_serial_quirks[] = {
636 * It is not clear whether this applies to all products.
639 .vendor = PCI_VENDOR_ID_AFAVLAB,
640 .device = PCI_ANY_ID,
641 .subvendor = PCI_ANY_ID,
642 .subdevice = PCI_ANY_ID,
643 .setup = afavlab_setup,
649 .vendor = PCI_VENDOR_ID_HP,
650 .device = PCI_DEVICE_ID_HP_DIVA,
651 .subvendor = PCI_ANY_ID,
652 .subdevice = PCI_ANY_ID,
653 .init = pci_hp_diva_init,
654 .setup = pci_hp_diva_setup,
660 .vendor = PCI_VENDOR_ID_INTEL,
661 .device = PCI_DEVICE_ID_INTEL_80960_RP,
663 .subdevice = PCI_ANY_ID,
664 .init = pci_inteli960ni_init,
665 .setup = pci_default_setup,
671 .vendor = PCI_VENDOR_ID_PANACOM,
672 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
673 .subvendor = PCI_ANY_ID,
674 .subdevice = PCI_ANY_ID,
675 .init = pci_plx9050_init,
676 .setup = pci_default_setup,
677 .exit = __devexit_p(pci_plx9050_exit),
680 .vendor = PCI_VENDOR_ID_PANACOM,
681 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
682 .subvendor = PCI_ANY_ID,
683 .subdevice = PCI_ANY_ID,
684 .init = pci_plx9050_init,
685 .setup = pci_default_setup,
686 .exit = __devexit_p(pci_plx9050_exit),
692 .vendor = PCI_VENDOR_ID_PLX,
693 .device = PCI_DEVICE_ID_PLX_9050,
694 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
695 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
696 .init = pci_plx9050_init,
697 .setup = pci_default_setup,
698 .exit = __devexit_p(pci_plx9050_exit),
701 .vendor = PCI_VENDOR_ID_PLX,
702 .device = PCI_DEVICE_ID_PLX_ROMULUS,
703 .subvendor = PCI_VENDOR_ID_PLX,
704 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
705 .init = pci_plx9050_init,
706 .setup = pci_default_setup,
707 .exit = __devexit_p(pci_plx9050_exit),
710 * SBS Technologies, Inc., PMC-OCTALPRO 232
713 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
714 .device = PCI_DEVICE_ID_OCTPRO,
715 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
716 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
719 .exit = __devexit_p(sbs_exit),
722 * SBS Technologies, Inc., PMC-OCTALPRO 422
725 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
726 .device = PCI_DEVICE_ID_OCTPRO,
727 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
728 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
731 .exit = __devexit_p(sbs_exit),
734 * SBS Technologies, Inc., P-Octal 232
737 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
738 .device = PCI_DEVICE_ID_OCTPRO,
739 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
740 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
743 .exit = __devexit_p(sbs_exit),
746 * SBS Technologies, Inc., P-Octal 422
749 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
750 .device = PCI_DEVICE_ID_OCTPRO,
751 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
752 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
755 .exit = __devexit_p(sbs_exit),
760 * It is not clear whether these could be collapsed.
763 .vendor = PCI_VENDOR_ID_SIIG,
764 .device = PCI_DEVICE_ID_SIIG_1S_10x_550,
765 .subvendor = PCI_ANY_ID,
766 .subdevice = PCI_ANY_ID,
767 .init = pci_siig10x_init,
768 .setup = pci_default_setup,
771 .vendor = PCI_VENDOR_ID_SIIG,
772 .device = PCI_DEVICE_ID_SIIG_1S_10x_650,
773 .subvendor = PCI_ANY_ID,
774 .subdevice = PCI_ANY_ID,
775 .init = pci_siig10x_init,
776 .setup = pci_default_setup,
779 .vendor = PCI_VENDOR_ID_SIIG,
780 .device = PCI_DEVICE_ID_SIIG_1S_10x_850,
781 .subvendor = PCI_ANY_ID,
782 .subdevice = PCI_ANY_ID,
783 .init = pci_siig10x_init,
784 .setup = pci_default_setup,
787 .vendor = PCI_VENDOR_ID_SIIG,
788 .device = PCI_DEVICE_ID_SIIG_2S_10x_550,
789 .subvendor = PCI_ANY_ID,
790 .subdevice = PCI_ANY_ID,
791 .init = pci_siig10x_init,
792 .setup = pci_default_setup,
795 .vendor = PCI_VENDOR_ID_SIIG,
796 .device = PCI_DEVICE_ID_SIIG_2S_10x_650,
797 .subvendor = PCI_ANY_ID,
798 .subdevice = PCI_ANY_ID,
799 .init = pci_siig10x_init,
800 .setup = pci_default_setup,
803 .vendor = PCI_VENDOR_ID_SIIG,
804 .device = PCI_DEVICE_ID_SIIG_2S_10x_850,
805 .subvendor = PCI_ANY_ID,
806 .subdevice = PCI_ANY_ID,
807 .init = pci_siig10x_init,
808 .setup = pci_default_setup,
811 .vendor = PCI_VENDOR_ID_SIIG,
812 .device = PCI_DEVICE_ID_SIIG_4S_10x_550,
813 .subvendor = PCI_ANY_ID,
814 .subdevice = PCI_ANY_ID,
815 .init = pci_siig10x_init,
816 .setup = pci_default_setup,
819 .vendor = PCI_VENDOR_ID_SIIG,
820 .device = PCI_DEVICE_ID_SIIG_4S_10x_650,
821 .subvendor = PCI_ANY_ID,
822 .subdevice = PCI_ANY_ID,
823 .init = pci_siig10x_init,
824 .setup = pci_default_setup,
827 .vendor = PCI_VENDOR_ID_SIIG,
828 .device = PCI_DEVICE_ID_SIIG_4S_10x_850,
829 .subvendor = PCI_ANY_ID,
830 .subdevice = PCI_ANY_ID,
831 .init = pci_siig10x_init,
832 .setup = pci_default_setup,
835 .vendor = PCI_VENDOR_ID_SIIG,
836 .device = PCI_DEVICE_ID_SIIG_1S_20x_550,
837 .subvendor = PCI_ANY_ID,
838 .subdevice = PCI_ANY_ID,
839 .init = pci_siig20x_init,
840 .setup = pci_default_setup,
843 .vendor = PCI_VENDOR_ID_SIIG,
844 .device = PCI_DEVICE_ID_SIIG_1S_20x_650,
845 .subvendor = PCI_ANY_ID,
846 .subdevice = PCI_ANY_ID,
847 .init = pci_siig20x_init,
848 .setup = pci_default_setup,
851 .vendor = PCI_VENDOR_ID_SIIG,
852 .device = PCI_DEVICE_ID_SIIG_1S_20x_850,
853 .subvendor = PCI_ANY_ID,
854 .subdevice = PCI_ANY_ID,
855 .init = pci_siig20x_init,
856 .setup = pci_default_setup,
859 .vendor = PCI_VENDOR_ID_SIIG,
860 .device = PCI_DEVICE_ID_SIIG_2S_20x_550,
861 .subvendor = PCI_ANY_ID,
862 .subdevice = PCI_ANY_ID,
863 .init = pci_siig20x_init,
864 .setup = pci_default_setup,
866 { .vendor = PCI_VENDOR_ID_SIIG,
867 .device = PCI_DEVICE_ID_SIIG_2S_20x_650,
868 .subvendor = PCI_ANY_ID,
869 .subdevice = PCI_ANY_ID,
870 .init = pci_siig20x_init,
871 .setup = pci_default_setup,
874 .vendor = PCI_VENDOR_ID_SIIG,
875 .device = PCI_DEVICE_ID_SIIG_2S_20x_850,
876 .subvendor = PCI_ANY_ID,
877 .subdevice = PCI_ANY_ID,
878 .init = pci_siig20x_init,
879 .setup = pci_default_setup,
882 .vendor = PCI_VENDOR_ID_SIIG,
883 .device = PCI_DEVICE_ID_SIIG_4S_20x_550,
884 .subvendor = PCI_ANY_ID,
885 .subdevice = PCI_ANY_ID,
886 .init = pci_siig20x_init,
887 .setup = pci_default_setup,
890 .vendor = PCI_VENDOR_ID_SIIG,
891 .device = PCI_DEVICE_ID_SIIG_4S_20x_650,
892 .subvendor = PCI_ANY_ID,
893 .subdevice = PCI_ANY_ID,
894 .init = pci_siig20x_init,
895 .setup = pci_default_setup,
898 .vendor = PCI_VENDOR_ID_SIIG,
899 .device = PCI_DEVICE_ID_SIIG_4S_20x_850,
900 .subvendor = PCI_ANY_ID,
901 .subdevice = PCI_ANY_ID,
902 .init = pci_siig20x_init,
903 .setup = pci_default_setup,
909 .vendor = PCI_VENDOR_ID_TITAN,
910 .device = PCI_DEVICE_ID_TITAN_400L,
911 .subvendor = PCI_ANY_ID,
912 .subdevice = PCI_ANY_ID,
913 .setup = titan_400l_800l_setup,
916 .vendor = PCI_VENDOR_ID_TITAN,
917 .device = PCI_DEVICE_ID_TITAN_800L,
918 .subvendor = PCI_ANY_ID,
919 .subdevice = PCI_ANY_ID,
920 .setup = titan_400l_800l_setup,
926 .vendor = PCI_VENDOR_ID_TIMEDIA,
927 .device = PCI_DEVICE_ID_TIMEDIA_1889,
928 .subvendor = PCI_VENDOR_ID_TIMEDIA,
929 .subdevice = PCI_ANY_ID,
930 .init = pci_timedia_init,
931 .setup = pci_timedia_setup,
934 .vendor = PCI_VENDOR_ID_TIMEDIA,
935 .device = PCI_ANY_ID,
936 .subvendor = PCI_ANY_ID,
937 .subdevice = PCI_ANY_ID,
938 .setup = pci_timedia_setup,
944 .vendor = PCI_VENDOR_ID_XIRCOM,
945 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
946 .subvendor = PCI_ANY_ID,
947 .subdevice = PCI_ANY_ID,
948 .init = pci_xircom_init,
949 .setup = pci_default_setup,
955 .vendor = PCI_VENDOR_ID_NETMOS,
956 .device = PCI_ANY_ID,
957 .subvendor = PCI_ANY_ID,
958 .subdevice = PCI_ANY_ID,
959 .init = pci_netmos_init,
960 .setup = pci_default_setup,
963 * Default "match everything" terminator entry
966 .vendor = PCI_ANY_ID,
967 .device = PCI_ANY_ID,
968 .subvendor = PCI_ANY_ID,
969 .subdevice = PCI_ANY_ID,
970 .setup = pci_default_setup,
974 static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
976 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
979 static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
981 struct pci_serial_quirk *quirk;
983 for (quirk = pci_serial_quirks; ; quirk++)
984 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
985 quirk_id_matches(quirk->device, dev->device) &&
986 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
987 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
993 get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx)
995 if (board->flags & FL_NOIRQ)
1002 * This is the configuration table for all of the PCI serial boards
1003 * which we support. It is directly indexed by the pci_board_num_t enum
1004 * value, which is encoded in the pci_device_id PCI probe table's
1005 * driver_data member.
1007 * The makeup of these names are:
1008 * pbn_bn{_bt}_n_baud
1010 * bn = PCI BAR number
1011 * bt = Index using PCI BARs
1012 * n = number of serial ports
1015 * This table is sorted by (in order): baud, bt, bn, n.
1017 * Please note: in theory if n = 1, _bt infix should make no difference.
1018 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
1020 enum pci_board_num_t {
1089 * Board-specific versions.
1109 * uart_offset - the space between channels
1110 * reg_shift - describes how the UART registers are mapped
1111 * to PCI memory by the card.
1112 * For example IER register on SBS, Inc. PMC-OctPro is located at
1113 * offset 0x10 from the UART base, while UART_IER is defined as 1
1114 * in include/linux/serial_reg.h,
1115 * see first lines of serial_in() and serial_out() in 8250.c
1118 static struct pci_board pci_boards[] __devinitdata = {
1122 .base_baud = 115200,
1125 [pbn_b0_1_115200] = {
1128 .base_baud = 115200,
1131 [pbn_b0_2_115200] = {
1134 .base_baud = 115200,
1137 [pbn_b0_4_115200] = {
1140 .base_baud = 115200,
1143 [pbn_b0_5_115200] = {
1146 .base_baud = 115200,
1150 [pbn_b0_1_921600] = {
1153 .base_baud = 921600,
1156 [pbn_b0_2_921600] = {
1159 .base_baud = 921600,
1162 [pbn_b0_4_921600] = {
1165 .base_baud = 921600,
1169 [pbn_b0_2_1130000] = {
1172 .base_baud = 1130000,
1176 [pbn_b0_4_1152000] = {
1179 .base_baud = 1152000,
1183 [pbn_b0_bt_1_115200] = {
1184 .flags = FL_BASE0|FL_BASE_BARS,
1186 .base_baud = 115200,
1189 [pbn_b0_bt_2_115200] = {
1190 .flags = FL_BASE0|FL_BASE_BARS,
1192 .base_baud = 115200,
1195 [pbn_b0_bt_8_115200] = {
1196 .flags = FL_BASE0|FL_BASE_BARS,
1198 .base_baud = 115200,
1202 [pbn_b0_bt_1_460800] = {
1203 .flags = FL_BASE0|FL_BASE_BARS,
1205 .base_baud = 460800,
1208 [pbn_b0_bt_2_460800] = {
1209 .flags = FL_BASE0|FL_BASE_BARS,
1211 .base_baud = 460800,
1214 [pbn_b0_bt_4_460800] = {
1215 .flags = FL_BASE0|FL_BASE_BARS,
1217 .base_baud = 460800,
1221 [pbn_b0_bt_1_921600] = {
1222 .flags = FL_BASE0|FL_BASE_BARS,
1224 .base_baud = 921600,
1227 [pbn_b0_bt_2_921600] = {
1228 .flags = FL_BASE0|FL_BASE_BARS,
1230 .base_baud = 921600,
1233 [pbn_b0_bt_4_921600] = {
1234 .flags = FL_BASE0|FL_BASE_BARS,
1236 .base_baud = 921600,
1239 [pbn_b0_bt_8_921600] = {
1240 .flags = FL_BASE0|FL_BASE_BARS,
1242 .base_baud = 921600,
1246 [pbn_b1_1_115200] = {
1249 .base_baud = 115200,
1252 [pbn_b1_2_115200] = {
1255 .base_baud = 115200,
1258 [pbn_b1_4_115200] = {
1261 .base_baud = 115200,
1264 [pbn_b1_8_115200] = {
1267 .base_baud = 115200,
1271 [pbn_b1_1_921600] = {
1274 .base_baud = 921600,
1277 [pbn_b1_2_921600] = {
1280 .base_baud = 921600,
1283 [pbn_b1_4_921600] = {
1286 .base_baud = 921600,
1289 [pbn_b1_8_921600] = {
1292 .base_baud = 921600,
1296 [pbn_b1_bt_2_921600] = {
1297 .flags = FL_BASE1|FL_BASE_BARS,
1299 .base_baud = 921600,
1303 [pbn_b1_1_1382400] = {
1306 .base_baud = 1382400,
1309 [pbn_b1_2_1382400] = {
1312 .base_baud = 1382400,
1315 [pbn_b1_4_1382400] = {
1318 .base_baud = 1382400,
1321 [pbn_b1_8_1382400] = {
1324 .base_baud = 1382400,
1328 [pbn_b2_1_115200] = {
1331 .base_baud = 115200,
1334 [pbn_b2_8_115200] = {
1337 .base_baud = 115200,
1341 [pbn_b2_1_460800] = {
1344 .base_baud = 460800,
1347 [pbn_b2_4_460800] = {
1350 .base_baud = 460800,
1353 [pbn_b2_8_460800] = {
1356 .base_baud = 460800,
1359 [pbn_b2_16_460800] = {
1362 .base_baud = 460800,
1366 [pbn_b2_1_921600] = {
1369 .base_baud = 921600,
1372 [pbn_b2_4_921600] = {
1375 .base_baud = 921600,
1378 [pbn_b2_8_921600] = {
1381 .base_baud = 921600,
1385 [pbn_b2_bt_1_115200] = {
1386 .flags = FL_BASE2|FL_BASE_BARS,
1388 .base_baud = 115200,
1391 [pbn_b2_bt_2_115200] = {
1392 .flags = FL_BASE2|FL_BASE_BARS,
1394 .base_baud = 115200,
1397 [pbn_b2_bt_4_115200] = {
1398 .flags = FL_BASE2|FL_BASE_BARS,
1400 .base_baud = 115200,
1404 [pbn_b2_bt_2_921600] = {
1405 .flags = FL_BASE2|FL_BASE_BARS,
1407 .base_baud = 921600,
1410 [pbn_b2_bt_4_921600] = {
1411 .flags = FL_BASE2|FL_BASE_BARS,
1413 .base_baud = 921600,
1417 [pbn_b3_4_115200] = {
1420 .base_baud = 115200,
1423 [pbn_b3_8_115200] = {
1426 .base_baud = 115200,
1431 * Entries following this are board-specific.
1440 .base_baud = 921600,
1441 .uart_offset = 0x400,
1445 .flags = FL_BASE2|FL_BASE_BARS,
1447 .base_baud = 921600,
1448 .uart_offset = 0x400,
1452 .flags = FL_BASE2|FL_BASE_BARS,
1454 .base_baud = 921600,
1455 .uart_offset = 0x400,
1459 /* I think this entry is broken - the first_offset looks wrong --rmk */
1460 [pbn_plx_romulus] = {
1463 .base_baud = 921600,
1464 .uart_offset = 8 << 2,
1466 .first_offset = 0x03,
1470 * This board uses the size of PCI Base region 0 to
1471 * signal now many ports are available
1474 .flags = FL_BASE0|FL_REGION_SZ_CAP,
1476 .base_baud = 115200,
1481 * EKF addition for i960 Boards form EKF with serial port.
1484 [pbn_intel_i960] = {
1487 .base_baud = 921600,
1488 .uart_offset = 8 << 2,
1490 .first_offset = 0x10000,
1493 .flags = FL_BASE0|FL_NOIRQ,
1495 .base_baud = 458333,
1498 .first_offset = 0x20178,
1502 * NEC Vrc-5074 (Nile 4) builtin UART.
1507 .base_baud = 520833,
1508 .uart_offset = 8 << 3,
1510 .first_offset = 0x300,
1514 * Computone - uses IOMEM.
1516 [pbn_computone_4] = {
1519 .base_baud = 921600,
1520 .uart_offset = 0x40,
1522 .first_offset = 0x200,
1524 [pbn_computone_6] = {
1527 .base_baud = 921600,
1528 .uart_offset = 0x40,
1530 .first_offset = 0x200,
1532 [pbn_computone_8] = {
1535 .base_baud = 921600,
1536 .uart_offset = 0x40,
1538 .first_offset = 0x200,
1543 .base_baud = 460800,
1548 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
1549 * Only basic 16550A support.
1550 * XR17C15[24] are not tested, but they should work.
1552 [pbn_exar_XR17C152] = {
1555 .base_baud = 921600,
1556 .uart_offset = 0x200,
1558 [pbn_exar_XR17C154] = {
1561 .base_baud = 921600,
1562 .uart_offset = 0x200,
1564 [pbn_exar_XR17C158] = {
1567 .base_baud = 921600,
1568 .uart_offset = 0x200,
1573 * Given a complete unknown PCI device, try to use some heuristics to
1574 * guess what the configuration might be, based on the pitiful PCI
1575 * serial specs. Returns 0 on success, 1 on failure.
1577 static int __devinit
1578 serial_pci_guess_board(struct pci_dev *dev, struct pci_board *board)
1580 int num_iomem, num_port, first_port = -1, i;
1583 * If it is not a communications device or the programming
1584 * interface is greater than 6, give up.
1586 * (Should we try to make guesses for multiport serial devices
1589 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
1590 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
1591 (dev->class & 0xff) > 6)
1594 num_iomem = num_port = 0;
1595 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1596 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
1598 if (first_port == -1)
1601 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
1606 * If there is 1 or 0 iomem regions, and exactly one port,
1607 * use it. We guess the number of ports based on the IO
1610 if (num_iomem <= 1 && num_port == 1) {
1611 board->flags = first_port;
1612 board->num_ports = pci_resource_len(dev, first_port) / 8;
1617 * Now guess if we've got a board which indexes by BARs.
1618 * Each IO BAR should be 8 bytes, and they should follow
1623 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1624 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
1625 pci_resource_len(dev, i) == 8 &&
1626 (first_port == -1 || (first_port + num_port) == i)) {
1628 if (first_port == -1)
1634 board->flags = first_port | FL_BASE_BARS;
1635 board->num_ports = num_port;
1643 serial_pci_matches(struct pci_board *board, struct pci_board *guessed)
1646 board->num_ports == guessed->num_ports &&
1647 board->base_baud == guessed->base_baud &&
1648 board->uart_offset == guessed->uart_offset &&
1649 board->reg_shift == guessed->reg_shift &&
1650 board->first_offset == guessed->first_offset;
1654 * Probe one serial board. Unfortunately, there is no rhyme nor reason
1655 * to the arrangement of serial ports on a PCI card.
1657 static int __devinit
1658 pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
1660 struct serial_private *priv;
1661 struct pci_board *board, tmp;
1662 struct pci_serial_quirk *quirk;
1663 int rc, nr_ports, i;
1665 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
1666 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
1671 board = &pci_boards[ent->driver_data];
1673 rc = pci_enable_device(dev);
1677 if (ent->driver_data == pbn_default) {
1679 * Use a copy of the pci_board entry for this;
1680 * avoid changing entries in the table.
1682 memcpy(&tmp, board, sizeof(struct pci_board));
1686 * We matched one of our class entries. Try to
1687 * determine the parameters of this board.
1689 rc = serial_pci_guess_board(dev, board);
1694 * We matched an explicit entry. If we are able to
1695 * detect this boards settings with our heuristic,
1696 * then we no longer need this entry.
1698 memcpy(&tmp, &pci_boards[pbn_default], sizeof(struct pci_board));
1699 rc = serial_pci_guess_board(dev, &tmp);
1700 if (rc == 0 && serial_pci_matches(board, &tmp))
1701 moan_device("Redundant entry in serial pci_table.",
1705 nr_ports = board->num_ports;
1708 * Find an init and setup quirks.
1710 quirk = find_quirk(dev);
1713 * Run the new-style initialization function.
1714 * The initialization function returns:
1716 * 0 - use board->num_ports
1717 * >0 - number of ports
1720 rc = quirk->init(dev);
1727 priv = kmalloc(sizeof(struct serial_private) +
1728 sizeof(unsigned int) * nr_ports,
1735 memset(priv, 0, sizeof(struct serial_private) +
1736 sizeof(unsigned int) * nr_ports);
1738 priv->quirk = quirk;
1739 pci_set_drvdata(dev, priv);
1741 for (i = 0; i < nr_ports; i++) {
1742 struct uart_port serial_port;
1743 memset(&serial_port, 0, sizeof(struct uart_port));
1745 serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF |
1747 serial_port.uartclk = board->base_baud * 16;
1748 serial_port.irq = get_pci_irq(dev, board, i);
1749 serial_port.dev = &dev->dev;
1750 if (quirk->setup(dev, board, &serial_port, i))
1752 #ifdef SERIAL_DEBUG_PCI
1753 printk("Setup PCI port: port %x, irq %d, type %d\n",
1754 serial_port.iobase, serial_port.irq, serial_port.iotype);
1757 priv->line[i] = serial8250_register_port(&serial_port);
1758 if (priv->line[i] < 0) {
1759 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
1772 pci_disable_device(dev);
1776 static void __devexit pciserial_remove_one(struct pci_dev *dev)
1778 struct serial_private *priv = pci_get_drvdata(dev);
1779 struct pci_serial_quirk *quirk;
1782 pci_set_drvdata(dev, NULL);
1784 for (i = 0; i < priv->nr; i++)
1785 serial8250_unregister_port(priv->line[i]);
1787 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1788 if (priv->remapped_bar[i])
1789 iounmap(priv->remapped_bar[i]);
1790 priv->remapped_bar[i] = NULL;
1794 * Find the exit quirks.
1796 quirk = find_quirk(dev);
1800 pci_disable_device(dev);
1805 static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
1807 struct serial_private *priv = pci_get_drvdata(dev);
1812 for (i = 0; i < priv->nr; i++)
1813 serial8250_suspend_port(priv->line[i]);
1815 pci_save_state(dev);
1816 pci_set_power_state(dev, pci_choose_state(dev, state));
1820 static int pciserial_resume_one(struct pci_dev *dev)
1822 struct serial_private *priv = pci_get_drvdata(dev);
1824 pci_set_power_state(dev, PCI_D0);
1825 pci_restore_state(dev);
1831 * The device may have been disabled. Re-enable it.
1833 pci_enable_device(dev);
1836 * Ensure that the board is correctly configured.
1838 if (priv->quirk->init)
1839 priv->quirk->init(dev);
1841 for (i = 0; i < priv->nr; i++)
1842 serial8250_resume_port(priv->line[i]);
1847 static struct pci_device_id serial_pci_tbl[] = {
1848 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1849 PCI_SUBVENDOR_ID_CONNECT_TECH,
1850 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1852 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1853 PCI_SUBVENDOR_ID_CONNECT_TECH,
1854 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1856 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1857 PCI_SUBVENDOR_ID_CONNECT_TECH,
1858 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1860 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1861 PCI_SUBVENDOR_ID_CONNECT_TECH,
1862 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1864 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1865 PCI_SUBVENDOR_ID_CONNECT_TECH,
1866 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1868 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1869 PCI_SUBVENDOR_ID_CONNECT_TECH,
1870 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1872 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1873 PCI_SUBVENDOR_ID_CONNECT_TECH,
1874 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
1876 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1877 PCI_SUBVENDOR_ID_CONNECT_TECH,
1878 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
1880 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1881 PCI_SUBVENDOR_ID_CONNECT_TECH,
1882 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
1884 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1885 PCI_SUBVENDOR_ID_CONNECT_TECH,
1886 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
1888 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1889 PCI_SUBVENDOR_ID_CONNECT_TECH,
1890 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
1892 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1893 PCI_SUBVENDOR_ID_CONNECT_TECH,
1894 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
1896 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1897 PCI_SUBVENDOR_ID_CONNECT_TECH,
1898 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
1900 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1901 PCI_SUBVENDOR_ID_CONNECT_TECH,
1902 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
1905 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
1906 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1907 pbn_b2_bt_1_115200 },
1908 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
1909 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1910 pbn_b2_bt_2_115200 },
1911 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
1912 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1913 pbn_b2_bt_4_115200 },
1914 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
1915 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1916 pbn_b2_bt_2_115200 },
1917 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
1918 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1919 pbn_b2_bt_4_115200 },
1920 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
1921 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1923 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
1924 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1927 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
1928 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1929 pbn_b2_bt_2_115200 },
1930 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
1931 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1932 pbn_b2_bt_2_921600 },
1934 * VScom SPCOM800, from sl@s.pl
1936 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
1937 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1939 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
1940 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1942 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1943 PCI_SUBVENDOR_ID_KEYSPAN,
1944 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
1946 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
1947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1949 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
1950 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1952 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1953 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1954 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
1956 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1957 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1958 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
1960 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1961 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1962 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
1964 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1965 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1966 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
1968 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1969 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1970 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
1972 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1973 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1974 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
1977 * Megawolf Romulus PCI Serial Card, from Mike Hudson
1980 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
1981 0x10b5, 0x106a, 0, 0,
1983 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
1984 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1986 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
1987 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1989 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
1990 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1992 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
1993 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1995 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
1996 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4, 0, 0,
1998 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
1999 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL, 0, 0,
2003 * The below card is a little controversial since it is the
2004 * subject of a PCI vendor/device ID clash. (See
2005 * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
2006 * For now just used the hex ID 0x950a.
2008 { PCI_VENDOR_ID_OXSEMI, 0x950a,
2009 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2011 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
2012 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2014 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
2015 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2016 pbn_b0_bt_2_921600 },
2019 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
2020 * from skokodyn@yahoo.com
2022 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2023 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
2025 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2026 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
2028 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2029 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
2031 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2032 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
2036 * Digitan DS560-558, from jimd@esoft.com
2038 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
2039 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2043 * Titan Electronic cards
2044 * The 400L and 800L have a custom setup quirk.
2046 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
2047 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2049 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
2050 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2052 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
2053 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2055 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
2056 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2058 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
2059 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2061 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
2062 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2063 pbn_b1_bt_2_921600 },
2064 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
2065 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2066 pbn_b0_bt_4_921600 },
2067 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
2068 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2069 pbn_b0_bt_8_921600 },
2071 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
2072 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2074 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
2075 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2077 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
2078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2080 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
2081 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2082 pbn_b2_bt_2_921600 },
2083 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
2084 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2085 pbn_b2_bt_2_921600 },
2086 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
2087 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2088 pbn_b2_bt_2_921600 },
2089 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
2090 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2091 pbn_b2_bt_4_921600 },
2092 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
2093 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2094 pbn_b2_bt_4_921600 },
2095 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
2096 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2097 pbn_b2_bt_4_921600 },
2098 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
2099 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2101 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
2102 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2104 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
2105 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2107 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
2108 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2109 pbn_b0_bt_2_921600 },
2110 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
2111 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2112 pbn_b0_bt_2_921600 },
2113 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
2114 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2115 pbn_b0_bt_2_921600 },
2116 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
2117 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2118 pbn_b0_bt_4_921600 },
2119 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
2120 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2121 pbn_b0_bt_4_921600 },
2122 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
2123 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2124 pbn_b0_bt_4_921600 },
2127 * Computone devices submitted by Doug McNash dmcnash@computone.com
2129 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2130 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
2131 0, 0, pbn_computone_4 },
2132 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2133 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
2134 0, 0, pbn_computone_8 },
2135 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2136 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
2137 0, 0, pbn_computone_6 },
2139 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
2140 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2142 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
2143 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
2144 pbn_b0_bt_1_921600 },
2147 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
2149 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
2150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2151 pbn_b0_bt_8_115200 },
2152 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
2153 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2154 pbn_b0_bt_8_115200 },
2156 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
2157 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2158 pbn_b0_bt_2_115200 },
2159 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
2160 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2161 pbn_b0_bt_2_115200 },
2162 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
2163 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2164 pbn_b0_bt_2_115200 },
2165 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
2166 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2167 pbn_b0_bt_4_460800 },
2168 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
2169 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2170 pbn_b0_bt_4_460800 },
2171 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
2172 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2173 pbn_b0_bt_2_460800 },
2174 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
2175 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2176 pbn_b0_bt_2_460800 },
2177 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
2178 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2179 pbn_b0_bt_2_460800 },
2180 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
2181 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2182 pbn_b0_bt_1_115200 },
2183 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
2184 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2185 pbn_b0_bt_1_460800 },
2188 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
2190 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
2191 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2195 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
2197 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
2198 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2202 * RAStel 2 port modem, gerg@moreton.com.au
2204 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
2205 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2206 pbn_b2_bt_2_115200 },
2209 * EKF addition for i960 Boards form EKF with serial port
2211 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
2212 0xE4BF, PCI_ANY_ID, 0, 0,
2216 * Xircom Cardbus/Ethernet combos
2218 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2219 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2222 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
2224 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
2225 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2229 * Untested PCI modems, sent in from various folks...
2233 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
2235 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
2236 0x1048, 0x1500, 0, 0,
2239 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
2246 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2247 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
2249 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2250 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2252 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
2253 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2257 * NEC Vrc-5074 (Nile 4) builtin UART.
2259 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NILE4,
2260 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2263 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
2264 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2266 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
2267 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2271 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
2273 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2274 PCI_ANY_ID, PCI_ANY_ID,
2276 0, pbn_exar_XR17C152 },
2277 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2278 PCI_ANY_ID, PCI_ANY_ID,
2280 0, pbn_exar_XR17C154 },
2281 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2282 PCI_ANY_ID, PCI_ANY_ID,
2284 0, pbn_exar_XR17C158 },
2287 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
2289 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
2290 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2294 * These entries match devices with class COMMUNICATION_SERIAL,
2295 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2297 { PCI_ANY_ID, PCI_ANY_ID,
2298 PCI_ANY_ID, PCI_ANY_ID,
2299 PCI_CLASS_COMMUNICATION_SERIAL << 8,
2300 0xffff00, pbn_default },
2301 { PCI_ANY_ID, PCI_ANY_ID,
2302 PCI_ANY_ID, PCI_ANY_ID,
2303 PCI_CLASS_COMMUNICATION_MODEM << 8,
2304 0xffff00, pbn_default },
2305 { PCI_ANY_ID, PCI_ANY_ID,
2306 PCI_ANY_ID, PCI_ANY_ID,
2307 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
2308 0xffff00, pbn_default },
2312 static struct pci_driver serial_pci_driver = {
2314 .probe = pciserial_init_one,
2315 .remove = __devexit_p(pciserial_remove_one),
2316 .suspend = pciserial_suspend_one,
2317 .resume = pciserial_resume_one,
2318 .id_table = serial_pci_tbl,
2321 static int __init serial8250_pci_init(void)
2323 return pci_register_driver(&serial_pci_driver);
2326 static void __exit serial8250_pci_exit(void)
2328 pci_unregister_driver(&serial_pci_driver);
2331 module_init(serial8250_pci_init);
2332 module_exit(serial8250_pci_exit);
2334 MODULE_LICENSE("GPL");
2335 MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
2336 MODULE_DEVICE_TABLE(pci, serial_pci_tbl);