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
57 struct pciserial_board
{
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 pciserial_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 base
= pci_resource_start(dev
, bar
);
115 if (pci_resource_flags(dev
, bar
) & IORESOURCE_MEM
) {
116 len
= pci_resource_len(dev
, bar
);
118 if (!priv
->remapped_bar
[bar
])
119 priv
->remapped_bar
[bar
] = ioremap(base
, len
);
120 if (!priv
->remapped_bar
[bar
])
123 port
->iotype
= UPIO_MEM
;
125 port
->mapbase
= base
+ offset
;
126 port
->membase
= priv
->remapped_bar
[bar
] + offset
;
127 port
->regshift
= regshift
;
129 port
->iotype
= UPIO_PORT
;
130 port
->iobase
= base
+ offset
;
132 port
->membase
= NULL
;
139 * AFAVLAB uses a different mixture of BARs and offsets
140 * Not that ugly ;) -- HW
143 afavlab_setup(struct pci_dev
*dev
, struct pciserial_board
*board
,
144 struct uart_port
*port
, int idx
)
146 unsigned int bar
, offset
= board
->first_offset
;
148 bar
= FL_GET_BASE(board
->flags
);
153 offset
+= (idx
- 4) * board
->uart_offset
;
156 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
160 * HP's Remote Management Console. The Diva chip came in several
161 * different versions. N-class, L2000 and A500 have two Diva chips, each
162 * with 3 UARTs (the third UART on the second chip is unused). Superdome
163 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
164 * one Diva chip, but it has been expanded to 5 UARTs.
166 static int __devinit
pci_hp_diva_init(struct pci_dev
*dev
)
170 switch (dev
->subsystem_device
) {
171 case PCI_DEVICE_ID_HP_DIVA_TOSCA1
:
172 case PCI_DEVICE_ID_HP_DIVA_HALFDOME
:
173 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE
:
174 case PCI_DEVICE_ID_HP_DIVA_EVEREST
:
177 case PCI_DEVICE_ID_HP_DIVA_TOSCA2
:
180 case PCI_DEVICE_ID_HP_DIVA_MAESTRO
:
183 case PCI_DEVICE_ID_HP_DIVA_POWERBAR
:
192 * HP's Diva chip puts the 4th/5th serial port further out, and
193 * some serial ports are supposed to be hidden on certain models.
196 pci_hp_diva_setup(struct pci_dev
*dev
, struct pciserial_board
*board
,
197 struct uart_port
*port
, int idx
)
199 unsigned int offset
= board
->first_offset
;
200 unsigned int bar
= FL_GET_BASE(board
->flags
);
202 switch (dev
->subsystem_device
) {
203 case PCI_DEVICE_ID_HP_DIVA_MAESTRO
:
207 case PCI_DEVICE_ID_HP_DIVA_EVEREST
:
217 offset
+= idx
* board
->uart_offset
;
219 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
223 * Added for EKF Intel i960 serial boards
225 static int __devinit
pci_inteli960ni_init(struct pci_dev
*dev
)
227 unsigned long oldval
;
229 if (!(dev
->subsystem_device
& 0x1000))
232 /* is firmware started? */
233 pci_read_config_dword(dev
, 0x44, (void*) &oldval
);
234 if (oldval
== 0x00001000L
) { /* RESET value */
235 printk(KERN_DEBUG
"Local i960 firmware missing");
242 * Some PCI serial cards using the PLX 9050 PCI interface chip require
243 * that the card interrupt be explicitly enabled or disabled. This
244 * seems to be mainly needed on card using the PLX which also use I/O
247 static int __devinit
pci_plx9050_init(struct pci_dev
*dev
)
252 if ((pci_resource_flags(dev
, 0) & IORESOURCE_MEM
) == 0) {
253 moan_device("no memory in bar 0", dev
);
258 if (dev
->vendor
== PCI_VENDOR_ID_PANACOM
)
260 if ((dev
->vendor
== PCI_VENDOR_ID_PLX
) &&
261 (dev
->device
== PCI_DEVICE_ID_PLX_ROMULUS
)) {
263 * As the megawolf cards have the int pins active
264 * high, and have 2 UART chips, both ints must be
265 * enabled on the 9050. Also, the UARTS are set in
266 * 16450 mode by default, so we have to enable the
267 * 16C950 'enhanced' mode so that we can use the
274 * enable/disable interrupts
276 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
279 writel(irq_config
, p
+ 0x4c);
282 * Read the register back to ensure that it took effect.
290 static void __devexit
pci_plx9050_exit(struct pci_dev
*dev
)
294 if ((pci_resource_flags(dev
, 0) & IORESOURCE_MEM
) == 0)
300 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
305 * Read the register back to ensure that it took effect.
312 /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
314 sbs_setup(struct pci_dev
*dev
, struct pciserial_board
*board
,
315 struct uart_port
*port
, int idx
)
317 unsigned int bar
, offset
= board
->first_offset
;
322 /* first four channels map to 0, 0x100, 0x200, 0x300 */
323 offset
+= idx
* board
->uart_offset
;
324 } else if (idx
< 8) {
325 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
326 offset
+= idx
* board
->uart_offset
+ 0xC00;
327 } else /* we have only 8 ports on PMC-OCTALPRO */
330 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
334 * This does initialization for PMC OCTALPRO cards:
335 * maps the device memory, resets the UARTs (needed, bc
336 * if the module is removed and inserted again, the card
337 * is in the sleep mode) and enables global interrupt.
340 /* global control register offset for SBS PMC-OctalPro */
341 #define OCT_REG_CR_OFF 0x500
343 static int __devinit
sbs_init(struct pci_dev
*dev
)
347 p
= ioremap(pci_resource_start(dev
, 0),pci_resource_len(dev
,0));
351 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
352 writeb(0x10,p
+ OCT_REG_CR_OFF
);
354 writeb(0x0,p
+ OCT_REG_CR_OFF
);
356 /* Set bit-2 (INTENABLE) of Control Register */
357 writeb(0x4, p
+ OCT_REG_CR_OFF
);
364 * Disables the global interrupt of PMC-OctalPro
367 static void __devexit
sbs_exit(struct pci_dev
*dev
)
371 p
= ioremap(pci_resource_start(dev
, 0),pci_resource_len(dev
,0));
373 writeb(0, p
+ OCT_REG_CR_OFF
);
379 * SIIG serial cards have an PCI interface chip which also controls
380 * the UART clocking frequency. Each UART can be clocked independently
381 * (except cards equiped with 4 UARTs) and initial clocking settings
382 * are stored in the EEPROM chip. It can cause problems because this
383 * version of serial driver doesn't support differently clocked UART's
384 * on single PCI card. To prevent this, initialization functions set
385 * high frequency clocking for all UART's on given card. It is safe (I
386 * hope) because it doesn't touch EEPROM settings to prevent conflicts
387 * with other OSes (like M$ DOS).
389 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
391 * There is two family of SIIG serial cards with different PCI
392 * interface chip and different configuration methods:
393 * - 10x cards have control registers in IO and/or memory space;
394 * - 20x cards have control registers in standard PCI configuration space.
396 * Note: all 10x cards have PCI device ids 0x10..
397 * all 20x cards have PCI device ids 0x20..
399 * There are also Quartet Serial cards which use Oxford Semiconductor
400 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
402 * Note: some SIIG cards are probed by the parport_serial object.
405 #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
406 #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
408 static int pci_siig10x_init(struct pci_dev
*dev
)
413 switch (dev
->device
& 0xfff8) {
414 case PCI_DEVICE_ID_SIIG_1S_10x
: /* 1S */
417 case PCI_DEVICE_ID_SIIG_2S_10x
: /* 2S, 2S1P */
420 default: /* 1S1P, 4S */
425 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
429 writew(readw(p
+ 0x28) & data
, p
+ 0x28);
435 #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
436 #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
438 static int pci_siig20x_init(struct pci_dev
*dev
)
442 /* Change clock frequency for the first UART. */
443 pci_read_config_byte(dev
, 0x6f, &data
);
444 pci_write_config_byte(dev
, 0x6f, data
& 0xef);
446 /* If this card has 2 UART, we have to do the same with second UART. */
447 if (((dev
->device
& 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x
) ||
448 ((dev
->device
& 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x
)) {
449 pci_read_config_byte(dev
, 0x73, &data
);
450 pci_write_config_byte(dev
, 0x73, data
& 0xef);
455 static int pci_siig_init(struct pci_dev
*dev
)
457 unsigned int type
= dev
->device
& 0xff00;
460 return pci_siig10x_init(dev
);
461 else if (type
== 0x2000)
462 return pci_siig20x_init(dev
);
464 moan_device("Unknown SIIG card", dev
);
468 int pci_siig10x_fn(struct pci_dev
*dev
, int enable
)
472 ret
= pci_siig10x_init(dev
);
476 int pci_siig20x_fn(struct pci_dev
*dev
, int enable
)
480 ret
= pci_siig20x_init(dev
);
484 EXPORT_SYMBOL(pci_siig10x_fn
);
485 EXPORT_SYMBOL(pci_siig20x_fn
);
488 * Timedia has an explosion of boards, and to avoid the PCI table from
489 * growing *huge*, we use this function to collapse some 70 entries
490 * in the PCI table into one, for sanity's and compactness's sake.
492 static unsigned short timedia_single_port
[] = {
493 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
496 static unsigned short timedia_dual_port
[] = {
497 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
498 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
499 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
500 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
504 static unsigned short timedia_quad_port
[] = {
505 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
506 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
507 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
511 static unsigned short timedia_eight_port
[] = {
512 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
513 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
516 static struct timedia_struct
{
520 { 1, timedia_single_port
},
521 { 2, timedia_dual_port
},
522 { 4, timedia_quad_port
},
523 { 8, timedia_eight_port
},
527 static int __devinit
pci_timedia_init(struct pci_dev
*dev
)
532 for (i
= 0; timedia_data
[i
].num
; i
++) {
533 ids
= timedia_data
[i
].ids
;
534 for (j
= 0; ids
[j
]; j
++)
535 if (dev
->subsystem_device
== ids
[j
])
536 return timedia_data
[i
].num
;
542 * Timedia/SUNIX uses a mixture of BARs and offsets
543 * Ugh, this is ugly as all hell --- TYT
546 pci_timedia_setup(struct pci_dev
*dev
, struct pciserial_board
*board
,
547 struct uart_port
*port
, int idx
)
549 unsigned int bar
= 0, offset
= board
->first_offset
;
556 offset
= board
->uart_offset
;
563 offset
= board
->uart_offset
;
572 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
576 * Some Titan cards are also a little weird
579 titan_400l_800l_setup(struct pci_dev
*dev
,
580 struct pciserial_board
*board
,
581 struct uart_port
*port
, int idx
)
583 unsigned int bar
, offset
= board
->first_offset
;
594 offset
= (idx
- 2) * board
->uart_offset
;
597 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
600 static int __devinit
pci_xircom_init(struct pci_dev
*dev
)
606 static int __devinit
pci_netmos_init(struct pci_dev
*dev
)
608 /* subdevice 0x00PS means <P> parallel, <S> serial */
609 unsigned int num_serial
= dev
->subsystem_device
& 0xf;
617 pci_default_setup(struct pci_dev
*dev
, struct pciserial_board
*board
,
618 struct uart_port
*port
, int idx
)
620 unsigned int bar
, offset
= board
->first_offset
, maxnr
;
622 bar
= FL_GET_BASE(board
->flags
);
623 if (board
->flags
& FL_BASE_BARS
)
626 offset
+= idx
* board
->uart_offset
;
628 maxnr
= (pci_resource_len(dev
, bar
) - board
->first_offset
) /
629 (8 << board
->reg_shift
);
631 if (board
->flags
& FL_REGION_SZ_CAP
&& idx
>= maxnr
)
634 return setup_port(dev
, port
, bar
, offset
, board
->reg_shift
);
637 /* This should be in linux/pci_ids.h */
638 #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
639 #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
640 #define PCI_DEVICE_ID_OCTPRO 0x0001
641 #define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
642 #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
643 #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
644 #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
647 * Master list of serial port init/setup/exit quirks.
648 * This does not describe the general nature of the port.
649 * (ie, baud base, number and location of ports, etc)
651 * This list is ordered alphabetically by vendor then device.
652 * Specific entries must come before more generic entries.
654 static struct pci_serial_quirk pci_serial_quirks
[] = {
657 * It is not clear whether this applies to all products.
660 .vendor
= PCI_VENDOR_ID_AFAVLAB
,
661 .device
= PCI_ANY_ID
,
662 .subvendor
= PCI_ANY_ID
,
663 .subdevice
= PCI_ANY_ID
,
664 .setup
= afavlab_setup
,
670 .vendor
= PCI_VENDOR_ID_HP
,
671 .device
= PCI_DEVICE_ID_HP_DIVA
,
672 .subvendor
= PCI_ANY_ID
,
673 .subdevice
= PCI_ANY_ID
,
674 .init
= pci_hp_diva_init
,
675 .setup
= pci_hp_diva_setup
,
681 .vendor
= PCI_VENDOR_ID_INTEL
,
682 .device
= PCI_DEVICE_ID_INTEL_80960_RP
,
684 .subdevice
= PCI_ANY_ID
,
685 .init
= pci_inteli960ni_init
,
686 .setup
= pci_default_setup
,
692 .vendor
= PCI_VENDOR_ID_PANACOM
,
693 .device
= PCI_DEVICE_ID_PANACOM_QUADMODEM
,
694 .subvendor
= PCI_ANY_ID
,
695 .subdevice
= PCI_ANY_ID
,
696 .init
= pci_plx9050_init
,
697 .setup
= pci_default_setup
,
698 .exit
= __devexit_p(pci_plx9050_exit
),
701 .vendor
= PCI_VENDOR_ID_PANACOM
,
702 .device
= PCI_DEVICE_ID_PANACOM_DUALMODEM
,
703 .subvendor
= PCI_ANY_ID
,
704 .subdevice
= PCI_ANY_ID
,
705 .init
= pci_plx9050_init
,
706 .setup
= pci_default_setup
,
707 .exit
= __devexit_p(pci_plx9050_exit
),
713 .vendor
= PCI_VENDOR_ID_PLX
,
714 .device
= PCI_DEVICE_ID_PLX_9050
,
715 .subvendor
= PCI_SUBVENDOR_ID_KEYSPAN
,
716 .subdevice
= PCI_SUBDEVICE_ID_KEYSPAN_SX2
,
717 .init
= pci_plx9050_init
,
718 .setup
= pci_default_setup
,
719 .exit
= __devexit_p(pci_plx9050_exit
),
722 .vendor
= PCI_VENDOR_ID_PLX
,
723 .device
= PCI_DEVICE_ID_PLX_ROMULUS
,
724 .subvendor
= PCI_VENDOR_ID_PLX
,
725 .subdevice
= PCI_DEVICE_ID_PLX_ROMULUS
,
726 .init
= pci_plx9050_init
,
727 .setup
= pci_default_setup
,
728 .exit
= __devexit_p(pci_plx9050_exit
),
731 * SBS Technologies, Inc., PMC-OCTALPRO 232
734 .vendor
= PCI_VENDOR_ID_SBSMODULARIO
,
735 .device
= PCI_DEVICE_ID_OCTPRO
,
736 .subvendor
= PCI_SUBVENDOR_ID_SBSMODULARIO
,
737 .subdevice
= PCI_SUBDEVICE_ID_OCTPRO232
,
740 .exit
= __devexit_p(sbs_exit
),
743 * SBS Technologies, Inc., PMC-OCTALPRO 422
746 .vendor
= PCI_VENDOR_ID_SBSMODULARIO
,
747 .device
= PCI_DEVICE_ID_OCTPRO
,
748 .subvendor
= PCI_SUBVENDOR_ID_SBSMODULARIO
,
749 .subdevice
= PCI_SUBDEVICE_ID_OCTPRO422
,
752 .exit
= __devexit_p(sbs_exit
),
755 * SBS Technologies, Inc., P-Octal 232
758 .vendor
= PCI_VENDOR_ID_SBSMODULARIO
,
759 .device
= PCI_DEVICE_ID_OCTPRO
,
760 .subvendor
= PCI_SUBVENDOR_ID_SBSMODULARIO
,
761 .subdevice
= PCI_SUBDEVICE_ID_POCTAL232
,
764 .exit
= __devexit_p(sbs_exit
),
767 * SBS Technologies, Inc., P-Octal 422
770 .vendor
= PCI_VENDOR_ID_SBSMODULARIO
,
771 .device
= PCI_DEVICE_ID_OCTPRO
,
772 .subvendor
= PCI_SUBVENDOR_ID_SBSMODULARIO
,
773 .subdevice
= PCI_SUBDEVICE_ID_POCTAL422
,
776 .exit
= __devexit_p(sbs_exit
),
782 .vendor
= PCI_VENDOR_ID_SIIG
,
783 .device
= PCI_ANY_ID
,
784 .subvendor
= PCI_ANY_ID
,
785 .subdevice
= PCI_ANY_ID
,
786 .init
= pci_siig_init
,
787 .setup
= pci_default_setup
,
793 .vendor
= PCI_VENDOR_ID_TITAN
,
794 .device
= PCI_DEVICE_ID_TITAN_400L
,
795 .subvendor
= PCI_ANY_ID
,
796 .subdevice
= PCI_ANY_ID
,
797 .setup
= titan_400l_800l_setup
,
800 .vendor
= PCI_VENDOR_ID_TITAN
,
801 .device
= PCI_DEVICE_ID_TITAN_800L
,
802 .subvendor
= PCI_ANY_ID
,
803 .subdevice
= PCI_ANY_ID
,
804 .setup
= titan_400l_800l_setup
,
810 .vendor
= PCI_VENDOR_ID_TIMEDIA
,
811 .device
= PCI_DEVICE_ID_TIMEDIA_1889
,
812 .subvendor
= PCI_VENDOR_ID_TIMEDIA
,
813 .subdevice
= PCI_ANY_ID
,
814 .init
= pci_timedia_init
,
815 .setup
= pci_timedia_setup
,
818 .vendor
= PCI_VENDOR_ID_TIMEDIA
,
819 .device
= PCI_ANY_ID
,
820 .subvendor
= PCI_ANY_ID
,
821 .subdevice
= PCI_ANY_ID
,
822 .setup
= pci_timedia_setup
,
828 .vendor
= PCI_VENDOR_ID_XIRCOM
,
829 .device
= PCI_DEVICE_ID_XIRCOM_X3201_MDM
,
830 .subvendor
= PCI_ANY_ID
,
831 .subdevice
= PCI_ANY_ID
,
832 .init
= pci_xircom_init
,
833 .setup
= pci_default_setup
,
839 .vendor
= PCI_VENDOR_ID_NETMOS
,
840 .device
= PCI_ANY_ID
,
841 .subvendor
= PCI_ANY_ID
,
842 .subdevice
= PCI_ANY_ID
,
843 .init
= pci_netmos_init
,
844 .setup
= pci_default_setup
,
847 * Default "match everything" terminator entry
850 .vendor
= PCI_ANY_ID
,
851 .device
= PCI_ANY_ID
,
852 .subvendor
= PCI_ANY_ID
,
853 .subdevice
= PCI_ANY_ID
,
854 .setup
= pci_default_setup
,
858 static inline int quirk_id_matches(u32 quirk_id
, u32 dev_id
)
860 return quirk_id
== PCI_ANY_ID
|| quirk_id
== dev_id
;
863 static struct pci_serial_quirk
*find_quirk(struct pci_dev
*dev
)
865 struct pci_serial_quirk
*quirk
;
867 for (quirk
= pci_serial_quirks
; ; quirk
++)
868 if (quirk_id_matches(quirk
->vendor
, dev
->vendor
) &&
869 quirk_id_matches(quirk
->device
, dev
->device
) &&
870 quirk_id_matches(quirk
->subvendor
, dev
->subsystem_vendor
) &&
871 quirk_id_matches(quirk
->subdevice
, dev
->subsystem_device
))
877 get_pci_irq(struct pci_dev
*dev
, struct pciserial_board
*board
)
879 if (board
->flags
& FL_NOIRQ
)
886 * This is the configuration table for all of the PCI serial boards
887 * which we support. It is directly indexed by the pci_board_num_t enum
888 * value, which is encoded in the pci_device_id PCI probe table's
889 * driver_data member.
891 * The makeup of these names are:
894 * bn = PCI BAR number
895 * bt = Index using PCI BARs
896 * n = number of serial ports
899 * This table is sorted by (in order): baud, bt, bn, n.
901 * Please note: in theory if n = 1, _bt infix should make no difference.
902 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
904 enum pci_board_num_t
{
971 * Board-specific versions.
991 * uart_offset - the space between channels
992 * reg_shift - describes how the UART registers are mapped
993 * to PCI memory by the card.
994 * For example IER register on SBS, Inc. PMC-OctPro is located at
995 * offset 0x10 from the UART base, while UART_IER is defined as 1
996 * in include/linux/serial_reg.h,
997 * see first lines of serial_in() and serial_out() in 8250.c
1000 static struct pciserial_board pci_boards
[] __devinitdata
= {
1004 .base_baud
= 115200,
1007 [pbn_b0_1_115200
] = {
1010 .base_baud
= 115200,
1013 [pbn_b0_2_115200
] = {
1016 .base_baud
= 115200,
1019 [pbn_b0_4_115200
] = {
1022 .base_baud
= 115200,
1025 [pbn_b0_5_115200
] = {
1028 .base_baud
= 115200,
1032 [pbn_b0_1_921600
] = {
1035 .base_baud
= 921600,
1038 [pbn_b0_2_921600
] = {
1041 .base_baud
= 921600,
1044 [pbn_b0_4_921600
] = {
1047 .base_baud
= 921600,
1050 [pbn_b0_4_1152000
] = {
1053 .base_baud
= 1152000,
1057 [pbn_b0_bt_1_115200
] = {
1058 .flags
= FL_BASE0
|FL_BASE_BARS
,
1060 .base_baud
= 115200,
1063 [pbn_b0_bt_2_115200
] = {
1064 .flags
= FL_BASE0
|FL_BASE_BARS
,
1066 .base_baud
= 115200,
1069 [pbn_b0_bt_8_115200
] = {
1070 .flags
= FL_BASE0
|FL_BASE_BARS
,
1072 .base_baud
= 115200,
1076 [pbn_b0_bt_1_460800
] = {
1077 .flags
= FL_BASE0
|FL_BASE_BARS
,
1079 .base_baud
= 460800,
1082 [pbn_b0_bt_2_460800
] = {
1083 .flags
= FL_BASE0
|FL_BASE_BARS
,
1085 .base_baud
= 460800,
1088 [pbn_b0_bt_4_460800
] = {
1089 .flags
= FL_BASE0
|FL_BASE_BARS
,
1091 .base_baud
= 460800,
1095 [pbn_b0_bt_1_921600
] = {
1096 .flags
= FL_BASE0
|FL_BASE_BARS
,
1098 .base_baud
= 921600,
1101 [pbn_b0_bt_2_921600
] = {
1102 .flags
= FL_BASE0
|FL_BASE_BARS
,
1104 .base_baud
= 921600,
1107 [pbn_b0_bt_4_921600
] = {
1108 .flags
= FL_BASE0
|FL_BASE_BARS
,
1110 .base_baud
= 921600,
1113 [pbn_b0_bt_8_921600
] = {
1114 .flags
= FL_BASE0
|FL_BASE_BARS
,
1116 .base_baud
= 921600,
1120 [pbn_b1_1_115200
] = {
1123 .base_baud
= 115200,
1126 [pbn_b1_2_115200
] = {
1129 .base_baud
= 115200,
1132 [pbn_b1_4_115200
] = {
1135 .base_baud
= 115200,
1138 [pbn_b1_8_115200
] = {
1141 .base_baud
= 115200,
1145 [pbn_b1_1_921600
] = {
1148 .base_baud
= 921600,
1151 [pbn_b1_2_921600
] = {
1154 .base_baud
= 921600,
1157 [pbn_b1_4_921600
] = {
1160 .base_baud
= 921600,
1163 [pbn_b1_8_921600
] = {
1166 .base_baud
= 921600,
1170 [pbn_b1_bt_2_921600
] = {
1171 .flags
= FL_BASE1
|FL_BASE_BARS
,
1173 .base_baud
= 921600,
1177 [pbn_b1_1_1382400
] = {
1180 .base_baud
= 1382400,
1183 [pbn_b1_2_1382400
] = {
1186 .base_baud
= 1382400,
1189 [pbn_b1_4_1382400
] = {
1192 .base_baud
= 1382400,
1195 [pbn_b1_8_1382400
] = {
1198 .base_baud
= 1382400,
1202 [pbn_b2_1_115200
] = {
1205 .base_baud
= 115200,
1208 [pbn_b2_8_115200
] = {
1211 .base_baud
= 115200,
1215 [pbn_b2_1_460800
] = {
1218 .base_baud
= 460800,
1221 [pbn_b2_4_460800
] = {
1224 .base_baud
= 460800,
1227 [pbn_b2_8_460800
] = {
1230 .base_baud
= 460800,
1233 [pbn_b2_16_460800
] = {
1236 .base_baud
= 460800,
1240 [pbn_b2_1_921600
] = {
1243 .base_baud
= 921600,
1246 [pbn_b2_4_921600
] = {
1249 .base_baud
= 921600,
1252 [pbn_b2_8_921600
] = {
1255 .base_baud
= 921600,
1259 [pbn_b2_bt_1_115200
] = {
1260 .flags
= FL_BASE2
|FL_BASE_BARS
,
1262 .base_baud
= 115200,
1265 [pbn_b2_bt_2_115200
] = {
1266 .flags
= FL_BASE2
|FL_BASE_BARS
,
1268 .base_baud
= 115200,
1271 [pbn_b2_bt_4_115200
] = {
1272 .flags
= FL_BASE2
|FL_BASE_BARS
,
1274 .base_baud
= 115200,
1278 [pbn_b2_bt_2_921600
] = {
1279 .flags
= FL_BASE2
|FL_BASE_BARS
,
1281 .base_baud
= 921600,
1284 [pbn_b2_bt_4_921600
] = {
1285 .flags
= FL_BASE2
|FL_BASE_BARS
,
1287 .base_baud
= 921600,
1291 [pbn_b3_4_115200
] = {
1294 .base_baud
= 115200,
1297 [pbn_b3_8_115200
] = {
1300 .base_baud
= 115200,
1305 * Entries following this are board-specific.
1314 .base_baud
= 921600,
1315 .uart_offset
= 0x400,
1319 .flags
= FL_BASE2
|FL_BASE_BARS
,
1321 .base_baud
= 921600,
1322 .uart_offset
= 0x400,
1326 .flags
= FL_BASE2
|FL_BASE_BARS
,
1328 .base_baud
= 921600,
1329 .uart_offset
= 0x400,
1333 /* I think this entry is broken - the first_offset looks wrong --rmk */
1334 [pbn_plx_romulus
] = {
1337 .base_baud
= 921600,
1338 .uart_offset
= 8 << 2,
1340 .first_offset
= 0x03,
1344 * This board uses the size of PCI Base region 0 to
1345 * signal now many ports are available
1348 .flags
= FL_BASE0
|FL_REGION_SZ_CAP
,
1350 .base_baud
= 115200,
1355 * EKF addition for i960 Boards form EKF with serial port.
1358 [pbn_intel_i960
] = {
1361 .base_baud
= 921600,
1362 .uart_offset
= 8 << 2,
1364 .first_offset
= 0x10000,
1367 .flags
= FL_BASE0
|FL_NOIRQ
,
1369 .base_baud
= 458333,
1372 .first_offset
= 0x20178,
1376 * NEC Vrc-5074 (Nile 4) builtin UART.
1381 .base_baud
= 520833,
1382 .uart_offset
= 8 << 3,
1384 .first_offset
= 0x300,
1388 * Computone - uses IOMEM.
1390 [pbn_computone_4
] = {
1393 .base_baud
= 921600,
1394 .uart_offset
= 0x40,
1396 .first_offset
= 0x200,
1398 [pbn_computone_6
] = {
1401 .base_baud
= 921600,
1402 .uart_offset
= 0x40,
1404 .first_offset
= 0x200,
1406 [pbn_computone_8
] = {
1409 .base_baud
= 921600,
1410 .uart_offset
= 0x40,
1412 .first_offset
= 0x200,
1417 .base_baud
= 460800,
1422 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
1423 * Only basic 16550A support.
1424 * XR17C15[24] are not tested, but they should work.
1426 [pbn_exar_XR17C152
] = {
1429 .base_baud
= 921600,
1430 .uart_offset
= 0x200,
1432 [pbn_exar_XR17C154
] = {
1435 .base_baud
= 921600,
1436 .uart_offset
= 0x200,
1438 [pbn_exar_XR17C158
] = {
1441 .base_baud
= 921600,
1442 .uart_offset
= 0x200,
1447 * Given a complete unknown PCI device, try to use some heuristics to
1448 * guess what the configuration might be, based on the pitiful PCI
1449 * serial specs. Returns 0 on success, 1 on failure.
1451 static int __devinit
1452 serial_pci_guess_board(struct pci_dev
*dev
, struct pciserial_board
*board
)
1454 int num_iomem
, num_port
, first_port
= -1, i
;
1457 * If it is not a communications device or the programming
1458 * interface is greater than 6, give up.
1460 * (Should we try to make guesses for multiport serial devices
1463 if ((((dev
->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL
) &&
1464 ((dev
->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM
)) ||
1465 (dev
->class & 0xff) > 6)
1468 num_iomem
= num_port
= 0;
1469 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1470 if (pci_resource_flags(dev
, i
) & IORESOURCE_IO
) {
1472 if (first_port
== -1)
1475 if (pci_resource_flags(dev
, i
) & IORESOURCE_MEM
)
1480 * If there is 1 or 0 iomem regions, and exactly one port,
1481 * use it. We guess the number of ports based on the IO
1484 if (num_iomem
<= 1 && num_port
== 1) {
1485 board
->flags
= first_port
;
1486 board
->num_ports
= pci_resource_len(dev
, first_port
) / 8;
1491 * Now guess if we've got a board which indexes by BARs.
1492 * Each IO BAR should be 8 bytes, and they should follow
1497 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1498 if (pci_resource_flags(dev
, i
) & IORESOURCE_IO
&&
1499 pci_resource_len(dev
, i
) == 8 &&
1500 (first_port
== -1 || (first_port
+ num_port
) == i
)) {
1502 if (first_port
== -1)
1508 board
->flags
= first_port
| FL_BASE_BARS
;
1509 board
->num_ports
= num_port
;
1517 serial_pci_matches(struct pciserial_board
*board
,
1518 struct pciserial_board
*guessed
)
1521 board
->num_ports
== guessed
->num_ports
&&
1522 board
->base_baud
== guessed
->base_baud
&&
1523 board
->uart_offset
== guessed
->uart_offset
&&
1524 board
->reg_shift
== guessed
->reg_shift
&&
1525 board
->first_offset
== guessed
->first_offset
;
1529 * Probe one serial board. Unfortunately, there is no rhyme nor reason
1530 * to the arrangement of serial ports on a PCI card.
1532 static int __devinit
1533 pciserial_init_one(struct pci_dev
*dev
, const struct pci_device_id
*ent
)
1535 struct uart_port serial_port
;
1536 struct serial_private
*priv
;
1537 struct pciserial_board
*board
, tmp
;
1538 struct pci_serial_quirk
*quirk
;
1539 int rc
, nr_ports
, i
;
1541 if (ent
->driver_data
>= ARRAY_SIZE(pci_boards
)) {
1542 printk(KERN_ERR
"pci_init_one: invalid driver_data: %ld\n",
1547 board
= &pci_boards
[ent
->driver_data
];
1549 rc
= pci_enable_device(dev
);
1553 if (ent
->driver_data
== pbn_default
) {
1555 * Use a copy of the pci_board entry for this;
1556 * avoid changing entries in the table.
1558 memcpy(&tmp
, board
, sizeof(struct pciserial_board
));
1562 * We matched one of our class entries. Try to
1563 * determine the parameters of this board.
1565 rc
= serial_pci_guess_board(dev
, board
);
1570 * We matched an explicit entry. If we are able to
1571 * detect this boards settings with our heuristic,
1572 * then we no longer need this entry.
1574 memcpy(&tmp
, &pci_boards
[pbn_default
],
1575 sizeof(struct pciserial_board
));
1576 rc
= serial_pci_guess_board(dev
, &tmp
);
1577 if (rc
== 0 && serial_pci_matches(board
, &tmp
))
1578 moan_device("Redundant entry in serial pci_table.",
1582 nr_ports
= board
->num_ports
;
1585 * Find an init and setup quirks.
1587 quirk
= find_quirk(dev
);
1590 * Run the new-style initialization function.
1591 * The initialization function returns:
1593 * 0 - use board->num_ports
1594 * >0 - number of ports
1597 rc
= quirk
->init(dev
);
1604 priv
= kmalloc(sizeof(struct serial_private
) +
1605 sizeof(unsigned int) * nr_ports
,
1612 memset(priv
, 0, sizeof(struct serial_private
) +
1613 sizeof(unsigned int) * nr_ports
);
1615 priv
->quirk
= quirk
;
1616 pci_set_drvdata(dev
, priv
);
1618 memset(&serial_port
, 0, sizeof(struct uart_port
));
1619 serial_port
.flags
= UPF_SKIP_TEST
| UPF_BOOT_AUTOCONF
| UPF_SHARE_IRQ
;
1620 serial_port
.uartclk
= board
->base_baud
* 16;
1621 serial_port
.irq
= get_pci_irq(dev
, board
);
1622 serial_port
.dev
= &dev
->dev
;
1624 for (i
= 0; i
< nr_ports
; i
++) {
1625 if (quirk
->setup(dev
, board
, &serial_port
, i
))
1628 #ifdef SERIAL_DEBUG_PCI
1629 printk("Setup PCI port: port %x, irq %d, type %d\n",
1630 serial_port
.iobase
, serial_port
.irq
, serial_port
.iotype
);
1633 priv
->line
[i
] = serial8250_register_port(&serial_port
);
1634 if (priv
->line
[i
] < 0) {
1635 printk(KERN_WARNING
"Couldn't register serial port %s: %d\n", pci_name(dev
), priv
->line
[i
]);
1648 pci_disable_device(dev
);
1652 static void __devexit
pciserial_remove_one(struct pci_dev
*dev
)
1654 struct serial_private
*priv
= pci_get_drvdata(dev
);
1655 struct pci_serial_quirk
*quirk
;
1658 pci_set_drvdata(dev
, NULL
);
1660 for (i
= 0; i
< priv
->nr
; i
++)
1661 serial8250_unregister_port(priv
->line
[i
]);
1663 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1664 if (priv
->remapped_bar
[i
])
1665 iounmap(priv
->remapped_bar
[i
]);
1666 priv
->remapped_bar
[i
] = NULL
;
1670 * Find the exit quirks.
1672 quirk
= find_quirk(dev
);
1676 pci_disable_device(dev
);
1681 static int pciserial_suspend_one(struct pci_dev
*dev
, pm_message_t state
)
1683 struct serial_private
*priv
= pci_get_drvdata(dev
);
1688 for (i
= 0; i
< priv
->nr
; i
++)
1689 serial8250_suspend_port(priv
->line
[i
]);
1691 pci_save_state(dev
);
1692 pci_set_power_state(dev
, pci_choose_state(dev
, state
));
1696 static int pciserial_resume_one(struct pci_dev
*dev
)
1698 struct serial_private
*priv
= pci_get_drvdata(dev
);
1700 pci_set_power_state(dev
, PCI_D0
);
1701 pci_restore_state(dev
);
1707 * The device may have been disabled. Re-enable it.
1709 pci_enable_device(dev
);
1712 * Ensure that the board is correctly configured.
1714 if (priv
->quirk
->init
)
1715 priv
->quirk
->init(dev
);
1717 for (i
= 0; i
< priv
->nr
; i
++)
1718 serial8250_resume_port(priv
->line
[i
]);
1723 static struct pci_device_id serial_pci_tbl
[] = {
1724 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1725 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1726 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232
, 0, 0,
1728 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1729 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1730 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232
, 0, 0,
1732 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1733 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1734 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232
, 0, 0,
1736 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1737 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1738 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232
, 0, 0,
1740 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1741 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1742 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232
, 0, 0,
1744 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1745 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1746 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232
, 0, 0,
1748 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1749 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1750 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485
, 0, 0,
1752 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1753 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1754 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4
, 0, 0,
1756 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1757 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1758 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485
, 0, 0,
1760 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1761 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1762 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2
, 0, 0,
1764 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1765 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1766 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485
, 0, 0,
1768 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1769 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1770 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6
, 0, 0,
1772 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1773 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1774 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1
, 0, 0,
1776 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1777 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1778 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1
, 0, 0,
1781 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_U530
,
1782 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1783 pbn_b2_bt_1_115200
},
1784 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM2
,
1785 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1786 pbn_b2_bt_2_115200
},
1787 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM422
,
1788 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1789 pbn_b2_bt_4_115200
},
1790 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM232
,
1791 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1792 pbn_b2_bt_2_115200
},
1793 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_COMM4
,
1794 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1795 pbn_b2_bt_4_115200
},
1796 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_COMM8
,
1797 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1799 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM8
,
1800 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1803 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_GTEK_SERIAL2
,
1804 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1805 pbn_b2_bt_2_115200
},
1806 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_SPCOM200
,
1807 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1808 pbn_b2_bt_2_921600
},
1810 * VScom SPCOM800, from sl@s.pl
1812 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_SPCOM800
,
1813 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1815 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_1077
,
1816 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1818 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1819 PCI_SUBVENDOR_ID_KEYSPAN
,
1820 PCI_SUBDEVICE_ID_KEYSPAN_SX2
, 0, 0,
1822 { PCI_VENDOR_ID_PANACOM
, PCI_DEVICE_ID_PANACOM_QUADMODEM
,
1823 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1825 { PCI_VENDOR_ID_PANACOM
, PCI_DEVICE_ID_PANACOM_DUALMODEM
,
1826 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1828 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1829 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1830 PCI_SUBDEVICE_ID_CHASE_PCIFAST4
, 0, 0,
1832 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1833 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1834 PCI_SUBDEVICE_ID_CHASE_PCIFAST8
, 0, 0,
1836 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1837 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1838 PCI_SUBDEVICE_ID_CHASE_PCIFAST16
, 0, 0,
1840 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1841 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1842 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC
, 0, 0,
1844 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1845 PCI_SUBVENDOR_ID_CHASE_PCIRAS
,
1846 PCI_SUBDEVICE_ID_CHASE_PCIRAS4
, 0, 0,
1848 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1849 PCI_SUBVENDOR_ID_CHASE_PCIRAS
,
1850 PCI_SUBDEVICE_ID_CHASE_PCIRAS8
, 0, 0,
1853 * Megawolf Romulus PCI Serial Card, from Mike Hudson
1856 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_ROMULUS
,
1857 0x10b5, 0x106a, 0, 0,
1859 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_QSC100
,
1860 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1862 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_DSC100
,
1863 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1865 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_ESC100D
,
1866 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1868 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_ESC100M
,
1869 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1871 { PCI_VENDOR_ID_SPECIALIX
, PCI_DEVICE_ID_OXSEMI_16PCI954
,
1872 PCI_VENDOR_ID_SPECIALIX
, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4
, 0, 0,
1874 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI954
,
1875 PCI_SUBVENDOR_ID_SIIG
, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL
, 0, 0,
1877 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI954
,
1878 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1880 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI952
,
1881 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1882 pbn_b0_bt_2_921600
},
1885 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
1886 * from skokodyn@yahoo.com
1888 { PCI_VENDOR_ID_SBSMODULARIO
, PCI_DEVICE_ID_OCTPRO
,
1889 PCI_SUBVENDOR_ID_SBSMODULARIO
, PCI_SUBDEVICE_ID_OCTPRO232
, 0, 0,
1891 { PCI_VENDOR_ID_SBSMODULARIO
, PCI_DEVICE_ID_OCTPRO
,
1892 PCI_SUBVENDOR_ID_SBSMODULARIO
, PCI_SUBDEVICE_ID_OCTPRO422
, 0, 0,
1894 { PCI_VENDOR_ID_SBSMODULARIO
, PCI_DEVICE_ID_OCTPRO
,
1895 PCI_SUBVENDOR_ID_SBSMODULARIO
, PCI_SUBDEVICE_ID_POCTAL232
, 0, 0,
1897 { PCI_VENDOR_ID_SBSMODULARIO
, PCI_DEVICE_ID_OCTPRO
,
1898 PCI_SUBVENDOR_ID_SBSMODULARIO
, PCI_SUBDEVICE_ID_POCTAL422
, 0, 0,
1902 * Digitan DS560-558, from jimd@esoft.com
1904 { PCI_VENDOR_ID_ATT
, PCI_DEVICE_ID_ATT_VENUS_MODEM
,
1905 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1909 * Titan Electronic cards
1910 * The 400L and 800L have a custom setup quirk.
1912 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_100
,
1913 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1915 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_200
,
1916 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1918 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_400
,
1919 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1921 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_800B
,
1922 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1924 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_100L
,
1925 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1927 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_200L
,
1928 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1929 pbn_b1_bt_2_921600
},
1930 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_400L
,
1931 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1932 pbn_b0_bt_4_921600
},
1933 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_800L
,
1934 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1935 pbn_b0_bt_8_921600
},
1937 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_550
,
1938 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1940 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_650
,
1941 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1943 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_850
,
1944 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1946 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_550
,
1947 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1948 pbn_b2_bt_2_921600
},
1949 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_650
,
1950 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1951 pbn_b2_bt_2_921600
},
1952 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_850
,
1953 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1954 pbn_b2_bt_2_921600
},
1955 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_550
,
1956 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1957 pbn_b2_bt_4_921600
},
1958 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_650
,
1959 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1960 pbn_b2_bt_4_921600
},
1961 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_850
,
1962 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1963 pbn_b2_bt_4_921600
},
1964 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_550
,
1965 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1967 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_650
,
1968 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1970 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_850
,
1971 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1973 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_550
,
1974 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1975 pbn_b0_bt_2_921600
},
1976 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_650
,
1977 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1978 pbn_b0_bt_2_921600
},
1979 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_850
,
1980 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1981 pbn_b0_bt_2_921600
},
1982 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_550
,
1983 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1984 pbn_b0_bt_4_921600
},
1985 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_650
,
1986 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1987 pbn_b0_bt_4_921600
},
1988 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_850
,
1989 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1990 pbn_b0_bt_4_921600
},
1993 * Computone devices submitted by Doug McNash dmcnash@computone.com
1995 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
1996 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG4
,
1997 0, 0, pbn_computone_4
},
1998 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
1999 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG8
,
2000 0, 0, pbn_computone_8
},
2001 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
2002 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG6
,
2003 0, 0, pbn_computone_6
},
2005 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI95N
,
2006 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2008 { PCI_VENDOR_ID_TIMEDIA
, PCI_DEVICE_ID_TIMEDIA_1889
,
2009 PCI_VENDOR_ID_TIMEDIA
, PCI_ANY_ID
, 0, 0,
2010 pbn_b0_bt_1_921600
},
2013 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
2015 { PCI_VENDOR_ID_AFAVLAB
, PCI_DEVICE_ID_AFAVLAB_P028
,
2016 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2017 pbn_b0_bt_8_115200
},
2018 { PCI_VENDOR_ID_AFAVLAB
, PCI_DEVICE_ID_AFAVLAB_P030
,
2019 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2020 pbn_b0_bt_8_115200
},
2022 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_DSERIAL
,
2023 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2024 pbn_b0_bt_2_115200
},
2025 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUATRO_A
,
2026 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2027 pbn_b0_bt_2_115200
},
2028 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUATRO_B
,
2029 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2030 pbn_b0_bt_2_115200
},
2031 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_OCTO_A
,
2032 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2033 pbn_b0_bt_4_460800
},
2034 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_OCTO_B
,
2035 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2036 pbn_b0_bt_4_460800
},
2037 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_PORT_PLUS
,
2038 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2039 pbn_b0_bt_2_460800
},
2040 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUAD_A
,
2041 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2042 pbn_b0_bt_2_460800
},
2043 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUAD_B
,
2044 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2045 pbn_b0_bt_2_460800
},
2046 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_SSERIAL
,
2047 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2048 pbn_b0_bt_1_115200
},
2049 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_PORT_650
,
2050 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2051 pbn_b0_bt_1_460800
},
2054 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
2056 { PCI_VENDOR_ID_DELL
, PCI_DEVICE_ID_DELL_RAC4
,
2057 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2061 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
2063 { PCI_VENDOR_ID_DELL
, PCI_DEVICE_ID_DELL_RACIII
,
2064 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2068 * RAStel 2 port modem, gerg@moreton.com.au
2070 { PCI_VENDOR_ID_MORETON
, PCI_DEVICE_ID_RASTEL_2PORT
,
2071 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2072 pbn_b2_bt_2_115200
},
2075 * EKF addition for i960 Boards form EKF with serial port
2077 { PCI_VENDOR_ID_INTEL
, PCI_DEVICE_ID_INTEL_80960_RP
,
2078 0xE4BF, PCI_ANY_ID
, 0, 0,
2082 * Xircom Cardbus/Ethernet combos
2084 { PCI_VENDOR_ID_XIRCOM
, PCI_DEVICE_ID_XIRCOM_X3201_MDM
,
2085 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2088 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
2090 { PCI_VENDOR_ID_XIRCOM
, PCI_DEVICE_ID_XIRCOM_RBM56G
,
2091 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2095 * Untested PCI modems, sent in from various folks...
2099 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
2101 { PCI_VENDOR_ID_ROCKWELL
, 0x1004,
2102 0x1048, 0x1500, 0, 0,
2105 { PCI_VENDOR_ID_SGI
, PCI_DEVICE_ID_SGI_IOC3
,
2112 { PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA
,
2113 PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA_RMP3
, 0, 0,
2115 { PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA
,
2116 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2118 { PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA_AUX
,
2119 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2123 * NEC Vrc-5074 (Nile 4) builtin UART.
2125 { PCI_VENDOR_ID_NEC
, PCI_DEVICE_ID_NEC_NILE4
,
2126 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2129 { PCI_VENDOR_ID_DCI
, PCI_DEVICE_ID_DCI_PCCOM4
,
2130 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2132 { PCI_VENDOR_ID_DCI
, PCI_DEVICE_ID_DCI_PCCOM8
,
2133 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2137 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
2139 { PCI_VENDOR_ID_EXAR
, PCI_DEVICE_ID_EXAR_XR17C152
,
2140 PCI_ANY_ID
, PCI_ANY_ID
,
2142 0, pbn_exar_XR17C152
},
2143 { PCI_VENDOR_ID_EXAR
, PCI_DEVICE_ID_EXAR_XR17C154
,
2144 PCI_ANY_ID
, PCI_ANY_ID
,
2146 0, pbn_exar_XR17C154
},
2147 { PCI_VENDOR_ID_EXAR
, PCI_DEVICE_ID_EXAR_XR17C158
,
2148 PCI_ANY_ID
, PCI_ANY_ID
,
2150 0, pbn_exar_XR17C158
},
2153 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
2155 { PCI_VENDOR_ID_TOPIC
, PCI_DEVICE_ID_TOPIC_TP560
,
2156 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2160 * These entries match devices with class COMMUNICATION_SERIAL,
2161 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2163 { PCI_ANY_ID
, PCI_ANY_ID
,
2164 PCI_ANY_ID
, PCI_ANY_ID
,
2165 PCI_CLASS_COMMUNICATION_SERIAL
<< 8,
2166 0xffff00, pbn_default
},
2167 { PCI_ANY_ID
, PCI_ANY_ID
,
2168 PCI_ANY_ID
, PCI_ANY_ID
,
2169 PCI_CLASS_COMMUNICATION_MODEM
<< 8,
2170 0xffff00, pbn_default
},
2171 { PCI_ANY_ID
, PCI_ANY_ID
,
2172 PCI_ANY_ID
, PCI_ANY_ID
,
2173 PCI_CLASS_COMMUNICATION_MULTISERIAL
<< 8,
2174 0xffff00, pbn_default
},
2178 static struct pci_driver serial_pci_driver
= {
2180 .probe
= pciserial_init_one
,
2181 .remove
= __devexit_p(pciserial_remove_one
),
2182 .suspend
= pciserial_suspend_one
,
2183 .resume
= pciserial_resume_one
,
2184 .id_table
= serial_pci_tbl
,
2187 static int __init
serial8250_pci_init(void)
2189 return pci_register_driver(&serial_pci_driver
);
2192 static void __exit
serial8250_pci_exit(void)
2194 pci_unregister_driver(&serial_pci_driver
);
2197 module_init(serial8250_pci_init
);
2198 module_exit(serial8250_pci_exit
);
2200 MODULE_LICENSE("GPL");
2201 MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
2202 MODULE_DEVICE_TABLE(pci
, serial_pci_tbl
);