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 * init function returns:
38 * > 0 - number of ports
39 * = 0 - use board->num_ports
42 struct pci_serial_quirk {
47 int (*init)(struct pci_dev *dev);
48 int (*setup)(struct serial_private *, struct pciserial_board *,
49 struct uart_port *, int);
50 void (*exit)(struct pci_dev *dev);
53 #define PCI_NUM_BAR_RESOURCES 6
55 struct serial_private {
58 void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
59 struct pci_serial_quirk *quirk;
63 static void moan_device(const char *str, struct pci_dev *dev)
65 printk(KERN_WARNING "%s: %s\n"
66 KERN_WARNING "Please send the output of lspci -vv, this\n"
67 KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
68 KERN_WARNING "manufacturer and name of serial board or\n"
69 KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
70 pci_name(dev), str, dev->vendor, dev->device,
71 dev->subsystem_vendor, dev->subsystem_device);
75 setup_port(struct serial_private *priv, struct uart_port *port,
76 int bar, int offset, int regshift)
78 struct pci_dev *dev = priv->dev;
79 unsigned long base, len;
81 if (bar >= PCI_NUM_BAR_RESOURCES)
84 base = pci_resource_start(dev, bar);
86 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
87 len = pci_resource_len(dev, bar);
89 if (!priv->remapped_bar[bar])
90 priv->remapped_bar[bar] = ioremap(base, len);
91 if (!priv->remapped_bar[bar])
94 port->iotype = UPIO_MEM;
96 port->mapbase = base + offset;
97 port->membase = priv->remapped_bar[bar] + offset;
98 port->regshift = regshift;
100 port->iotype = UPIO_PORT;
101 port->iobase = base + offset;
103 port->membase = NULL;
110 * AFAVLAB uses a different mixture of BARs and offsets
111 * Not that ugly ;) -- HW
114 afavlab_setup(struct serial_private *priv, struct pciserial_board *board,
115 struct uart_port *port, int idx)
117 unsigned int bar, offset = board->first_offset;
119 bar = FL_GET_BASE(board->flags);
124 offset += (idx - 4) * board->uart_offset;
127 return setup_port(priv, port, bar, offset, board->reg_shift);
131 * HP's Remote Management Console. The Diva chip came in several
132 * different versions. N-class, L2000 and A500 have two Diva chips, each
133 * with 3 UARTs (the third UART on the second chip is unused). Superdome
134 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
135 * one Diva chip, but it has been expanded to 5 UARTs.
137 static int __devinit pci_hp_diva_init(struct pci_dev *dev)
141 switch (dev->subsystem_device) {
142 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
143 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
144 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
145 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
148 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
151 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
154 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
163 * HP's Diva chip puts the 4th/5th serial port further out, and
164 * some serial ports are supposed to be hidden on certain models.
167 pci_hp_diva_setup(struct serial_private *priv, struct pciserial_board *board,
168 struct uart_port *port, int idx)
170 unsigned int offset = board->first_offset;
171 unsigned int bar = FL_GET_BASE(board->flags);
173 switch (priv->dev->subsystem_device) {
174 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
178 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
188 offset += idx * board->uart_offset;
190 return setup_port(priv, port, bar, offset, board->reg_shift);
194 * Added for EKF Intel i960 serial boards
196 static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
198 unsigned long oldval;
200 if (!(dev->subsystem_device & 0x1000))
203 /* is firmware started? */
204 pci_read_config_dword(dev, 0x44, (void*) &oldval);
205 if (oldval == 0x00001000L) { /* RESET value */
206 printk(KERN_DEBUG "Local i960 firmware missing");
213 * Some PCI serial cards using the PLX 9050 PCI interface chip require
214 * that the card interrupt be explicitly enabled or disabled. This
215 * seems to be mainly needed on card using the PLX which also use I/O
218 static int __devinit pci_plx9050_init(struct pci_dev *dev)
223 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
224 moan_device("no memory in bar 0", dev);
229 if (dev->vendor == PCI_VENDOR_ID_PANACOM)
231 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
232 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS)) {
234 * As the megawolf cards have the int pins active
235 * high, and have 2 UART chips, both ints must be
236 * enabled on the 9050. Also, the UARTS are set in
237 * 16450 mode by default, so we have to enable the
238 * 16C950 'enhanced' mode so that we can use the
245 * enable/disable interrupts
247 p = ioremap(pci_resource_start(dev, 0), 0x80);
250 writel(irq_config, p + 0x4c);
253 * Read the register back to ensure that it took effect.
261 static void __devexit pci_plx9050_exit(struct pci_dev *dev)
265 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
271 p = ioremap(pci_resource_start(dev, 0), 0x80);
276 * Read the register back to ensure that it took effect.
283 /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
285 sbs_setup(struct serial_private *priv, struct pciserial_board *board,
286 struct uart_port *port, int idx)
288 unsigned int bar, offset = board->first_offset;
293 /* first four channels map to 0, 0x100, 0x200, 0x300 */
294 offset += idx * board->uart_offset;
295 } else if (idx < 8) {
296 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
297 offset += idx * board->uart_offset + 0xC00;
298 } else /* we have only 8 ports on PMC-OCTALPRO */
301 return setup_port(priv, port, bar, offset, board->reg_shift);
305 * This does initialization for PMC OCTALPRO cards:
306 * maps the device memory, resets the UARTs (needed, bc
307 * if the module is removed and inserted again, the card
308 * is in the sleep mode) and enables global interrupt.
311 /* global control register offset for SBS PMC-OctalPro */
312 #define OCT_REG_CR_OFF 0x500
314 static int __devinit sbs_init(struct pci_dev *dev)
318 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
322 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
323 writeb(0x10,p + OCT_REG_CR_OFF);
325 writeb(0x0,p + OCT_REG_CR_OFF);
327 /* Set bit-2 (INTENABLE) of Control Register */
328 writeb(0x4, p + OCT_REG_CR_OFF);
335 * Disables the global interrupt of PMC-OctalPro
338 static void __devexit sbs_exit(struct pci_dev *dev)
342 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
344 writeb(0, p + OCT_REG_CR_OFF);
350 * SIIG serial cards have an PCI interface chip which also controls
351 * the UART clocking frequency. Each UART can be clocked independently
352 * (except cards equiped with 4 UARTs) and initial clocking settings
353 * are stored in the EEPROM chip. It can cause problems because this
354 * version of serial driver doesn't support differently clocked UART's
355 * on single PCI card. To prevent this, initialization functions set
356 * high frequency clocking for all UART's on given card. It is safe (I
357 * hope) because it doesn't touch EEPROM settings to prevent conflicts
358 * with other OSes (like M$ DOS).
360 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
362 * There is two family of SIIG serial cards with different PCI
363 * interface chip and different configuration methods:
364 * - 10x cards have control registers in IO and/or memory space;
365 * - 20x cards have control registers in standard PCI configuration space.
367 * Note: all 10x cards have PCI device ids 0x10..
368 * all 20x cards have PCI device ids 0x20..
370 * There are also Quartet Serial cards which use Oxford Semiconductor
371 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
373 * Note: some SIIG cards are probed by the parport_serial object.
376 #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
377 #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
379 static int pci_siig10x_init(struct pci_dev *dev)
384 switch (dev->device & 0xfff8) {
385 case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
388 case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
391 default: /* 1S1P, 4S */
396 p = ioremap(pci_resource_start(dev, 0), 0x80);
400 writew(readw(p + 0x28) & data, p + 0x28);
406 #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
407 #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
409 static int pci_siig20x_init(struct pci_dev *dev)
413 /* Change clock frequency for the first UART. */
414 pci_read_config_byte(dev, 0x6f, &data);
415 pci_write_config_byte(dev, 0x6f, data & 0xef);
417 /* If this card has 2 UART, we have to do the same with second UART. */
418 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
419 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
420 pci_read_config_byte(dev, 0x73, &data);
421 pci_write_config_byte(dev, 0x73, data & 0xef);
426 static int pci_siig_init(struct pci_dev *dev)
428 unsigned int type = dev->device & 0xff00;
431 return pci_siig10x_init(dev);
432 else if (type == 0x2000)
433 return pci_siig20x_init(dev);
435 moan_device("Unknown SIIG card", dev);
440 * Timedia has an explosion of boards, and to avoid the PCI table from
441 * growing *huge*, we use this function to collapse some 70 entries
442 * in the PCI table into one, for sanity's and compactness's sake.
444 static unsigned short timedia_single_port[] = {
445 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
448 static unsigned short timedia_dual_port[] = {
449 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
450 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
451 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
452 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
456 static unsigned short timedia_quad_port[] = {
457 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
458 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
459 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
463 static unsigned short timedia_eight_port[] = {
464 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
465 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
468 static struct timedia_struct {
472 { 1, timedia_single_port },
473 { 2, timedia_dual_port },
474 { 4, timedia_quad_port },
475 { 8, timedia_eight_port },
479 static int __devinit pci_timedia_init(struct pci_dev *dev)
484 for (i = 0; timedia_data[i].num; i++) {
485 ids = timedia_data[i].ids;
486 for (j = 0; ids[j]; j++)
487 if (dev->subsystem_device == ids[j])
488 return timedia_data[i].num;
494 * Timedia/SUNIX uses a mixture of BARs and offsets
495 * Ugh, this is ugly as all hell --- TYT
498 pci_timedia_setup(struct serial_private *priv, struct pciserial_board *board,
499 struct uart_port *port, int idx)
501 unsigned int bar = 0, offset = board->first_offset;
508 offset = board->uart_offset;
515 offset = board->uart_offset;
524 return setup_port(priv, port, bar, offset, board->reg_shift);
528 * Some Titan cards are also a little weird
531 titan_400l_800l_setup(struct serial_private *priv,
532 struct pciserial_board *board,
533 struct uart_port *port, int idx)
535 unsigned int bar, offset = board->first_offset;
546 offset = (idx - 2) * board->uart_offset;
549 return setup_port(priv, port, bar, offset, board->reg_shift);
552 static int __devinit pci_xircom_init(struct pci_dev *dev)
558 static int __devinit pci_netmos_init(struct pci_dev *dev)
560 /* subdevice 0x00PS means <P> parallel, <S> serial */
561 unsigned int num_serial = dev->subsystem_device & 0xf;
569 pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
570 struct uart_port *port, int idx)
572 unsigned int bar, offset = board->first_offset, maxnr;
574 bar = FL_GET_BASE(board->flags);
575 if (board->flags & FL_BASE_BARS)
578 offset += idx * board->uart_offset;
580 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) /
581 (8 << board->reg_shift);
583 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
586 return setup_port(priv, port, bar, offset, board->reg_shift);
589 /* This should be in linux/pci_ids.h */
590 #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
591 #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
592 #define PCI_DEVICE_ID_OCTPRO 0x0001
593 #define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
594 #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
595 #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
596 #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
599 * Master list of serial port init/setup/exit quirks.
600 * This does not describe the general nature of the port.
601 * (ie, baud base, number and location of ports, etc)
603 * This list is ordered alphabetically by vendor then device.
604 * Specific entries must come before more generic entries.
606 static struct pci_serial_quirk pci_serial_quirks[] = {
609 * It is not clear whether this applies to all products.
612 .vendor = PCI_VENDOR_ID_AFAVLAB,
613 .device = PCI_ANY_ID,
614 .subvendor = PCI_ANY_ID,
615 .subdevice = PCI_ANY_ID,
616 .setup = afavlab_setup,
622 .vendor = PCI_VENDOR_ID_HP,
623 .device = PCI_DEVICE_ID_HP_DIVA,
624 .subvendor = PCI_ANY_ID,
625 .subdevice = PCI_ANY_ID,
626 .init = pci_hp_diva_init,
627 .setup = pci_hp_diva_setup,
633 .vendor = PCI_VENDOR_ID_INTEL,
634 .device = PCI_DEVICE_ID_INTEL_80960_RP,
636 .subdevice = PCI_ANY_ID,
637 .init = pci_inteli960ni_init,
638 .setup = pci_default_setup,
644 .vendor = PCI_VENDOR_ID_PANACOM,
645 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
646 .subvendor = PCI_ANY_ID,
647 .subdevice = PCI_ANY_ID,
648 .init = pci_plx9050_init,
649 .setup = pci_default_setup,
650 .exit = __devexit_p(pci_plx9050_exit),
653 .vendor = PCI_VENDOR_ID_PANACOM,
654 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
655 .subvendor = PCI_ANY_ID,
656 .subdevice = PCI_ANY_ID,
657 .init = pci_plx9050_init,
658 .setup = pci_default_setup,
659 .exit = __devexit_p(pci_plx9050_exit),
665 .vendor = PCI_VENDOR_ID_PLX,
666 .device = PCI_DEVICE_ID_PLX_9050,
667 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
668 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
669 .init = pci_plx9050_init,
670 .setup = pci_default_setup,
671 .exit = __devexit_p(pci_plx9050_exit),
674 .vendor = PCI_VENDOR_ID_PLX,
675 .device = PCI_DEVICE_ID_PLX_ROMULUS,
676 .subvendor = PCI_VENDOR_ID_PLX,
677 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
678 .init = pci_plx9050_init,
679 .setup = pci_default_setup,
680 .exit = __devexit_p(pci_plx9050_exit),
683 * SBS Technologies, Inc., PMC-OCTALPRO 232
686 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
687 .device = PCI_DEVICE_ID_OCTPRO,
688 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
689 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
692 .exit = __devexit_p(sbs_exit),
695 * SBS Technologies, Inc., PMC-OCTALPRO 422
698 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
699 .device = PCI_DEVICE_ID_OCTPRO,
700 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
701 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
704 .exit = __devexit_p(sbs_exit),
707 * SBS Technologies, Inc., P-Octal 232
710 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
711 .device = PCI_DEVICE_ID_OCTPRO,
712 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
713 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
716 .exit = __devexit_p(sbs_exit),
719 * SBS Technologies, Inc., P-Octal 422
722 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
723 .device = PCI_DEVICE_ID_OCTPRO,
724 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
725 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
728 .exit = __devexit_p(sbs_exit),
734 .vendor = PCI_VENDOR_ID_SIIG,
735 .device = PCI_ANY_ID,
736 .subvendor = PCI_ANY_ID,
737 .subdevice = PCI_ANY_ID,
738 .init = pci_siig_init,
739 .setup = pci_default_setup,
745 .vendor = PCI_VENDOR_ID_TITAN,
746 .device = PCI_DEVICE_ID_TITAN_400L,
747 .subvendor = PCI_ANY_ID,
748 .subdevice = PCI_ANY_ID,
749 .setup = titan_400l_800l_setup,
752 .vendor = PCI_VENDOR_ID_TITAN,
753 .device = PCI_DEVICE_ID_TITAN_800L,
754 .subvendor = PCI_ANY_ID,
755 .subdevice = PCI_ANY_ID,
756 .setup = titan_400l_800l_setup,
762 .vendor = PCI_VENDOR_ID_TIMEDIA,
763 .device = PCI_DEVICE_ID_TIMEDIA_1889,
764 .subvendor = PCI_VENDOR_ID_TIMEDIA,
765 .subdevice = PCI_ANY_ID,
766 .init = pci_timedia_init,
767 .setup = pci_timedia_setup,
770 .vendor = PCI_VENDOR_ID_TIMEDIA,
771 .device = PCI_ANY_ID,
772 .subvendor = PCI_ANY_ID,
773 .subdevice = PCI_ANY_ID,
774 .setup = pci_timedia_setup,
780 .vendor = PCI_VENDOR_ID_XIRCOM,
781 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
782 .subvendor = PCI_ANY_ID,
783 .subdevice = PCI_ANY_ID,
784 .init = pci_xircom_init,
785 .setup = pci_default_setup,
791 .vendor = PCI_VENDOR_ID_NETMOS,
792 .device = PCI_ANY_ID,
793 .subvendor = PCI_ANY_ID,
794 .subdevice = PCI_ANY_ID,
795 .init = pci_netmos_init,
796 .setup = pci_default_setup,
799 * Default "match everything" terminator entry
802 .vendor = PCI_ANY_ID,
803 .device = PCI_ANY_ID,
804 .subvendor = PCI_ANY_ID,
805 .subdevice = PCI_ANY_ID,
806 .setup = pci_default_setup,
810 static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
812 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
815 static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
817 struct pci_serial_quirk *quirk;
819 for (quirk = pci_serial_quirks; ; quirk++)
820 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
821 quirk_id_matches(quirk->device, dev->device) &&
822 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
823 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
829 get_pci_irq(struct pci_dev *dev, struct pciserial_board *board)
831 if (board->flags & FL_NOIRQ)
838 * This is the configuration table for all of the PCI serial boards
839 * which we support. It is directly indexed by the pci_board_num_t enum
840 * value, which is encoded in the pci_device_id PCI probe table's
841 * driver_data member.
843 * The makeup of these names are:
846 * bn = PCI BAR number
847 * bt = Index using PCI BARs
848 * n = number of serial ports
851 * This table is sorted by (in order): baud, bt, bn, n.
853 * Please note: in theory if n = 1, _bt infix should make no difference.
854 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
856 enum pci_board_num_t {
923 * Board-specific versions.
943 * uart_offset - the space between channels
944 * reg_shift - describes how the UART registers are mapped
945 * to PCI memory by the card.
946 * For example IER register on SBS, Inc. PMC-OctPro is located at
947 * offset 0x10 from the UART base, while UART_IER is defined as 1
948 * in include/linux/serial_reg.h,
949 * see first lines of serial_in() and serial_out() in 8250.c
952 static struct pciserial_board pci_boards[] __devinitdata = {
959 [pbn_b0_1_115200] = {
965 [pbn_b0_2_115200] = {
971 [pbn_b0_4_115200] = {
977 [pbn_b0_5_115200] = {
984 [pbn_b0_1_921600] = {
990 [pbn_b0_2_921600] = {
996 [pbn_b0_4_921600] = {
1002 [pbn_b0_4_1152000] = {
1005 .base_baud = 1152000,
1009 [pbn_b0_bt_1_115200] = {
1010 .flags = FL_BASE0|FL_BASE_BARS,
1012 .base_baud = 115200,
1015 [pbn_b0_bt_2_115200] = {
1016 .flags = FL_BASE0|FL_BASE_BARS,
1018 .base_baud = 115200,
1021 [pbn_b0_bt_8_115200] = {
1022 .flags = FL_BASE0|FL_BASE_BARS,
1024 .base_baud = 115200,
1028 [pbn_b0_bt_1_460800] = {
1029 .flags = FL_BASE0|FL_BASE_BARS,
1031 .base_baud = 460800,
1034 [pbn_b0_bt_2_460800] = {
1035 .flags = FL_BASE0|FL_BASE_BARS,
1037 .base_baud = 460800,
1040 [pbn_b0_bt_4_460800] = {
1041 .flags = FL_BASE0|FL_BASE_BARS,
1043 .base_baud = 460800,
1047 [pbn_b0_bt_1_921600] = {
1048 .flags = FL_BASE0|FL_BASE_BARS,
1050 .base_baud = 921600,
1053 [pbn_b0_bt_2_921600] = {
1054 .flags = FL_BASE0|FL_BASE_BARS,
1056 .base_baud = 921600,
1059 [pbn_b0_bt_4_921600] = {
1060 .flags = FL_BASE0|FL_BASE_BARS,
1062 .base_baud = 921600,
1065 [pbn_b0_bt_8_921600] = {
1066 .flags = FL_BASE0|FL_BASE_BARS,
1068 .base_baud = 921600,
1072 [pbn_b1_1_115200] = {
1075 .base_baud = 115200,
1078 [pbn_b1_2_115200] = {
1081 .base_baud = 115200,
1084 [pbn_b1_4_115200] = {
1087 .base_baud = 115200,
1090 [pbn_b1_8_115200] = {
1093 .base_baud = 115200,
1097 [pbn_b1_1_921600] = {
1100 .base_baud = 921600,
1103 [pbn_b1_2_921600] = {
1106 .base_baud = 921600,
1109 [pbn_b1_4_921600] = {
1112 .base_baud = 921600,
1115 [pbn_b1_8_921600] = {
1118 .base_baud = 921600,
1122 [pbn_b1_bt_2_921600] = {
1123 .flags = FL_BASE1|FL_BASE_BARS,
1125 .base_baud = 921600,
1129 [pbn_b1_1_1382400] = {
1132 .base_baud = 1382400,
1135 [pbn_b1_2_1382400] = {
1138 .base_baud = 1382400,
1141 [pbn_b1_4_1382400] = {
1144 .base_baud = 1382400,
1147 [pbn_b1_8_1382400] = {
1150 .base_baud = 1382400,
1154 [pbn_b2_1_115200] = {
1157 .base_baud = 115200,
1160 [pbn_b2_8_115200] = {
1163 .base_baud = 115200,
1167 [pbn_b2_1_460800] = {
1170 .base_baud = 460800,
1173 [pbn_b2_4_460800] = {
1176 .base_baud = 460800,
1179 [pbn_b2_8_460800] = {
1182 .base_baud = 460800,
1185 [pbn_b2_16_460800] = {
1188 .base_baud = 460800,
1192 [pbn_b2_1_921600] = {
1195 .base_baud = 921600,
1198 [pbn_b2_4_921600] = {
1201 .base_baud = 921600,
1204 [pbn_b2_8_921600] = {
1207 .base_baud = 921600,
1211 [pbn_b2_bt_1_115200] = {
1212 .flags = FL_BASE2|FL_BASE_BARS,
1214 .base_baud = 115200,
1217 [pbn_b2_bt_2_115200] = {
1218 .flags = FL_BASE2|FL_BASE_BARS,
1220 .base_baud = 115200,
1223 [pbn_b2_bt_4_115200] = {
1224 .flags = FL_BASE2|FL_BASE_BARS,
1226 .base_baud = 115200,
1230 [pbn_b2_bt_2_921600] = {
1231 .flags = FL_BASE2|FL_BASE_BARS,
1233 .base_baud = 921600,
1236 [pbn_b2_bt_4_921600] = {
1237 .flags = FL_BASE2|FL_BASE_BARS,
1239 .base_baud = 921600,
1243 [pbn_b3_4_115200] = {
1246 .base_baud = 115200,
1249 [pbn_b3_8_115200] = {
1252 .base_baud = 115200,
1257 * Entries following this are board-specific.
1266 .base_baud = 921600,
1267 .uart_offset = 0x400,
1271 .flags = FL_BASE2|FL_BASE_BARS,
1273 .base_baud = 921600,
1274 .uart_offset = 0x400,
1278 .flags = FL_BASE2|FL_BASE_BARS,
1280 .base_baud = 921600,
1281 .uart_offset = 0x400,
1285 /* I think this entry is broken - the first_offset looks wrong --rmk */
1286 [pbn_plx_romulus] = {
1289 .base_baud = 921600,
1290 .uart_offset = 8 << 2,
1292 .first_offset = 0x03,
1296 * This board uses the size of PCI Base region 0 to
1297 * signal now many ports are available
1300 .flags = FL_BASE0|FL_REGION_SZ_CAP,
1302 .base_baud = 115200,
1307 * EKF addition for i960 Boards form EKF with serial port.
1310 [pbn_intel_i960] = {
1313 .base_baud = 921600,
1314 .uart_offset = 8 << 2,
1316 .first_offset = 0x10000,
1319 .flags = FL_BASE0|FL_NOIRQ,
1321 .base_baud = 458333,
1324 .first_offset = 0x20178,
1328 * NEC Vrc-5074 (Nile 4) builtin UART.
1333 .base_baud = 520833,
1334 .uart_offset = 8 << 3,
1336 .first_offset = 0x300,
1340 * Computone - uses IOMEM.
1342 [pbn_computone_4] = {
1345 .base_baud = 921600,
1346 .uart_offset = 0x40,
1348 .first_offset = 0x200,
1350 [pbn_computone_6] = {
1353 .base_baud = 921600,
1354 .uart_offset = 0x40,
1356 .first_offset = 0x200,
1358 [pbn_computone_8] = {
1361 .base_baud = 921600,
1362 .uart_offset = 0x40,
1364 .first_offset = 0x200,
1369 .base_baud = 460800,
1374 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
1375 * Only basic 16550A support.
1376 * XR17C15[24] are not tested, but they should work.
1378 [pbn_exar_XR17C152] = {
1381 .base_baud = 921600,
1382 .uart_offset = 0x200,
1384 [pbn_exar_XR17C154] = {
1387 .base_baud = 921600,
1388 .uart_offset = 0x200,
1390 [pbn_exar_XR17C158] = {
1393 .base_baud = 921600,
1394 .uart_offset = 0x200,
1399 * Given a complete unknown PCI device, try to use some heuristics to
1400 * guess what the configuration might be, based on the pitiful PCI
1401 * serial specs. Returns 0 on success, 1 on failure.
1403 static int __devinit
1404 serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
1406 int num_iomem, num_port, first_port = -1, i;
1409 * If it is not a communications device or the programming
1410 * interface is greater than 6, give up.
1412 * (Should we try to make guesses for multiport serial devices
1415 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
1416 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
1417 (dev->class & 0xff) > 6)
1420 num_iomem = num_port = 0;
1421 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1422 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
1424 if (first_port == -1)
1427 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
1432 * If there is 1 or 0 iomem regions, and exactly one port,
1433 * use it. We guess the number of ports based on the IO
1436 if (num_iomem <= 1 && num_port == 1) {
1437 board->flags = first_port;
1438 board->num_ports = pci_resource_len(dev, first_port) / 8;
1443 * Now guess if we've got a board which indexes by BARs.
1444 * Each IO BAR should be 8 bytes, and they should follow
1449 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1450 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
1451 pci_resource_len(dev, i) == 8 &&
1452 (first_port == -1 || (first_port + num_port) == i)) {
1454 if (first_port == -1)
1460 board->flags = first_port | FL_BASE_BARS;
1461 board->num_ports = num_port;
1469 serial_pci_matches(struct pciserial_board *board,
1470 struct pciserial_board *guessed)
1473 board->num_ports == guessed->num_ports &&
1474 board->base_baud == guessed->base_baud &&
1475 board->uart_offset == guessed->uart_offset &&
1476 board->reg_shift == guessed->reg_shift &&
1477 board->first_offset == guessed->first_offset;
1480 struct serial_private *
1481 pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board)
1483 struct uart_port serial_port;
1484 struct serial_private *priv;
1485 struct pci_serial_quirk *quirk;
1486 int rc, nr_ports, i;
1488 nr_ports = board->num_ports;
1491 * Find an init and setup quirks.
1493 quirk = find_quirk(dev);
1496 * Run the new-style initialization function.
1497 * The initialization function returns:
1499 * 0 - use board->num_ports
1500 * >0 - number of ports
1503 rc = quirk->init(dev);
1512 priv = kmalloc(sizeof(struct serial_private) +
1513 sizeof(unsigned int) * nr_ports,
1516 priv = ERR_PTR(-ENOMEM);
1520 memset(priv, 0, sizeof(struct serial_private) +
1521 sizeof(unsigned int) * nr_ports);
1524 priv->quirk = quirk;
1526 memset(&serial_port, 0, sizeof(struct uart_port));
1527 serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
1528 serial_port.uartclk = board->base_baud * 16;
1529 serial_port.irq = get_pci_irq(dev, board);
1530 serial_port.dev = &dev->dev;
1532 for (i = 0; i < nr_ports; i++) {
1533 if (quirk->setup(priv, board, &serial_port, i))
1536 #ifdef SERIAL_DEBUG_PCI
1537 printk("Setup PCI port: port %x, irq %d, type %d\n",
1538 serial_port.iobase, serial_port.irq, serial_port.iotype);
1541 priv->line[i] = serial8250_register_port(&serial_port);
1542 if (priv->line[i] < 0) {
1543 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
1558 EXPORT_SYMBOL_GPL(pciserial_init_ports);
1560 void pciserial_remove_ports(struct serial_private *priv)
1562 struct pci_serial_quirk *quirk;
1565 for (i = 0; i < priv->nr; i++)
1566 serial8250_unregister_port(priv->line[i]);
1568 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1569 if (priv->remapped_bar[i])
1570 iounmap(priv->remapped_bar[i]);
1571 priv->remapped_bar[i] = NULL;
1575 * Find the exit quirks.
1577 quirk = find_quirk(priv->dev);
1579 quirk->exit(priv->dev);
1583 EXPORT_SYMBOL_GPL(pciserial_remove_ports);
1585 void pciserial_suspend_ports(struct serial_private *priv)
1589 for (i = 0; i < priv->nr; i++)
1590 if (priv->line[i] >= 0)
1591 serial8250_suspend_port(priv->line[i]);
1593 EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
1595 void pciserial_resume_ports(struct serial_private *priv)
1600 * Ensure that the board is correctly configured.
1602 if (priv->quirk->init)
1603 priv->quirk->init(priv->dev);
1605 for (i = 0; i < priv->nr; i++)
1606 if (priv->line[i] >= 0)
1607 serial8250_resume_port(priv->line[i]);
1609 EXPORT_SYMBOL_GPL(pciserial_resume_ports);
1612 * Probe one serial board. Unfortunately, there is no rhyme nor reason
1613 * to the arrangement of serial ports on a PCI card.
1615 static int __devinit
1616 pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
1618 struct serial_private *priv;
1619 struct pciserial_board *board, tmp;
1622 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
1623 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
1628 board = &pci_boards[ent->driver_data];
1630 rc = pci_enable_device(dev);
1634 if (ent->driver_data == pbn_default) {
1636 * Use a copy of the pci_board entry for this;
1637 * avoid changing entries in the table.
1639 memcpy(&tmp, board, sizeof(struct pciserial_board));
1643 * We matched one of our class entries. Try to
1644 * determine the parameters of this board.
1646 rc = serial_pci_guess_board(dev, board);
1651 * We matched an explicit entry. If we are able to
1652 * detect this boards settings with our heuristic,
1653 * then we no longer need this entry.
1655 memcpy(&tmp, &pci_boards[pbn_default],
1656 sizeof(struct pciserial_board));
1657 rc = serial_pci_guess_board(dev, &tmp);
1658 if (rc == 0 && serial_pci_matches(board, &tmp))
1659 moan_device("Redundant entry in serial pci_table.",
1663 priv = pciserial_init_ports(dev, board);
1664 if (!IS_ERR(priv)) {
1665 pci_set_drvdata(dev, priv);
1672 pci_disable_device(dev);
1676 static void __devexit pciserial_remove_one(struct pci_dev *dev)
1678 struct serial_private *priv = pci_get_drvdata(dev);
1680 pci_set_drvdata(dev, NULL);
1682 pciserial_remove_ports(priv);
1684 pci_disable_device(dev);
1687 static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
1689 struct serial_private *priv = pci_get_drvdata(dev);
1692 pciserial_suspend_ports(priv);
1694 pci_save_state(dev);
1695 pci_set_power_state(dev, pci_choose_state(dev, state));
1699 static int pciserial_resume_one(struct pci_dev *dev)
1701 struct serial_private *priv = pci_get_drvdata(dev);
1703 pci_set_power_state(dev, PCI_D0);
1704 pci_restore_state(dev);
1708 * The device may have been disabled. Re-enable it.
1710 pci_enable_device(dev);
1712 pciserial_resume_ports(priv);
1717 static struct pci_device_id serial_pci_tbl[] = {
1718 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1719 PCI_SUBVENDOR_ID_CONNECT_TECH,
1720 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1722 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1723 PCI_SUBVENDOR_ID_CONNECT_TECH,
1724 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1726 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1727 PCI_SUBVENDOR_ID_CONNECT_TECH,
1728 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1730 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1731 PCI_SUBVENDOR_ID_CONNECT_TECH,
1732 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1734 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1735 PCI_SUBVENDOR_ID_CONNECT_TECH,
1736 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1738 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1739 PCI_SUBVENDOR_ID_CONNECT_TECH,
1740 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1742 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1743 PCI_SUBVENDOR_ID_CONNECT_TECH,
1744 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
1746 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1747 PCI_SUBVENDOR_ID_CONNECT_TECH,
1748 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
1750 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1751 PCI_SUBVENDOR_ID_CONNECT_TECH,
1752 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
1754 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1755 PCI_SUBVENDOR_ID_CONNECT_TECH,
1756 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
1758 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1759 PCI_SUBVENDOR_ID_CONNECT_TECH,
1760 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
1762 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1763 PCI_SUBVENDOR_ID_CONNECT_TECH,
1764 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
1766 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1767 PCI_SUBVENDOR_ID_CONNECT_TECH,
1768 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
1770 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1771 PCI_SUBVENDOR_ID_CONNECT_TECH,
1772 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
1775 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
1776 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1777 pbn_b2_bt_1_115200 },
1778 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
1779 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1780 pbn_b2_bt_2_115200 },
1781 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
1782 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1783 pbn_b2_bt_4_115200 },
1784 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
1785 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1786 pbn_b2_bt_2_115200 },
1787 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
1788 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1789 pbn_b2_bt_4_115200 },
1790 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
1791 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1793 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
1794 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1797 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
1798 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1799 pbn_b2_bt_2_115200 },
1800 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
1801 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1802 pbn_b2_bt_2_921600 },
1804 * VScom SPCOM800, from sl@s.pl
1806 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
1807 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1809 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
1810 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1812 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1813 PCI_SUBVENDOR_ID_KEYSPAN,
1814 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
1816 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
1817 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1819 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
1820 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1822 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1823 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1824 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
1826 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1827 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1828 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
1830 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1831 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1832 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
1834 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1835 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1836 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
1838 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1839 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1840 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
1842 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1843 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1844 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
1847 * Megawolf Romulus PCI Serial Card, from Mike Hudson
1850 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
1851 0x10b5, 0x106a, 0, 0,
1853 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
1854 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1856 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
1857 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1859 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
1860 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1862 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
1863 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1865 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
1866 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4, 0, 0,
1868 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
1869 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL, 0, 0,
1871 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
1872 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1874 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
1875 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1876 pbn_b0_bt_2_921600 },
1879 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
1880 * from skokodyn@yahoo.com
1882 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
1883 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
1885 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
1886 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
1888 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
1889 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
1891 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
1892 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
1896 * Digitan DS560-558, from jimd@esoft.com
1898 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
1899 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1903 * Titan Electronic cards
1904 * The 400L and 800L have a custom setup quirk.
1906 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
1907 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1909 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
1910 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1912 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
1913 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1915 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
1916 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1918 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
1919 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1921 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
1922 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1923 pbn_b1_bt_2_921600 },
1924 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
1925 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1926 pbn_b0_bt_4_921600 },
1927 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
1928 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1929 pbn_b0_bt_8_921600 },
1931 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
1932 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1934 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
1935 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1937 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
1938 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1940 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
1941 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1942 pbn_b2_bt_2_921600 },
1943 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
1944 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1945 pbn_b2_bt_2_921600 },
1946 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
1947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1948 pbn_b2_bt_2_921600 },
1949 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
1950 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1951 pbn_b2_bt_4_921600 },
1952 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
1953 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1954 pbn_b2_bt_4_921600 },
1955 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
1956 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1957 pbn_b2_bt_4_921600 },
1958 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
1959 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1961 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
1962 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1964 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
1965 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1967 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
1968 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1969 pbn_b0_bt_2_921600 },
1970 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
1971 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1972 pbn_b0_bt_2_921600 },
1973 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
1974 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1975 pbn_b0_bt_2_921600 },
1976 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
1977 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1978 pbn_b0_bt_4_921600 },
1979 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
1980 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1981 pbn_b0_bt_4_921600 },
1982 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
1983 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1984 pbn_b0_bt_4_921600 },
1987 * Computone devices submitted by Doug McNash dmcnash@computone.com
1989 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
1990 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
1991 0, 0, pbn_computone_4 },
1992 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
1993 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
1994 0, 0, pbn_computone_8 },
1995 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
1996 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
1997 0, 0, pbn_computone_6 },
1999 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
2000 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2002 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
2003 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
2004 pbn_b0_bt_1_921600 },
2007 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
2009 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
2010 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2011 pbn_b0_bt_8_115200 },
2012 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
2013 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2014 pbn_b0_bt_8_115200 },
2016 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
2017 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2018 pbn_b0_bt_2_115200 },
2019 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
2020 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2021 pbn_b0_bt_2_115200 },
2022 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
2023 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2024 pbn_b0_bt_2_115200 },
2025 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
2026 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2027 pbn_b0_bt_4_460800 },
2028 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
2029 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2030 pbn_b0_bt_4_460800 },
2031 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
2032 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2033 pbn_b0_bt_2_460800 },
2034 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
2035 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2036 pbn_b0_bt_2_460800 },
2037 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
2038 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2039 pbn_b0_bt_2_460800 },
2040 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
2041 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2042 pbn_b0_bt_1_115200 },
2043 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
2044 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2045 pbn_b0_bt_1_460800 },
2048 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
2050 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
2051 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2055 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
2057 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
2058 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2062 * RAStel 2 port modem, gerg@moreton.com.au
2064 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
2065 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2066 pbn_b2_bt_2_115200 },
2069 * EKF addition for i960 Boards form EKF with serial port
2071 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
2072 0xE4BF, PCI_ANY_ID, 0, 0,
2076 * Xircom Cardbus/Ethernet combos
2078 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2079 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2082 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
2084 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
2085 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2089 * Untested PCI modems, sent in from various folks...
2093 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
2095 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
2096 0x1048, 0x1500, 0, 0,
2099 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
2106 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2107 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
2109 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2110 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2112 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
2113 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2117 * NEC Vrc-5074 (Nile 4) builtin UART.
2119 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NILE4,
2120 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2123 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
2124 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2126 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
2127 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2131 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
2133 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2134 PCI_ANY_ID, PCI_ANY_ID,
2136 0, pbn_exar_XR17C152 },
2137 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2138 PCI_ANY_ID, PCI_ANY_ID,
2140 0, pbn_exar_XR17C154 },
2141 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2142 PCI_ANY_ID, PCI_ANY_ID,
2144 0, pbn_exar_XR17C158 },
2147 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
2149 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
2150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2154 * These entries match devices with class COMMUNICATION_SERIAL,
2155 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2157 { PCI_ANY_ID, PCI_ANY_ID,
2158 PCI_ANY_ID, PCI_ANY_ID,
2159 PCI_CLASS_COMMUNICATION_SERIAL << 8,
2160 0xffff00, pbn_default },
2161 { PCI_ANY_ID, PCI_ANY_ID,
2162 PCI_ANY_ID, PCI_ANY_ID,
2163 PCI_CLASS_COMMUNICATION_MODEM << 8,
2164 0xffff00, pbn_default },
2165 { PCI_ANY_ID, PCI_ANY_ID,
2166 PCI_ANY_ID, PCI_ANY_ID,
2167 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
2168 0xffff00, pbn_default },
2172 static struct pci_driver serial_pci_driver = {
2174 .probe = pciserial_init_one,
2175 .remove = __devexit_p(pciserial_remove_one),
2176 .suspend = pciserial_suspend_one,
2177 .resume = pciserial_resume_one,
2178 .id_table = serial_pci_tbl,
2181 static int __init serial8250_pci_init(void)
2183 return pci_register_driver(&serial_pci_driver);
2186 static void __exit serial8250_pci_exit(void)
2188 pci_unregister_driver(&serial_pci_driver);
2191 module_init(serial8250_pci_init);
2192 module_exit(serial8250_pci_exit);
2194 MODULE_LICENSE("GPL");
2195 MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
2196 MODULE_DEVICE_TABLE(pci, serial_pci_tbl);