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/tty.h>
24 #include <linux/serial.h>
25 #include <linux/serial_core.h>
26 #include <linux/8250_pci.h>
28 #include <asm/bitops.h>
29 #include <asm/byteorder.h>
30 #include <asm/serial.h>
36 * Definitions for PCI support.
38 #define FL_BASE_MASK 0x0007
39 #define FL_BASE0 0x0000
40 #define FL_BASE1 0x0001
41 #define FL_BASE2 0x0002
42 #define FL_BASE3 0x0003
43 #define FL_BASE4 0x0004
44 #define FL_GET_BASE(x) (x & FL_BASE_MASK)
46 #define FL_IRQ_MASK (0x0007 << 4)
47 #define FL_IRQBASE0 (0x0000 << 4)
48 #define FL_IRQBASE1 (0x0001 << 4)
49 #define FL_IRQBASE2 (0x0002 << 4)
50 #define FL_IRQBASE3 (0x0003 << 4)
51 #define FL_IRQBASE4 (0x0004 << 4)
52 #define FL_GET_IRQBASE(x) ((x & FL_IRQ_MASK) >> 4)
54 /* Use successive BARs (PCI base address registers),
55 else use offset into some specified BAR */
56 #define FL_BASE_BARS 0x0008
58 /* Use the irq resource table instead of dev->irq */
59 #define FL_IRQRESOURCE 0x0080
61 /* Use the Base address register size to cap number of ports */
62 #define FL_REGION_SZ_CAP 0x0100
66 unsigned int num_ports
;
67 unsigned int base_baud
;
68 unsigned int uart_offset
;
69 unsigned int reg_shift
;
70 unsigned int first_offset
;
74 * init function returns:
75 * > 0 - number of ports
76 * = 0 - use board->num_ports
79 struct pci_serial_quirk
{
84 int (*init
)(struct pci_dev
*dev
);
85 int (*setup
)(struct pci_dev
*dev
, struct pci_board
*board
,
86 struct serial_struct
*req
, int idx
);
87 void (*exit
)(struct pci_dev
*dev
);
90 #define PCI_NUM_BAR_RESOURCES 6
92 struct serial_private
{
94 void *remapped_bar
[PCI_NUM_BAR_RESOURCES
];
95 struct pci_serial_quirk
*quirk
;
99 static void moan_device(const char *str
, struct pci_dev
*dev
)
101 printk(KERN_WARNING
"%s: %s\n"
102 KERN_WARNING
"Please send the output of lspci -vv, this\n"
103 KERN_WARNING
"message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
104 KERN_WARNING
"manufacturer and name of serial board or\n"
105 KERN_WARNING
"modem board to rmk+serial@arm.linux.org.uk.\n",
106 dev
->slot_name
, str
, dev
->vendor
, dev
->device
,
107 dev
->subsystem_vendor
, dev
->subsystem_device
);
111 setup_port(struct pci_dev
*dev
, struct serial_struct
*req
,
112 int bar
, int offset
, int regshift
)
114 struct serial_private
*priv
= pci_get_drvdata(dev
);
115 unsigned long port
, len
;
117 if (bar
>= PCI_NUM_BAR_RESOURCES
)
120 if (pci_resource_flags(dev
, bar
) & IORESOURCE_MEM
) {
121 port
= pci_resource_start(dev
, bar
);
122 len
= pci_resource_len(dev
, bar
);
124 if (!priv
->remapped_bar
[bar
])
125 priv
->remapped_bar
[bar
] = ioremap(port
, len
);
126 if (!priv
->remapped_bar
[bar
])
129 req
->io_type
= UPIO_MEM
;
130 req
->iomap_base
= port
+ offset
;
131 req
->iomem_base
= priv
->remapped_bar
[bar
] + offset
;
132 req
->iomem_reg_shift
= regshift
;
134 port
= pci_resource_start(dev
, bar
) + offset
;
135 req
->io_type
= UPIO_PORT
;
137 if (HIGH_BITS_OFFSET
)
138 req
->port_high
= port
>> HIGH_BITS_OFFSET
;
144 * AFAVLAB uses a different mixture of BARs and offsets
145 * Not that ugly ;) -- HW
148 afavlab_setup(struct pci_dev
*dev
, struct pci_board
*board
,
149 struct serial_struct
*req
, int idx
)
151 unsigned int bar
, offset
= board
->first_offset
;
153 bar
= FL_GET_BASE(board
->flags
);
157 offset
+= (idx
- 4) * board
->uart_offset
;
159 return setup_port(dev
, req
, bar
, offset
, board
->reg_shift
);
163 * HP's Remote Management Console. The Diva chip came in several
164 * different versions. N-class, L2000 and A500 have two Diva chips, each
165 * with 3 UARTs (the third UART on the second chip is unused). Superdome
166 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
167 * one Diva chip, but it has been expanded to 5 UARTs.
169 static int __devinit
pci_hp_diva_init(struct pci_dev
*dev
)
173 switch (dev
->subsystem_device
) {
174 case PCI_DEVICE_ID_HP_DIVA_TOSCA1
:
175 case PCI_DEVICE_ID_HP_DIVA_HALFDOME
:
176 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE
:
177 case PCI_DEVICE_ID_HP_DIVA_EVEREST
:
180 case PCI_DEVICE_ID_HP_DIVA_TOSCA2
:
183 case PCI_DEVICE_ID_HP_DIVA_MAESTRO
:
186 case PCI_DEVICE_ID_HP_DIVA_POWERBAR
:
195 * HP's Diva chip puts the 4th/5th serial port further out, and
196 * some serial ports are supposed to be hidden on certain models.
199 pci_hp_diva_setup(struct pci_dev
*dev
, struct pci_board
*board
,
200 struct serial_struct
*req
, int idx
)
202 unsigned int offset
= board
->first_offset
;
203 unsigned int bar
= FL_GET_BASE(board
->flags
);
205 switch (dev
->subsystem_device
) {
206 case PCI_DEVICE_ID_HP_DIVA_MAESTRO
:
210 case PCI_DEVICE_ID_HP_DIVA_EVEREST
:
220 offset
+= idx
* board
->uart_offset
;
222 return setup_port(dev
, req
, bar
, offset
, board
->reg_shift
);
226 * Added for EKF Intel i960 serial boards
228 static int __devinit
pci_inteli960ni_init(struct pci_dev
*dev
)
230 unsigned long oldval
;
232 if (!(dev
->subsystem_device
& 0x1000))
235 /* is firmware started? */
236 pci_read_config_dword(dev
, 0x44, (void*) &oldval
);
237 if (oldval
== 0x00001000L
) { /* RESET value */
238 printk(KERN_DEBUG
"Local i960 firmware missing");
245 * Some PCI serial cards using the PLX 9050 PCI interface chip require
246 * that the card interrupt be explicitly enabled or disabled. This
247 * seems to be mainly needed on card using the PLX which also use I/O
250 static int __devinit
pci_plx9050_init(struct pci_dev
*dev
)
254 if ((pci_resource_flags(dev
, 0) & IORESOURCE_MEM
) == 0) {
255 moan_device("no memory in bar 0", dev
);
260 if (dev
->vendor
== PCI_VENDOR_ID_PANACOM
)
262 if ((dev
->vendor
== PCI_VENDOR_ID_PLX
) &&
263 (dev
->device
== PCI_DEVICE_ID_PLX_ROMULUS
)) {
265 * As the megawolf cards have the int pins active
266 * high, and have 2 UART chips, both ints must be
267 * enabled on the 9050. Also, the UARTS are set in
268 * 16450 mode by default, so we have to enable the
269 * 16C950 'enhanced' mode so that we can use the
276 * enable/disable interrupts
278 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
281 writel(irq_config
, (unsigned long)p
+ 0x4c);
284 * Read the register back to ensure that it took effect.
286 readl((unsigned long)p
+ 0x4c);
292 static void __devexit
pci_plx9050_exit(struct pci_dev
*dev
)
296 if ((pci_resource_flags(dev
, 0) & IORESOURCE_MEM
) == 0)
302 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
307 * Read the register back to ensure that it took effect.
315 * SIIG serial cards have an PCI interface chip which also controls
316 * the UART clocking frequency. Each UART can be clocked independently
317 * (except cards equiped with 4 UARTs) and initial clocking settings
318 * are stored in the EEPROM chip. It can cause problems because this
319 * version of serial driver doesn't support differently clocked UART's
320 * on single PCI card. To prevent this, initialization functions set
321 * high frequency clocking for all UART's on given card. It is safe (I
322 * hope) because it doesn't touch EEPROM settings to prevent conflicts
323 * with other OSes (like M$ DOS).
325 * SIIG support added by Andrey Panin <pazke@mail.tp.ru>, 10/1999
327 * There is two family of SIIG serial cards with different PCI
328 * interface chip and different configuration methods:
329 * - 10x cards have control registers in IO and/or memory space;
330 * - 20x cards have control registers in standard PCI configuration space.
332 * Note: some SIIG cards are probed by the parport_serial object.
335 #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
336 #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
338 static int pci_siig10x_init(struct pci_dev
*dev
)
342 switch (dev
->device
& 0xfff8) {
343 case PCI_DEVICE_ID_SIIG_1S_10x
: /* 1S */
346 case PCI_DEVICE_ID_SIIG_2S_10x
: /* 2S, 2S1P */
349 default: /* 1S1P, 4S */
354 p
= ioremap(pci_resource_start(dev
, 0), 0x80);
358 writew(readw((unsigned long) p
+ 0x28) & data
, (unsigned long) p
+ 0x28);
359 readw((unsigned long)p
+ 0x28);
364 #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
365 #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
367 static int pci_siig20x_init(struct pci_dev
*dev
)
371 /* Change clock frequency for the first UART. */
372 pci_read_config_byte(dev
, 0x6f, &data
);
373 pci_write_config_byte(dev
, 0x6f, data
& 0xef);
375 /* If this card has 2 UART, we have to do the same with second UART. */
376 if (((dev
->device
& 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x
) ||
377 ((dev
->device
& 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x
)) {
378 pci_read_config_byte(dev
, 0x73, &data
);
379 pci_write_config_byte(dev
, 0x73, data
& 0xef);
384 int pci_siig10x_fn(struct pci_dev
*dev
, int enable
)
388 ret
= pci_siig10x_init(dev
);
392 int pci_siig20x_fn(struct pci_dev
*dev
, int enable
)
396 ret
= pci_siig20x_init(dev
);
400 EXPORT_SYMBOL(pci_siig10x_fn
);
401 EXPORT_SYMBOL(pci_siig20x_fn
);
404 * Timedia has an explosion of boards, and to avoid the PCI table from
405 * growing *huge*, we use this function to collapse some 70 entries
406 * in the PCI table into one, for sanity's and compactness's sake.
408 static unsigned short timedia_single_port
[] = {
409 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
412 static unsigned short timedia_dual_port
[] = {
413 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
414 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
415 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
416 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
420 static unsigned short timedia_quad_port
[] = {
421 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
422 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
423 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
427 static unsigned short timedia_eight_port
[] = {
428 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
429 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
432 static struct timedia_struct
{
436 { 1, timedia_single_port
},
437 { 2, timedia_dual_port
},
438 { 4, timedia_quad_port
},
439 { 8, timedia_eight_port
},
443 static int __devinit
pci_timedia_init(struct pci_dev
*dev
)
448 for (i
= 0; timedia_data
[i
].num
; i
++) {
449 ids
= timedia_data
[i
].ids
;
450 for (j
= 0; ids
[j
]; j
++)
451 if (dev
->subsystem_device
== ids
[j
])
452 return timedia_data
[i
].num
;
458 * Timedia/SUNIX uses a mixture of BARs and offsets
459 * Ugh, this is ugly as all hell --- TYT
462 pci_timedia_setup(struct pci_dev
*dev
, struct pci_board
*board
,
463 struct serial_struct
*req
, int idx
)
465 unsigned int bar
= 0, offset
= board
->first_offset
;
472 offset
= board
->uart_offset
;
479 offset
= board
->uart_offset
;
488 return setup_port(dev
, req
, bar
, offset
, board
->reg_shift
);
492 * Some Titan cards are also a little weird
495 titan_400l_800l_setup(struct pci_dev
*dev
, struct pci_board
*board
,
496 struct serial_struct
*req
, int idx
)
498 unsigned int bar
, offset
= board
->first_offset
;
509 offset
= (idx
- 2) * board
->uart_offset
;
512 return setup_port(dev
, req
, bar
, offset
, board
->reg_shift
);
515 static int __devinit
pci_xircom_init(struct pci_dev
*dev
)
517 __set_current_state(TASK_UNINTERRUPTIBLE
);
518 schedule_timeout(HZ
/10);
523 pci_default_setup(struct pci_dev
*dev
, struct pci_board
*board
,
524 struct serial_struct
*req
, int idx
)
526 unsigned int bar
, offset
= board
->first_offset
, maxnr
;
528 bar
= FL_GET_BASE(board
->flags
);
529 if (board
->flags
& FL_BASE_BARS
)
532 offset
+= idx
* board
->uart_offset
;
534 maxnr
= (pci_resource_len(dev
, bar
) - board
->uart_offset
) /
535 (8 << board
->reg_shift
);
537 if (board
->flags
& FL_REGION_SZ_CAP
&& idx
>= maxnr
)
540 return setup_port(dev
, req
, bar
, offset
, board
->reg_shift
);
544 * Master list of serial port init/setup/exit quirks.
545 * This does not describe the general nature of the port.
546 * (ie, baud base, number and location of ports, etc)
548 * This list is ordered alphabetically by vendor then device.
549 * Specific entries must come before more generic entries.
551 static struct pci_serial_quirk pci_serial_quirks
[] = {
554 * It is not clear whether this applies to all products.
557 .vendor
= PCI_VENDOR_ID_AFAVLAB
,
558 .device
= PCI_ANY_ID
,
559 .subvendor
= PCI_ANY_ID
,
560 .subdevice
= PCI_ANY_ID
,
561 .setup
= afavlab_setup
,
567 .vendor
= PCI_VENDOR_ID_HP
,
568 .device
= PCI_DEVICE_ID_HP_DIVA
,
569 .subvendor
= PCI_ANY_ID
,
570 .subdevice
= PCI_ANY_ID
,
571 .init
= pci_hp_diva_init
,
572 .setup
= pci_hp_diva_setup
,
578 .vendor
= PCI_VENDOR_ID_INTEL
,
579 .device
= PCI_DEVICE_ID_INTEL_80960_RP
,
581 .subdevice
= PCI_ANY_ID
,
582 .init
= pci_inteli960ni_init
,
583 .setup
= pci_default_setup
,
589 .vendor
= PCI_VENDOR_ID_PANACOM
,
590 .device
= PCI_DEVICE_ID_PANACOM_QUADMODEM
,
591 .subvendor
= PCI_ANY_ID
,
592 .subdevice
= PCI_ANY_ID
,
593 .init
= pci_plx9050_init
,
594 .setup
= pci_default_setup
,
595 .exit
= __devexit_p(pci_plx9050_exit
),
598 .vendor
= PCI_VENDOR_ID_PANACOM
,
599 .device
= PCI_DEVICE_ID_PANACOM_DUALMODEM
,
600 .subvendor
= PCI_ANY_ID
,
601 .subdevice
= PCI_ANY_ID
,
602 .init
= pci_plx9050_init
,
603 .setup
= pci_default_setup
,
604 .exit
= __devexit_p(pci_plx9050_exit
),
610 .vendor
= PCI_VENDOR_ID_PLX
,
611 .device
= PCI_DEVICE_ID_PLX_9050
,
612 .subvendor
= PCI_SUBVENDOR_ID_KEYSPAN
,
613 .subdevice
= PCI_SUBDEVICE_ID_KEYSPAN_SX2
,
614 .init
= pci_plx9050_init
,
615 .setup
= pci_default_setup
,
616 .exit
= __devexit_p(pci_plx9050_exit
),
619 .vendor
= PCI_VENDOR_ID_PLX
,
620 .device
= PCI_DEVICE_ID_PLX_ROMULUS
,
621 .subvendor
= PCI_VENDOR_ID_PLX
,
622 .subdevice
= PCI_DEVICE_ID_PLX_ROMULUS
,
623 .init
= pci_plx9050_init
,
624 .setup
= pci_default_setup
,
625 .exit
= __devexit_p(pci_plx9050_exit
),
629 * It is not clear whether these could be collapsed.
632 .vendor
= PCI_VENDOR_ID_SIIG
,
633 .device
= PCI_DEVICE_ID_SIIG_1S_10x_550
,
634 .subvendor
= PCI_ANY_ID
,
635 .subdevice
= PCI_ANY_ID
,
636 .init
= pci_siig10x_init
,
637 .setup
= pci_default_setup
,
640 .vendor
= PCI_VENDOR_ID_SIIG
,
641 .device
= PCI_DEVICE_ID_SIIG_1S_10x_650
,
642 .subvendor
= PCI_ANY_ID
,
643 .subdevice
= PCI_ANY_ID
,
644 .init
= pci_siig10x_init
,
645 .setup
= pci_default_setup
,
648 .vendor
= PCI_VENDOR_ID_SIIG
,
649 .device
= PCI_DEVICE_ID_SIIG_1S_10x_850
,
650 .subvendor
= PCI_ANY_ID
,
651 .subdevice
= PCI_ANY_ID
,
652 .init
= pci_siig10x_init
,
653 .setup
= pci_default_setup
,
656 .vendor
= PCI_VENDOR_ID_SIIG
,
657 .device
= PCI_DEVICE_ID_SIIG_2S_10x_550
,
658 .subvendor
= PCI_ANY_ID
,
659 .subdevice
= PCI_ANY_ID
,
660 .init
= pci_siig10x_init
,
661 .setup
= pci_default_setup
,
664 .vendor
= PCI_VENDOR_ID_SIIG
,
665 .device
= PCI_DEVICE_ID_SIIG_2S_10x_650
,
666 .subvendor
= PCI_ANY_ID
,
667 .subdevice
= PCI_ANY_ID
,
668 .init
= pci_siig10x_init
,
669 .setup
= pci_default_setup
,
672 .vendor
= PCI_VENDOR_ID_SIIG
,
673 .device
= PCI_DEVICE_ID_SIIG_2S_10x_850
,
674 .subvendor
= PCI_ANY_ID
,
675 .subdevice
= PCI_ANY_ID
,
676 .init
= pci_siig10x_init
,
677 .setup
= pci_default_setup
,
680 .vendor
= PCI_VENDOR_ID_SIIG
,
681 .device
= PCI_DEVICE_ID_SIIG_4S_10x_550
,
682 .subvendor
= PCI_ANY_ID
,
683 .subdevice
= PCI_ANY_ID
,
684 .init
= pci_siig10x_init
,
685 .setup
= pci_default_setup
,
688 .vendor
= PCI_VENDOR_ID_SIIG
,
689 .device
= PCI_DEVICE_ID_SIIG_4S_10x_650
,
690 .subvendor
= PCI_ANY_ID
,
691 .subdevice
= PCI_ANY_ID
,
692 .init
= pci_siig10x_init
,
693 .setup
= pci_default_setup
,
696 .vendor
= PCI_VENDOR_ID_SIIG
,
697 .device
= PCI_DEVICE_ID_SIIG_4S_10x_850
,
698 .subvendor
= PCI_ANY_ID
,
699 .subdevice
= PCI_ANY_ID
,
700 .init
= pci_siig10x_init
,
701 .setup
= pci_default_setup
,
704 .vendor
= PCI_VENDOR_ID_SIIG
,
705 .device
= PCI_DEVICE_ID_SIIG_1S_20x_550
,
706 .subvendor
= PCI_ANY_ID
,
707 .subdevice
= PCI_ANY_ID
,
708 .init
= pci_siig20x_init
,
709 .setup
= pci_default_setup
,
712 .vendor
= PCI_VENDOR_ID_SIIG
,
713 .device
= PCI_DEVICE_ID_SIIG_1S_20x_650
,
714 .subvendor
= PCI_ANY_ID
,
715 .subdevice
= PCI_ANY_ID
,
716 .init
= pci_siig20x_init
,
717 .setup
= pci_default_setup
,
720 .vendor
= PCI_VENDOR_ID_SIIG
,
721 .device
= PCI_DEVICE_ID_SIIG_1S_20x_850
,
722 .subvendor
= PCI_ANY_ID
,
723 .subdevice
= PCI_ANY_ID
,
724 .init
= pci_siig20x_init
,
725 .setup
= pci_default_setup
,
728 .vendor
= PCI_VENDOR_ID_SIIG
,
729 .device
= PCI_DEVICE_ID_SIIG_2S_20x_550
,
730 .subvendor
= PCI_ANY_ID
,
731 .subdevice
= PCI_ANY_ID
,
732 .init
= pci_siig20x_init
,
733 .setup
= pci_default_setup
,
735 { .vendor
= PCI_VENDOR_ID_SIIG
,
736 .device
= PCI_DEVICE_ID_SIIG_2S_20x_650
,
737 .subvendor
= PCI_ANY_ID
,
738 .subdevice
= PCI_ANY_ID
,
739 .init
= pci_siig20x_init
,
740 .setup
= pci_default_setup
,
743 .vendor
= PCI_VENDOR_ID_SIIG
,
744 .device
= PCI_DEVICE_ID_SIIG_2S_20x_850
,
745 .subvendor
= PCI_ANY_ID
,
746 .subdevice
= PCI_ANY_ID
,
747 .init
= pci_siig20x_init
,
748 .setup
= pci_default_setup
,
751 .vendor
= PCI_VENDOR_ID_SIIG
,
752 .device
= PCI_DEVICE_ID_SIIG_4S_20x_550
,
753 .subvendor
= PCI_ANY_ID
,
754 .subdevice
= PCI_ANY_ID
,
755 .init
= pci_siig20x_init
,
756 .setup
= pci_default_setup
,
759 .vendor
= PCI_VENDOR_ID_SIIG
,
760 .device
= PCI_DEVICE_ID_SIIG_4S_20x_650
,
761 .subvendor
= PCI_ANY_ID
,
762 .subdevice
= PCI_ANY_ID
,
763 .init
= pci_siig20x_init
,
764 .setup
= pci_default_setup
,
767 .vendor
= PCI_VENDOR_ID_SIIG
,
768 .device
= PCI_DEVICE_ID_SIIG_4S_20x_850
,
769 .subvendor
= PCI_ANY_ID
,
770 .subdevice
= PCI_ANY_ID
,
771 .init
= pci_siig20x_init
,
772 .setup
= pci_default_setup
,
778 .vendor
= PCI_VENDOR_ID_TITAN
,
779 .device
= PCI_DEVICE_ID_TITAN_400L
,
780 .subvendor
= PCI_ANY_ID
,
781 .subdevice
= PCI_ANY_ID
,
782 .setup
= titan_400l_800l_setup
,
785 .vendor
= PCI_VENDOR_ID_TITAN
,
786 .device
= PCI_DEVICE_ID_TITAN_800L
,
787 .subvendor
= PCI_ANY_ID
,
788 .subdevice
= PCI_ANY_ID
,
789 .setup
= titan_400l_800l_setup
,
795 .vendor
= PCI_VENDOR_ID_TIMEDIA
,
796 .device
= PCI_DEVICE_ID_TIMEDIA_1889
,
797 .subvendor
= PCI_VENDOR_ID_TIMEDIA
,
798 .subdevice
= PCI_ANY_ID
,
799 .init
= pci_timedia_init
,
800 .setup
= pci_timedia_setup
,
803 .vendor
= PCI_VENDOR_ID_TIMEDIA
,
804 .device
= PCI_ANY_ID
,
805 .subvendor
= PCI_ANY_ID
,
806 .subdevice
= PCI_ANY_ID
,
807 .setup
= pci_timedia_setup
,
813 .vendor
= PCI_VENDOR_ID_XIRCOM
,
814 .device
= PCI_DEVICE_ID_XIRCOM_X3201_MDM
,
815 .subvendor
= PCI_ANY_ID
,
816 .subdevice
= PCI_ANY_ID
,
817 .init
= pci_xircom_init
,
818 .setup
= pci_default_setup
,
821 * Default "match everything" terminator entry
824 .vendor
= PCI_ANY_ID
,
825 .device
= PCI_ANY_ID
,
826 .subvendor
= PCI_ANY_ID
,
827 .subdevice
= PCI_ANY_ID
,
828 .setup
= pci_default_setup
,
832 static inline int quirk_id_matches(u32 quirk_id
, u32 dev_id
)
834 return quirk_id
== PCI_ANY_ID
|| quirk_id
== dev_id
;
837 static struct pci_serial_quirk
*find_quirk(struct pci_dev
*dev
)
839 struct pci_serial_quirk
*quirk
;
841 for (quirk
= pci_serial_quirks
; ; quirk
++)
842 if (quirk_id_matches(quirk
->vendor
, dev
->vendor
) &&
843 quirk_id_matches(quirk
->device
, dev
->device
) &&
844 quirk_id_matches(quirk
->subvendor
, dev
->subsystem_vendor
) &&
845 quirk_id_matches(quirk
->subdevice
, dev
->subsystem_device
))
851 get_pci_irq(struct pci_dev
*dev
, struct pci_board
*board
, int idx
)
855 if ((board
->flags
& FL_IRQRESOURCE
) == 0)
858 base_idx
= FL_GET_IRQBASE(board
->flags
);
860 if (base_idx
> DEVICE_COUNT_IRQ
)
863 return dev
->irq_resource
[base_idx
].start
;
867 * This is the configuration table for all of the PCI serial boards
868 * which we support. It is directly indexed by the pci_board_num_t enum
869 * value, which is encoded in the pci_device_id PCI probe table's
870 * driver_data member.
872 * The makeup of these names are:
875 * bn = PCI BAR number
876 * bt = Index using PCI BARs
877 * n = number of serial ports
880 * Please note: in theory if n = 1, _bt infix should make no difference.
881 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
883 enum pci_board_num_t
{
947 * Board-specific versions.
962 static struct pci_board pci_boards
[] __devinitdata
= {
969 [pbn_b0_1_115200
] = {
975 [pbn_b0_2_115200
] = {
981 [pbn_b0_4_115200
] = {
987 [pbn_b0_5_115200
] = {
994 [pbn_b0_1_921600
] = {
1000 [pbn_b0_2_921600
] = {
1003 .base_baud
= 921600,
1006 [pbn_b0_4_921600
] = {
1009 .base_baud
= 921600,
1013 [pbn_b0_bt_1_115200
] = {
1014 .flags
= FL_BASE0
|FL_BASE_BARS
,
1016 .base_baud
= 115200,
1019 [pbn_b0_bt_2_115200
] = {
1020 .flags
= FL_BASE0
|FL_BASE_BARS
,
1022 .base_baud
= 115200,
1025 [pbn_b0_bt_8_115200
] = {
1026 .flags
= FL_BASE0
|FL_BASE_BARS
,
1028 .base_baud
= 115200,
1032 [pbn_b0_bt_1_460800
] = {
1033 .flags
= FL_BASE0
|FL_BASE_BARS
,
1035 .base_baud
= 460800,
1038 [pbn_b0_bt_2_460800
] = {
1039 .flags
= FL_BASE0
|FL_BASE_BARS
,
1041 .base_baud
= 460800,
1044 [pbn_b0_bt_4_460800
] = {
1045 .flags
= FL_BASE0
|FL_BASE_BARS
,
1047 .base_baud
= 460800,
1051 [pbn_b0_bt_1_921600
] = {
1052 .flags
= FL_BASE0
|FL_BASE_BARS
,
1054 .base_baud
= 921600,
1057 [pbn_b0_bt_2_921600
] = {
1058 .flags
= FL_BASE0
|FL_BASE_BARS
,
1060 .base_baud
= 921600,
1063 [pbn_b0_bt_4_921600
] = {
1064 .flags
= FL_BASE0
|FL_BASE_BARS
,
1066 .base_baud
= 921600,
1069 [pbn_b0_bt_8_921600
] = {
1070 .flags
= FL_BASE0
|FL_BASE_BARS
,
1072 .base_baud
= 921600,
1076 [pbn_b1_1_115200
] = {
1079 .base_baud
= 115200,
1082 [pbn_b1_2_115200
] = {
1085 .base_baud
= 115200,
1088 [pbn_b1_4_115200
] = {
1091 .base_baud
= 115200,
1094 [pbn_b1_8_115200
] = {
1097 .base_baud
= 115200,
1101 [pbn_b1_1_921600
] = {
1104 .base_baud
= 921600,
1107 [pbn_b1_2_921600
] = {
1110 .base_baud
= 921600,
1113 [pbn_b1_4_921600
] = {
1116 .base_baud
= 921600,
1119 [pbn_b1_8_921600
] = {
1122 .base_baud
= 921600,
1126 [pbn_b1_bt_2_921600
] = {
1127 .flags
= FL_BASE1
|FL_BASE_BARS
,
1129 .base_baud
= 921600,
1133 [pbn_b1_2_1382400
] = {
1136 .base_baud
= 1382400,
1139 [pbn_b1_4_1382400
] = {
1142 .base_baud
= 1382400,
1145 [pbn_b1_8_1382400
] = {
1148 .base_baud
= 1382400,
1152 [pbn_b2_1_115200
] = {
1155 .base_baud
= 115200,
1158 [pbn_b2_8_115200
] = {
1161 .base_baud
= 115200,
1165 [pbn_b2_1_460800
] = {
1168 .base_baud
= 460800,
1171 [pbn_b2_4_460800
] = {
1174 .base_baud
= 460800,
1177 [pbn_b2_8_460800
] = {
1180 .base_baud
= 460800,
1183 [pbn_b2_16_460800
] = {
1186 .base_baud
= 460800,
1190 [pbn_b2_1_921600
] = {
1193 .base_baud
= 921600,
1196 [pbn_b2_4_921600
] = {
1199 .base_baud
= 921600,
1202 [pbn_b2_8_921600
] = {
1205 .base_baud
= 921600,
1209 [pbn_b2_bt_1_115200
] = {
1210 .flags
= FL_BASE2
|FL_BASE_BARS
,
1212 .base_baud
= 115200,
1215 [pbn_b2_bt_2_115200
] = {
1216 .flags
= FL_BASE2
|FL_BASE_BARS
,
1218 .base_baud
= 115200,
1221 [pbn_b2_bt_4_115200
] = {
1222 .flags
= FL_BASE2
|FL_BASE_BARS
,
1224 .base_baud
= 115200,
1228 [pbn_b2_bt_2_921600
] = {
1229 .flags
= FL_BASE2
|FL_BASE_BARS
,
1231 .base_baud
= 921600,
1234 [pbn_b2_bt_4_921600
] = {
1235 .flags
= FL_BASE2
|FL_BASE_BARS
,
1237 .base_baud
= 921600,
1241 [pbn_b3_4_115200
] = {
1244 .base_baud
= 115200,
1247 [pbn_b3_8_115200
] = {
1250 .base_baud
= 115200,
1255 * Entries following this are board-specific.
1264 .base_baud
= 921600,
1265 .uart_offset
= 0x400,
1269 .flags
= FL_BASE2
|FL_BASE_BARS
,
1271 .base_baud
= 921600,
1272 .uart_offset
= 0x400,
1276 .flags
= FL_BASE2
|FL_BASE_BARS
,
1278 .base_baud
= 921600,
1279 .uart_offset
= 0x400,
1283 /* I think this entry is broken - the first_offset looks wrong --rmk */
1284 [pbn_plx_romulus
] = {
1287 .base_baud
= 921600,
1288 .uart_offset
= 8 << 2,
1290 .first_offset
= 0x03,
1294 * This board uses the size of PCI Base region 0 to
1295 * signal now many ports are available
1298 .flags
= FL_BASE0
|FL_REGION_SZ_CAP
,
1300 .base_baud
= 115200,
1305 * EKF addition for i960 Boards form EKF with serial port.
1308 [pbn_intel_i960
] = {
1311 .base_baud
= 921600,
1312 .uart_offset
= 8 << 2,
1314 .first_offset
= 0x10000,
1317 .flags
= FL_BASE0
|FL_IRQRESOURCE
,
1319 .base_baud
= 458333,
1322 .first_offset
= 0x20178,
1326 * NEC Vrc-5074 (Nile 4) builtin UART.
1331 .base_baud
= 520833,
1332 .uart_offset
= 8 << 3,
1334 .first_offset
= 0x300,
1338 * Computone - uses IOMEM.
1340 [pbn_computone_4
] = {
1343 .base_baud
= 921600,
1344 .uart_offset
= 0x40,
1346 .first_offset
= 0x200,
1348 [pbn_computone_6
] = {
1351 .base_baud
= 921600,
1352 .uart_offset
= 0x40,
1354 .first_offset
= 0x200,
1356 [pbn_computone_8
] = {
1359 .base_baud
= 921600,
1360 .uart_offset
= 0x40,
1362 .first_offset
= 0x200,
1367 * Given a complete unknown PCI device, try to use some heuristics to
1368 * guess what the configuration might be, based on the pitiful PCI
1369 * serial specs. Returns 0 on success, 1 on failure.
1371 static int __devinit
1372 serial_pci_guess_board(struct pci_dev
*dev
, struct pci_board
*board
)
1374 int num_iomem
, num_port
, first_port
= -1, i
;
1377 * If it is not a communications device or the programming
1378 * interface is greater than 6, give up.
1380 * (Should we try to make guesses for multiport serial devices
1383 if ((((dev
->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL
) &&
1384 ((dev
->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM
)) ||
1385 (dev
->class & 0xff) > 6)
1388 num_iomem
= num_port
= 0;
1389 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1390 if (pci_resource_flags(dev
, i
) & IORESOURCE_IO
) {
1392 if (first_port
== -1)
1395 if (pci_resource_flags(dev
, i
) & IORESOURCE_MEM
)
1400 * If there is 1 or 0 iomem regions, and exactly one port,
1401 * use it. We guess the number of ports based on the IO
1404 if (num_iomem
<= 1 && num_port
== 1) {
1405 board
->flags
= first_port
;
1406 board
->num_ports
= pci_resource_len(dev
, first_port
) / 8;
1411 * Now guess if we've got a board which indexes by BARs.
1412 * Each IO BAR should be 8 bytes, and they should follow
1417 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1418 if (pci_resource_flags(dev
, i
) & IORESOURCE_IO
&&
1419 pci_resource_len(dev
, i
) == 8 &&
1420 (first_port
== -1 || (first_port
+ num_port
) == i
)) {
1422 if (first_port
== -1)
1428 board
->flags
= first_port
| FL_BASE_BARS
;
1429 board
->num_ports
= num_port
;
1437 serial_pci_matches(struct pci_board
*board
, struct pci_board
*guessed
)
1440 board
->num_ports
== guessed
->num_ports
&&
1441 board
->base_baud
== guessed
->base_baud
&&
1442 board
->uart_offset
== guessed
->uart_offset
&&
1443 board
->reg_shift
== guessed
->reg_shift
&&
1444 board
->first_offset
== guessed
->first_offset
;
1448 * Probe one serial board. Unfortunately, there is no rhyme nor reason
1449 * to the arrangement of serial ports on a PCI card.
1451 static int __devinit
1452 pciserial_init_one(struct pci_dev
*dev
, const struct pci_device_id
*ent
)
1454 struct serial_private
*priv
;
1455 struct pci_board
*board
, tmp
;
1456 struct pci_serial_quirk
*quirk
;
1457 struct serial_struct serial_req
;
1458 int base_baud
, rc
, nr_ports
, i
;
1460 if (ent
->driver_data
>= ARRAY_SIZE(pci_boards
)) {
1461 printk(KERN_ERR
"pci_init_one: invalid driver_data: %ld\n",
1466 board
= &pci_boards
[ent
->driver_data
];
1468 rc
= pci_enable_device(dev
);
1472 if (ent
->driver_data
== pbn_default
) {
1474 * Use a copy of the pci_board entry for this;
1475 * avoid changing entries in the table.
1477 memcpy(&tmp
, board
, sizeof(struct pci_board
));
1481 * We matched one of our class entries. Try to
1482 * determine the parameters of this board.
1484 rc
= serial_pci_guess_board(dev
, board
);
1489 * We matched an explicit entry. If we are able to
1490 * detect this boards settings with our heuristic,
1491 * then we no longer need this entry.
1493 memcpy(&tmp
, &pci_boards
[pbn_default
], sizeof(struct pci_board
));
1494 rc
= serial_pci_guess_board(dev
, &tmp
);
1495 if (rc
== 0 && serial_pci_matches(board
, &tmp
))
1496 moan_device("Redundant entry in serial pci_table.",
1500 nr_ports
= board
->num_ports
;
1503 * Find an init and setup quirks.
1505 quirk
= find_quirk(dev
);
1508 * Run the new-style initialization function.
1509 * The initialization function returns:
1511 * 0 - use board->num_ports
1512 * >0 - number of ports
1515 rc
= quirk
->init(dev
);
1522 priv
= kmalloc(sizeof(struct serial_private
) +
1523 sizeof(unsigned int) * nr_ports
,
1530 memset(priv
, 0, sizeof(struct serial_private
) +
1531 sizeof(unsigned int) * nr_ports
);
1533 priv
->quirk
= quirk
;
1534 pci_set_drvdata(dev
, priv
);
1536 base_baud
= board
->base_baud
;
1538 moan_device("Board entry does not specify baud rate.", dev
);
1539 base_baud
= BASE_BAUD
;
1541 for (i
= 0; i
< nr_ports
; i
++) {
1542 memset(&serial_req
, 0, sizeof(serial_req
));
1543 serial_req
.flags
= UPF_SKIP_TEST
| UPF_AUTOPROBE
|
1544 UPF_RESOURCES
| UPF_SHARE_IRQ
;
1545 serial_req
.baud_base
= base_baud
;
1546 serial_req
.irq
= get_pci_irq(dev
, board
, i
);
1547 if (quirk
->setup(dev
, board
, &serial_req
, i
))
1549 #ifdef SERIAL_DEBUG_PCI
1550 printk("Setup PCI port: port %x, irq %d, type %d\n",
1551 serial_req
.port
, serial_req
.irq
, serial_req
.io_type
);
1554 priv
->line
[i
] = register_serial(&serial_req
);
1555 if (priv
->line
[i
] < 0)
1567 pci_disable_device(dev
);
1571 static void __devexit
pciserial_remove_one(struct pci_dev
*dev
)
1573 struct serial_private
*priv
= pci_get_drvdata(dev
);
1575 pci_set_drvdata(dev
, NULL
);
1578 struct pci_serial_quirk
*quirk
;
1581 for (i
= 0; i
< priv
->nr
; i
++)
1582 unregister_serial(priv
->line
[i
]);
1584 for (i
= 0; i
< PCI_NUM_BAR_RESOURCES
; i
++) {
1585 if (priv
->remapped_bar
[i
])
1586 iounmap(priv
->remapped_bar
[i
]);
1587 priv
->remapped_bar
[i
] = NULL
;
1591 * Find the exit quirks.
1593 quirk
= find_quirk(dev
);
1597 pci_disable_device(dev
);
1603 static int pciserial_save_state_one(struct pci_dev
*dev
, u32 state
)
1605 struct serial_private
*priv
= pci_get_drvdata(dev
);
1610 for (i
= 0; i
< priv
->nr
; i
++)
1611 serial8250_suspend_port(priv
->line
[i
], SUSPEND_SAVE_STATE
);
1616 static int pciserial_suspend_one(struct pci_dev
*dev
, u32 state
)
1618 struct serial_private
*priv
= pci_get_drvdata(dev
);
1623 for (i
= 0; i
< priv
->nr
; i
++)
1624 serial8250_suspend_port(priv
->line
[i
], SUSPEND_POWER_DOWN
);
1629 static int pciserial_resume_one(struct pci_dev
*dev
)
1631 struct serial_private
*priv
= pci_get_drvdata(dev
);
1637 * Ensure that the board is correctly configured.
1639 if (priv
->quirk
->init
)
1640 priv
->quirk
->init(dev
);
1642 for (i
= 0; i
< priv
->nr
; i
++) {
1643 serial8250_resume_port(priv
->line
[i
], RESUME_POWER_ON
);
1644 serial8250_resume_port(priv
->line
[i
], RESUME_RESTORE_STATE
);
1650 static struct pci_device_id serial_pci_tbl
[] __devinitdata
= {
1651 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1652 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1653 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232
, 0, 0,
1655 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1656 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1657 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232
, 0, 0,
1659 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V960
,
1660 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1661 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232
, 0, 0,
1663 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1664 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1665 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232
, 0, 0,
1667 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1668 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1669 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232
, 0, 0,
1671 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1672 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1673 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232
, 0, 0,
1675 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1676 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1677 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485
, 0, 0,
1679 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1680 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1681 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4
, 0, 0,
1683 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1684 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1685 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485
, 0, 0,
1687 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1688 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1689 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2
, 0, 0,
1691 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1692 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1693 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485
, 0, 0,
1695 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1696 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1697 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6
, 0, 0,
1699 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1700 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1701 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1
, 0, 0,
1703 { PCI_VENDOR_ID_V3
, PCI_DEVICE_ID_V3_V351
,
1704 PCI_SUBVENDOR_ID_CONNECT_TECH
,
1705 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1
, 0, 0,
1708 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_U530
,
1709 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1710 pbn_b2_bt_1_115200
},
1711 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM2
,
1712 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1713 pbn_b2_bt_2_115200
},
1714 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM422
,
1715 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1716 pbn_b2_bt_4_115200
},
1717 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_UCOMM232
,
1718 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1719 pbn_b2_bt_2_115200
},
1720 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_COMM4
,
1721 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1722 pbn_b2_bt_4_115200
},
1723 { PCI_VENDOR_ID_SEALEVEL
, PCI_DEVICE_ID_SEALEVEL_COMM8
,
1724 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1727 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_GTEK_SERIAL2
,
1728 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1729 pbn_b2_bt_2_115200
},
1730 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_SPCOM200
,
1731 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1732 pbn_b2_bt_2_921600
},
1734 * VScom SPCOM800, from sl@s.pl
1736 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_SPCOM800
,
1737 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1739 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_1077
,
1740 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1742 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1743 PCI_SUBVENDOR_ID_KEYSPAN
,
1744 PCI_SUBDEVICE_ID_KEYSPAN_SX2
, 0, 0,
1746 { PCI_VENDOR_ID_PANACOM
, PCI_DEVICE_ID_PANACOM_QUADMODEM
,
1747 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1749 { PCI_VENDOR_ID_PANACOM
, PCI_DEVICE_ID_PANACOM_DUALMODEM
,
1750 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1752 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1753 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1754 PCI_SUBDEVICE_ID_CHASE_PCIFAST4
, 0, 0,
1756 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1757 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1758 PCI_SUBDEVICE_ID_CHASE_PCIFAST8
, 0, 0,
1760 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1761 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1762 PCI_SUBDEVICE_ID_CHASE_PCIFAST16
, 0, 0,
1764 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1765 PCI_SUBVENDOR_ID_CHASE_PCIFAST
,
1766 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC
, 0, 0,
1768 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1769 PCI_SUBVENDOR_ID_CHASE_PCIRAS
,
1770 PCI_SUBDEVICE_ID_CHASE_PCIRAS4
, 0, 0,
1772 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_9050
,
1773 PCI_SUBVENDOR_ID_CHASE_PCIRAS
,
1774 PCI_SUBDEVICE_ID_CHASE_PCIRAS8
, 0, 0,
1777 * Megawolf Romulus PCI Serial Card, from Mike Hudson
1780 { PCI_VENDOR_ID_PLX
, PCI_DEVICE_ID_PLX_ROMULUS
,
1781 0x10b5, 0x106a, 0, 0,
1783 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_QSC100
,
1784 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1786 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_DSC100
,
1787 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1789 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_ESC100D
,
1790 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1792 { PCI_VENDOR_ID_QUATECH
, PCI_DEVICE_ID_QUATECH_ESC100M
,
1793 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1795 { PCI_VENDOR_ID_SPECIALIX
, PCI_DEVICE_ID_OXSEMI_16PCI954
,
1796 PCI_VENDOR_ID_SPECIALIX
, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4
, 0, 0,
1798 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI954
,
1799 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1801 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI952
,
1802 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1806 * Digitan DS560-558, from jimd@esoft.com
1808 { PCI_VENDOR_ID_ATT
, PCI_DEVICE_ID_ATT_VENUS_MODEM
,
1809 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1813 * Titan Electronic cards
1814 * The 400L and 800L have a custom setup quirk.
1816 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_100
,
1817 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1819 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_200
,
1820 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1822 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_400
,
1823 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1825 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_800B
,
1826 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1828 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_100L
,
1829 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1831 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_200L
,
1832 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1833 pbn_b1_bt_2_921600
},
1834 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_400L
,
1835 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1836 pbn_b0_bt_4_921600
},
1837 { PCI_VENDOR_ID_TITAN
, PCI_DEVICE_ID_TITAN_800L
,
1838 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1839 pbn_b0_bt_8_921600
},
1841 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_550
,
1842 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1844 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_650
,
1845 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1847 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_10x_850
,
1848 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1850 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_550
,
1851 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1852 pbn_b2_bt_2_921600
},
1853 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_650
,
1854 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1855 pbn_b2_bt_2_921600
},
1856 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_10x_850
,
1857 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1858 pbn_b2_bt_2_921600
},
1859 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_550
,
1860 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1861 pbn_b2_bt_4_921600
},
1862 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_650
,
1863 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1864 pbn_b2_bt_4_921600
},
1865 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_10x_850
,
1866 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1867 pbn_b2_bt_4_921600
},
1868 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_550
,
1869 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1871 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_650
,
1872 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1874 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_1S_20x_850
,
1875 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1877 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_550
,
1878 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1879 pbn_b0_bt_2_921600
},
1880 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_650
,
1881 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1882 pbn_b0_bt_2_921600
},
1883 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_2S_20x_850
,
1884 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1885 pbn_b0_bt_2_921600
},
1886 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_550
,
1887 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1888 pbn_b0_bt_4_921600
},
1889 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_650
,
1890 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1891 pbn_b0_bt_4_921600
},
1892 { PCI_VENDOR_ID_SIIG
, PCI_DEVICE_ID_SIIG_4S_20x_850
,
1893 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1894 pbn_b0_bt_4_921600
},
1897 * Computone devices submitted by Doug McNash dmcnash@computone.com
1899 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
1900 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG4
,
1901 0, 0, pbn_computone_4
},
1902 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
1903 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG8
,
1904 0, 0, pbn_computone_8
},
1905 { PCI_VENDOR_ID_COMPUTONE
, PCI_DEVICE_ID_COMPUTONE_PG
,
1906 PCI_SUBVENDOR_ID_COMPUTONE
, PCI_SUBDEVICE_ID_COMPUTONE_PG6
,
1907 0, 0, pbn_computone_6
},
1909 { PCI_VENDOR_ID_OXSEMI
, PCI_DEVICE_ID_OXSEMI_16PCI95N
,
1910 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1912 { PCI_VENDOR_ID_TIMEDIA
, PCI_DEVICE_ID_TIMEDIA_1889
,
1913 PCI_VENDOR_ID_TIMEDIA
, PCI_ANY_ID
, 0, 0,
1914 pbn_b0_bt_1_921600
},
1917 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
1919 { PCI_VENDOR_ID_AFAVLAB
, PCI_DEVICE_ID_AFAVLAB_P028
,
1920 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1921 pbn_b0_bt_8_115200
},
1923 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_DSERIAL
,
1924 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1925 pbn_b0_bt_2_115200
},
1926 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUATRO_A
,
1927 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1928 pbn_b0_bt_2_115200
},
1929 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUATRO_B
,
1930 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1931 pbn_b0_bt_2_115200
},
1932 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_OCTO_A
,
1933 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1934 pbn_b0_bt_4_460800
},
1935 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_OCTO_B
,
1936 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1937 pbn_b0_bt_4_460800
},
1938 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_PORT_PLUS
,
1939 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1940 pbn_b0_bt_2_460800
},
1941 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUAD_A
,
1942 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1943 pbn_b0_bt_2_460800
},
1944 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_QUAD_B
,
1945 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1946 pbn_b0_bt_2_460800
},
1947 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_SSERIAL
,
1948 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1949 pbn_b0_bt_1_115200
},
1950 { PCI_VENDOR_ID_LAVA
, PCI_DEVICE_ID_LAVA_PORT_650
,
1951 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1952 pbn_b0_bt_1_460800
},
1955 * RAStel 2 port modem, gerg@moreton.com.au
1957 { PCI_VENDOR_ID_MORETON
, PCI_DEVICE_ID_RASTEL_2PORT
,
1958 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1959 pbn_b2_bt_2_115200
},
1962 * EKF addition for i960 Boards form EKF with serial port
1964 { PCI_VENDOR_ID_INTEL
, PCI_DEVICE_ID_INTEL_80960_RP
,
1965 0xE4BF, PCI_ANY_ID
, 0, 0,
1969 * Xircom Cardbus/Ethernet combos
1971 { PCI_VENDOR_ID_XIRCOM
, PCI_DEVICE_ID_XIRCOM_X3201_MDM
,
1972 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1975 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
1977 { PCI_VENDOR_ID_XIRCOM
, PCI_DEVICE_ID_XIRCOM_RBM56G
,
1978 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
1982 * Untested PCI modems, sent in from various folks...
1986 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
1988 { PCI_VENDOR_ID_ROCKWELL
, 0x1004,
1989 0x1048, 0x1500, 0, 0,
1992 { PCI_VENDOR_ID_SGI
, PCI_DEVICE_ID_SGI_IOC3
,
1999 { PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA
,
2000 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2002 { PCI_VENDOR_ID_HP
, PCI_DEVICE_ID_HP_DIVA_AUX
,
2003 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2007 * NEC Vrc-5074 (Nile 4) builtin UART.
2009 { PCI_VENDOR_ID_NEC
, PCI_DEVICE_ID_NEC_NILE4
,
2010 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2013 { PCI_VENDOR_ID_DCI
, PCI_DEVICE_ID_DCI_PCCOM4
,
2014 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2016 { PCI_VENDOR_ID_DCI
, PCI_DEVICE_ID_DCI_PCCOM8
,
2017 PCI_ANY_ID
, PCI_ANY_ID
, 0, 0,
2021 * These entries match devices with class COMMUNICATION_SERIAL,
2022 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2024 { PCI_ANY_ID
, PCI_ANY_ID
,
2025 PCI_ANY_ID
, PCI_ANY_ID
,
2026 PCI_CLASS_COMMUNICATION_SERIAL
<< 8,
2027 0xffff00, pbn_default
},
2028 { PCI_ANY_ID
, PCI_ANY_ID
,
2029 PCI_ANY_ID
, PCI_ANY_ID
,
2030 PCI_CLASS_COMMUNICATION_MODEM
<< 8,
2031 0xffff00, pbn_default
},
2032 { PCI_ANY_ID
, PCI_ANY_ID
,
2033 PCI_ANY_ID
, PCI_ANY_ID
,
2034 PCI_CLASS_COMMUNICATION_MULTISERIAL
<< 8,
2035 0xffff00, pbn_default
},
2039 static struct pci_driver serial_pci_driver
= {
2041 .probe
= pciserial_init_one
,
2042 .remove
= __devexit_p(pciserial_remove_one
),
2043 .save_state
= pciserial_save_state_one
,
2044 .suspend
= pciserial_suspend_one
,
2045 .resume
= pciserial_resume_one
,
2046 .id_table
= serial_pci_tbl
,
2049 static int __init
serial8250_pci_init(void)
2051 return pci_module_init(&serial_pci_driver
);
2054 static void __exit
serial8250_pci_exit(void)
2056 pci_unregister_driver(&serial_pci_driver
);
2059 module_init(serial8250_pci_init
);
2060 module_exit(serial8250_pci_exit
);
2062 MODULE_LICENSE("GPL");
2063 MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
2064 MODULE_DEVICE_TABLE(pci
, serial_pci_tbl
);