blob: e1d4668f86ae0fd86a846d6e48e66c90d6bb2f22 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Probe module for 8250/16550-type PCI serial ports.
3 *
4 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
5 *
6 * Copyright (C) 2001 Russell King, All Rights Reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 */
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/pci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/string.h>
16#include <linux/kernel.h>
17#include <linux/slab.h>
18#include <linux/delay.h>
19#include <linux/tty.h>
20#include <linux/serial_core.h>
21#include <linux/8250_pci.h>
22#include <linux/bitops.h>
23
24#include <asm/byteorder.h>
25#include <asm/io.h>
26
27#include "8250.h"
28
29#undef SERIAL_DEBUG_PCI
30
31/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 * init function returns:
33 * > 0 - number of ports
34 * = 0 - use board->num_ports
35 * < 0 - error
36 */
37struct pci_serial_quirk {
38 u32 vendor;
39 u32 device;
40 u32 subvendor;
41 u32 subdevice;
Frédéric Brière5bf8f502011-05-29 15:08:03 -040042 int (*probe)(struct pci_dev *dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 int (*init)(struct pci_dev *dev);
Russell King975a1a7d2009-01-02 13:44:27 +000044 int (*setup)(struct serial_private *,
45 const struct pciserial_board *,
Russell King05caac52005-07-27 11:41:18 +010046 struct uart_port *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 void (*exit)(struct pci_dev *dev);
48};
49
50#define PCI_NUM_BAR_RESOURCES 6
51
52struct serial_private {
Russell King70db3d92005-07-27 11:34:27 +010053 struct pci_dev *dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 unsigned int nr;
55 void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
56 struct pci_serial_quirk *quirk;
57 int line[0];
58};
59
Nicos Gollan7808edc2011-05-05 21:00:37 +020060static int pci_default_setup(struct serial_private*,
61 const struct pciserial_board*, struct uart_port*, int);
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063static void moan_device(const char *str, struct pci_dev *dev)
64{
Joe Perchesad361c92009-07-06 13:05:40 -070065 printk(KERN_WARNING
66 "%s: %s\n"
67 "Please send the output of lspci -vv, this\n"
68 "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
69 "manufacturer and name of serial board or\n"
70 "modem board to rmk+serial@arm.linux.org.uk.\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 pci_name(dev), str, dev->vendor, dev->device,
72 dev->subsystem_vendor, dev->subsystem_device);
73}
74
75static int
Russell King70db3d92005-07-27 11:34:27 +010076setup_port(struct serial_private *priv, struct uart_port *port,
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 int bar, int offset, int regshift)
78{
Russell King70db3d92005-07-27 11:34:27 +010079 struct pci_dev *dev = priv->dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 unsigned long base, len;
81
82 if (bar >= PCI_NUM_BAR_RESOURCES)
83 return -EINVAL;
84
Russell King72ce9a82005-07-27 11:32:04 +010085 base = pci_resource_start(dev, bar);
86
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 len = pci_resource_len(dev, bar);
89
90 if (!priv->remapped_bar[bar])
Alan Cox6f441fe2008-05-01 04:34:59 -070091 priv->remapped_bar[bar] = ioremap_nocache(base, len);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 if (!priv->remapped_bar[bar])
93 return -ENOMEM;
94
95 port->iotype = UPIO_MEM;
Russell King72ce9a82005-07-27 11:32:04 +010096 port->iobase = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 port->mapbase = base + offset;
98 port->membase = priv->remapped_bar[bar] + offset;
99 port->regshift = regshift;
100 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 port->iotype = UPIO_PORT;
Russell King72ce9a82005-07-27 11:32:04 +0100102 port->iobase = base + offset;
103 port->mapbase = 0;
104 port->membase = NULL;
105 port->regshift = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 }
107 return 0;
108}
109
110/*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -0800111 * ADDI-DATA GmbH communication cards <info@addi-data.com>
112 */
113static int addidata_apci7800_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000114 const struct pciserial_board *board,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -0800115 struct uart_port *port, int idx)
116{
117 unsigned int bar = 0, offset = board->first_offset;
118 bar = FL_GET_BASE(board->flags);
119
120 if (idx < 2) {
121 offset += idx * board->uart_offset;
122 } else if ((idx >= 2) && (idx < 4)) {
123 bar += 1;
124 offset += ((idx - 2) * board->uart_offset);
125 } else if ((idx >= 4) && (idx < 6)) {
126 bar += 2;
127 offset += ((idx - 4) * board->uart_offset);
128 } else if (idx >= 6) {
129 bar += 3;
130 offset += ((idx - 6) * board->uart_offset);
131 }
132
133 return setup_port(priv, port, bar, offset, board->reg_shift);
134}
135
136/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 * AFAVLAB uses a different mixture of BARs and offsets
138 * Not that ugly ;) -- HW
139 */
140static int
Russell King975a1a7d2009-01-02 13:44:27 +0000141afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 struct uart_port *port, int idx)
143{
144 unsigned int bar, offset = board->first_offset;
Alan Cox5756ee92008-02-08 04:18:51 -0800145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 bar = FL_GET_BASE(board->flags);
147 if (idx < 4)
148 bar += idx;
149 else {
150 bar = 4;
151 offset += (idx - 4) * board->uart_offset;
152 }
153
Russell King70db3d92005-07-27 11:34:27 +0100154 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155}
156
157/*
158 * HP's Remote Management Console. The Diva chip came in several
159 * different versions. N-class, L2000 and A500 have two Diva chips, each
160 * with 3 UARTs (the third UART on the second chip is unused). Superdome
161 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
162 * one Diva chip, but it has been expanded to 5 UARTs.
163 */
Russell King61a116e2006-07-03 15:22:35 +0100164static int pci_hp_diva_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165{
166 int rc = 0;
167
168 switch (dev->subsystem_device) {
169 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
170 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
171 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
172 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
173 rc = 3;
174 break;
175 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
176 rc = 2;
177 break;
178 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
179 rc = 4;
180 break;
181 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
Justin Chen551f8f02005-10-24 22:16:38 +0100182 case PCI_DEVICE_ID_HP_DIVA_HURRICANE:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 rc = 1;
184 break;
185 }
186
187 return rc;
188}
189
190/*
191 * HP's Diva chip puts the 4th/5th serial port further out, and
192 * some serial ports are supposed to be hidden on certain models.
193 */
194static int
Russell King975a1a7d2009-01-02 13:44:27 +0000195pci_hp_diva_setup(struct serial_private *priv,
196 const struct pciserial_board *board,
197 struct uart_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198{
199 unsigned int offset = board->first_offset;
200 unsigned int bar = FL_GET_BASE(board->flags);
201
Russell King70db3d92005-07-27 11:34:27 +0100202 switch (priv->dev->subsystem_device) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
204 if (idx == 3)
205 idx++;
206 break;
207 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
208 if (idx > 0)
209 idx++;
210 if (idx > 2)
211 idx++;
212 break;
213 }
214 if (idx > 2)
215 offset = 0x18;
216
217 offset += idx * board->uart_offset;
218
Russell King70db3d92005-07-27 11:34:27 +0100219 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220}
221
222/*
223 * Added for EKF Intel i960 serial boards
224 */
Russell King61a116e2006-07-03 15:22:35 +0100225static int pci_inteli960ni_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226{
227 unsigned long oldval;
228
229 if (!(dev->subsystem_device & 0x1000))
230 return -ENODEV;
231
232 /* is firmware started? */
Alan Cox5756ee92008-02-08 04:18:51 -0800233 pci_read_config_dword(dev, 0x44, (void *)&oldval);
234 if (oldval == 0x00001000L) { /* RESET value */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 printk(KERN_DEBUG "Local i960 firmware missing");
236 return -ENODEV;
237 }
238 return 0;
239}
240
241/*
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
245 * mapped memory.
246 */
Russell King61a116e2006-07-03 15:22:35 +0100247static int pci_plx9050_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248{
249 u8 irq_config;
250 void __iomem *p;
251
252 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
253 moan_device("no memory in bar 0", dev);
254 return 0;
255 }
256
257 irq_config = 0x41;
Bjorn Helgaasadd7b582005-10-24 22:11:57 +0100258 if (dev->vendor == PCI_VENDOR_ID_PANACOM ||
Alan Cox5756ee92008-02-08 04:18:51 -0800259 dev->subsystem_vendor == PCI_SUBVENDOR_ID_EXSYS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260 irq_config = 0x43;
Alan Cox5756ee92008-02-08 04:18:51 -0800261
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
Alan Cox5756ee92008-02-08 04:18:51 -0800263 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 /*
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
270 * deep FIFOs
271 */
272 irq_config = 0x5b;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273 /*
274 * enable/disable interrupts
275 */
Alan Cox6f441fe2008-05-01 04:34:59 -0700276 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 if (p == NULL)
278 return -ENOMEM;
279 writel(irq_config, p + 0x4c);
280
281 /*
282 * Read the register back to ensure that it took effect.
283 */
284 readl(p + 0x4c);
285 iounmap(p);
286
287 return 0;
288}
289
290static void __devexit pci_plx9050_exit(struct pci_dev *dev)
291{
292 u8 __iomem *p;
293
294 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
295 return;
296
297 /*
298 * disable interrupts
299 */
Alan Cox6f441fe2008-05-01 04:34:59 -0700300 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700301 if (p != NULL) {
302 writel(0, p + 0x4c);
303
304 /*
305 * Read the register back to ensure that it took effect.
306 */
307 readl(p + 0x4c);
308 iounmap(p);
309 }
310}
311
Will Page04bf7e72009-04-06 17:32:15 +0100312#define NI8420_INT_ENABLE_REG 0x38
313#define NI8420_INT_ENABLE_BIT 0x2000
314
315static void __devexit pci_ni8420_exit(struct pci_dev *dev)
316{
317 void __iomem *p;
318 unsigned long base, len;
319 unsigned int bar = 0;
320
321 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
322 moan_device("no memory in bar", dev);
323 return;
324 }
325
326 base = pci_resource_start(dev, bar);
327 len = pci_resource_len(dev, bar);
328 p = ioremap_nocache(base, len);
329 if (p == NULL)
330 return;
331
332 /* Disable the CPU Interrupt */
333 writel(readl(p + NI8420_INT_ENABLE_REG) & ~(NI8420_INT_ENABLE_BIT),
334 p + NI8420_INT_ENABLE_REG);
335 iounmap(p);
336}
337
338
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100339/* MITE registers */
340#define MITE_IOWBSR1 0xc4
341#define MITE_IOWCR1 0xf4
342#define MITE_LCIMR1 0x08
343#define MITE_LCIMR2 0x10
344
345#define MITE_LCIMR2_CLR_CPU_IE (1 << 30)
346
347static void __devexit pci_ni8430_exit(struct pci_dev *dev)
348{
349 void __iomem *p;
350 unsigned long base, len;
351 unsigned int bar = 0;
352
353 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
354 moan_device("no memory in bar", dev);
355 return;
356 }
357
358 base = pci_resource_start(dev, bar);
359 len = pci_resource_len(dev, bar);
360 p = ioremap_nocache(base, len);
361 if (p == NULL)
362 return;
363
364 /* Disable the CPU Interrupt */
365 writel(MITE_LCIMR2_CLR_CPU_IE, p + MITE_LCIMR2);
366 iounmap(p);
367}
368
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
370static int
Russell King975a1a7d2009-01-02 13:44:27 +0000371sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 struct uart_port *port, int idx)
373{
374 unsigned int bar, offset = board->first_offset;
375
376 bar = 0;
377
378 if (idx < 4) {
379 /* first four channels map to 0, 0x100, 0x200, 0x300 */
380 offset += idx * board->uart_offset;
381 } else if (idx < 8) {
382 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
383 offset += idx * board->uart_offset + 0xC00;
384 } else /* we have only 8 ports on PMC-OCTALPRO */
385 return 1;
386
Russell King70db3d92005-07-27 11:34:27 +0100387 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388}
389
390/*
391* This does initialization for PMC OCTALPRO cards:
392* maps the device memory, resets the UARTs (needed, bc
393* if the module is removed and inserted again, the card
394* is in the sleep mode) and enables global interrupt.
395*/
396
397/* global control register offset for SBS PMC-OctalPro */
398#define OCT_REG_CR_OFF 0x500
399
Russell King61a116e2006-07-03 15:22:35 +0100400static int sbs_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401{
402 u8 __iomem *p;
403
Arjan van de Ven24ed3ab2009-06-24 18:34:58 +0100404 p = pci_ioremap_bar(dev, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405
406 if (p == NULL)
407 return -ENOMEM;
408 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
Alan Cox5756ee92008-02-08 04:18:51 -0800409 writeb(0x10, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 udelay(50);
Alan Cox5756ee92008-02-08 04:18:51 -0800411 writeb(0x0, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
413 /* Set bit-2 (INTENABLE) of Control Register */
414 writeb(0x4, p + OCT_REG_CR_OFF);
415 iounmap(p);
416
417 return 0;
418}
419
420/*
421 * Disables the global interrupt of PMC-OctalPro
422 */
423
424static void __devexit sbs_exit(struct pci_dev *dev)
425{
426 u8 __iomem *p;
427
Arjan van de Ven24ed3ab2009-06-24 18:34:58 +0100428 p = pci_ioremap_bar(dev, 0);
Alan Cox5756ee92008-02-08 04:18:51 -0800429 /* FIXME: What if resource_len < OCT_REG_CR_OFF */
430 if (p != NULL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 writeb(0, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 iounmap(p);
433}
434
435/*
436 * SIIG serial cards have an PCI interface chip which also controls
437 * the UART clocking frequency. Each UART can be clocked independently
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300438 * (except cards equipped with 4 UARTs) and initial clocking settings
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 * are stored in the EEPROM chip. It can cause problems because this
440 * version of serial driver doesn't support differently clocked UART's
441 * on single PCI card. To prevent this, initialization functions set
442 * high frequency clocking for all UART's on given card. It is safe (I
443 * hope) because it doesn't touch EEPROM settings to prevent conflicts
444 * with other OSes (like M$ DOS).
445 *
446 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
Alan Cox5756ee92008-02-08 04:18:51 -0800447 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 * There is two family of SIIG serial cards with different PCI
449 * interface chip and different configuration methods:
450 * - 10x cards have control registers in IO and/or memory space;
451 * - 20x cards have control registers in standard PCI configuration space.
452 *
Russell King67d74b82005-07-27 11:33:03 +0100453 * Note: all 10x cards have PCI device ids 0x10..
454 * all 20x cards have PCI device ids 0x20..
455 *
Andrey Paninfbc0dc02005-07-18 11:38:09 +0100456 * There are also Quartet Serial cards which use Oxford Semiconductor
457 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
458 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459 * Note: some SIIG cards are probed by the parport_serial object.
460 */
461
462#define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
463#define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
464
465static int pci_siig10x_init(struct pci_dev *dev)
466{
467 u16 data;
468 void __iomem *p;
469
470 switch (dev->device & 0xfff8) {
471 case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
472 data = 0xffdf;
473 break;
474 case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
475 data = 0xf7ff;
476 break;
477 default: /* 1S1P, 4S */
478 data = 0xfffb;
479 break;
480 }
481
Alan Cox6f441fe2008-05-01 04:34:59 -0700482 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 if (p == NULL)
484 return -ENOMEM;
485
486 writew(readw(p + 0x28) & data, p + 0x28);
487 readw(p + 0x28);
488 iounmap(p);
489 return 0;
490}
491
492#define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
493#define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
494
495static int pci_siig20x_init(struct pci_dev *dev)
496{
497 u8 data;
498
499 /* Change clock frequency for the first UART. */
500 pci_read_config_byte(dev, 0x6f, &data);
501 pci_write_config_byte(dev, 0x6f, data & 0xef);
502
503 /* If this card has 2 UART, we have to do the same with second UART. */
504 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
505 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
506 pci_read_config_byte(dev, 0x73, &data);
507 pci_write_config_byte(dev, 0x73, data & 0xef);
508 }
509 return 0;
510}
511
Russell King67d74b82005-07-27 11:33:03 +0100512static int pci_siig_init(struct pci_dev *dev)
513{
514 unsigned int type = dev->device & 0xff00;
515
516 if (type == 0x1000)
517 return pci_siig10x_init(dev);
518 else if (type == 0x2000)
519 return pci_siig20x_init(dev);
520
521 moan_device("Unknown SIIG card", dev);
522 return -ENODEV;
523}
524
Andrey Panin3ec9c592006-02-02 20:15:09 +0000525static int pci_siig_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000526 const struct pciserial_board *board,
Andrey Panin3ec9c592006-02-02 20:15:09 +0000527 struct uart_port *port, int idx)
528{
529 unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
530
531 if (idx > 3) {
532 bar = 4;
533 offset = (idx - 4) * 8;
534 }
535
536 return setup_port(priv, port, bar, offset, 0);
537}
538
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539/*
540 * Timedia has an explosion of boards, and to avoid the PCI table from
541 * growing *huge*, we use this function to collapse some 70 entries
542 * in the PCI table into one, for sanity's and compactness's sake.
543 */
Helge Dellere9422e02006-08-29 21:57:29 +0200544static const unsigned short timedia_single_port[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
546};
547
Helge Dellere9422e02006-08-29 21:57:29 +0200548static const unsigned short timedia_dual_port[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
Alan Cox5756ee92008-02-08 04:18:51 -0800550 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
551 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
553 0xD079, 0
554};
555
Helge Dellere9422e02006-08-29 21:57:29 +0200556static const unsigned short timedia_quad_port[] = {
Alan Cox5756ee92008-02-08 04:18:51 -0800557 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
558 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
560 0xB157, 0
561};
562
Helge Dellere9422e02006-08-29 21:57:29 +0200563static const unsigned short timedia_eight_port[] = {
Alan Cox5756ee92008-02-08 04:18:51 -0800564 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700565 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
566};
567
Arjan van de Vencb3592b2005-11-28 21:04:11 +0000568static const struct timedia_struct {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 int num;
Helge Dellere9422e02006-08-29 21:57:29 +0200570 const unsigned short *ids;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571} timedia_data[] = {
572 { 1, timedia_single_port },
573 { 2, timedia_dual_port },
574 { 4, timedia_quad_port },
Helge Dellere9422e02006-08-29 21:57:29 +0200575 { 8, timedia_eight_port }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576};
577
Frédéric Brièreb9b24552011-05-29 15:08:04 -0400578/*
579 * There are nearly 70 different Timedia/SUNIX PCI serial devices. Instead of
580 * listing them individually, this driver merely grabs them all with
581 * PCI_ANY_ID. Some of these devices, however, also feature a parallel port,
582 * and should be left free to be claimed by parport_serial instead.
583 */
584static int pci_timedia_probe(struct pci_dev *dev)
585{
586 /*
587 * Check the third digit of the subdevice ID
588 * (0,2,3,5,6: serial only -- 7,8,9: serial + parallel)
589 */
590 if ((dev->subsystem_device & 0x00f0) >= 0x70) {
591 dev_info(&dev->dev,
592 "ignoring Timedia subdevice %04x for parport_serial\n",
593 dev->subsystem_device);
594 return -ENODEV;
595 }
596
597 return 0;
598}
599
Russell King61a116e2006-07-03 15:22:35 +0100600static int pci_timedia_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601{
Helge Dellere9422e02006-08-29 21:57:29 +0200602 const unsigned short *ids;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 int i, j;
604
Helge Dellere9422e02006-08-29 21:57:29 +0200605 for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606 ids = timedia_data[i].ids;
607 for (j = 0; ids[j]; j++)
608 if (dev->subsystem_device == ids[j])
609 return timedia_data[i].num;
610 }
611 return 0;
612}
613
614/*
615 * Timedia/SUNIX uses a mixture of BARs and offsets
616 * Ugh, this is ugly as all hell --- TYT
617 */
618static int
Russell King975a1a7d2009-01-02 13:44:27 +0000619pci_timedia_setup(struct serial_private *priv,
620 const struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621 struct uart_port *port, int idx)
622{
623 unsigned int bar = 0, offset = board->first_offset;
624
625 switch (idx) {
626 case 0:
627 bar = 0;
628 break;
629 case 1:
630 offset = board->uart_offset;
631 bar = 0;
632 break;
633 case 2:
634 bar = 1;
635 break;
636 case 3:
637 offset = board->uart_offset;
Dave Jonesc2cd6d32005-12-07 18:11:26 +0000638 /* FALLTHROUGH */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 case 4: /* BAR 2 */
640 case 5: /* BAR 3 */
641 case 6: /* BAR 4 */
642 case 7: /* BAR 5 */
643 bar = idx - 2;
644 }
645
Russell King70db3d92005-07-27 11:34:27 +0100646 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647}
648
649/*
650 * Some Titan cards are also a little weird
651 */
652static int
Russell King70db3d92005-07-27 11:34:27 +0100653titan_400l_800l_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000654 const struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655 struct uart_port *port, int idx)
656{
657 unsigned int bar, offset = board->first_offset;
658
659 switch (idx) {
660 case 0:
661 bar = 1;
662 break;
663 case 1:
664 bar = 2;
665 break;
666 default:
667 bar = 4;
668 offset = (idx - 2) * board->uart_offset;
669 }
670
Russell King70db3d92005-07-27 11:34:27 +0100671 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700672}
673
Russell King61a116e2006-07-03 15:22:35 +0100674static int pci_xircom_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675{
676 msleep(100);
677 return 0;
678}
679
Will Page04bf7e72009-04-06 17:32:15 +0100680static int pci_ni8420_init(struct pci_dev *dev)
681{
682 void __iomem *p;
683 unsigned long base, len;
684 unsigned int bar = 0;
685
686 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
687 moan_device("no memory in bar", dev);
688 return 0;
689 }
690
691 base = pci_resource_start(dev, bar);
692 len = pci_resource_len(dev, bar);
693 p = ioremap_nocache(base, len);
694 if (p == NULL)
695 return -ENOMEM;
696
697 /* Enable CPU Interrupt */
698 writel(readl(p + NI8420_INT_ENABLE_REG) | NI8420_INT_ENABLE_BIT,
699 p + NI8420_INT_ENABLE_REG);
700
701 iounmap(p);
702 return 0;
703}
704
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100705#define MITE_IOWBSR1_WSIZE 0xa
706#define MITE_IOWBSR1_WIN_OFFSET 0x800
707#define MITE_IOWBSR1_WENAB (1 << 7)
708#define MITE_LCIMR1_IO_IE_0 (1 << 24)
709#define MITE_LCIMR2_SET_CPU_IE (1 << 31)
710#define MITE_IOWCR1_RAMSEL_MASK 0xfffffffe
711
712static int pci_ni8430_init(struct pci_dev *dev)
713{
714 void __iomem *p;
715 unsigned long base, len;
716 u32 device_window;
717 unsigned int bar = 0;
718
719 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
720 moan_device("no memory in bar", dev);
721 return 0;
722 }
723
724 base = pci_resource_start(dev, bar);
725 len = pci_resource_len(dev, bar);
726 p = ioremap_nocache(base, len);
727 if (p == NULL)
728 return -ENOMEM;
729
730 /* Set device window address and size in BAR0 */
731 device_window = ((base + MITE_IOWBSR1_WIN_OFFSET) & 0xffffff00)
732 | MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
733 writel(device_window, p + MITE_IOWBSR1);
734
735 /* Set window access to go to RAMSEL IO address space */
736 writel((readl(p + MITE_IOWCR1) & MITE_IOWCR1_RAMSEL_MASK),
737 p + MITE_IOWCR1);
738
739 /* Enable IO Bus Interrupt 0 */
740 writel(MITE_LCIMR1_IO_IE_0, p + MITE_LCIMR1);
741
742 /* Enable CPU Interrupt */
743 writel(MITE_LCIMR2_SET_CPU_IE, p + MITE_LCIMR2);
744
745 iounmap(p);
746 return 0;
747}
748
749/* UART Port Control Register */
750#define NI8430_PORTCON 0x0f
751#define NI8430_PORTCON_TXVR_ENABLE (1 << 3)
752
753static int
Alan Coxbf538fe2009-04-06 17:35:42 +0100754pci_ni8430_setup(struct serial_private *priv,
755 const struct pciserial_board *board,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100756 struct uart_port *port, int idx)
757{
758 void __iomem *p;
759 unsigned long base, len;
760 unsigned int bar, offset = board->first_offset;
761
762 if (idx >= board->num_ports)
763 return 1;
764
765 bar = FL_GET_BASE(board->flags);
766 offset += idx * board->uart_offset;
767
768 base = pci_resource_start(priv->dev, bar);
769 len = pci_resource_len(priv->dev, bar);
770 p = ioremap_nocache(base, len);
771
772 /* enable the transciever */
773 writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,
774 p + offset + NI8430_PORTCON);
775
776 iounmap(p);
777
778 return setup_port(priv, port, bar, offset, board->reg_shift);
779}
780
Nicos Gollan7808edc2011-05-05 21:00:37 +0200781static int pci_netmos_9900_setup(struct serial_private *priv,
782 const struct pciserial_board *board,
783 struct uart_port *port, int idx)
784{
785 unsigned int bar;
786
787 if ((priv->dev->subsystem_device & 0xff00) == 0x3000) {
788 /* netmos apparently orders BARs by datasheet layout, so serial
789 * ports get BARs 0 and 3 (or 1 and 4 for memmapped)
790 */
791 bar = 3 * idx;
792
793 return setup_port(priv, port, bar, 0, board->reg_shift);
794 } else {
795 return pci_default_setup(priv, board, port, idx);
796 }
797}
798
799/* the 99xx series comes with a range of device IDs and a variety
800 * of capabilities:
801 *
802 * 9900 has varying capabilities and can cascade to sub-controllers
803 * (cascading should be purely internal)
804 * 9904 is hardwired with 4 serial ports
805 * 9912 and 9922 are hardwired with 2 serial ports
806 */
807static int pci_netmos_9900_numports(struct pci_dev *dev)
808{
809 unsigned int c = dev->class;
810 unsigned int pi;
811 unsigned short sub_serports;
812
813 pi = (c & 0xff);
814
815 if (pi == 2) {
816 return 1;
817 } else if ((pi == 0) &&
818 (dev->device == PCI_DEVICE_ID_NETMOS_9900)) {
819 /* two possibilities: 0x30ps encodes number of parallel and
820 * serial ports, or 0x1000 indicates *something*. This is not
821 * immediately obvious, since the 2s1p+4s configuration seems
822 * to offer all functionality on functions 0..2, while still
823 * advertising the same function 3 as the 4s+2s1p config.
824 */
825 sub_serports = dev->subsystem_device & 0xf;
826 if (sub_serports > 0) {
827 return sub_serports;
828 } else {
829 printk(KERN_NOTICE "NetMos/Mostech serial driver ignoring port on ambiguous config.\n");
830 return 0;
831 }
832 }
833
834 moan_device("unknown NetMos/Mostech program interface", dev);
835 return 0;
836}
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100837
Russell King61a116e2006-07-03 15:22:35 +0100838static int pci_netmos_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839{
840 /* subdevice 0x00PS means <P> parallel, <S> serial */
841 unsigned int num_serial = dev->subsystem_device & 0xf;
842
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -0800843 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) ||
844 (dev->device == PCI_DEVICE_ID_NETMOS_9865))
Michael Bueschc4285b42009-06-30 11:41:21 -0700845 return 0;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200846
Jiri Slaby25cf9bc2009-01-15 13:30:34 +0000847 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
848 dev->subsystem_device == 0x0299)
849 return 0;
850
Nicos Gollan7808edc2011-05-05 21:00:37 +0200851 switch (dev->device) { /* FALLTHROUGH on all */
852 case PCI_DEVICE_ID_NETMOS_9904:
853 case PCI_DEVICE_ID_NETMOS_9912:
854 case PCI_DEVICE_ID_NETMOS_9922:
855 case PCI_DEVICE_ID_NETMOS_9900:
856 num_serial = pci_netmos_9900_numports(dev);
857 break;
858
859 default:
860 if (num_serial == 0 ) {
861 moan_device("unknown NetMos/Mostech device", dev);
862 }
863 }
864
Linus Torvalds1da177e2005-04-16 15:20:36 -0700865 if (num_serial == 0)
866 return -ENODEV;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200867
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868 return num_serial;
869}
870
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700871/*
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700872 * These chips are available with optionally one parallel port and up to
873 * two serial ports. Unfortunately they all have the same product id.
874 *
875 * Basic configuration is done over a region of 32 I/O ports. The base
876 * ioport is called INTA or INTC, depending on docs/other drivers.
877 *
878 * The region of the 32 I/O ports is configured in POSIO0R...
879 */
880
881/* registers */
882#define ITE_887x_MISCR 0x9c
883#define ITE_887x_INTCBAR 0x78
884#define ITE_887x_UARTBAR 0x7c
885#define ITE_887x_PS0BAR 0x10
886#define ITE_887x_POSIO0 0x60
887
888/* I/O space size */
889#define ITE_887x_IOSIZE 32
890/* I/O space size (bits 26-24; 8 bytes = 011b) */
891#define ITE_887x_POSIO_IOSIZE_8 (3 << 24)
892/* I/O space size (bits 26-24; 32 bytes = 101b) */
893#define ITE_887x_POSIO_IOSIZE_32 (5 << 24)
894/* Decoding speed (1 = slow, 2 = medium, 3 = fast) */
895#define ITE_887x_POSIO_SPEED (3 << 29)
896/* enable IO_Space bit */
897#define ITE_887x_POSIO_ENABLE (1 << 31)
898
Ralf Baechlef79abb82007-08-30 23:56:31 -0700899static int pci_ite887x_init(struct pci_dev *dev)
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700900{
901 /* inta_addr are the configuration addresses of the ITE */
902 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
903 0x200, 0x280, 0 };
904 int ret, i, type;
905 struct resource *iobase = NULL;
906 u32 miscr, uartbar, ioport;
907
908 /* search for the base-ioport */
909 i = 0;
910 while (inta_addr[i] && iobase == NULL) {
911 iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
912 "ite887x");
913 if (iobase != NULL) {
914 /* write POSIO0R - speed | size | ioport */
915 pci_write_config_dword(dev, ITE_887x_POSIO0,
916 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
917 ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
918 /* write INTCBAR - ioport */
Alan Cox5756ee92008-02-08 04:18:51 -0800919 pci_write_config_dword(dev, ITE_887x_INTCBAR,
920 inta_addr[i]);
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700921 ret = inb(inta_addr[i]);
922 if (ret != 0xff) {
923 /* ioport connected */
924 break;
925 }
926 release_region(iobase->start, ITE_887x_IOSIZE);
927 iobase = NULL;
928 }
929 i++;
930 }
931
932 if (!inta_addr[i]) {
933 printk(KERN_ERR "ite887x: could not find iobase\n");
934 return -ENODEV;
935 }
936
937 /* start of undocumented type checking (see parport_pc.c) */
938 type = inb(iobase->start + 0x18) & 0x0f;
939
940 switch (type) {
941 case 0x2: /* ITE8871 (1P) */
942 case 0xa: /* ITE8875 (1P) */
943 ret = 0;
944 break;
945 case 0xe: /* ITE8872 (2S1P) */
946 ret = 2;
947 break;
948 case 0x6: /* ITE8873 (1S) */
949 ret = 1;
950 break;
951 case 0x8: /* ITE8874 (2S) */
952 ret = 2;
953 break;
954 default:
955 moan_device("Unknown ITE887x", dev);
956 ret = -ENODEV;
957 }
958
959 /* configure all serial ports */
960 for (i = 0; i < ret; i++) {
961 /* read the I/O port from the device */
962 pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)),
963 &ioport);
964 ioport &= 0x0000FF00; /* the actual base address */
965 pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)),
966 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
967 ITE_887x_POSIO_IOSIZE_8 | ioport);
968
969 /* write the ioport to the UARTBAR */
970 pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar);
971 uartbar &= ~(0xffff << (16 * i)); /* clear half the reg */
972 uartbar |= (ioport << (16 * i)); /* set the ioport */
973 pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar);
974
975 /* get current config */
976 pci_read_config_dword(dev, ITE_887x_MISCR, &miscr);
977 /* disable interrupts (UARTx_Routing[3:0]) */
978 miscr &= ~(0xf << (12 - 4 * i));
979 /* activate the UART (UARTx_En) */
980 miscr |= 1 << (23 - i);
981 /* write new config with activated UART */
982 pci_write_config_dword(dev, ITE_887x_MISCR, miscr);
983 }
984
985 if (ret <= 0) {
986 /* the device has no UARTs if we get here */
987 release_region(iobase->start, ITE_887x_IOSIZE);
988 }
989
990 return ret;
991}
992
993static void __devexit pci_ite887x_exit(struct pci_dev *dev)
994{
995 u32 ioport;
996 /* the ioport is bit 0-15 in POSIO0R */
997 pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport);
998 ioport &= 0xffff;
999 release_region(ioport, ITE_887x_IOSIZE);
1000}
1001
Russell King9f2a0362009-01-02 13:44:20 +00001002/*
1003 * Oxford Semiconductor Inc.
1004 * Check that device is part of the Tornado range of devices, then determine
1005 * the number of ports available on the device.
1006 */
1007static int pci_oxsemi_tornado_init(struct pci_dev *dev)
1008{
1009 u8 __iomem *p;
1010 unsigned long deviceID;
1011 unsigned int number_uarts = 0;
1012
1013 /* OxSemi Tornado devices are all 0xCxxx */
1014 if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
1015 (dev->device & 0xF000) != 0xC000)
1016 return 0;
1017
1018 p = pci_iomap(dev, 0, 5);
1019 if (p == NULL)
1020 return -ENOMEM;
1021
1022 deviceID = ioread32(p);
1023 /* Tornado device */
1024 if (deviceID == 0x07000200) {
1025 number_uarts = ioread8(p + 4);
1026 printk(KERN_DEBUG
1027 "%d ports detected on Oxford PCI Express device\n",
1028 number_uarts);
1029 }
1030 pci_iounmap(dev, p);
1031 return number_uarts;
1032}
1033
Linus Torvalds1da177e2005-04-16 15:20:36 -07001034static int
Russell King975a1a7d2009-01-02 13:44:27 +00001035pci_default_setup(struct serial_private *priv,
1036 const struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001037 struct uart_port *port, int idx)
1038{
1039 unsigned int bar, offset = board->first_offset, maxnr;
1040
1041 bar = FL_GET_BASE(board->flags);
1042 if (board->flags & FL_BASE_BARS)
1043 bar += idx;
1044 else
1045 offset += idx * board->uart_offset;
1046
Greg Kroah-Hartman2427ddd2006-06-12 17:07:52 -07001047 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1048 (board->reg_shift + 3);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001049
1050 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1051 return 1;
Alan Cox5756ee92008-02-08 04:18:51 -08001052
Russell King70db3d92005-07-27 11:34:27 +01001053 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001054}
1055
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001056static int
1057ce4100_serial_setup(struct serial_private *priv,
1058 const struct pciserial_board *board,
1059 struct uart_port *port, int idx)
1060{
1061 int ret;
1062
1063 ret = setup_port(priv, port, 0, 0, board->reg_shift);
1064 port->iotype = UPIO_MEM32;
1065 port->type = PORT_XSCALE;
1066 port->flags = (port->flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1067 port->regshift = 2;
1068
1069 return ret;
1070}
1071
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001072static int
1073pci_omegapci_setup(struct serial_private *priv,
1074 struct pciserial_board *board,
1075 struct uart_port *port, int idx)
1076{
1077 return setup_port(priv, port, 2, idx * 8, 0);
1078}
1079
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001080static int skip_tx_en_setup(struct serial_private *priv,
1081 const struct pciserial_board *board,
1082 struct uart_port *port, int idx)
1083{
1084 port->flags |= UPF_NO_TXEN_TEST;
1085 printk(KERN_DEBUG "serial8250: skipping TxEn test for device "
1086 "[%04x:%04x] subsystem [%04x:%04x]\n",
1087 priv->dev->vendor,
1088 priv->dev->device,
1089 priv->dev->subsystem_vendor,
1090 priv->dev->subsystem_device);
1091
1092 return pci_default_setup(priv, board, port, idx);
1093}
1094
Linus Torvalds1da177e2005-04-16 15:20:36 -07001095/* This should be in linux/pci_ids.h */
1096#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1097#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1098#define PCI_DEVICE_ID_OCTPRO 0x0001
1099#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
1100#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1101#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1102#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
Michael Bramer78d70d42009-01-27 11:51:16 +00001103#define PCI_VENDOR_ID_ADVANTECH 0x13fe
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001104#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66
Michael Bramer78d70d42009-01-27 11:51:16 +00001105#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
Yegor Yefremov66169ad2010-06-04 09:58:18 +02001106#define PCI_DEVICE_ID_TITAN_200I 0x8028
1107#define PCI_DEVICE_ID_TITAN_400I 0x8048
1108#define PCI_DEVICE_ID_TITAN_800I 0x8088
1109#define PCI_DEVICE_ID_TITAN_800EH 0xA007
1110#define PCI_DEVICE_ID_TITAN_800EHB 0xA008
1111#define PCI_DEVICE_ID_TITAN_400EH 0xA009
1112#define PCI_DEVICE_ID_TITAN_100E 0xA010
1113#define PCI_DEVICE_ID_TITAN_200E 0xA012
1114#define PCI_DEVICE_ID_TITAN_400E 0xA013
1115#define PCI_DEVICE_ID_TITAN_800E 0xA014
1116#define PCI_DEVICE_ID_TITAN_200EI 0xA016
1117#define PCI_DEVICE_ID_TITAN_200EISI 0xA017
Lytochkin Borise8470032010-07-26 10:02:26 +04001118#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
Scott Kilauaa273ae2011-05-11 15:41:59 -05001119#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001120#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
Linus Torvalds1da177e2005-04-16 15:20:36 -07001121
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001122/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1123#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
1124
Linus Torvalds1da177e2005-04-16 15:20:36 -07001125/*
1126 * Master list of serial port init/setup/exit quirks.
1127 * This does not describe the general nature of the port.
1128 * (ie, baud base, number and location of ports, etc)
1129 *
1130 * This list is ordered alphabetically by vendor then device.
1131 * Specific entries must come before more generic entries.
1132 */
Sam Ravnborg7a63ce52008-04-28 02:14:02 -07001133static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001134 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001135 * ADDI-DATA GmbH communication cards <info@addi-data.com>
1136 */
1137 {
1138 .vendor = PCI_VENDOR_ID_ADDIDATA_OLD,
1139 .device = PCI_DEVICE_ID_ADDIDATA_APCI7800,
1140 .subvendor = PCI_ANY_ID,
1141 .subdevice = PCI_ANY_ID,
1142 .setup = addidata_apci7800_setup,
1143 },
1144 /*
Russell King61a116e2006-07-03 15:22:35 +01001145 * AFAVLAB cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001146 * It is not clear whether this applies to all products.
1147 */
1148 {
1149 .vendor = PCI_VENDOR_ID_AFAVLAB,
1150 .device = PCI_ANY_ID,
1151 .subvendor = PCI_ANY_ID,
1152 .subdevice = PCI_ANY_ID,
1153 .setup = afavlab_setup,
1154 },
1155 /*
1156 * HP Diva
1157 */
1158 {
1159 .vendor = PCI_VENDOR_ID_HP,
1160 .device = PCI_DEVICE_ID_HP_DIVA,
1161 .subvendor = PCI_ANY_ID,
1162 .subdevice = PCI_ANY_ID,
1163 .init = pci_hp_diva_init,
1164 .setup = pci_hp_diva_setup,
1165 },
1166 /*
1167 * Intel
1168 */
1169 {
1170 .vendor = PCI_VENDOR_ID_INTEL,
1171 .device = PCI_DEVICE_ID_INTEL_80960_RP,
1172 .subvendor = 0xe4bf,
1173 .subdevice = PCI_ANY_ID,
1174 .init = pci_inteli960ni_init,
1175 .setup = pci_default_setup,
1176 },
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001177 {
1178 .vendor = PCI_VENDOR_ID_INTEL,
1179 .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
1180 .subvendor = PCI_ANY_ID,
1181 .subdevice = PCI_ANY_ID,
1182 .setup = skip_tx_en_setup,
1183 },
1184 {
1185 .vendor = PCI_VENDOR_ID_INTEL,
1186 .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
1187 .subvendor = PCI_ANY_ID,
1188 .subdevice = PCI_ANY_ID,
1189 .setup = skip_tx_en_setup,
1190 },
1191 {
1192 .vendor = PCI_VENDOR_ID_INTEL,
1193 .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
1194 .subvendor = PCI_ANY_ID,
1195 .subdevice = PCI_ANY_ID,
1196 .setup = skip_tx_en_setup,
1197 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001198 {
1199 .vendor = PCI_VENDOR_ID_INTEL,
1200 .device = PCI_DEVICE_ID_INTEL_CE4100_UART,
1201 .subvendor = PCI_ANY_ID,
1202 .subdevice = PCI_ANY_ID,
1203 .setup = ce4100_serial_setup,
1204 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001205 /*
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001206 * ITE
1207 */
1208 {
1209 .vendor = PCI_VENDOR_ID_ITE,
1210 .device = PCI_DEVICE_ID_ITE_8872,
1211 .subvendor = PCI_ANY_ID,
1212 .subdevice = PCI_ANY_ID,
1213 .init = pci_ite887x_init,
1214 .setup = pci_default_setup,
1215 .exit = __devexit_p(pci_ite887x_exit),
1216 },
1217 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001218 * National Instruments
1219 */
1220 {
1221 .vendor = PCI_VENDOR_ID_NI,
Will Page04bf7e72009-04-06 17:32:15 +01001222 .device = PCI_DEVICE_ID_NI_PCI23216,
1223 .subvendor = PCI_ANY_ID,
1224 .subdevice = PCI_ANY_ID,
1225 .init = pci_ni8420_init,
1226 .setup = pci_default_setup,
1227 .exit = __devexit_p(pci_ni8420_exit),
1228 },
1229 {
1230 .vendor = PCI_VENDOR_ID_NI,
1231 .device = PCI_DEVICE_ID_NI_PCI2328,
1232 .subvendor = PCI_ANY_ID,
1233 .subdevice = PCI_ANY_ID,
1234 .init = pci_ni8420_init,
1235 .setup = pci_default_setup,
1236 .exit = __devexit_p(pci_ni8420_exit),
1237 },
1238 {
1239 .vendor = PCI_VENDOR_ID_NI,
1240 .device = PCI_DEVICE_ID_NI_PCI2324,
1241 .subvendor = PCI_ANY_ID,
1242 .subdevice = PCI_ANY_ID,
1243 .init = pci_ni8420_init,
1244 .setup = pci_default_setup,
1245 .exit = __devexit_p(pci_ni8420_exit),
1246 },
1247 {
1248 .vendor = PCI_VENDOR_ID_NI,
1249 .device = PCI_DEVICE_ID_NI_PCI2322,
1250 .subvendor = PCI_ANY_ID,
1251 .subdevice = PCI_ANY_ID,
1252 .init = pci_ni8420_init,
1253 .setup = pci_default_setup,
1254 .exit = __devexit_p(pci_ni8420_exit),
1255 },
1256 {
1257 .vendor = PCI_VENDOR_ID_NI,
1258 .device = PCI_DEVICE_ID_NI_PCI2324I,
1259 .subvendor = PCI_ANY_ID,
1260 .subdevice = PCI_ANY_ID,
1261 .init = pci_ni8420_init,
1262 .setup = pci_default_setup,
1263 .exit = __devexit_p(pci_ni8420_exit),
1264 },
1265 {
1266 .vendor = PCI_VENDOR_ID_NI,
1267 .device = PCI_DEVICE_ID_NI_PCI2322I,
1268 .subvendor = PCI_ANY_ID,
1269 .subdevice = PCI_ANY_ID,
1270 .init = pci_ni8420_init,
1271 .setup = pci_default_setup,
1272 .exit = __devexit_p(pci_ni8420_exit),
1273 },
1274 {
1275 .vendor = PCI_VENDOR_ID_NI,
1276 .device = PCI_DEVICE_ID_NI_PXI8420_23216,
1277 .subvendor = PCI_ANY_ID,
1278 .subdevice = PCI_ANY_ID,
1279 .init = pci_ni8420_init,
1280 .setup = pci_default_setup,
1281 .exit = __devexit_p(pci_ni8420_exit),
1282 },
1283 {
1284 .vendor = PCI_VENDOR_ID_NI,
1285 .device = PCI_DEVICE_ID_NI_PXI8420_2328,
1286 .subvendor = PCI_ANY_ID,
1287 .subdevice = PCI_ANY_ID,
1288 .init = pci_ni8420_init,
1289 .setup = pci_default_setup,
1290 .exit = __devexit_p(pci_ni8420_exit),
1291 },
1292 {
1293 .vendor = PCI_VENDOR_ID_NI,
1294 .device = PCI_DEVICE_ID_NI_PXI8420_2324,
1295 .subvendor = PCI_ANY_ID,
1296 .subdevice = PCI_ANY_ID,
1297 .init = pci_ni8420_init,
1298 .setup = pci_default_setup,
1299 .exit = __devexit_p(pci_ni8420_exit),
1300 },
1301 {
1302 .vendor = PCI_VENDOR_ID_NI,
1303 .device = PCI_DEVICE_ID_NI_PXI8420_2322,
1304 .subvendor = PCI_ANY_ID,
1305 .subdevice = PCI_ANY_ID,
1306 .init = pci_ni8420_init,
1307 .setup = pci_default_setup,
1308 .exit = __devexit_p(pci_ni8420_exit),
1309 },
1310 {
1311 .vendor = PCI_VENDOR_ID_NI,
1312 .device = PCI_DEVICE_ID_NI_PXI8422_2324,
1313 .subvendor = PCI_ANY_ID,
1314 .subdevice = PCI_ANY_ID,
1315 .init = pci_ni8420_init,
1316 .setup = pci_default_setup,
1317 .exit = __devexit_p(pci_ni8420_exit),
1318 },
1319 {
1320 .vendor = PCI_VENDOR_ID_NI,
1321 .device = PCI_DEVICE_ID_NI_PXI8422_2322,
1322 .subvendor = PCI_ANY_ID,
1323 .subdevice = PCI_ANY_ID,
1324 .init = pci_ni8420_init,
1325 .setup = pci_default_setup,
1326 .exit = __devexit_p(pci_ni8420_exit),
1327 },
1328 {
1329 .vendor = PCI_VENDOR_ID_NI,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001330 .device = PCI_ANY_ID,
1331 .subvendor = PCI_ANY_ID,
1332 .subdevice = PCI_ANY_ID,
1333 .init = pci_ni8430_init,
1334 .setup = pci_ni8430_setup,
1335 .exit = __devexit_p(pci_ni8430_exit),
1336 },
1337 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07001338 * Panacom
1339 */
1340 {
1341 .vendor = PCI_VENDOR_ID_PANACOM,
1342 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
1343 .subvendor = PCI_ANY_ID,
1344 .subdevice = PCI_ANY_ID,
1345 .init = pci_plx9050_init,
1346 .setup = pci_default_setup,
1347 .exit = __devexit_p(pci_plx9050_exit),
Alan Cox5756ee92008-02-08 04:18:51 -08001348 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001349 {
1350 .vendor = PCI_VENDOR_ID_PANACOM,
1351 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
1352 .subvendor = PCI_ANY_ID,
1353 .subdevice = PCI_ANY_ID,
1354 .init = pci_plx9050_init,
1355 .setup = pci_default_setup,
1356 .exit = __devexit_p(pci_plx9050_exit),
1357 },
1358 /*
1359 * PLX
1360 */
1361 {
1362 .vendor = PCI_VENDOR_ID_PLX,
Thomas Hoehn48212002007-02-10 01:46:05 -08001363 .device = PCI_DEVICE_ID_PLX_9030,
1364 .subvendor = PCI_SUBVENDOR_ID_PERLE,
1365 .subdevice = PCI_ANY_ID,
1366 .setup = pci_default_setup,
1367 },
1368 {
1369 .vendor = PCI_VENDOR_ID_PLX,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001370 .device = PCI_DEVICE_ID_PLX_9050,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01001371 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
1372 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
1373 .init = pci_plx9050_init,
1374 .setup = pci_default_setup,
1375 .exit = __devexit_p(pci_plx9050_exit),
1376 },
1377 {
1378 .vendor = PCI_VENDOR_ID_PLX,
1379 .device = PCI_DEVICE_ID_PLX_9050,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001380 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
1381 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
1382 .init = pci_plx9050_init,
1383 .setup = pci_default_setup,
1384 .exit = __devexit_p(pci_plx9050_exit),
1385 },
1386 {
1387 .vendor = PCI_VENDOR_ID_PLX,
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001388 .device = PCI_DEVICE_ID_PLX_9050,
1389 .subvendor = PCI_VENDOR_ID_PLX,
1390 .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
1391 .init = pci_plx9050_init,
1392 .setup = pci_default_setup,
1393 .exit = __devexit_p(pci_plx9050_exit),
1394 },
1395 {
1396 .vendor = PCI_VENDOR_ID_PLX,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001397 .device = PCI_DEVICE_ID_PLX_ROMULUS,
1398 .subvendor = PCI_VENDOR_ID_PLX,
1399 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
1400 .init = pci_plx9050_init,
1401 .setup = pci_default_setup,
1402 .exit = __devexit_p(pci_plx9050_exit),
1403 },
1404 /*
1405 * SBS Technologies, Inc., PMC-OCTALPRO 232
1406 */
1407 {
1408 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
1409 .device = PCI_DEVICE_ID_OCTPRO,
1410 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
1411 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
1412 .init = sbs_init,
1413 .setup = sbs_setup,
1414 .exit = __devexit_p(sbs_exit),
1415 },
1416 /*
1417 * SBS Technologies, Inc., PMC-OCTALPRO 422
1418 */
1419 {
1420 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
1421 .device = PCI_DEVICE_ID_OCTPRO,
1422 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
1423 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
1424 .init = sbs_init,
1425 .setup = sbs_setup,
1426 .exit = __devexit_p(sbs_exit),
1427 },
1428 /*
1429 * SBS Technologies, Inc., P-Octal 232
1430 */
1431 {
1432 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
1433 .device = PCI_DEVICE_ID_OCTPRO,
1434 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
1435 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
1436 .init = sbs_init,
1437 .setup = sbs_setup,
1438 .exit = __devexit_p(sbs_exit),
1439 },
1440 /*
1441 * SBS Technologies, Inc., P-Octal 422
1442 */
1443 {
1444 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
1445 .device = PCI_DEVICE_ID_OCTPRO,
1446 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
1447 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
1448 .init = sbs_init,
1449 .setup = sbs_setup,
1450 .exit = __devexit_p(sbs_exit),
1451 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001452 /*
Russell King61a116e2006-07-03 15:22:35 +01001453 * SIIG cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001454 */
1455 {
1456 .vendor = PCI_VENDOR_ID_SIIG,
Russell King67d74b82005-07-27 11:33:03 +01001457 .device = PCI_ANY_ID,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001458 .subvendor = PCI_ANY_ID,
1459 .subdevice = PCI_ANY_ID,
Russell King67d74b82005-07-27 11:33:03 +01001460 .init = pci_siig_init,
Andrey Panin3ec9c592006-02-02 20:15:09 +00001461 .setup = pci_siig_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001462 },
1463 /*
1464 * Titan cards
1465 */
1466 {
1467 .vendor = PCI_VENDOR_ID_TITAN,
1468 .device = PCI_DEVICE_ID_TITAN_400L,
1469 .subvendor = PCI_ANY_ID,
1470 .subdevice = PCI_ANY_ID,
1471 .setup = titan_400l_800l_setup,
1472 },
1473 {
1474 .vendor = PCI_VENDOR_ID_TITAN,
1475 .device = PCI_DEVICE_ID_TITAN_800L,
1476 .subvendor = PCI_ANY_ID,
1477 .subdevice = PCI_ANY_ID,
1478 .setup = titan_400l_800l_setup,
1479 },
1480 /*
1481 * Timedia cards
1482 */
1483 {
1484 .vendor = PCI_VENDOR_ID_TIMEDIA,
1485 .device = PCI_DEVICE_ID_TIMEDIA_1889,
1486 .subvendor = PCI_VENDOR_ID_TIMEDIA,
1487 .subdevice = PCI_ANY_ID,
Frédéric Brièreb9b24552011-05-29 15:08:04 -04001488 .probe = pci_timedia_probe,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001489 .init = pci_timedia_init,
1490 .setup = pci_timedia_setup,
1491 },
1492 {
1493 .vendor = PCI_VENDOR_ID_TIMEDIA,
1494 .device = PCI_ANY_ID,
1495 .subvendor = PCI_ANY_ID,
1496 .subdevice = PCI_ANY_ID,
1497 .setup = pci_timedia_setup,
1498 },
1499 /*
1500 * Xircom cards
1501 */
1502 {
1503 .vendor = PCI_VENDOR_ID_XIRCOM,
1504 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
1505 .subvendor = PCI_ANY_ID,
1506 .subdevice = PCI_ANY_ID,
1507 .init = pci_xircom_init,
1508 .setup = pci_default_setup,
1509 },
1510 /*
Russell King61a116e2006-07-03 15:22:35 +01001511 * Netmos cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001512 */
1513 {
1514 .vendor = PCI_VENDOR_ID_NETMOS,
1515 .device = PCI_ANY_ID,
1516 .subvendor = PCI_ANY_ID,
1517 .subdevice = PCI_ANY_ID,
1518 .init = pci_netmos_init,
Nicos Gollan7808edc2011-05-05 21:00:37 +02001519 .setup = pci_netmos_9900_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001520 },
1521 /*
Scott Kilauaa273ae2011-05-11 15:41:59 -05001522 * For Oxford Semiconductor Tornado based devices
Russell King9f2a0362009-01-02 13:44:20 +00001523 */
1524 {
1525 .vendor = PCI_VENDOR_ID_OXSEMI,
1526 .device = PCI_ANY_ID,
1527 .subvendor = PCI_ANY_ID,
1528 .subdevice = PCI_ANY_ID,
1529 .init = pci_oxsemi_tornado_init,
1530 .setup = pci_default_setup,
1531 },
1532 {
1533 .vendor = PCI_VENDOR_ID_MAINPINE,
1534 .device = PCI_ANY_ID,
1535 .subvendor = PCI_ANY_ID,
1536 .subdevice = PCI_ANY_ID,
1537 .init = pci_oxsemi_tornado_init,
1538 .setup = pci_default_setup,
1539 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05001540 {
1541 .vendor = PCI_VENDOR_ID_DIGI,
1542 .device = PCIE_DEVICE_ID_NEO_2_OX_IBM,
1543 .subvendor = PCI_SUBVENDOR_ID_IBM,
1544 .subdevice = PCI_ANY_ID,
1545 .init = pci_oxsemi_tornado_init,
1546 .setup = pci_default_setup,
1547 },
Russell King9f2a0362009-01-02 13:44:20 +00001548 /*
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001549 * Cronyx Omega PCI (PLX-chip based)
1550 */
1551 {
1552 .vendor = PCI_VENDOR_ID_PLX,
1553 .device = PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
1554 .subvendor = PCI_ANY_ID,
1555 .subdevice = PCI_ANY_ID,
1556 .setup = pci_omegapci_setup,
1557 },
1558 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07001559 * Default "match everything" terminator entry
1560 */
1561 {
1562 .vendor = PCI_ANY_ID,
1563 .device = PCI_ANY_ID,
1564 .subvendor = PCI_ANY_ID,
1565 .subdevice = PCI_ANY_ID,
1566 .setup = pci_default_setup,
1567 }
1568};
1569
1570static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
1571{
1572 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
1573}
1574
1575static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
1576{
1577 struct pci_serial_quirk *quirk;
1578
1579 for (quirk = pci_serial_quirks; ; quirk++)
1580 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
1581 quirk_id_matches(quirk->device, dev->device) &&
1582 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
1583 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
Alan Cox5756ee92008-02-08 04:18:51 -08001584 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001585 return quirk;
1586}
1587
Andrew Mortondd68e882006-01-05 10:55:26 +00001588static inline int get_pci_irq(struct pci_dev *dev,
Russell King975a1a7d2009-01-02 13:44:27 +00001589 const struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001590{
1591 if (board->flags & FL_NOIRQ)
1592 return 0;
1593 else
1594 return dev->irq;
1595}
1596
1597/*
1598 * This is the configuration table for all of the PCI serial boards
1599 * which we support. It is directly indexed by the pci_board_num_t enum
1600 * value, which is encoded in the pci_device_id PCI probe table's
1601 * driver_data member.
1602 *
1603 * The makeup of these names are:
Gareth Howlett26e92862006-01-04 17:00:42 +00001604 * pbn_bn{_bt}_n_baud{_offsetinhex}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001605 *
Gareth Howlett26e92862006-01-04 17:00:42 +00001606 * bn = PCI BAR number
1607 * bt = Index using PCI BARs
1608 * n = number of serial ports
1609 * baud = baud rate
1610 * offsetinhex = offset for each sequential port (in hex)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001611 *
Gareth Howlett26e92862006-01-04 17:00:42 +00001612 * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
Russell Kingf1690f32005-05-06 10:19:09 +01001613 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001614 * Please note: in theory if n = 1, _bt infix should make no difference.
1615 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
1616 */
1617enum pci_board_num_t {
1618 pbn_default = 0,
1619
1620 pbn_b0_1_115200,
1621 pbn_b0_2_115200,
1622 pbn_b0_4_115200,
1623 pbn_b0_5_115200,
Alan Coxbf0df632007-10-16 01:24:00 -07001624 pbn_b0_8_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001625
1626 pbn_b0_1_921600,
1627 pbn_b0_2_921600,
1628 pbn_b0_4_921600,
1629
David Ransondb1de152005-07-27 11:43:55 -07001630 pbn_b0_2_1130000,
1631
Andrey Paninfbc0dc02005-07-18 11:38:09 +01001632 pbn_b0_4_1152000,
1633
Gareth Howlett26e92862006-01-04 17:00:42 +00001634 pbn_b0_2_1843200,
1635 pbn_b0_4_1843200,
1636
1637 pbn_b0_2_1843200_200,
1638 pbn_b0_4_1843200_200,
1639 pbn_b0_8_1843200_200,
1640
Lee Howard7106b4e2008-10-21 13:48:58 +01001641 pbn_b0_1_4000000,
1642
Linus Torvalds1da177e2005-04-16 15:20:36 -07001643 pbn_b0_bt_1_115200,
1644 pbn_b0_bt_2_115200,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08001645 pbn_b0_bt_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001646 pbn_b0_bt_8_115200,
1647
1648 pbn_b0_bt_1_460800,
1649 pbn_b0_bt_2_460800,
1650 pbn_b0_bt_4_460800,
1651
1652 pbn_b0_bt_1_921600,
1653 pbn_b0_bt_2_921600,
1654 pbn_b0_bt_4_921600,
1655 pbn_b0_bt_8_921600,
1656
1657 pbn_b1_1_115200,
1658 pbn_b1_2_115200,
1659 pbn_b1_4_115200,
1660 pbn_b1_8_115200,
Will Page04bf7e72009-04-06 17:32:15 +01001661 pbn_b1_16_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001662
1663 pbn_b1_1_921600,
1664 pbn_b1_2_921600,
1665 pbn_b1_4_921600,
1666 pbn_b1_8_921600,
1667
Gareth Howlett26e92862006-01-04 17:00:42 +00001668 pbn_b1_2_1250000,
1669
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001670 pbn_b1_bt_1_115200,
Will Page04bf7e72009-04-06 17:32:15 +01001671 pbn_b1_bt_2_115200,
1672 pbn_b1_bt_4_115200,
1673
Linus Torvalds1da177e2005-04-16 15:20:36 -07001674 pbn_b1_bt_2_921600,
1675
1676 pbn_b1_1_1382400,
1677 pbn_b1_2_1382400,
1678 pbn_b1_4_1382400,
1679 pbn_b1_8_1382400,
1680
1681 pbn_b2_1_115200,
Peter Horton737c1752006-08-26 09:07:36 +01001682 pbn_b2_2_115200,
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08001683 pbn_b2_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001684 pbn_b2_8_115200,
1685
1686 pbn_b2_1_460800,
1687 pbn_b2_4_460800,
1688 pbn_b2_8_460800,
1689 pbn_b2_16_460800,
1690
1691 pbn_b2_1_921600,
1692 pbn_b2_4_921600,
1693 pbn_b2_8_921600,
1694
Lytochkin Borise8470032010-07-26 10:02:26 +04001695 pbn_b2_8_1152000,
1696
Linus Torvalds1da177e2005-04-16 15:20:36 -07001697 pbn_b2_bt_1_115200,
1698 pbn_b2_bt_2_115200,
1699 pbn_b2_bt_4_115200,
1700
1701 pbn_b2_bt_2_921600,
1702 pbn_b2_bt_4_921600,
1703
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00001704 pbn_b3_2_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001705 pbn_b3_4_115200,
1706 pbn_b3_8_115200,
1707
Yegor Yefremov66169ad2010-06-04 09:58:18 +02001708 pbn_b4_bt_2_921600,
1709 pbn_b4_bt_4_921600,
1710 pbn_b4_bt_8_921600,
1711
Linus Torvalds1da177e2005-04-16 15:20:36 -07001712 /*
1713 * Board-specific versions.
1714 */
1715 pbn_panacom,
1716 pbn_panacom2,
1717 pbn_panacom4,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01001718 pbn_exsys_4055,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001719 pbn_plx_romulus,
1720 pbn_oxsemi,
Lee Howard7106b4e2008-10-21 13:48:58 +01001721 pbn_oxsemi_1_4000000,
1722 pbn_oxsemi_2_4000000,
1723 pbn_oxsemi_4_4000000,
1724 pbn_oxsemi_8_4000000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001725 pbn_intel_i960,
1726 pbn_sgi_ioc3,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001727 pbn_computone_4,
1728 pbn_computone_6,
1729 pbn_computone_8,
1730 pbn_sbsxrsio,
1731 pbn_exar_XR17C152,
1732 pbn_exar_XR17C154,
1733 pbn_exar_XR17C158,
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07001734 pbn_exar_ibm_saturn,
Olof Johanssonaa798502007-08-22 14:01:55 -07001735 pbn_pasemi_1682M,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001736 pbn_ni8430_2,
1737 pbn_ni8430_4,
1738 pbn_ni8430_8,
1739 pbn_ni8430_16,
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07001740 pbn_ADDIDATA_PCIe_1_3906250,
1741 pbn_ADDIDATA_PCIe_2_3906250,
1742 pbn_ADDIDATA_PCIe_4_3906250,
1743 pbn_ADDIDATA_PCIe_8_3906250,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001744 pbn_ce4100_1_115200,
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001745 pbn_omegapci,
Nicos Gollan7808edc2011-05-05 21:00:37 +02001746 pbn_NETMOS9900_2s_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001747};
1748
1749/*
1750 * uart_offset - the space between channels
1751 * reg_shift - describes how the UART registers are mapped
1752 * to PCI memory by the card.
1753 * For example IER register on SBS, Inc. PMC-OctPro is located at
1754 * offset 0x10 from the UART base, while UART_IER is defined as 1
1755 * in include/linux/serial_reg.h,
1756 * see first lines of serial_in() and serial_out() in 8250.c
1757*/
1758
Russell King1c7c1fe2005-07-27 11:31:19 +01001759static struct pciserial_board pci_boards[] __devinitdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001760 [pbn_default] = {
1761 .flags = FL_BASE0,
1762 .num_ports = 1,
1763 .base_baud = 115200,
1764 .uart_offset = 8,
1765 },
1766 [pbn_b0_1_115200] = {
1767 .flags = FL_BASE0,
1768 .num_ports = 1,
1769 .base_baud = 115200,
1770 .uart_offset = 8,
1771 },
1772 [pbn_b0_2_115200] = {
1773 .flags = FL_BASE0,
1774 .num_ports = 2,
1775 .base_baud = 115200,
1776 .uart_offset = 8,
1777 },
1778 [pbn_b0_4_115200] = {
1779 .flags = FL_BASE0,
1780 .num_ports = 4,
1781 .base_baud = 115200,
1782 .uart_offset = 8,
1783 },
1784 [pbn_b0_5_115200] = {
1785 .flags = FL_BASE0,
1786 .num_ports = 5,
1787 .base_baud = 115200,
1788 .uart_offset = 8,
1789 },
Alan Coxbf0df632007-10-16 01:24:00 -07001790 [pbn_b0_8_115200] = {
1791 .flags = FL_BASE0,
1792 .num_ports = 8,
1793 .base_baud = 115200,
1794 .uart_offset = 8,
1795 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001796 [pbn_b0_1_921600] = {
1797 .flags = FL_BASE0,
1798 .num_ports = 1,
1799 .base_baud = 921600,
1800 .uart_offset = 8,
1801 },
1802 [pbn_b0_2_921600] = {
1803 .flags = FL_BASE0,
1804 .num_ports = 2,
1805 .base_baud = 921600,
1806 .uart_offset = 8,
1807 },
1808 [pbn_b0_4_921600] = {
1809 .flags = FL_BASE0,
1810 .num_ports = 4,
1811 .base_baud = 921600,
1812 .uart_offset = 8,
1813 },
David Ransondb1de152005-07-27 11:43:55 -07001814
1815 [pbn_b0_2_1130000] = {
1816 .flags = FL_BASE0,
1817 .num_ports = 2,
1818 .base_baud = 1130000,
1819 .uart_offset = 8,
1820 },
1821
Andrey Paninfbc0dc02005-07-18 11:38:09 +01001822 [pbn_b0_4_1152000] = {
1823 .flags = FL_BASE0,
1824 .num_ports = 4,
1825 .base_baud = 1152000,
1826 .uart_offset = 8,
1827 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001828
Gareth Howlett26e92862006-01-04 17:00:42 +00001829 [pbn_b0_2_1843200] = {
1830 .flags = FL_BASE0,
1831 .num_ports = 2,
1832 .base_baud = 1843200,
1833 .uart_offset = 8,
1834 },
1835 [pbn_b0_4_1843200] = {
1836 .flags = FL_BASE0,
1837 .num_ports = 4,
1838 .base_baud = 1843200,
1839 .uart_offset = 8,
1840 },
1841
1842 [pbn_b0_2_1843200_200] = {
1843 .flags = FL_BASE0,
1844 .num_ports = 2,
1845 .base_baud = 1843200,
1846 .uart_offset = 0x200,
1847 },
1848 [pbn_b0_4_1843200_200] = {
1849 .flags = FL_BASE0,
1850 .num_ports = 4,
1851 .base_baud = 1843200,
1852 .uart_offset = 0x200,
1853 },
1854 [pbn_b0_8_1843200_200] = {
1855 .flags = FL_BASE0,
1856 .num_ports = 8,
1857 .base_baud = 1843200,
1858 .uart_offset = 0x200,
1859 },
Lee Howard7106b4e2008-10-21 13:48:58 +01001860 [pbn_b0_1_4000000] = {
1861 .flags = FL_BASE0,
1862 .num_ports = 1,
1863 .base_baud = 4000000,
1864 .uart_offset = 8,
1865 },
Gareth Howlett26e92862006-01-04 17:00:42 +00001866
Linus Torvalds1da177e2005-04-16 15:20:36 -07001867 [pbn_b0_bt_1_115200] = {
1868 .flags = FL_BASE0|FL_BASE_BARS,
1869 .num_ports = 1,
1870 .base_baud = 115200,
1871 .uart_offset = 8,
1872 },
1873 [pbn_b0_bt_2_115200] = {
1874 .flags = FL_BASE0|FL_BASE_BARS,
1875 .num_ports = 2,
1876 .base_baud = 115200,
1877 .uart_offset = 8,
1878 },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08001879 [pbn_b0_bt_4_115200] = {
1880 .flags = FL_BASE0|FL_BASE_BARS,
1881 .num_ports = 4,
1882 .base_baud = 115200,
1883 .uart_offset = 8,
1884 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001885 [pbn_b0_bt_8_115200] = {
1886 .flags = FL_BASE0|FL_BASE_BARS,
1887 .num_ports = 8,
1888 .base_baud = 115200,
1889 .uart_offset = 8,
1890 },
1891
1892 [pbn_b0_bt_1_460800] = {
1893 .flags = FL_BASE0|FL_BASE_BARS,
1894 .num_ports = 1,
1895 .base_baud = 460800,
1896 .uart_offset = 8,
1897 },
1898 [pbn_b0_bt_2_460800] = {
1899 .flags = FL_BASE0|FL_BASE_BARS,
1900 .num_ports = 2,
1901 .base_baud = 460800,
1902 .uart_offset = 8,
1903 },
1904 [pbn_b0_bt_4_460800] = {
1905 .flags = FL_BASE0|FL_BASE_BARS,
1906 .num_ports = 4,
1907 .base_baud = 460800,
1908 .uart_offset = 8,
1909 },
1910
1911 [pbn_b0_bt_1_921600] = {
1912 .flags = FL_BASE0|FL_BASE_BARS,
1913 .num_ports = 1,
1914 .base_baud = 921600,
1915 .uart_offset = 8,
1916 },
1917 [pbn_b0_bt_2_921600] = {
1918 .flags = FL_BASE0|FL_BASE_BARS,
1919 .num_ports = 2,
1920 .base_baud = 921600,
1921 .uart_offset = 8,
1922 },
1923 [pbn_b0_bt_4_921600] = {
1924 .flags = FL_BASE0|FL_BASE_BARS,
1925 .num_ports = 4,
1926 .base_baud = 921600,
1927 .uart_offset = 8,
1928 },
1929 [pbn_b0_bt_8_921600] = {
1930 .flags = FL_BASE0|FL_BASE_BARS,
1931 .num_ports = 8,
1932 .base_baud = 921600,
1933 .uart_offset = 8,
1934 },
1935
1936 [pbn_b1_1_115200] = {
1937 .flags = FL_BASE1,
1938 .num_ports = 1,
1939 .base_baud = 115200,
1940 .uart_offset = 8,
1941 },
1942 [pbn_b1_2_115200] = {
1943 .flags = FL_BASE1,
1944 .num_ports = 2,
1945 .base_baud = 115200,
1946 .uart_offset = 8,
1947 },
1948 [pbn_b1_4_115200] = {
1949 .flags = FL_BASE1,
1950 .num_ports = 4,
1951 .base_baud = 115200,
1952 .uart_offset = 8,
1953 },
1954 [pbn_b1_8_115200] = {
1955 .flags = FL_BASE1,
1956 .num_ports = 8,
1957 .base_baud = 115200,
1958 .uart_offset = 8,
1959 },
Will Page04bf7e72009-04-06 17:32:15 +01001960 [pbn_b1_16_115200] = {
1961 .flags = FL_BASE1,
1962 .num_ports = 16,
1963 .base_baud = 115200,
1964 .uart_offset = 8,
1965 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001966
1967 [pbn_b1_1_921600] = {
1968 .flags = FL_BASE1,
1969 .num_ports = 1,
1970 .base_baud = 921600,
1971 .uart_offset = 8,
1972 },
1973 [pbn_b1_2_921600] = {
1974 .flags = FL_BASE1,
1975 .num_ports = 2,
1976 .base_baud = 921600,
1977 .uart_offset = 8,
1978 },
1979 [pbn_b1_4_921600] = {
1980 .flags = FL_BASE1,
1981 .num_ports = 4,
1982 .base_baud = 921600,
1983 .uart_offset = 8,
1984 },
1985 [pbn_b1_8_921600] = {
1986 .flags = FL_BASE1,
1987 .num_ports = 8,
1988 .base_baud = 921600,
1989 .uart_offset = 8,
1990 },
Gareth Howlett26e92862006-01-04 17:00:42 +00001991 [pbn_b1_2_1250000] = {
1992 .flags = FL_BASE1,
1993 .num_ports = 2,
1994 .base_baud = 1250000,
1995 .uart_offset = 8,
1996 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001997
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001998 [pbn_b1_bt_1_115200] = {
1999 .flags = FL_BASE1|FL_BASE_BARS,
2000 .num_ports = 1,
2001 .base_baud = 115200,
2002 .uart_offset = 8,
2003 },
Will Page04bf7e72009-04-06 17:32:15 +01002004 [pbn_b1_bt_2_115200] = {
2005 .flags = FL_BASE1|FL_BASE_BARS,
2006 .num_ports = 2,
2007 .base_baud = 115200,
2008 .uart_offset = 8,
2009 },
2010 [pbn_b1_bt_4_115200] = {
2011 .flags = FL_BASE1|FL_BASE_BARS,
2012 .num_ports = 4,
2013 .base_baud = 115200,
2014 .uart_offset = 8,
2015 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002016
Linus Torvalds1da177e2005-04-16 15:20:36 -07002017 [pbn_b1_bt_2_921600] = {
2018 .flags = FL_BASE1|FL_BASE_BARS,
2019 .num_ports = 2,
2020 .base_baud = 921600,
2021 .uart_offset = 8,
2022 },
2023
2024 [pbn_b1_1_1382400] = {
2025 .flags = FL_BASE1,
2026 .num_ports = 1,
2027 .base_baud = 1382400,
2028 .uart_offset = 8,
2029 },
2030 [pbn_b1_2_1382400] = {
2031 .flags = FL_BASE1,
2032 .num_ports = 2,
2033 .base_baud = 1382400,
2034 .uart_offset = 8,
2035 },
2036 [pbn_b1_4_1382400] = {
2037 .flags = FL_BASE1,
2038 .num_ports = 4,
2039 .base_baud = 1382400,
2040 .uart_offset = 8,
2041 },
2042 [pbn_b1_8_1382400] = {
2043 .flags = FL_BASE1,
2044 .num_ports = 8,
2045 .base_baud = 1382400,
2046 .uart_offset = 8,
2047 },
2048
2049 [pbn_b2_1_115200] = {
2050 .flags = FL_BASE2,
2051 .num_ports = 1,
2052 .base_baud = 115200,
2053 .uart_offset = 8,
2054 },
Peter Horton737c1752006-08-26 09:07:36 +01002055 [pbn_b2_2_115200] = {
2056 .flags = FL_BASE2,
2057 .num_ports = 2,
2058 .base_baud = 115200,
2059 .uart_offset = 8,
2060 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002061 [pbn_b2_4_115200] = {
2062 .flags = FL_BASE2,
2063 .num_ports = 4,
2064 .base_baud = 115200,
2065 .uart_offset = 8,
2066 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002067 [pbn_b2_8_115200] = {
2068 .flags = FL_BASE2,
2069 .num_ports = 8,
2070 .base_baud = 115200,
2071 .uart_offset = 8,
2072 },
2073
2074 [pbn_b2_1_460800] = {
2075 .flags = FL_BASE2,
2076 .num_ports = 1,
2077 .base_baud = 460800,
2078 .uart_offset = 8,
2079 },
2080 [pbn_b2_4_460800] = {
2081 .flags = FL_BASE2,
2082 .num_ports = 4,
2083 .base_baud = 460800,
2084 .uart_offset = 8,
2085 },
2086 [pbn_b2_8_460800] = {
2087 .flags = FL_BASE2,
2088 .num_ports = 8,
2089 .base_baud = 460800,
2090 .uart_offset = 8,
2091 },
2092 [pbn_b2_16_460800] = {
2093 .flags = FL_BASE2,
2094 .num_ports = 16,
2095 .base_baud = 460800,
2096 .uart_offset = 8,
2097 },
2098
2099 [pbn_b2_1_921600] = {
2100 .flags = FL_BASE2,
2101 .num_ports = 1,
2102 .base_baud = 921600,
2103 .uart_offset = 8,
2104 },
2105 [pbn_b2_4_921600] = {
2106 .flags = FL_BASE2,
2107 .num_ports = 4,
2108 .base_baud = 921600,
2109 .uart_offset = 8,
2110 },
2111 [pbn_b2_8_921600] = {
2112 .flags = FL_BASE2,
2113 .num_ports = 8,
2114 .base_baud = 921600,
2115 .uart_offset = 8,
2116 },
2117
Lytochkin Borise8470032010-07-26 10:02:26 +04002118 [pbn_b2_8_1152000] = {
2119 .flags = FL_BASE2,
2120 .num_ports = 8,
2121 .base_baud = 1152000,
2122 .uart_offset = 8,
2123 },
2124
Linus Torvalds1da177e2005-04-16 15:20:36 -07002125 [pbn_b2_bt_1_115200] = {
2126 .flags = FL_BASE2|FL_BASE_BARS,
2127 .num_ports = 1,
2128 .base_baud = 115200,
2129 .uart_offset = 8,
2130 },
2131 [pbn_b2_bt_2_115200] = {
2132 .flags = FL_BASE2|FL_BASE_BARS,
2133 .num_ports = 2,
2134 .base_baud = 115200,
2135 .uart_offset = 8,
2136 },
2137 [pbn_b2_bt_4_115200] = {
2138 .flags = FL_BASE2|FL_BASE_BARS,
2139 .num_ports = 4,
2140 .base_baud = 115200,
2141 .uart_offset = 8,
2142 },
2143
2144 [pbn_b2_bt_2_921600] = {
2145 .flags = FL_BASE2|FL_BASE_BARS,
2146 .num_ports = 2,
2147 .base_baud = 921600,
2148 .uart_offset = 8,
2149 },
2150 [pbn_b2_bt_4_921600] = {
2151 .flags = FL_BASE2|FL_BASE_BARS,
2152 .num_ports = 4,
2153 .base_baud = 921600,
2154 .uart_offset = 8,
2155 },
2156
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00002157 [pbn_b3_2_115200] = {
2158 .flags = FL_BASE3,
2159 .num_ports = 2,
2160 .base_baud = 115200,
2161 .uart_offset = 8,
2162 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002163 [pbn_b3_4_115200] = {
2164 .flags = FL_BASE3,
2165 .num_ports = 4,
2166 .base_baud = 115200,
2167 .uart_offset = 8,
2168 },
2169 [pbn_b3_8_115200] = {
2170 .flags = FL_BASE3,
2171 .num_ports = 8,
2172 .base_baud = 115200,
2173 .uart_offset = 8,
2174 },
2175
Yegor Yefremov66169ad2010-06-04 09:58:18 +02002176 [pbn_b4_bt_2_921600] = {
2177 .flags = FL_BASE4,
2178 .num_ports = 2,
2179 .base_baud = 921600,
2180 .uart_offset = 8,
2181 },
2182 [pbn_b4_bt_4_921600] = {
2183 .flags = FL_BASE4,
2184 .num_ports = 4,
2185 .base_baud = 921600,
2186 .uart_offset = 8,
2187 },
2188 [pbn_b4_bt_8_921600] = {
2189 .flags = FL_BASE4,
2190 .num_ports = 8,
2191 .base_baud = 921600,
2192 .uart_offset = 8,
2193 },
2194
Linus Torvalds1da177e2005-04-16 15:20:36 -07002195 /*
2196 * Entries following this are board-specific.
2197 */
2198
2199 /*
2200 * Panacom - IOMEM
2201 */
2202 [pbn_panacom] = {
2203 .flags = FL_BASE2,
2204 .num_ports = 2,
2205 .base_baud = 921600,
2206 .uart_offset = 0x400,
2207 .reg_shift = 7,
2208 },
2209 [pbn_panacom2] = {
2210 .flags = FL_BASE2|FL_BASE_BARS,
2211 .num_ports = 2,
2212 .base_baud = 921600,
2213 .uart_offset = 0x400,
2214 .reg_shift = 7,
2215 },
2216 [pbn_panacom4] = {
2217 .flags = FL_BASE2|FL_BASE_BARS,
2218 .num_ports = 4,
2219 .base_baud = 921600,
2220 .uart_offset = 0x400,
2221 .reg_shift = 7,
2222 },
2223
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01002224 [pbn_exsys_4055] = {
2225 .flags = FL_BASE2,
2226 .num_ports = 4,
2227 .base_baud = 115200,
2228 .uart_offset = 8,
2229 },
2230
Linus Torvalds1da177e2005-04-16 15:20:36 -07002231 /* I think this entry is broken - the first_offset looks wrong --rmk */
2232 [pbn_plx_romulus] = {
2233 .flags = FL_BASE2,
2234 .num_ports = 4,
2235 .base_baud = 921600,
2236 .uart_offset = 8 << 2,
2237 .reg_shift = 2,
2238 .first_offset = 0x03,
2239 },
2240
2241 /*
2242 * This board uses the size of PCI Base region 0 to
2243 * signal now many ports are available
2244 */
2245 [pbn_oxsemi] = {
2246 .flags = FL_BASE0|FL_REGION_SZ_CAP,
2247 .num_ports = 32,
2248 .base_baud = 115200,
2249 .uart_offset = 8,
2250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01002251 [pbn_oxsemi_1_4000000] = {
2252 .flags = FL_BASE0,
2253 .num_ports = 1,
2254 .base_baud = 4000000,
2255 .uart_offset = 0x200,
2256 .first_offset = 0x1000,
2257 },
2258 [pbn_oxsemi_2_4000000] = {
2259 .flags = FL_BASE0,
2260 .num_ports = 2,
2261 .base_baud = 4000000,
2262 .uart_offset = 0x200,
2263 .first_offset = 0x1000,
2264 },
2265 [pbn_oxsemi_4_4000000] = {
2266 .flags = FL_BASE0,
2267 .num_ports = 4,
2268 .base_baud = 4000000,
2269 .uart_offset = 0x200,
2270 .first_offset = 0x1000,
2271 },
2272 [pbn_oxsemi_8_4000000] = {
2273 .flags = FL_BASE0,
2274 .num_ports = 8,
2275 .base_baud = 4000000,
2276 .uart_offset = 0x200,
2277 .first_offset = 0x1000,
2278 },
2279
Linus Torvalds1da177e2005-04-16 15:20:36 -07002280
2281 /*
2282 * EKF addition for i960 Boards form EKF with serial port.
2283 * Max 256 ports.
2284 */
2285 [pbn_intel_i960] = {
2286 .flags = FL_BASE0,
2287 .num_ports = 32,
2288 .base_baud = 921600,
2289 .uart_offset = 8 << 2,
2290 .reg_shift = 2,
2291 .first_offset = 0x10000,
2292 },
2293 [pbn_sgi_ioc3] = {
2294 .flags = FL_BASE0|FL_NOIRQ,
2295 .num_ports = 1,
2296 .base_baud = 458333,
2297 .uart_offset = 8,
2298 .reg_shift = 0,
2299 .first_offset = 0x20178,
2300 },
2301
2302 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002303 * Computone - uses IOMEM.
2304 */
2305 [pbn_computone_4] = {
2306 .flags = FL_BASE0,
2307 .num_ports = 4,
2308 .base_baud = 921600,
2309 .uart_offset = 0x40,
2310 .reg_shift = 2,
2311 .first_offset = 0x200,
2312 },
2313 [pbn_computone_6] = {
2314 .flags = FL_BASE0,
2315 .num_ports = 6,
2316 .base_baud = 921600,
2317 .uart_offset = 0x40,
2318 .reg_shift = 2,
2319 .first_offset = 0x200,
2320 },
2321 [pbn_computone_8] = {
2322 .flags = FL_BASE0,
2323 .num_ports = 8,
2324 .base_baud = 921600,
2325 .uart_offset = 0x40,
2326 .reg_shift = 2,
2327 .first_offset = 0x200,
2328 },
2329 [pbn_sbsxrsio] = {
2330 .flags = FL_BASE0,
2331 .num_ports = 8,
2332 .base_baud = 460800,
2333 .uart_offset = 256,
2334 .reg_shift = 4,
2335 },
2336 /*
2337 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
2338 * Only basic 16550A support.
2339 * XR17C15[24] are not tested, but they should work.
2340 */
2341 [pbn_exar_XR17C152] = {
2342 .flags = FL_BASE0,
2343 .num_ports = 2,
2344 .base_baud = 921600,
2345 .uart_offset = 0x200,
2346 },
2347 [pbn_exar_XR17C154] = {
2348 .flags = FL_BASE0,
2349 .num_ports = 4,
2350 .base_baud = 921600,
2351 .uart_offset = 0x200,
2352 },
2353 [pbn_exar_XR17C158] = {
2354 .flags = FL_BASE0,
2355 .num_ports = 8,
2356 .base_baud = 921600,
2357 .uart_offset = 0x200,
2358 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07002359 [pbn_exar_ibm_saturn] = {
2360 .flags = FL_BASE0,
2361 .num_ports = 1,
2362 .base_baud = 921600,
2363 .uart_offset = 0x200,
2364 },
2365
Olof Johanssonaa798502007-08-22 14:01:55 -07002366 /*
2367 * PA Semi PWRficient PA6T-1682M on-chip UART
2368 */
2369 [pbn_pasemi_1682M] = {
2370 .flags = FL_BASE0,
2371 .num_ports = 1,
2372 .base_baud = 8333333,
2373 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002374 /*
2375 * National Instruments 843x
2376 */
2377 [pbn_ni8430_16] = {
2378 .flags = FL_BASE0,
2379 .num_ports = 16,
2380 .base_baud = 3686400,
2381 .uart_offset = 0x10,
2382 .first_offset = 0x800,
2383 },
2384 [pbn_ni8430_8] = {
2385 .flags = FL_BASE0,
2386 .num_ports = 8,
2387 .base_baud = 3686400,
2388 .uart_offset = 0x10,
2389 .first_offset = 0x800,
2390 },
2391 [pbn_ni8430_4] = {
2392 .flags = FL_BASE0,
2393 .num_ports = 4,
2394 .base_baud = 3686400,
2395 .uart_offset = 0x10,
2396 .first_offset = 0x800,
2397 },
2398 [pbn_ni8430_2] = {
2399 .flags = FL_BASE0,
2400 .num_ports = 2,
2401 .base_baud = 3686400,
2402 .uart_offset = 0x10,
2403 .first_offset = 0x800,
2404 },
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07002405 /*
2406 * ADDI-DATA GmbH PCI-Express communication cards <info@addi-data.com>
2407 */
2408 [pbn_ADDIDATA_PCIe_1_3906250] = {
2409 .flags = FL_BASE0,
2410 .num_ports = 1,
2411 .base_baud = 3906250,
2412 .uart_offset = 0x200,
2413 .first_offset = 0x1000,
2414 },
2415 [pbn_ADDIDATA_PCIe_2_3906250] = {
2416 .flags = FL_BASE0,
2417 .num_ports = 2,
2418 .base_baud = 3906250,
2419 .uart_offset = 0x200,
2420 .first_offset = 0x1000,
2421 },
2422 [pbn_ADDIDATA_PCIe_4_3906250] = {
2423 .flags = FL_BASE0,
2424 .num_ports = 4,
2425 .base_baud = 3906250,
2426 .uart_offset = 0x200,
2427 .first_offset = 0x1000,
2428 },
2429 [pbn_ADDIDATA_PCIe_8_3906250] = {
2430 .flags = FL_BASE0,
2431 .num_ports = 8,
2432 .base_baud = 3906250,
2433 .uart_offset = 0x200,
2434 .first_offset = 0x1000,
2435 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08002436 [pbn_ce4100_1_115200] = {
2437 .flags = FL_BASE0,
2438 .num_ports = 1,
2439 .base_baud = 921600,
2440 .reg_shift = 2,
2441 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002442 [pbn_omegapci] = {
2443 .flags = FL_BASE0,
2444 .num_ports = 8,
2445 .base_baud = 115200,
2446 .uart_offset = 0x200,
2447 },
Nicos Gollan7808edc2011-05-05 21:00:37 +02002448 [pbn_NETMOS9900_2s_115200] = {
2449 .flags = FL_BASE0,
2450 .num_ports = 2,
2451 .base_baud = 115200,
2452 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002453};
2454
Christian Schmidt436bbd42007-08-22 14:01:19 -07002455static const struct pci_device_id softmodem_blacklist[] = {
Alan Cox5756ee92008-02-08 04:18:51 -08002456 { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
Maciej Szmigieroebf7c062010-10-26 21:48:21 +02002457 { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */
2458 { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */
Christian Schmidt436bbd42007-08-22 14:01:19 -07002459};
2460
Linus Torvalds1da177e2005-04-16 15:20:36 -07002461/*
2462 * Given a complete unknown PCI device, try to use some heuristics to
2463 * guess what the configuration might be, based on the pitiful PCI
2464 * serial specs. Returns 0 on success, 1 on failure.
2465 */
2466static int __devinit
Russell King1c7c1fe2005-07-27 11:31:19 +01002467serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002468{
Christian Schmidt436bbd42007-08-22 14:01:19 -07002469 const struct pci_device_id *blacklist;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002470 int num_iomem, num_port, first_port = -1, i;
Alan Cox5756ee92008-02-08 04:18:51 -08002471
Linus Torvalds1da177e2005-04-16 15:20:36 -07002472 /*
2473 * If it is not a communications device or the programming
2474 * interface is greater than 6, give up.
2475 *
2476 * (Should we try to make guesses for multiport serial devices
Alan Cox5756ee92008-02-08 04:18:51 -08002477 * later?)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002478 */
2479 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
2480 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
2481 (dev->class & 0xff) > 6)
2482 return -ENODEV;
2483
Christian Schmidt436bbd42007-08-22 14:01:19 -07002484 /*
2485 * Do not access blacklisted devices that are known not to
2486 * feature serial ports.
2487 */
2488 for (blacklist = softmodem_blacklist;
2489 blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist);
2490 blacklist++) {
2491 if (dev->vendor == blacklist->vendor &&
2492 dev->device == blacklist->device)
2493 return -ENODEV;
2494 }
2495
Linus Torvalds1da177e2005-04-16 15:20:36 -07002496 num_iomem = num_port = 0;
2497 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
2498 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
2499 num_port++;
2500 if (first_port == -1)
2501 first_port = i;
2502 }
2503 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
2504 num_iomem++;
2505 }
2506
2507 /*
2508 * If there is 1 or 0 iomem regions, and exactly one port,
2509 * use it. We guess the number of ports based on the IO
2510 * region size.
2511 */
2512 if (num_iomem <= 1 && num_port == 1) {
2513 board->flags = first_port;
2514 board->num_ports = pci_resource_len(dev, first_port) / 8;
2515 return 0;
2516 }
2517
2518 /*
2519 * Now guess if we've got a board which indexes by BARs.
2520 * Each IO BAR should be 8 bytes, and they should follow
2521 * consecutively.
2522 */
2523 first_port = -1;
2524 num_port = 0;
2525 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
2526 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
2527 pci_resource_len(dev, i) == 8 &&
2528 (first_port == -1 || (first_port + num_port) == i)) {
2529 num_port++;
2530 if (first_port == -1)
2531 first_port = i;
2532 }
2533 }
2534
2535 if (num_port > 1) {
2536 board->flags = first_port | FL_BASE_BARS;
2537 board->num_ports = num_port;
2538 return 0;
2539 }
2540
2541 return -ENODEV;
2542}
2543
2544static inline int
Russell King975a1a7d2009-01-02 13:44:27 +00002545serial_pci_matches(const struct pciserial_board *board,
2546 const struct pciserial_board *guessed)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002547{
2548 return
2549 board->num_ports == guessed->num_ports &&
2550 board->base_baud == guessed->base_baud &&
2551 board->uart_offset == guessed->uart_offset &&
2552 board->reg_shift == guessed->reg_shift &&
2553 board->first_offset == guessed->first_offset;
2554}
2555
Russell King241fc432005-07-27 11:35:54 +01002556struct serial_private *
Russell King975a1a7d2009-01-02 13:44:27 +00002557pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
Russell King241fc432005-07-27 11:35:54 +01002558{
2559 struct uart_port serial_port;
2560 struct serial_private *priv;
2561 struct pci_serial_quirk *quirk;
2562 int rc, nr_ports, i;
2563
2564 nr_ports = board->num_ports;
2565
2566 /*
2567 * Find an init and setup quirks.
2568 */
2569 quirk = find_quirk(dev);
2570
2571 /*
2572 * Run the new-style initialization function.
2573 * The initialization function returns:
2574 * <0 - error
2575 * 0 - use board->num_ports
2576 * >0 - number of ports
2577 */
2578 if (quirk->init) {
2579 rc = quirk->init(dev);
2580 if (rc < 0) {
2581 priv = ERR_PTR(rc);
2582 goto err_out;
2583 }
2584 if (rc)
2585 nr_ports = rc;
2586 }
2587
Burman Yan8f31bb32007-02-14 00:33:07 -08002588 priv = kzalloc(sizeof(struct serial_private) +
Russell King241fc432005-07-27 11:35:54 +01002589 sizeof(unsigned int) * nr_ports,
2590 GFP_KERNEL);
2591 if (!priv) {
2592 priv = ERR_PTR(-ENOMEM);
2593 goto err_deinit;
2594 }
2595
Russell King241fc432005-07-27 11:35:54 +01002596 priv->dev = dev;
2597 priv->quirk = quirk;
2598
2599 memset(&serial_port, 0, sizeof(struct uart_port));
2600 serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
2601 serial_port.uartclk = board->base_baud * 16;
2602 serial_port.irq = get_pci_irq(dev, board);
2603 serial_port.dev = &dev->dev;
2604
2605 for (i = 0; i < nr_ports; i++) {
2606 if (quirk->setup(priv, board, &serial_port, i))
2607 break;
2608
2609#ifdef SERIAL_DEBUG_PCI
Lennert Buytenhek80647b92009-11-11 14:26:41 -08002610 printk(KERN_DEBUG "Setup PCI port: port %lx, irq %d, type %d\n",
Russell King241fc432005-07-27 11:35:54 +01002611 serial_port.iobase, serial_port.irq, serial_port.iotype);
2612#endif
Alan Cox5756ee92008-02-08 04:18:51 -08002613
Russell King241fc432005-07-27 11:35:54 +01002614 priv->line[i] = serial8250_register_port(&serial_port);
2615 if (priv->line[i] < 0) {
2616 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
2617 break;
2618 }
2619 }
Russell King241fc432005-07-27 11:35:54 +01002620 priv->nr = i;
Russell King241fc432005-07-27 11:35:54 +01002621 return priv;
2622
Alan Cox5756ee92008-02-08 04:18:51 -08002623err_deinit:
Russell King241fc432005-07-27 11:35:54 +01002624 if (quirk->exit)
2625 quirk->exit(dev);
Alan Cox5756ee92008-02-08 04:18:51 -08002626err_out:
Russell King241fc432005-07-27 11:35:54 +01002627 return priv;
2628}
2629EXPORT_SYMBOL_GPL(pciserial_init_ports);
2630
2631void pciserial_remove_ports(struct serial_private *priv)
2632{
2633 struct pci_serial_quirk *quirk;
2634 int i;
2635
2636 for (i = 0; i < priv->nr; i++)
2637 serial8250_unregister_port(priv->line[i]);
2638
2639 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
2640 if (priv->remapped_bar[i])
2641 iounmap(priv->remapped_bar[i]);
2642 priv->remapped_bar[i] = NULL;
2643 }
2644
2645 /*
2646 * Find the exit quirks.
2647 */
2648 quirk = find_quirk(priv->dev);
2649 if (quirk->exit)
2650 quirk->exit(priv->dev);
2651
2652 kfree(priv);
2653}
2654EXPORT_SYMBOL_GPL(pciserial_remove_ports);
2655
2656void pciserial_suspend_ports(struct serial_private *priv)
2657{
2658 int i;
2659
2660 for (i = 0; i < priv->nr; i++)
2661 if (priv->line[i] >= 0)
2662 serial8250_suspend_port(priv->line[i]);
2663}
2664EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
2665
2666void pciserial_resume_ports(struct serial_private *priv)
2667{
2668 int i;
2669
2670 /*
2671 * Ensure that the board is correctly configured.
2672 */
2673 if (priv->quirk->init)
2674 priv->quirk->init(priv->dev);
2675
2676 for (i = 0; i < priv->nr; i++)
2677 if (priv->line[i] >= 0)
2678 serial8250_resume_port(priv->line[i]);
2679}
2680EXPORT_SYMBOL_GPL(pciserial_resume_ports);
2681
Linus Torvalds1da177e2005-04-16 15:20:36 -07002682/*
2683 * Probe one serial board. Unfortunately, there is no rhyme nor reason
2684 * to the arrangement of serial ports on a PCI card.
2685 */
2686static int __devinit
2687pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
2688{
Frédéric Brière5bf8f502011-05-29 15:08:03 -04002689 struct pci_serial_quirk *quirk;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002690 struct serial_private *priv;
Russell King975a1a7d2009-01-02 13:44:27 +00002691 const struct pciserial_board *board;
2692 struct pciserial_board tmp;
Russell King241fc432005-07-27 11:35:54 +01002693 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002694
Frédéric Brière5bf8f502011-05-29 15:08:03 -04002695 quirk = find_quirk(dev);
2696 if (quirk->probe) {
2697 rc = quirk->probe(dev);
2698 if (rc)
2699 return rc;
2700 }
2701
Linus Torvalds1da177e2005-04-16 15:20:36 -07002702 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
2703 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
2704 ent->driver_data);
2705 return -EINVAL;
2706 }
2707
2708 board = &pci_boards[ent->driver_data];
2709
2710 rc = pci_enable_device(dev);
2711 if (rc)
2712 return rc;
2713
2714 if (ent->driver_data == pbn_default) {
2715 /*
2716 * Use a copy of the pci_board entry for this;
2717 * avoid changing entries in the table.
2718 */
Russell King1c7c1fe2005-07-27 11:31:19 +01002719 memcpy(&tmp, board, sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002720 board = &tmp;
2721
2722 /*
2723 * We matched one of our class entries. Try to
2724 * determine the parameters of this board.
2725 */
Russell King975a1a7d2009-01-02 13:44:27 +00002726 rc = serial_pci_guess_board(dev, &tmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002727 if (rc)
2728 goto disable;
2729 } else {
2730 /*
2731 * We matched an explicit entry. If we are able to
2732 * detect this boards settings with our heuristic,
2733 * then we no longer need this entry.
2734 */
Russell King1c7c1fe2005-07-27 11:31:19 +01002735 memcpy(&tmp, &pci_boards[pbn_default],
2736 sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002737 rc = serial_pci_guess_board(dev, &tmp);
2738 if (rc == 0 && serial_pci_matches(board, &tmp))
2739 moan_device("Redundant entry in serial pci_table.",
2740 dev);
2741 }
2742
Russell King241fc432005-07-27 11:35:54 +01002743 priv = pciserial_init_ports(dev, board);
2744 if (!IS_ERR(priv)) {
2745 pci_set_drvdata(dev, priv);
2746 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002747 }
2748
Russell King241fc432005-07-27 11:35:54 +01002749 rc = PTR_ERR(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002750
Linus Torvalds1da177e2005-04-16 15:20:36 -07002751 disable:
2752 pci_disable_device(dev);
2753 return rc;
2754}
2755
2756static void __devexit pciserial_remove_one(struct pci_dev *dev)
2757{
2758 struct serial_private *priv = pci_get_drvdata(dev);
2759
2760 pci_set_drvdata(dev, NULL);
2761
Russell King241fc432005-07-27 11:35:54 +01002762 pciserial_remove_ports(priv);
Russell King056a8762005-07-22 10:15:04 +01002763
2764 pci_disable_device(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002765}
2766
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07002767#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07002768static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
2769{
2770 struct serial_private *priv = pci_get_drvdata(dev);
2771
Russell King241fc432005-07-27 11:35:54 +01002772 if (priv)
2773 pciserial_suspend_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002774
Linus Torvalds1da177e2005-04-16 15:20:36 -07002775 pci_save_state(dev);
2776 pci_set_power_state(dev, pci_choose_state(dev, state));
2777 return 0;
2778}
2779
2780static int pciserial_resume_one(struct pci_dev *dev)
2781{
Dirk Hohndelccb9d592007-10-29 06:28:17 -07002782 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002783 struct serial_private *priv = pci_get_drvdata(dev);
2784
2785 pci_set_power_state(dev, PCI_D0);
2786 pci_restore_state(dev);
2787
2788 if (priv) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002789 /*
2790 * The device may have been disabled. Re-enable it.
2791 */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07002792 err = pci_enable_device(dev);
Alan Cox40836c42008-10-13 10:36:11 +01002793 /* FIXME: We cannot simply error out here */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07002794 if (err)
Alan Cox40836c42008-10-13 10:36:11 +01002795 printk(KERN_ERR "pciserial: Unable to re-enable ports, trying to continue.\n");
Russell King241fc432005-07-27 11:35:54 +01002796 pciserial_resume_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002797 }
2798 return 0;
2799}
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07002800#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002801
2802static struct pci_device_id serial_pci_tbl[] = {
Michael Bramer78d70d42009-01-27 11:51:16 +00002803 /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
2804 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
2805 PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
2806 pbn_b2_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002807 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
2808 PCI_SUBVENDOR_ID_CONNECT_TECH,
2809 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
2810 pbn_b1_8_1382400 },
2811 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
2812 PCI_SUBVENDOR_ID_CONNECT_TECH,
2813 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
2814 pbn_b1_4_1382400 },
2815 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
2816 PCI_SUBVENDOR_ID_CONNECT_TECH,
2817 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
2818 pbn_b1_2_1382400 },
2819 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2820 PCI_SUBVENDOR_ID_CONNECT_TECH,
2821 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
2822 pbn_b1_8_1382400 },
2823 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2824 PCI_SUBVENDOR_ID_CONNECT_TECH,
2825 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
2826 pbn_b1_4_1382400 },
2827 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2828 PCI_SUBVENDOR_ID_CONNECT_TECH,
2829 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
2830 pbn_b1_2_1382400 },
2831 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2832 PCI_SUBVENDOR_ID_CONNECT_TECH,
2833 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
2834 pbn_b1_8_921600 },
2835 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2836 PCI_SUBVENDOR_ID_CONNECT_TECH,
2837 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
2838 pbn_b1_8_921600 },
2839 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2840 PCI_SUBVENDOR_ID_CONNECT_TECH,
2841 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
2842 pbn_b1_4_921600 },
2843 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2844 PCI_SUBVENDOR_ID_CONNECT_TECH,
2845 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
2846 pbn_b1_4_921600 },
2847 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2848 PCI_SUBVENDOR_ID_CONNECT_TECH,
2849 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
2850 pbn_b1_2_921600 },
2851 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2852 PCI_SUBVENDOR_ID_CONNECT_TECH,
2853 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
2854 pbn_b1_8_921600 },
2855 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2856 PCI_SUBVENDOR_ID_CONNECT_TECH,
2857 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
2858 pbn_b1_8_921600 },
2859 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2860 PCI_SUBVENDOR_ID_CONNECT_TECH,
2861 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
2862 pbn_b1_4_921600 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002863 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
2864 PCI_SUBVENDOR_ID_CONNECT_TECH,
2865 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
2866 pbn_b1_2_1250000 },
2867 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
2868 PCI_SUBVENDOR_ID_CONNECT_TECH,
2869 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
2870 pbn_b0_2_1843200 },
2871 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
2872 PCI_SUBVENDOR_ID_CONNECT_TECH,
2873 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
2874 pbn_b0_4_1843200 },
Yoichi Yuasa85d14942006-02-08 21:46:24 +00002875 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
2876 PCI_VENDOR_ID_AFAVLAB,
2877 PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
2878 pbn_b0_4_1152000 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002879 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2880 PCI_SUBVENDOR_ID_CONNECT_TECH,
2881 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232, 0, 0,
2882 pbn_b0_2_1843200_200 },
2883 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2884 PCI_SUBVENDOR_ID_CONNECT_TECH,
2885 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232, 0, 0,
2886 pbn_b0_4_1843200_200 },
2887 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2888 PCI_SUBVENDOR_ID_CONNECT_TECH,
2889 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232, 0, 0,
2890 pbn_b0_8_1843200_200 },
2891 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2892 PCI_SUBVENDOR_ID_CONNECT_TECH,
2893 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1, 0, 0,
2894 pbn_b0_2_1843200_200 },
2895 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2896 PCI_SUBVENDOR_ID_CONNECT_TECH,
2897 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2, 0, 0,
2898 pbn_b0_4_1843200_200 },
2899 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2900 PCI_SUBVENDOR_ID_CONNECT_TECH,
2901 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4, 0, 0,
2902 pbn_b0_8_1843200_200 },
2903 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2904 PCI_SUBVENDOR_ID_CONNECT_TECH,
2905 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2, 0, 0,
2906 pbn_b0_2_1843200_200 },
2907 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2908 PCI_SUBVENDOR_ID_CONNECT_TECH,
2909 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4, 0, 0,
2910 pbn_b0_4_1843200_200 },
2911 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2912 PCI_SUBVENDOR_ID_CONNECT_TECH,
2913 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8, 0, 0,
2914 pbn_b0_8_1843200_200 },
2915 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2916 PCI_SUBVENDOR_ID_CONNECT_TECH,
2917 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485, 0, 0,
2918 pbn_b0_2_1843200_200 },
2919 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2920 PCI_SUBVENDOR_ID_CONNECT_TECH,
2921 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485, 0, 0,
2922 pbn_b0_4_1843200_200 },
2923 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2924 PCI_SUBVENDOR_ID_CONNECT_TECH,
2925 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
2926 pbn_b0_8_1843200_200 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07002927 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2928 PCI_VENDOR_ID_IBM, PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT,
2929 0, 0, pbn_exar_ibm_saturn },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002930
2931 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
Alan Cox5756ee92008-02-08 04:18:51 -08002932 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002933 pbn_b2_bt_1_115200 },
2934 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
Alan Cox5756ee92008-02-08 04:18:51 -08002935 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002936 pbn_b2_bt_2_115200 },
2937 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
Alan Cox5756ee92008-02-08 04:18:51 -08002938 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002939 pbn_b2_bt_4_115200 },
2940 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
Alan Cox5756ee92008-02-08 04:18:51 -08002941 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002942 pbn_b2_bt_2_115200 },
2943 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
Alan Cox5756ee92008-02-08 04:18:51 -08002944 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002945 pbn_b2_bt_4_115200 },
2946 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
Alan Cox5756ee92008-02-08 04:18:51 -08002947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002948 pbn_b2_8_115200 },
Flavio Leitnere65f0f82009-01-02 13:50:43 +00002949 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
2950 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2951 pbn_b2_8_460800 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002952 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
2953 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2954 pbn_b2_8_115200 },
2955
2956 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
2957 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2958 pbn_b2_bt_2_115200 },
2959 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
2960 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2961 pbn_b2_bt_2_921600 },
2962 /*
2963 * VScom SPCOM800, from sl@s.pl
2964 */
Alan Cox5756ee92008-02-08 04:18:51 -08002965 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
2966 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002967 pbn_b2_8_921600 },
2968 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
Alan Cox5756ee92008-02-08 04:18:51 -08002969 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002970 pbn_b2_4_921600 },
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07002971 /* Unknown card - subdevice 0x1584 */
2972 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
2973 PCI_VENDOR_ID_PLX,
2974 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
2975 pbn_b0_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002976 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
2977 PCI_SUBVENDOR_ID_KEYSPAN,
2978 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
2979 pbn_panacom },
2980 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
2981 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2982 pbn_panacom4 },
2983 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
2984 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2985 pbn_panacom2 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002986 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
2987 PCI_VENDOR_ID_ESDGMBH,
2988 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
2989 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002990 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
2991 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08002992 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002993 pbn_b2_4_460800 },
2994 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
2995 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08002996 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002997 pbn_b2_8_460800 },
2998 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
2999 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003000 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003001 pbn_b2_16_460800 },
3002 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3003 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003004 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003005 pbn_b2_16_460800 },
3006 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3007 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08003008 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003009 pbn_b2_4_460800 },
3010 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3011 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08003012 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003013 pbn_b2_8_460800 },
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01003014 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3015 PCI_SUBVENDOR_ID_EXSYS,
3016 PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
3017 pbn_exsys_4055 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003018 /*
3019 * Megawolf Romulus PCI Serial Card, from Mike Hudson
3020 * (Exoray@isys.ca)
3021 */
3022 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
3023 0x10b5, 0x106a, 0, 0,
3024 pbn_plx_romulus },
3025 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
3026 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3027 pbn_b1_4_115200 },
3028 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
3029 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3030 pbn_b1_2_115200 },
3031 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
3032 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3033 pbn_b1_8_115200 },
3034 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
3035 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3036 pbn_b1_8_115200 },
3037 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08003038 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
3039 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003040 pbn_b0_4_921600 },
3041 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08003042 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
3043 0, 0,
Andrey Paninfbc0dc02005-07-18 11:38:09 +01003044 pbn_b0_4_1152000 },
Mikulas Patockac9bd9d02010-10-26 14:20:48 -04003045 { PCI_VENDOR_ID_OXSEMI, 0x9505,
3046 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3047 pbn_b0_bt_2_921600 },
David Ransondb1de152005-07-27 11:43:55 -07003048
3049 /*
3050 * The below card is a little controversial since it is the
3051 * subject of a PCI vendor/device ID clash. (See
3052 * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
3053 * For now just used the hex ID 0x950a.
3054 */
3055 { PCI_VENDOR_ID_OXSEMI, 0x950a,
Niels de Vos39aced62009-01-02 13:46:58 +00003056 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL, 0, 0,
3057 pbn_b0_2_115200 },
3058 { PCI_VENDOR_ID_OXSEMI, 0x950a,
David Ransondb1de152005-07-27 11:43:55 -07003059 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3060 pbn_b0_2_1130000 },
Andre Przywara70fd8fd2009-06-11 12:41:57 +01003061 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_C950,
3062 PCI_VENDOR_ID_OXSEMI, PCI_SUBDEVICE_ID_OXSEMI_C950, 0, 0,
3063 pbn_b0_1_921600 },
Andrey Paninfbc0dc02005-07-18 11:38:09 +01003064 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003065 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3066 pbn_b0_4_115200 },
3067 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
3068 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3069 pbn_b0_bt_2_921600 },
Lytochkin Borise8470032010-07-26 10:02:26 +04003070 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
3071 PCI_ANY_ID , PCI_ANY_ID, 0, 0,
3072 pbn_b2_8_1152000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003073
3074 /*
Lee Howard7106b4e2008-10-21 13:48:58 +01003075 * Oxford Semiconductor Inc. Tornado PCI express device range.
3076 */
3077 { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
3078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3079 pbn_b0_1_4000000 },
3080 { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
3081 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3082 pbn_b0_1_4000000 },
3083 { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
3084 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3085 pbn_oxsemi_1_4000000 },
3086 { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
3087 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3088 pbn_oxsemi_1_4000000 },
3089 { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
3090 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3091 pbn_b0_1_4000000 },
3092 { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
3093 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3094 pbn_b0_1_4000000 },
3095 { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
3096 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3097 pbn_oxsemi_1_4000000 },
3098 { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
3099 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3100 pbn_oxsemi_1_4000000 },
3101 { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
3102 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3103 pbn_b0_1_4000000 },
3104 { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
3105 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3106 pbn_b0_1_4000000 },
3107 { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
3108 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3109 pbn_b0_1_4000000 },
3110 { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
3111 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3112 pbn_b0_1_4000000 },
3113 { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
3114 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3115 pbn_oxsemi_2_4000000 },
3116 { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
3117 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3118 pbn_oxsemi_2_4000000 },
3119 { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
3120 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3121 pbn_oxsemi_4_4000000 },
3122 { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
3123 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3124 pbn_oxsemi_4_4000000 },
3125 { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
3126 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3127 pbn_oxsemi_8_4000000 },
3128 { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
3129 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3130 pbn_oxsemi_8_4000000 },
3131 { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
3132 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3133 pbn_oxsemi_1_4000000 },
3134 { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
3135 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3136 pbn_oxsemi_1_4000000 },
3137 { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
3138 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3139 pbn_oxsemi_1_4000000 },
3140 { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
3141 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3142 pbn_oxsemi_1_4000000 },
3143 { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
3144 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3145 pbn_oxsemi_1_4000000 },
3146 { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
3147 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3148 pbn_oxsemi_1_4000000 },
3149 { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
3150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3151 pbn_oxsemi_1_4000000 },
3152 { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
3153 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3154 pbn_oxsemi_1_4000000 },
3155 { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
3156 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3157 pbn_oxsemi_1_4000000 },
3158 { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
3159 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3160 pbn_oxsemi_1_4000000 },
3161 { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
3162 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3163 pbn_oxsemi_1_4000000 },
3164 { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
3165 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3166 pbn_oxsemi_1_4000000 },
3167 { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
3168 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3169 pbn_oxsemi_1_4000000 },
3170 { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
3171 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3172 pbn_oxsemi_1_4000000 },
3173 { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
3174 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3175 pbn_oxsemi_1_4000000 },
3176 { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
3177 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3178 pbn_oxsemi_1_4000000 },
3179 { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
3180 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3181 pbn_oxsemi_1_4000000 },
3182 { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
3183 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3184 pbn_oxsemi_1_4000000 },
3185 { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
3186 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3187 pbn_oxsemi_1_4000000 },
3188 { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
3189 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3190 pbn_oxsemi_1_4000000 },
3191 { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
3192 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3193 pbn_oxsemi_1_4000000 },
3194 { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
3195 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3196 pbn_oxsemi_1_4000000 },
3197 { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
3198 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3199 pbn_oxsemi_1_4000000 },
3200 { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
3201 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3202 pbn_oxsemi_1_4000000 },
3203 { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
3204 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3205 pbn_oxsemi_1_4000000 },
3206 { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
3207 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3208 pbn_oxsemi_1_4000000 },
Lee Howardb80de362008-10-21 13:50:14 +01003209 /*
3210 * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
3211 */
3212 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
3213 PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
3214 pbn_oxsemi_1_4000000 },
3215 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
3216 PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
3217 pbn_oxsemi_2_4000000 },
3218 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
3219 PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
3220 pbn_oxsemi_4_4000000 },
3221 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
3222 PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
3223 pbn_oxsemi_8_4000000 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05003224
3225 /*
3226 * Digi/IBM PCIe 2-port Async EIA-232 Adapter utilizing OxSemi Tornado
3227 */
3228 { PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
3229 PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
3230 pbn_oxsemi_2_4000000 },
3231
Lee Howard7106b4e2008-10-21 13:48:58 +01003232 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003233 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
3234 * from skokodyn@yahoo.com
3235 */
3236 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
3237 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
3238 pbn_sbsxrsio },
3239 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
3240 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
3241 pbn_sbsxrsio },
3242 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
3243 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
3244 pbn_sbsxrsio },
3245 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
3246 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
3247 pbn_sbsxrsio },
3248
3249 /*
3250 * Digitan DS560-558, from jimd@esoft.com
3251 */
3252 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
Alan Cox5756ee92008-02-08 04:18:51 -08003253 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003254 pbn_b1_1_115200 },
3255
3256 /*
3257 * Titan Electronic cards
3258 * The 400L and 800L have a custom setup quirk.
3259 */
3260 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
Alan Cox5756ee92008-02-08 04:18:51 -08003261 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003262 pbn_b0_1_921600 },
3263 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
Alan Cox5756ee92008-02-08 04:18:51 -08003264 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003265 pbn_b0_2_921600 },
3266 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
Alan Cox5756ee92008-02-08 04:18:51 -08003267 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003268 pbn_b0_4_921600 },
3269 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
Alan Cox5756ee92008-02-08 04:18:51 -08003270 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003271 pbn_b0_4_921600 },
3272 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
3273 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3274 pbn_b1_1_921600 },
3275 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
3276 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3277 pbn_b1_bt_2_921600 },
3278 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
3279 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3280 pbn_b0_bt_4_921600 },
3281 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
3282 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3283 pbn_b0_bt_8_921600 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02003284 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200I,
3285 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3286 pbn_b4_bt_2_921600 },
3287 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400I,
3288 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3289 pbn_b4_bt_4_921600 },
3290 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800I,
3291 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3292 pbn_b4_bt_8_921600 },
3293 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400EH,
3294 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3295 pbn_b0_4_921600 },
3296 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EH,
3297 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3298 pbn_b0_4_921600 },
3299 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EHB,
3300 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3301 pbn_b0_4_921600 },
3302 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
3303 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3304 pbn_oxsemi_1_4000000 },
3305 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
3306 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3307 pbn_oxsemi_2_4000000 },
3308 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
3309 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3310 pbn_oxsemi_4_4000000 },
3311 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
3312 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3313 pbn_oxsemi_8_4000000 },
3314 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
3315 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3316 pbn_oxsemi_2_4000000 },
3317 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
3318 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3319 pbn_oxsemi_2_4000000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003320
3321 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
3322 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3323 pbn_b2_1_460800 },
3324 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
3325 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3326 pbn_b2_1_460800 },
3327 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
3328 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3329 pbn_b2_1_460800 },
3330 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
3331 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3332 pbn_b2_bt_2_921600 },
3333 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
3334 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3335 pbn_b2_bt_2_921600 },
3336 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
3337 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3338 pbn_b2_bt_2_921600 },
3339 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
3340 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3341 pbn_b2_bt_4_921600 },
3342 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
3343 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3344 pbn_b2_bt_4_921600 },
3345 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
3346 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3347 pbn_b2_bt_4_921600 },
3348 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
3349 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3350 pbn_b0_1_921600 },
3351 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
3352 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3353 pbn_b0_1_921600 },
3354 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
3355 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3356 pbn_b0_1_921600 },
3357 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
3358 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3359 pbn_b0_bt_2_921600 },
3360 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
3361 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3362 pbn_b0_bt_2_921600 },
3363 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
3364 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3365 pbn_b0_bt_2_921600 },
3366 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
3367 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3368 pbn_b0_bt_4_921600 },
3369 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
3370 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3371 pbn_b0_bt_4_921600 },
3372 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
3373 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3374 pbn_b0_bt_4_921600 },
Andrey Panin3ec9c592006-02-02 20:15:09 +00003375 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
3376 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3377 pbn_b0_bt_8_921600 },
3378 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
3379 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3380 pbn_b0_bt_8_921600 },
3381 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
3382 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3383 pbn_b0_bt_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003384
3385 /*
3386 * Computone devices submitted by Doug McNash dmcnash@computone.com
3387 */
3388 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
3389 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
3390 0, 0, pbn_computone_4 },
3391 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
3392 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
3393 0, 0, pbn_computone_8 },
3394 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
3395 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
3396 0, 0, pbn_computone_6 },
3397
3398 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
3399 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3400 pbn_oxsemi },
3401 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
3402 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
3403 pbn_b0_bt_1_921600 },
3404
3405 /*
3406 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
3407 */
3408 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
3409 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3410 pbn_b0_bt_8_115200 },
3411 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
3412 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3413 pbn_b0_bt_8_115200 },
3414
3415 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
3416 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3417 pbn_b0_bt_2_115200 },
3418 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
3419 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3420 pbn_b0_bt_2_115200 },
3421 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
3422 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3423 pbn_b0_bt_2_115200 },
Lennert Buytenhekb87e5e22009-11-11 14:26:42 -08003424 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
3425 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3426 pbn_b0_bt_2_115200 },
3427 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
3428 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3429 pbn_b0_bt_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003430 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
3431 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3432 pbn_b0_bt_4_460800 },
3433 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
3434 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3435 pbn_b0_bt_4_460800 },
3436 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
3437 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3438 pbn_b0_bt_2_460800 },
3439 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
3440 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3441 pbn_b0_bt_2_460800 },
3442 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
3443 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3444 pbn_b0_bt_2_460800 },
3445 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
3446 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3447 pbn_b0_bt_1_115200 },
3448 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
3449 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3450 pbn_b0_bt_1_460800 },
3451
3452 /*
Russell King1fb8cac2006-12-13 14:45:46 +00003453 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
3454 * Cards are identified by their subsystem vendor IDs, which
3455 * (in hex) match the model number.
3456 *
3457 * Note that JC140x are RS422/485 cards which require ox950
3458 * ACR = 0x10, and as such are not currently fully supported.
3459 */
3460 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
3461 0x1204, 0x0004, 0, 0,
3462 pbn_b0_4_921600 },
3463 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
3464 0x1208, 0x0004, 0, 0,
3465 pbn_b0_4_921600 },
3466/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
3467 0x1402, 0x0002, 0, 0,
3468 pbn_b0_2_921600 }, */
3469/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
3470 0x1404, 0x0004, 0, 0,
3471 pbn_b0_4_921600 }, */
3472 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
3473 0x1208, 0x0004, 0, 0,
3474 pbn_b0_4_921600 },
3475
Kiros Yeh2a52fcb2009-12-21 16:26:48 -08003476 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
3477 0x1204, 0x0004, 0, 0,
3478 pbn_b0_4_921600 },
3479 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
3480 0x1208, 0x0004, 0, 0,
3481 pbn_b0_4_921600 },
3482 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF3,
3483 0x1208, 0x0004, 0, 0,
3484 pbn_b0_4_921600 },
Russell King1fb8cac2006-12-13 14:45:46 +00003485 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003486 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
3487 */
3488 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
3489 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3490 pbn_b1_1_1382400 },
3491
3492 /*
3493 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
3494 */
3495 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
3496 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3497 pbn_b1_1_1382400 },
3498
3499 /*
3500 * RAStel 2 port modem, gerg@moreton.com.au
3501 */
3502 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
3503 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3504 pbn_b2_bt_2_115200 },
3505
3506 /*
3507 * EKF addition for i960 Boards form EKF with serial port
3508 */
3509 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
3510 0xE4BF, PCI_ANY_ID, 0, 0,
3511 pbn_intel_i960 },
3512
3513 /*
3514 * Xircom Cardbus/Ethernet combos
3515 */
3516 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
3517 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3518 pbn_b0_1_115200 },
3519 /*
3520 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
3521 */
3522 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
3523 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3524 pbn_b0_1_115200 },
3525
3526 /*
3527 * Untested PCI modems, sent in from various folks...
3528 */
3529
3530 /*
3531 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
3532 */
3533 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
3534 0x1048, 0x1500, 0, 0,
3535 pbn_b1_1_115200 },
3536
3537 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
3538 0xFF00, 0, 0, 0,
3539 pbn_sgi_ioc3 },
3540
3541 /*
3542 * HP Diva card
3543 */
3544 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
3545 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
3546 pbn_b1_1_115200 },
3547 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
3548 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3549 pbn_b0_5_115200 },
3550 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
3551 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3552 pbn_b2_1_115200 },
3553
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00003554 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
3555 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3556 pbn_b3_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003557 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
3558 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3559 pbn_b3_4_115200 },
3560 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
3561 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3562 pbn_b3_8_115200 },
3563
3564 /*
3565 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
3566 */
3567 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3568 PCI_ANY_ID, PCI_ANY_ID,
3569 0,
3570 0, pbn_exar_XR17C152 },
3571 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3572 PCI_ANY_ID, PCI_ANY_ID,
3573 0,
3574 0, pbn_exar_XR17C154 },
3575 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3576 PCI_ANY_ID, PCI_ANY_ID,
3577 0,
3578 0, pbn_exar_XR17C158 },
3579
3580 /*
3581 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
3582 */
3583 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
3584 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3585 pbn_b0_1_115200 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07003586 /*
3587 * ITE
3588 */
3589 { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
3590 PCI_ANY_ID, PCI_ANY_ID,
3591 0, 0,
3592 pbn_b1_bt_1_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003593
3594 /*
Peter Horton737c1752006-08-26 09:07:36 +01003595 * IntaShield IS-200
3596 */
3597 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
3598 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
3599 pbn_b2_2_115200 },
Ignacio García Pérez4b6f6ce2008-05-23 13:04:28 -07003600 /*
3601 * IntaShield IS-400
3602 */
3603 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
3604 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
3605 pbn_b2_4_115200 },
Peter Horton737c1752006-08-26 09:07:36 +01003606 /*
Thomas Hoehn48212002007-02-10 01:46:05 -08003607 * Perle PCI-RAS cards
3608 */
3609 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
3610 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
3611 0, 0, pbn_b2_4_921600 },
3612 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
3613 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
3614 0, 0, pbn_b2_8_921600 },
Alan Coxbf0df632007-10-16 01:24:00 -07003615
3616 /*
3617 * Mainpine series cards: Fairly standard layout but fools
3618 * parts of the autodetect in some cases and uses otherwise
3619 * unmatched communications subclasses in the PCI Express case
3620 */
3621
3622 { /* RockForceDUO */
3623 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3624 PCI_VENDOR_ID_MAINPINE, 0x0200,
3625 0, 0, pbn_b0_2_115200 },
3626 { /* RockForceQUATRO */
3627 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3628 PCI_VENDOR_ID_MAINPINE, 0x0300,
3629 0, 0, pbn_b0_4_115200 },
3630 { /* RockForceDUO+ */
3631 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3632 PCI_VENDOR_ID_MAINPINE, 0x0400,
3633 0, 0, pbn_b0_2_115200 },
3634 { /* RockForceQUATRO+ */
3635 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3636 PCI_VENDOR_ID_MAINPINE, 0x0500,
3637 0, 0, pbn_b0_4_115200 },
3638 { /* RockForce+ */
3639 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3640 PCI_VENDOR_ID_MAINPINE, 0x0600,
3641 0, 0, pbn_b0_2_115200 },
3642 { /* RockForce+ */
3643 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3644 PCI_VENDOR_ID_MAINPINE, 0x0700,
3645 0, 0, pbn_b0_4_115200 },
3646 { /* RockForceOCTO+ */
3647 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3648 PCI_VENDOR_ID_MAINPINE, 0x0800,
3649 0, 0, pbn_b0_8_115200 },
3650 { /* RockForceDUO+ */
3651 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3652 PCI_VENDOR_ID_MAINPINE, 0x0C00,
3653 0, 0, pbn_b0_2_115200 },
3654 { /* RockForceQUARTRO+ */
3655 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3656 PCI_VENDOR_ID_MAINPINE, 0x0D00,
3657 0, 0, pbn_b0_4_115200 },
3658 { /* RockForceOCTO+ */
3659 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3660 PCI_VENDOR_ID_MAINPINE, 0x1D00,
3661 0, 0, pbn_b0_8_115200 },
3662 { /* RockForceD1 */
3663 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3664 PCI_VENDOR_ID_MAINPINE, 0x2000,
3665 0, 0, pbn_b0_1_115200 },
3666 { /* RockForceF1 */
3667 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3668 PCI_VENDOR_ID_MAINPINE, 0x2100,
3669 0, 0, pbn_b0_1_115200 },
3670 { /* RockForceD2 */
3671 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3672 PCI_VENDOR_ID_MAINPINE, 0x2200,
3673 0, 0, pbn_b0_2_115200 },
3674 { /* RockForceF2 */
3675 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3676 PCI_VENDOR_ID_MAINPINE, 0x2300,
3677 0, 0, pbn_b0_2_115200 },
3678 { /* RockForceD4 */
3679 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3680 PCI_VENDOR_ID_MAINPINE, 0x2400,
3681 0, 0, pbn_b0_4_115200 },
3682 { /* RockForceF4 */
3683 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3684 PCI_VENDOR_ID_MAINPINE, 0x2500,
3685 0, 0, pbn_b0_4_115200 },
3686 { /* RockForceD8 */
3687 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3688 PCI_VENDOR_ID_MAINPINE, 0x2600,
3689 0, 0, pbn_b0_8_115200 },
3690 { /* RockForceF8 */
3691 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3692 PCI_VENDOR_ID_MAINPINE, 0x2700,
3693 0, 0, pbn_b0_8_115200 },
3694 { /* IQ Express D1 */
3695 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3696 PCI_VENDOR_ID_MAINPINE, 0x3000,
3697 0, 0, pbn_b0_1_115200 },
3698 { /* IQ Express F1 */
3699 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3700 PCI_VENDOR_ID_MAINPINE, 0x3100,
3701 0, 0, pbn_b0_1_115200 },
3702 { /* IQ Express D2 */
3703 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3704 PCI_VENDOR_ID_MAINPINE, 0x3200,
3705 0, 0, pbn_b0_2_115200 },
3706 { /* IQ Express F2 */
3707 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3708 PCI_VENDOR_ID_MAINPINE, 0x3300,
3709 0, 0, pbn_b0_2_115200 },
3710 { /* IQ Express D4 */
3711 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3712 PCI_VENDOR_ID_MAINPINE, 0x3400,
3713 0, 0, pbn_b0_4_115200 },
3714 { /* IQ Express F4 */
3715 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3716 PCI_VENDOR_ID_MAINPINE, 0x3500,
3717 0, 0, pbn_b0_4_115200 },
3718 { /* IQ Express D8 */
3719 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3720 PCI_VENDOR_ID_MAINPINE, 0x3C00,
3721 0, 0, pbn_b0_8_115200 },
3722 { /* IQ Express F8 */
3723 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
3724 PCI_VENDOR_ID_MAINPINE, 0x3D00,
3725 0, 0, pbn_b0_8_115200 },
3726
3727
Thomas Hoehn48212002007-02-10 01:46:05 -08003728 /*
Olof Johanssonaa798502007-08-22 14:01:55 -07003729 * PA Semi PA6T-1682M on-chip UART
3730 */
3731 { PCI_VENDOR_ID_PASEMI, 0xa004,
3732 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3733 pbn_pasemi_1682M },
3734
3735 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01003736 * National Instruments
3737 */
Will Page04bf7e72009-04-06 17:32:15 +01003738 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
3739 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3740 pbn_b1_16_115200 },
3741 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
3742 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3743 pbn_b1_8_115200 },
3744 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
3745 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3746 pbn_b1_bt_4_115200 },
3747 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
3748 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3749 pbn_b1_bt_2_115200 },
3750 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
3751 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3752 pbn_b1_bt_4_115200 },
3753 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
3754 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3755 pbn_b1_bt_2_115200 },
3756 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
3757 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3758 pbn_b1_16_115200 },
3759 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
3760 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3761 pbn_b1_8_115200 },
3762 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
3763 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3764 pbn_b1_bt_4_115200 },
3765 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
3766 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3767 pbn_b1_bt_2_115200 },
3768 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
3769 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3770 pbn_b1_bt_4_115200 },
3771 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
3772 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3773 pbn_b1_bt_2_115200 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01003774 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
3775 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3776 pbn_ni8430_2 },
3777 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
3778 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3779 pbn_ni8430_2 },
3780 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
3781 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3782 pbn_ni8430_4 },
3783 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
3784 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3785 pbn_ni8430_4 },
3786 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
3787 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3788 pbn_ni8430_8 },
3789 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
3790 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3791 pbn_ni8430_8 },
3792 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
3793 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3794 pbn_ni8430_16 },
3795 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
3796 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3797 pbn_ni8430_16 },
3798 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
3799 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3800 pbn_ni8430_2 },
3801 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
3802 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3803 pbn_ni8430_2 },
3804 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
3805 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3806 pbn_ni8430_4 },
3807 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
3808 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3809 pbn_ni8430_4 },
3810
3811 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08003812 * ADDI-DATA GmbH communication cards <info@addi-data.com>
3813 */
3814 { PCI_VENDOR_ID_ADDIDATA,
3815 PCI_DEVICE_ID_ADDIDATA_APCI7500,
3816 PCI_ANY_ID,
3817 PCI_ANY_ID,
3818 0,
3819 0,
3820 pbn_b0_4_115200 },
3821
3822 { PCI_VENDOR_ID_ADDIDATA,
3823 PCI_DEVICE_ID_ADDIDATA_APCI7420,
3824 PCI_ANY_ID,
3825 PCI_ANY_ID,
3826 0,
3827 0,
3828 pbn_b0_2_115200 },
3829
3830 { PCI_VENDOR_ID_ADDIDATA,
3831 PCI_DEVICE_ID_ADDIDATA_APCI7300,
3832 PCI_ANY_ID,
3833 PCI_ANY_ID,
3834 0,
3835 0,
3836 pbn_b0_1_115200 },
3837
3838 { PCI_VENDOR_ID_ADDIDATA_OLD,
3839 PCI_DEVICE_ID_ADDIDATA_APCI7800,
3840 PCI_ANY_ID,
3841 PCI_ANY_ID,
3842 0,
3843 0,
3844 pbn_b1_8_115200 },
3845
3846 { PCI_VENDOR_ID_ADDIDATA,
3847 PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
3848 PCI_ANY_ID,
3849 PCI_ANY_ID,
3850 0,
3851 0,
3852 pbn_b0_4_115200 },
3853
3854 { PCI_VENDOR_ID_ADDIDATA,
3855 PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
3856 PCI_ANY_ID,
3857 PCI_ANY_ID,
3858 0,
3859 0,
3860 pbn_b0_2_115200 },
3861
3862 { PCI_VENDOR_ID_ADDIDATA,
3863 PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
3864 PCI_ANY_ID,
3865 PCI_ANY_ID,
3866 0,
3867 0,
3868 pbn_b0_1_115200 },
3869
3870 { PCI_VENDOR_ID_ADDIDATA,
3871 PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
3872 PCI_ANY_ID,
3873 PCI_ANY_ID,
3874 0,
3875 0,
3876 pbn_b0_4_115200 },
3877
3878 { PCI_VENDOR_ID_ADDIDATA,
3879 PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
3880 PCI_ANY_ID,
3881 PCI_ANY_ID,
3882 0,
3883 0,
3884 pbn_b0_2_115200 },
3885
3886 { PCI_VENDOR_ID_ADDIDATA,
3887 PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
3888 PCI_ANY_ID,
3889 PCI_ANY_ID,
3890 0,
3891 0,
3892 pbn_b0_1_115200 },
3893
3894 { PCI_VENDOR_ID_ADDIDATA,
3895 PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
3896 PCI_ANY_ID,
3897 PCI_ANY_ID,
3898 0,
3899 0,
3900 pbn_b0_8_115200 },
3901
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07003902 { PCI_VENDOR_ID_ADDIDATA,
3903 PCI_DEVICE_ID_ADDIDATA_APCIe7500,
3904 PCI_ANY_ID,
3905 PCI_ANY_ID,
3906 0,
3907 0,
3908 pbn_ADDIDATA_PCIe_4_3906250 },
3909
3910 { PCI_VENDOR_ID_ADDIDATA,
3911 PCI_DEVICE_ID_ADDIDATA_APCIe7420,
3912 PCI_ANY_ID,
3913 PCI_ANY_ID,
3914 0,
3915 0,
3916 pbn_ADDIDATA_PCIe_2_3906250 },
3917
3918 { PCI_VENDOR_ID_ADDIDATA,
3919 PCI_DEVICE_ID_ADDIDATA_APCIe7300,
3920 PCI_ANY_ID,
3921 PCI_ANY_ID,
3922 0,
3923 0,
3924 pbn_ADDIDATA_PCIe_1_3906250 },
3925
3926 { PCI_VENDOR_ID_ADDIDATA,
3927 PCI_DEVICE_ID_ADDIDATA_APCIe7800,
3928 PCI_ANY_ID,
3929 PCI_ANY_ID,
3930 0,
3931 0,
3932 pbn_ADDIDATA_PCIe_8_3906250 },
3933
Jiri Slaby25cf9bc2009-01-15 13:30:34 +00003934 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
3935 PCI_VENDOR_ID_IBM, 0x0299,
3936 0, 0, pbn_b0_bt_2_115200 },
3937
Michael Bueschc4285b42009-06-30 11:41:21 -07003938 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
3939 0xA000, 0x1000,
3940 0, 0, pbn_b0_1_115200 },
3941
Nicos Gollan7808edc2011-05-05 21:00:37 +02003942 /* the 9901 is a rebranded 9912 */
3943 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
3944 0xA000, 0x1000,
3945 0, 0, pbn_b0_1_115200 },
3946
3947 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
3948 0xA000, 0x1000,
3949 0, 0, pbn_b0_1_115200 },
3950
3951 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
3952 0xA000, 0x1000,
3953 0, 0, pbn_b0_1_115200 },
3954
3955 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
3956 0xA000, 0x1000,
3957 0, 0, pbn_b0_1_115200 },
3958
3959 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
3960 0xA000, 0x3002,
3961 0, 0, pbn_NETMOS9900_2s_115200 },
3962
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08003963 /*
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08003964 * Best Connectivity PCI Multi I/O cards
3965 */
3966
3967 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
3968 0xA000, 0x1000,
3969 0, 0, pbn_b0_1_115200 },
3970
3971 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
3972 0xA000, 0x3004,
3973 0, 0, pbn_b0_bt_4_115200 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003974 /* Intel CE4100 */
3975 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
3976 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3977 pbn_ce4100_1_115200 },
3978
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04003979 /*
3980 * Cronyx Omega PCI
3981 */
3982 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
3983 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3984 pbn_omegapci },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08003985
3986 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003987 * These entries match devices with class COMMUNICATION_SERIAL,
3988 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
3989 */
3990 { PCI_ANY_ID, PCI_ANY_ID,
3991 PCI_ANY_ID, PCI_ANY_ID,
3992 PCI_CLASS_COMMUNICATION_SERIAL << 8,
3993 0xffff00, pbn_default },
3994 { PCI_ANY_ID, PCI_ANY_ID,
3995 PCI_ANY_ID, PCI_ANY_ID,
3996 PCI_CLASS_COMMUNICATION_MODEM << 8,
3997 0xffff00, pbn_default },
3998 { PCI_ANY_ID, PCI_ANY_ID,
3999 PCI_ANY_ID, PCI_ANY_ID,
4000 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
4001 0xffff00, pbn_default },
4002 { 0, }
4003};
4004
4005static struct pci_driver serial_pci_driver = {
4006 .name = "serial",
4007 .probe = pciserial_init_one,
4008 .remove = __devexit_p(pciserial_remove_one),
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07004009#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07004010 .suspend = pciserial_suspend_one,
4011 .resume = pciserial_resume_one,
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07004012#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07004013 .id_table = serial_pci_tbl,
4014};
4015
4016static int __init serial8250_pci_init(void)
4017{
4018 return pci_register_driver(&serial_pci_driver);
4019}
4020
4021static void __exit serial8250_pci_exit(void)
4022{
4023 pci_unregister_driver(&serial_pci_driver);
4024}
4025
4026module_init(serial8250_pci_init);
4027module_exit(serial8250_pci_exit);
4028
4029MODULE_LICENSE("GPL");
4030MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
4031MODULE_DEVICE_TABLE(pci, serial_pci_tbl);