blob: 4ea45c15388cc8148cf9e5b5773f909962b28e4c [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 */
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -070012#undef DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/pci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/string.h>
17#include <linux/kernel.h>
18#include <linux/slab.h>
19#include <linux/delay.h>
20#include <linux/tty.h>
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -070021#include <linux/serial_reg.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <linux/serial_core.h>
23#include <linux/8250_pci.h>
24#include <linux/bitops.h>
25
26#include <asm/byteorder.h>
27#include <asm/io.h>
28
29#include "8250.h"
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031/*
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 *,
Alan Cox2655a2c2012-07-12 12:59:50 +010046 struct uart_8250_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*,
Alan Cox2655a2c2012-07-12 12:59:50 +010061 const struct pciserial_board*, struct uart_8250_port *, int);
Nicos Gollan7808edc2011-05-05 21:00:37 +020062
Linus Torvalds1da177e2005-04-16 15:20:36 -070063static void moan_device(const char *str, struct pci_dev *dev)
64{
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -070065 dev_err(&dev->dev,
Joe Perchesad361c92009-07-06 13:05:40 -070066 "%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
Alan Cox2655a2c2012-07-12 12:59:50 +010076setup_port(struct serial_private *priv, struct uart_8250_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
Alan Cox2655a2c2012-07-12 12:59:50 +010095 port->port.iotype = UPIO_MEM;
96 port->port.iobase = 0;
97 port->port.mapbase = base + offset;
98 port->port.membase = priv->remapped_bar[bar] + offset;
99 port->port.regshift = regshift;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 } else {
Alan Cox2655a2c2012-07-12 12:59:50 +0100101 port->port.iotype = UPIO_PORT;
102 port->port.iobase = base + offset;
103 port->port.mapbase = 0;
104 port->port.membase = NULL;
105 port->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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100115 struct uart_8250_port *port, int idx)
Krauth.Julien02c9b5c2008-02-04 22:27:49 -0800116{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100142 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100197 struct uart_8250_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 */
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -0700235 dev_dbg(&dev->dev, "Local i960 firmware missing\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 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
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500290static void pci_plx9050_exit(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291{
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
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500315static void pci_ni8420_exit(struct pci_dev *dev)
Will Page04bf7e72009-04-06 17:32:15 +0100316{
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
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500347static void pci_ni8430_exit(struct pci_dev *dev)
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100348{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100372 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373{
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
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500424static void sbs_exit(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100527 struct uart_8250_port *port, int idx)
Andrey Panin3ec9c592006-02-02 20:15:09 +0000528{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100621 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700622{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100655 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656{
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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100756 struct uart_8250_port *port, int idx)
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100757{
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
Joe Perches7c9d4402011-06-23 11:39:20 -0700772 /* enable the transceiver */
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100773 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,
Alan Cox2655a2c2012-07-12 12:59:50 +0100783 struct uart_8250_port *port, int idx)
Nicos Gollan7808edc2011-05-05 21:00:37 +0200784{
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 {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -0700829 dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on ambiguous config.\n");
Nicos Gollan7808edc2011-05-05 21:00:37 +0200830 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]) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -0700933 dev_err(&dev->dev, "ite887x: could not find iobase\n");
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700934 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
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500993static void pci_ite887x_exit(struct pci_dev *dev)
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700994{
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);
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001026 dev_dbg(&dev->dev,
Russell King9f2a0362009-01-02 13:44:20 +00001027 "%d ports detected on Oxford PCI Express device\n",
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001028 number_uarts);
Russell King9f2a0362009-01-02 13:44:20 +00001029 }
1030 pci_iounmap(dev, p);
1031 return number_uarts;
1032}
1033
Alan Coxeb26dfe2012-07-12 13:00:31 +01001034static int pci_asix_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +00001035 const struct pciserial_board *board,
Alan Coxeb26dfe2012-07-12 13:00:31 +01001036 struct uart_8250_port *port, int idx)
1037{
1038 port->bugs |= UART_BUG_PARITY;
1039 return pci_default_setup(priv, board, port, idx);
1040}
1041
Alan Cox55c7c0f2012-11-29 09:03:00 +10301042/* Quatech devices have their own extra interface features */
1043
1044struct quatech_feature {
1045 u16 devid;
1046 bool amcc;
1047};
1048
1049#define QPCR_TEST_FOR1 0x3F
1050#define QPCR_TEST_GET1 0x00
1051#define QPCR_TEST_FOR2 0x40
1052#define QPCR_TEST_GET2 0x40
1053#define QPCR_TEST_FOR3 0x80
1054#define QPCR_TEST_GET3 0x40
1055#define QPCR_TEST_FOR4 0xC0
1056#define QPCR_TEST_GET4 0x80
1057
1058#define QOPR_CLOCK_X1 0x0000
1059#define QOPR_CLOCK_X2 0x0001
1060#define QOPR_CLOCK_X4 0x0002
1061#define QOPR_CLOCK_X8 0x0003
1062#define QOPR_CLOCK_RATE_MASK 0x0003
1063
1064
1065static struct quatech_feature quatech_cards[] = {
1066 { PCI_DEVICE_ID_QUATECH_QSC100, 1 },
1067 { PCI_DEVICE_ID_QUATECH_DSC100, 1 },
1068 { PCI_DEVICE_ID_QUATECH_DSC100E, 0 },
1069 { PCI_DEVICE_ID_QUATECH_DSC200, 1 },
1070 { PCI_DEVICE_ID_QUATECH_DSC200E, 0 },
1071 { PCI_DEVICE_ID_QUATECH_ESC100D, 1 },
1072 { PCI_DEVICE_ID_QUATECH_ESC100M, 1 },
1073 { PCI_DEVICE_ID_QUATECH_QSCP100, 1 },
1074 { PCI_DEVICE_ID_QUATECH_DSCP100, 1 },
1075 { PCI_DEVICE_ID_QUATECH_QSCP200, 1 },
1076 { PCI_DEVICE_ID_QUATECH_DSCP200, 1 },
1077 { PCI_DEVICE_ID_QUATECH_ESCLP100, 0 },
1078 { PCI_DEVICE_ID_QUATECH_QSCLP100, 0 },
1079 { PCI_DEVICE_ID_QUATECH_DSCLP100, 0 },
1080 { PCI_DEVICE_ID_QUATECH_SSCLP100, 0 },
1081 { PCI_DEVICE_ID_QUATECH_QSCLP200, 0 },
1082 { PCI_DEVICE_ID_QUATECH_DSCLP200, 0 },
1083 { PCI_DEVICE_ID_QUATECH_SSCLP200, 0 },
1084 { PCI_DEVICE_ID_QUATECH_SPPXP_100, 0 },
1085 { 0, }
1086};
1087
1088static int pci_quatech_amcc(u16 devid)
1089{
1090 struct quatech_feature *qf = &quatech_cards[0];
1091 while (qf->devid) {
1092 if (qf->devid == devid)
1093 return qf->amcc;
1094 qf++;
1095 }
1096 pr_err("quatech: unknown port type '0x%04X'.\n", devid);
1097 return 0;
1098};
1099
1100static int pci_quatech_rqopr(struct uart_8250_port *port)
1101{
1102 unsigned long base = port->port.iobase;
1103 u8 LCR, val;
1104
1105 LCR = inb(base + UART_LCR);
1106 outb(0xBF, base + UART_LCR);
1107 val = inb(base + UART_SCR);
1108 outb(LCR, base + UART_LCR);
1109 return val;
1110}
1111
1112static void pci_quatech_wqopr(struct uart_8250_port *port, u8 qopr)
1113{
1114 unsigned long base = port->port.iobase;
1115 u8 LCR, val;
1116
1117 LCR = inb(base + UART_LCR);
1118 outb(0xBF, base + UART_LCR);
1119 val = inb(base + UART_SCR);
1120 outb(qopr, base + UART_SCR);
1121 outb(LCR, base + UART_LCR);
1122}
1123
1124static int pci_quatech_rqmcr(struct uart_8250_port *port)
1125{
1126 unsigned long base = port->port.iobase;
1127 u8 LCR, val, qmcr;
1128
1129 LCR = inb(base + UART_LCR);
1130 outb(0xBF, base + UART_LCR);
1131 val = inb(base + UART_SCR);
1132 outb(val | 0x10, base + UART_SCR);
1133 qmcr = inb(base + UART_MCR);
1134 outb(val, base + UART_SCR);
1135 outb(LCR, base + UART_LCR);
1136
1137 return qmcr;
1138}
1139
1140static void pci_quatech_wqmcr(struct uart_8250_port *port, u8 qmcr)
1141{
1142 unsigned long base = port->port.iobase;
1143 u8 LCR, val;
1144
1145 LCR = inb(base + UART_LCR);
1146 outb(0xBF, base + UART_LCR);
1147 val = inb(base + UART_SCR);
1148 outb(val | 0x10, base + UART_SCR);
1149 outb(qmcr, base + UART_MCR);
1150 outb(val, base + UART_SCR);
1151 outb(LCR, base + UART_LCR);
1152}
1153
1154static int pci_quatech_has_qmcr(struct uart_8250_port *port)
1155{
1156 unsigned long base = port->port.iobase;
1157 u8 LCR, val;
1158
1159 LCR = inb(base + UART_LCR);
1160 outb(0xBF, base + UART_LCR);
1161 val = inb(base + UART_SCR);
1162 if (val & 0x20) {
1163 outb(0x80, UART_LCR);
1164 if (!(inb(UART_SCR) & 0x20)) {
1165 outb(LCR, base + UART_LCR);
1166 return 1;
1167 }
1168 }
1169 return 0;
1170}
1171
1172static int pci_quatech_test(struct uart_8250_port *port)
1173{
1174 u8 reg;
1175 u8 qopr = pci_quatech_rqopr(port);
1176 pci_quatech_wqopr(port, qopr & QPCR_TEST_FOR1);
1177 reg = pci_quatech_rqopr(port) & 0xC0;
1178 if (reg != QPCR_TEST_GET1)
1179 return -EINVAL;
1180 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR2);
1181 reg = pci_quatech_rqopr(port) & 0xC0;
1182 if (reg != QPCR_TEST_GET2)
1183 return -EINVAL;
1184 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR3);
1185 reg = pci_quatech_rqopr(port) & 0xC0;
1186 if (reg != QPCR_TEST_GET3)
1187 return -EINVAL;
1188 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR4);
1189 reg = pci_quatech_rqopr(port) & 0xC0;
1190 if (reg != QPCR_TEST_GET4)
1191 return -EINVAL;
1192
1193 pci_quatech_wqopr(port, qopr);
1194 return 0;
1195}
1196
1197static int pci_quatech_clock(struct uart_8250_port *port)
1198{
1199 u8 qopr, reg, set;
1200 unsigned long clock;
1201
1202 if (pci_quatech_test(port) < 0)
1203 return 1843200;
1204
1205 qopr = pci_quatech_rqopr(port);
1206
1207 pci_quatech_wqopr(port, qopr & ~QOPR_CLOCK_X8);
1208 reg = pci_quatech_rqopr(port);
1209 if (reg & QOPR_CLOCK_X8) {
1210 clock = 1843200;
1211 goto out;
1212 }
1213 pci_quatech_wqopr(port, qopr | QOPR_CLOCK_X8);
1214 reg = pci_quatech_rqopr(port);
1215 if (!(reg & QOPR_CLOCK_X8)) {
1216 clock = 1843200;
1217 goto out;
1218 }
1219 reg &= QOPR_CLOCK_X8;
1220 if (reg == QOPR_CLOCK_X2) {
1221 clock = 3685400;
1222 set = QOPR_CLOCK_X2;
1223 } else if (reg == QOPR_CLOCK_X4) {
1224 clock = 7372800;
1225 set = QOPR_CLOCK_X4;
1226 } else if (reg == QOPR_CLOCK_X8) {
1227 clock = 14745600;
1228 set = QOPR_CLOCK_X8;
1229 } else {
1230 clock = 1843200;
1231 set = QOPR_CLOCK_X1;
1232 }
1233 qopr &= ~QOPR_CLOCK_RATE_MASK;
1234 qopr |= set;
1235
1236out:
1237 pci_quatech_wqopr(port, qopr);
1238 return clock;
1239}
1240
1241static int pci_quatech_rs422(struct uart_8250_port *port)
1242{
1243 u8 qmcr;
1244 int rs422 = 0;
1245
1246 if (!pci_quatech_has_qmcr(port))
1247 return 0;
1248 qmcr = pci_quatech_rqmcr(port);
1249 pci_quatech_wqmcr(port, 0xFF);
1250 if (pci_quatech_rqmcr(port))
1251 rs422 = 1;
1252 pci_quatech_wqmcr(port, qmcr);
1253 return rs422;
1254}
1255
1256static int pci_quatech_init(struct pci_dev *dev)
1257{
1258 if (pci_quatech_amcc(dev->device)) {
1259 unsigned long base = pci_resource_start(dev, 0);
1260 if (base) {
1261 u32 tmp;
1262 outl(inl(base + 0x38), base + 0x38);
1263 tmp = inl(base + 0x3c);
1264 outl(tmp | 0x01000000, base + 0x3c);
1265 outl(tmp, base + 0x3c);
1266 }
1267 }
1268 return 0;
1269}
1270
1271static int pci_quatech_setup(struct serial_private *priv,
1272 const struct pciserial_board *board,
1273 struct uart_8250_port *port, int idx)
1274{
1275 /* Needed by pci_quatech calls below */
1276 port->port.iobase = pci_resource_start(priv->dev, FL_GET_BASE(board->flags));
1277 /* Set up the clocking */
1278 port->port.uartclk = pci_quatech_clock(port);
1279 /* For now just warn about RS422 */
1280 if (pci_quatech_rs422(port))
1281 pr_warn("quatech: software control of RS422 features not currently supported.\n");
1282 return pci_default_setup(priv, board, port, idx);
1283}
1284
Greg Kroah-Hartmand73dfc62013-01-15 22:44:48 -08001285static void pci_quatech_exit(struct pci_dev *dev)
Alan Cox55c7c0f2012-11-29 09:03:00 +10301286{
1287}
1288
Alan Coxeb26dfe2012-07-12 13:00:31 +01001289static int pci_default_setup(struct serial_private *priv,
Russell King70db3d92005-07-27 11:34:27 +01001290 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001291 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001292{
1293 unsigned int bar, offset = board->first_offset, maxnr;
1294
1295 bar = FL_GET_BASE(board->flags);
1296 if (board->flags & FL_BASE_BARS)
1297 bar += idx;
1298 else
1299 offset += idx * board->uart_offset;
1300
Greg Kroah-Hartman2427ddd2006-06-12 17:07:52 -07001301 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1302 (board->reg_shift + 3);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001303
1304 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1305 return 1;
Alan Cox5756ee92008-02-08 04:18:51 -08001306
Russell King70db3d92005-07-27 11:34:27 +01001307 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001308}
1309
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001310static int
1311ce4100_serial_setup(struct serial_private *priv,
1312 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001313 struct uart_8250_port *port, int idx)
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001314{
1315 int ret;
1316
Maxime Bizon08ec2122012-10-19 10:45:07 +02001317 ret = setup_port(priv, port, idx, 0, board->reg_shift);
Alan Cox2655a2c2012-07-12 12:59:50 +01001318 port->port.iotype = UPIO_MEM32;
1319 port->port.type = PORT_XSCALE;
1320 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1321 port->port.regshift = 2;
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001322
1323 return ret;
1324}
1325
Heikki Krogerusb15e5692013-09-27 10:52:59 +03001326#define PCI_DEVICE_ID_INTEL_BYT_UART1 0x0f0a
1327#define PCI_DEVICE_ID_INTEL_BYT_UART2 0x0f0c
1328
1329#define BYT_PRV_CLK 0x800
1330#define BYT_PRV_CLK_EN (1 << 0)
1331#define BYT_PRV_CLK_M_VAL_SHIFT 1
1332#define BYT_PRV_CLK_N_VAL_SHIFT 16
1333#define BYT_PRV_CLK_UPDATE (1 << 31)
1334
1335#define BYT_GENERAL_REG 0x808
1336#define BYT_GENERAL_DIS_RTS_N_OVERRIDE (1 << 3)
1337
1338#define BYT_TX_OVF_INT 0x820
1339#define BYT_TX_OVF_INT_MASK (1 << 1)
1340
1341static void
1342byt_set_termios(struct uart_port *p, struct ktermios *termios,
1343 struct ktermios *old)
1344{
1345 unsigned int baud = tty_termios_baud_rate(termios);
1346 unsigned int m = 6912;
1347 unsigned int n = 15625;
1348 u32 reg;
1349
1350 /* For baud rates 1M, 2M, 3M and 4M the dividers must be adjusted. */
1351 if (baud == 1000000 || baud == 2000000 || baud == 4000000) {
1352 m = 64;
1353 n = 100;
1354
1355 p->uartclk = 64000000;
1356 } else if (baud == 3000000) {
1357 m = 48;
1358 n = 100;
1359
1360 p->uartclk = 48000000;
1361 } else {
1362 p->uartclk = 44236800;
1363 }
1364
1365 /* Reset the clock */
1366 reg = (m << BYT_PRV_CLK_M_VAL_SHIFT) | (n << BYT_PRV_CLK_N_VAL_SHIFT);
1367 writel(reg, p->membase + BYT_PRV_CLK);
1368 reg |= BYT_PRV_CLK_EN | BYT_PRV_CLK_UPDATE;
1369 writel(reg, p->membase + BYT_PRV_CLK);
1370
1371 /*
1372 * If auto-handshake mechanism is not enabled,
1373 * disable rts_n override
1374 */
1375 reg = readl(p->membase + BYT_GENERAL_REG);
1376 reg &= ~BYT_GENERAL_DIS_RTS_N_OVERRIDE;
1377 if (termios->c_cflag & CRTSCTS)
1378 reg |= BYT_GENERAL_DIS_RTS_N_OVERRIDE;
1379 writel(reg, p->membase + BYT_GENERAL_REG);
1380
1381 serial8250_do_set_termios(p, termios, old);
1382}
1383
1384static bool byt_dma_filter(struct dma_chan *chan, void *param)
1385{
1386 return chan->chan_id == *(int *)param;
1387}
1388
1389static int
1390byt_serial_setup(struct serial_private *priv,
1391 const struct pciserial_board *board,
1392 struct uart_8250_port *port, int idx)
1393{
1394 struct uart_8250_dma *dma;
1395 int ret;
1396
1397 dma = devm_kzalloc(port->port.dev, sizeof(*dma), GFP_KERNEL);
1398 if (!dma)
1399 return -ENOMEM;
1400
1401 switch (priv->dev->device) {
1402 case PCI_DEVICE_ID_INTEL_BYT_UART1:
1403 dma->rx_chan_id = 3;
1404 dma->tx_chan_id = 2;
1405 break;
1406 case PCI_DEVICE_ID_INTEL_BYT_UART2:
1407 dma->rx_chan_id = 5;
1408 dma->tx_chan_id = 4;
1409 break;
1410 default:
1411 return -EINVAL;
1412 }
1413
1414 dma->rxconf.slave_id = dma->rx_chan_id;
1415 dma->rxconf.src_maxburst = 16;
1416
1417 dma->txconf.slave_id = dma->tx_chan_id;
1418 dma->txconf.dst_maxburst = 16;
1419
1420 dma->fn = byt_dma_filter;
1421 dma->rx_param = &dma->rx_chan_id;
1422 dma->tx_param = &dma->tx_chan_id;
1423
1424 ret = pci_default_setup(priv, board, port, idx);
1425 port->port.iotype = UPIO_MEM;
1426 port->port.type = PORT_16550A;
1427 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1428 port->port.set_termios = byt_set_termios;
1429 port->port.fifosize = 64;
1430 port->tx_loadsz = 64;
1431 port->dma = dma;
1432 port->capabilities = UART_CAP_FIFO | UART_CAP_AFE;
1433
1434 /* Disable Tx counter interrupts */
1435 writel(BYT_TX_OVF_INT_MASK, port->port.membase + BYT_TX_OVF_INT);
1436
1437 return ret;
1438}
1439
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001440static int
1441pci_omegapci_setup(struct serial_private *priv,
Alan Cox1798ca12011-05-24 12:35:48 +01001442 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001443 struct uart_8250_port *port, int idx)
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001444{
1445 return setup_port(priv, port, 2, idx * 8, 0);
1446}
1447
Stephen Hurdebebd492013-01-17 14:14:53 -08001448static int
1449pci_brcm_trumanage_setup(struct serial_private *priv,
1450 const struct pciserial_board *board,
1451 struct uart_8250_port *port, int idx)
1452{
1453 int ret = pci_default_setup(priv, board, port, idx);
1454
1455 port->port.type = PORT_BRCM_TRUMANAGE;
1456 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1457 return ret;
1458}
1459
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001460static int pci_fintek_setup(struct serial_private *priv,
1461 const struct pciserial_board *board,
1462 struct uart_8250_port *port, int idx)
1463{
1464 struct pci_dev *pdev = priv->dev;
1465 unsigned long base;
1466 unsigned long iobase;
1467 unsigned long ciobase = 0;
1468 u8 config_base;
1469
1470 /*
1471 * We are supposed to be able to read these from the PCI config space,
1472 * but the values there don't seem to match what we need to use, so
1473 * just use these hard-coded values for now, as they are correct.
1474 */
1475 switch (idx) {
1476 case 0: iobase = 0xe000; config_base = 0x40; break;
1477 case 1: iobase = 0xe008; config_base = 0x48; break;
1478 case 2: iobase = 0xe010; config_base = 0x50; break;
1479 case 3: iobase = 0xe018; config_base = 0x58; break;
1480 case 4: iobase = 0xe020; config_base = 0x60; break;
1481 case 5: iobase = 0xe028; config_base = 0x68; break;
1482 case 6: iobase = 0xe030; config_base = 0x70; break;
1483 case 7: iobase = 0xe038; config_base = 0x78; break;
1484 case 8: iobase = 0xe040; config_base = 0x80; break;
1485 case 9: iobase = 0xe048; config_base = 0x88; break;
1486 case 10: iobase = 0xe050; config_base = 0x90; break;
1487 case 11: iobase = 0xe058; config_base = 0x98; break;
1488 default:
1489 /* Unknown number of ports, get out of here */
1490 return -EINVAL;
1491 }
1492
1493 if (idx < 4) {
1494 base = pci_resource_start(priv->dev, 3);
1495 ciobase = (int)(base + (0x8 * idx));
1496 }
1497
1498 dev_dbg(&pdev->dev, "%s: idx=%d iobase=0x%lx ciobase=0x%lx config_base=0x%2x\n",
1499 __func__, idx, iobase, ciobase, config_base);
1500
1501 /* Enable UART I/O port */
1502 pci_write_config_byte(pdev, config_base + 0x00, 0x01);
1503
1504 /* Select 128-byte FIFO and 8x FIFO threshold */
1505 pci_write_config_byte(pdev, config_base + 0x01, 0x33);
1506
1507 /* LSB UART */
1508 pci_write_config_byte(pdev, config_base + 0x04, (u8)(iobase & 0xff));
1509
1510 /* MSB UART */
1511 pci_write_config_byte(pdev, config_base + 0x05, (u8)((iobase & 0xff00) >> 8));
1512
1513 /* irq number, this usually fails, but the spec says to do it anyway. */
1514 pci_write_config_byte(pdev, config_base + 0x06, pdev->irq);
1515
1516 port->port.iotype = UPIO_PORT;
1517 port->port.iobase = iobase;
1518 port->port.mapbase = 0;
1519 port->port.membase = NULL;
1520 port->port.regshift = 0;
1521
1522 return 0;
1523}
1524
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001525static int skip_tx_en_setup(struct serial_private *priv,
1526 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001527 struct uart_8250_port *port, int idx)
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001528{
Alan Cox2655a2c2012-07-12 12:59:50 +01001529 port->port.flags |= UPF_NO_TXEN_TEST;
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001530 dev_dbg(&priv->dev->dev,
1531 "serial8250: skipping TxEn test for device [%04x:%04x] subsystem [%04x:%04x]\n",
1532 priv->dev->vendor, priv->dev->device,
1533 priv->dev->subsystem_vendor, priv->dev->subsystem_device);
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001534
1535 return pci_default_setup(priv, board, port, idx);
1536}
1537
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -07001538static void kt_handle_break(struct uart_port *p)
1539{
1540 struct uart_8250_port *up =
1541 container_of(p, struct uart_8250_port, port);
1542 /*
1543 * On receipt of a BI, serial device in Intel ME (Intel
1544 * management engine) needs to have its fifos cleared for sane
1545 * SOL (Serial Over Lan) output.
1546 */
1547 serial8250_clear_and_reinit_fifos(up);
1548}
1549
1550static unsigned int kt_serial_in(struct uart_port *p, int offset)
1551{
1552 struct uart_8250_port *up =
1553 container_of(p, struct uart_8250_port, port);
1554 unsigned int val;
1555
1556 /*
1557 * When the Intel ME (management engine) gets reset its serial
1558 * port registers could return 0 momentarily. Functions like
1559 * serial8250_console_write, read and save the IER, perform
1560 * some operation and then restore it. In order to avoid
1561 * setting IER register inadvertently to 0, if the value read
1562 * is 0, double check with ier value in uart_8250_port and use
1563 * that instead. up->ier should be the same value as what is
1564 * currently configured.
1565 */
1566 val = inb(p->iobase + offset);
1567 if (offset == UART_IER) {
1568 if (val == 0)
1569 val = up->ier;
1570 }
1571 return val;
1572}
1573
Dan Williamsbc02d152012-04-06 11:49:50 -07001574static int kt_serial_setup(struct serial_private *priv,
1575 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001576 struct uart_8250_port *port, int idx)
Dan Williamsbc02d152012-04-06 11:49:50 -07001577{
Alan Cox2655a2c2012-07-12 12:59:50 +01001578 port->port.flags |= UPF_BUG_THRE;
1579 port->port.serial_in = kt_serial_in;
1580 port->port.handle_break = kt_handle_break;
Dan Williamsbc02d152012-04-06 11:49:50 -07001581 return skip_tx_en_setup(priv, board, port, idx);
1582}
1583
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09001584static int pci_eg20t_init(struct pci_dev *dev)
1585{
1586#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
1587 return -ENODEV;
1588#else
1589 return 0;
1590#endif
1591}
1592
Søren Holm06315342011-09-02 22:55:37 +02001593static int
1594pci_xr17c154_setup(struct serial_private *priv,
1595 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001596 struct uart_8250_port *port, int idx)
Søren Holm06315342011-09-02 22:55:37 +02001597{
Alan Cox2655a2c2012-07-12 12:59:50 +01001598 port->port.flags |= UPF_EXAR_EFR;
Søren Holm06315342011-09-02 22:55:37 +02001599 return pci_default_setup(priv, board, port, idx);
1600}
1601
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001602static int
Matt Schultedc96efb2012-11-19 09:12:04 -06001603pci_xr17v35x_setup(struct serial_private *priv,
1604 const struct pciserial_board *board,
1605 struct uart_8250_port *port, int idx)
1606{
1607 u8 __iomem *p;
1608
1609 p = pci_ioremap_bar(priv->dev, 0);
Matt Schulte13c32372012-11-21 10:39:18 -06001610 if (p == NULL)
1611 return -ENOMEM;
Matt Schultedc96efb2012-11-19 09:12:04 -06001612
1613 port->port.flags |= UPF_EXAR_EFR;
1614
1615 /*
1616 * Setup Multipurpose Input/Output pins.
1617 */
1618 if (idx == 0) {
1619 writeb(0x00, p + 0x8f); /*MPIOINT[7:0]*/
1620 writeb(0x00, p + 0x90); /*MPIOLVL[7:0]*/
1621 writeb(0x00, p + 0x91); /*MPIO3T[7:0]*/
1622 writeb(0x00, p + 0x92); /*MPIOINV[7:0]*/
1623 writeb(0x00, p + 0x93); /*MPIOSEL[7:0]*/
1624 writeb(0x00, p + 0x94); /*MPIOOD[7:0]*/
1625 writeb(0x00, p + 0x95); /*MPIOINT[15:8]*/
1626 writeb(0x00, p + 0x96); /*MPIOLVL[15:8]*/
1627 writeb(0x00, p + 0x97); /*MPIO3T[15:8]*/
1628 writeb(0x00, p + 0x98); /*MPIOINV[15:8]*/
1629 writeb(0x00, p + 0x99); /*MPIOSEL[15:8]*/
1630 writeb(0x00, p + 0x9a); /*MPIOOD[15:8]*/
1631 }
Matt Schultef965b9c2012-11-20 11:25:40 -06001632 writeb(0x00, p + UART_EXAR_8XMODE);
1633 writeb(UART_FCTR_EXAR_TRGD, p + UART_EXAR_FCTR);
1634 writeb(128, p + UART_EXAR_TXTRG);
1635 writeb(128, p + UART_EXAR_RXTRG);
Matt Schultedc96efb2012-11-19 09:12:04 -06001636 iounmap(p);
1637
1638 return pci_default_setup(priv, board, port, idx);
1639}
1640
Matt Schulte14faa8c2012-11-21 10:35:15 -06001641#define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x0004
1642#define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x0002
1643#define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a
1644#define PCI_DEVICE_ID_COMMTECH_2328PCI335 0x000b
1645
1646static int
1647pci_fastcom335_setup(struct serial_private *priv,
1648 const struct pciserial_board *board,
1649 struct uart_8250_port *port, int idx)
1650{
1651 u8 __iomem *p;
1652
1653 p = pci_ioremap_bar(priv->dev, 0);
1654 if (p == NULL)
1655 return -ENOMEM;
1656
1657 port->port.flags |= UPF_EXAR_EFR;
1658
1659 /*
1660 * Setup Multipurpose Input/Output pins.
1661 */
1662 if (idx == 0) {
1663 switch (priv->dev->device) {
1664 case PCI_DEVICE_ID_COMMTECH_4222PCI335:
1665 case PCI_DEVICE_ID_COMMTECH_4224PCI335:
1666 writeb(0x78, p + 0x90); /* MPIOLVL[7:0] */
1667 writeb(0x00, p + 0x92); /* MPIOINV[7:0] */
1668 writeb(0x00, p + 0x93); /* MPIOSEL[7:0] */
1669 break;
1670 case PCI_DEVICE_ID_COMMTECH_2324PCI335:
1671 case PCI_DEVICE_ID_COMMTECH_2328PCI335:
1672 writeb(0x00, p + 0x90); /* MPIOLVL[7:0] */
1673 writeb(0xc0, p + 0x92); /* MPIOINV[7:0] */
1674 writeb(0xc0, p + 0x93); /* MPIOSEL[7:0] */
1675 break;
1676 }
1677 writeb(0x00, p + 0x8f); /* MPIOINT[7:0] */
1678 writeb(0x00, p + 0x91); /* MPIO3T[7:0] */
1679 writeb(0x00, p + 0x94); /* MPIOOD[7:0] */
1680 }
1681 writeb(0x00, p + UART_EXAR_8XMODE);
1682 writeb(UART_FCTR_EXAR_TRGD, p + UART_EXAR_FCTR);
1683 writeb(32, p + UART_EXAR_TXTRG);
1684 writeb(32, p + UART_EXAR_RXTRG);
1685 iounmap(p);
1686
1687 return pci_default_setup(priv, board, port, idx);
1688}
1689
Matt Schultedc96efb2012-11-19 09:12:04 -06001690static int
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001691pci_wch_ch353_setup(struct serial_private *priv,
1692 const struct pciserial_board *board,
1693 struct uart_8250_port *port, int idx)
1694{
1695 port->port.flags |= UPF_FIXED_TYPE;
1696 port->port.type = PORT_16550A;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001697 return pci_default_setup(priv, board, port, idx);
1698}
1699
Linus Torvalds1da177e2005-04-16 15:20:36 -07001700#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1701#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1702#define PCI_DEVICE_ID_OCTPRO 0x0001
1703#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
1704#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1705#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1706#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
Flavio Leitner26e82202012-09-21 21:04:34 -03001707#define PCI_SUBDEVICE_ID_SIIG_DUAL_00 0x2500
1708#define PCI_SUBDEVICE_ID_SIIG_DUAL_30 0x2530
Michael Bramer78d70d42009-01-27 11:51:16 +00001709#define PCI_VENDOR_ID_ADVANTECH 0x13fe
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001710#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66
Michael Bramer78d70d42009-01-27 11:51:16 +00001711#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
Yegor Yefremov66169ad2010-06-04 09:58:18 +02001712#define PCI_DEVICE_ID_TITAN_200I 0x8028
1713#define PCI_DEVICE_ID_TITAN_400I 0x8048
1714#define PCI_DEVICE_ID_TITAN_800I 0x8088
1715#define PCI_DEVICE_ID_TITAN_800EH 0xA007
1716#define PCI_DEVICE_ID_TITAN_800EHB 0xA008
1717#define PCI_DEVICE_ID_TITAN_400EH 0xA009
1718#define PCI_DEVICE_ID_TITAN_100E 0xA010
1719#define PCI_DEVICE_ID_TITAN_200E 0xA012
1720#define PCI_DEVICE_ID_TITAN_400E 0xA013
1721#define PCI_DEVICE_ID_TITAN_800E 0xA014
1722#define PCI_DEVICE_ID_TITAN_200EI 0xA016
1723#define PCI_DEVICE_ID_TITAN_200EISI 0xA017
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01001724#define PCI_DEVICE_ID_TITAN_400V3 0xA310
1725#define PCI_DEVICE_ID_TITAN_410V3 0xA312
1726#define PCI_DEVICE_ID_TITAN_800V3 0xA314
1727#define PCI_DEVICE_ID_TITAN_800V3B 0xA315
Lytochkin Borise8470032010-07-26 10:02:26 +04001728#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
Scott Kilauaa273ae2011-05-11 15:41:59 -05001729#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001730#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
Dan Williamsbc02d152012-04-06 11:49:50 -07001731#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
Alan Cox27788c52012-09-04 16:21:06 +01001732#define PCI_VENDOR_ID_WCH 0x4348
Wang YanQing8b5c9132013-03-05 23:16:48 +08001733#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
Alan Cox27788c52012-09-04 16:21:06 +01001734#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
1735#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
1736#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
Alan Cox66835492012-08-16 12:01:33 +01001737#define PCI_VENDOR_ID_AGESTAR 0x5372
1738#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
Alan Coxeb26dfe2012-07-12 13:00:31 +01001739#define PCI_VENDOR_ID_ASIX 0x9710
Matt Schulte14faa8c2012-11-21 10:35:15 -06001740#define PCI_DEVICE_ID_COMMTECH_4224PCIE 0x0020
1741#define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021
Matt Schulteb7b90412012-12-06 22:19:59 -06001742#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022
Stephen Hurdebebd492013-01-17 14:14:53 -08001743#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001744#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
Matt Schulte14faa8c2012-11-21 10:35:15 -06001745
Stephen Chiversabd7bac2013-01-28 19:49:20 +11001746#define PCI_VENDOR_ID_SUNIX 0x1fd4
1747#define PCI_DEVICE_ID_SUNIX_1999 0x1999
1748
Linus Torvalds1da177e2005-04-16 15:20:36 -07001749
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001750/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1751#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
Scott Ashcroftd13402a2013-03-03 21:35:06 +00001752#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001753
Linus Torvalds1da177e2005-04-16 15:20:36 -07001754/*
1755 * Master list of serial port init/setup/exit quirks.
1756 * This does not describe the general nature of the port.
1757 * (ie, baud base, number and location of ports, etc)
1758 *
1759 * This list is ordered alphabetically by vendor then device.
1760 * Specific entries must come before more generic entries.
1761 */
Sam Ravnborg7a63ce52008-04-28 02:14:02 -07001762static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001763 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001764 * ADDI-DATA GmbH communication cards <info@addi-data.com>
1765 */
1766 {
Ian Abbott086231f2013-07-16 16:14:39 +01001767 .vendor = PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001768 .device = PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001769 .subvendor = PCI_ANY_ID,
1770 .subdevice = PCI_ANY_ID,
1771 .setup = addidata_apci7800_setup,
1772 },
1773 /*
Russell King61a116e2006-07-03 15:22:35 +01001774 * AFAVLAB cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001775 * It is not clear whether this applies to all products.
1776 */
1777 {
1778 .vendor = PCI_VENDOR_ID_AFAVLAB,
1779 .device = PCI_ANY_ID,
1780 .subvendor = PCI_ANY_ID,
1781 .subdevice = PCI_ANY_ID,
1782 .setup = afavlab_setup,
1783 },
1784 /*
1785 * HP Diva
1786 */
1787 {
1788 .vendor = PCI_VENDOR_ID_HP,
1789 .device = PCI_DEVICE_ID_HP_DIVA,
1790 .subvendor = PCI_ANY_ID,
1791 .subdevice = PCI_ANY_ID,
1792 .init = pci_hp_diva_init,
1793 .setup = pci_hp_diva_setup,
1794 },
1795 /*
1796 * Intel
1797 */
1798 {
1799 .vendor = PCI_VENDOR_ID_INTEL,
1800 .device = PCI_DEVICE_ID_INTEL_80960_RP,
1801 .subvendor = 0xe4bf,
1802 .subdevice = PCI_ANY_ID,
1803 .init = pci_inteli960ni_init,
1804 .setup = pci_default_setup,
1805 },
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001806 {
1807 .vendor = PCI_VENDOR_ID_INTEL,
1808 .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
1809 .subvendor = PCI_ANY_ID,
1810 .subdevice = PCI_ANY_ID,
1811 .setup = skip_tx_en_setup,
1812 },
1813 {
1814 .vendor = PCI_VENDOR_ID_INTEL,
1815 .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
1816 .subvendor = PCI_ANY_ID,
1817 .subdevice = PCI_ANY_ID,
1818 .setup = skip_tx_en_setup,
1819 },
1820 {
1821 .vendor = PCI_VENDOR_ID_INTEL,
1822 .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
1823 .subvendor = PCI_ANY_ID,
1824 .subdevice = PCI_ANY_ID,
1825 .setup = skip_tx_en_setup,
1826 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001827 {
1828 .vendor = PCI_VENDOR_ID_INTEL,
1829 .device = PCI_DEVICE_ID_INTEL_CE4100_UART,
1830 .subvendor = PCI_ANY_ID,
1831 .subdevice = PCI_ANY_ID,
1832 .setup = ce4100_serial_setup,
1833 },
Dan Williamsbc02d152012-04-06 11:49:50 -07001834 {
1835 .vendor = PCI_VENDOR_ID_INTEL,
1836 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
1837 .subvendor = PCI_ANY_ID,
1838 .subdevice = PCI_ANY_ID,
1839 .setup = kt_serial_setup,
1840 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03001841 {
1842 .vendor = PCI_VENDOR_ID_INTEL,
1843 .device = PCI_DEVICE_ID_INTEL_BYT_UART1,
1844 .subvendor = PCI_ANY_ID,
1845 .subdevice = PCI_ANY_ID,
1846 .setup = byt_serial_setup,
1847 },
1848 {
1849 .vendor = PCI_VENDOR_ID_INTEL,
1850 .device = PCI_DEVICE_ID_INTEL_BYT_UART2,
1851 .subvendor = PCI_ANY_ID,
1852 .subdevice = PCI_ANY_ID,
1853 .setup = byt_serial_setup,
1854 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001855 /*
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001856 * ITE
1857 */
1858 {
1859 .vendor = PCI_VENDOR_ID_ITE,
1860 .device = PCI_DEVICE_ID_ITE_8872,
1861 .subvendor = PCI_ANY_ID,
1862 .subdevice = PCI_ANY_ID,
1863 .init = pci_ite887x_init,
1864 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001865 .exit = pci_ite887x_exit,
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001866 },
1867 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001868 * National Instruments
1869 */
1870 {
1871 .vendor = PCI_VENDOR_ID_NI,
Will Page04bf7e72009-04-06 17:32:15 +01001872 .device = PCI_DEVICE_ID_NI_PCI23216,
1873 .subvendor = PCI_ANY_ID,
1874 .subdevice = PCI_ANY_ID,
1875 .init = pci_ni8420_init,
1876 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001877 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001878 },
1879 {
1880 .vendor = PCI_VENDOR_ID_NI,
1881 .device = PCI_DEVICE_ID_NI_PCI2328,
1882 .subvendor = PCI_ANY_ID,
1883 .subdevice = PCI_ANY_ID,
1884 .init = pci_ni8420_init,
1885 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001886 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001887 },
1888 {
1889 .vendor = PCI_VENDOR_ID_NI,
1890 .device = PCI_DEVICE_ID_NI_PCI2324,
1891 .subvendor = PCI_ANY_ID,
1892 .subdevice = PCI_ANY_ID,
1893 .init = pci_ni8420_init,
1894 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001895 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001896 },
1897 {
1898 .vendor = PCI_VENDOR_ID_NI,
1899 .device = PCI_DEVICE_ID_NI_PCI2322,
1900 .subvendor = PCI_ANY_ID,
1901 .subdevice = PCI_ANY_ID,
1902 .init = pci_ni8420_init,
1903 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001904 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001905 },
1906 {
1907 .vendor = PCI_VENDOR_ID_NI,
1908 .device = PCI_DEVICE_ID_NI_PCI2324I,
1909 .subvendor = PCI_ANY_ID,
1910 .subdevice = PCI_ANY_ID,
1911 .init = pci_ni8420_init,
1912 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001913 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001914 },
1915 {
1916 .vendor = PCI_VENDOR_ID_NI,
1917 .device = PCI_DEVICE_ID_NI_PCI2322I,
1918 .subvendor = PCI_ANY_ID,
1919 .subdevice = PCI_ANY_ID,
1920 .init = pci_ni8420_init,
1921 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001922 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001923 },
1924 {
1925 .vendor = PCI_VENDOR_ID_NI,
1926 .device = PCI_DEVICE_ID_NI_PXI8420_23216,
1927 .subvendor = PCI_ANY_ID,
1928 .subdevice = PCI_ANY_ID,
1929 .init = pci_ni8420_init,
1930 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001931 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001932 },
1933 {
1934 .vendor = PCI_VENDOR_ID_NI,
1935 .device = PCI_DEVICE_ID_NI_PXI8420_2328,
1936 .subvendor = PCI_ANY_ID,
1937 .subdevice = PCI_ANY_ID,
1938 .init = pci_ni8420_init,
1939 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001940 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001941 },
1942 {
1943 .vendor = PCI_VENDOR_ID_NI,
1944 .device = PCI_DEVICE_ID_NI_PXI8420_2324,
1945 .subvendor = PCI_ANY_ID,
1946 .subdevice = PCI_ANY_ID,
1947 .init = pci_ni8420_init,
1948 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001949 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001950 },
1951 {
1952 .vendor = PCI_VENDOR_ID_NI,
1953 .device = PCI_DEVICE_ID_NI_PXI8420_2322,
1954 .subvendor = PCI_ANY_ID,
1955 .subdevice = PCI_ANY_ID,
1956 .init = pci_ni8420_init,
1957 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001958 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001959 },
1960 {
1961 .vendor = PCI_VENDOR_ID_NI,
1962 .device = PCI_DEVICE_ID_NI_PXI8422_2324,
1963 .subvendor = PCI_ANY_ID,
1964 .subdevice = PCI_ANY_ID,
1965 .init = pci_ni8420_init,
1966 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001967 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001968 },
1969 {
1970 .vendor = PCI_VENDOR_ID_NI,
1971 .device = PCI_DEVICE_ID_NI_PXI8422_2322,
1972 .subvendor = PCI_ANY_ID,
1973 .subdevice = PCI_ANY_ID,
1974 .init = pci_ni8420_init,
1975 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001976 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001977 },
1978 {
1979 .vendor = PCI_VENDOR_ID_NI,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001980 .device = PCI_ANY_ID,
1981 .subvendor = PCI_ANY_ID,
1982 .subdevice = PCI_ANY_ID,
1983 .init = pci_ni8430_init,
1984 .setup = pci_ni8430_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001985 .exit = pci_ni8430_exit,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001986 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10301987 /* Quatech */
1988 {
1989 .vendor = PCI_VENDOR_ID_QUATECH,
1990 .device = PCI_ANY_ID,
1991 .subvendor = PCI_ANY_ID,
1992 .subdevice = PCI_ANY_ID,
1993 .init = pci_quatech_init,
1994 .setup = pci_quatech_setup,
Greg Kroah-Hartmand73dfc62013-01-15 22:44:48 -08001995 .exit = pci_quatech_exit,
Alan Cox55c7c0f2012-11-29 09:03:00 +10301996 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001997 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07001998 * Panacom
1999 */
2000 {
2001 .vendor = PCI_VENDOR_ID_PANACOM,
2002 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
2003 .subvendor = PCI_ANY_ID,
2004 .subdevice = PCI_ANY_ID,
2005 .init = pci_plx9050_init,
2006 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002007 .exit = pci_plx9050_exit,
Alan Cox5756ee92008-02-08 04:18:51 -08002008 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002009 {
2010 .vendor = PCI_VENDOR_ID_PANACOM,
2011 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
2012 .subvendor = PCI_ANY_ID,
2013 .subdevice = PCI_ANY_ID,
2014 .init = pci_plx9050_init,
2015 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002016 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002017 },
2018 /*
2019 * PLX
2020 */
2021 {
2022 .vendor = PCI_VENDOR_ID_PLX,
Thomas Hoehn48212002007-02-10 01:46:05 -08002023 .device = PCI_DEVICE_ID_PLX_9030,
2024 .subvendor = PCI_SUBVENDOR_ID_PERLE,
2025 .subdevice = PCI_ANY_ID,
2026 .setup = pci_default_setup,
2027 },
2028 {
2029 .vendor = PCI_VENDOR_ID_PLX,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002030 .device = PCI_DEVICE_ID_PLX_9050,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01002031 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
2032 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
2033 .init = pci_plx9050_init,
2034 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002035 .exit = pci_plx9050_exit,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01002036 },
2037 {
2038 .vendor = PCI_VENDOR_ID_PLX,
2039 .device = PCI_DEVICE_ID_PLX_9050,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002040 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
2041 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
2042 .init = pci_plx9050_init,
2043 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002044 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002045 },
2046 {
2047 .vendor = PCI_VENDOR_ID_PLX,
2048 .device = PCI_DEVICE_ID_PLX_ROMULUS,
2049 .subvendor = PCI_VENDOR_ID_PLX,
2050 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
2051 .init = pci_plx9050_init,
2052 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002053 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002054 },
2055 /*
2056 * SBS Technologies, Inc., PMC-OCTALPRO 232
2057 */
2058 {
2059 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2060 .device = PCI_DEVICE_ID_OCTPRO,
2061 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2062 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
2063 .init = sbs_init,
2064 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002065 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002066 },
2067 /*
2068 * SBS Technologies, Inc., PMC-OCTALPRO 422
2069 */
2070 {
2071 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2072 .device = PCI_DEVICE_ID_OCTPRO,
2073 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2074 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
2075 .init = sbs_init,
2076 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002077 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002078 },
2079 /*
2080 * SBS Technologies, Inc., P-Octal 232
2081 */
2082 {
2083 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2084 .device = PCI_DEVICE_ID_OCTPRO,
2085 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2086 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
2087 .init = sbs_init,
2088 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002089 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002090 },
2091 /*
2092 * SBS Technologies, Inc., P-Octal 422
2093 */
2094 {
2095 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2096 .device = PCI_DEVICE_ID_OCTPRO,
2097 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2098 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
2099 .init = sbs_init,
2100 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002101 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002102 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002103 /*
Russell King61a116e2006-07-03 15:22:35 +01002104 * SIIG cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002105 */
2106 {
2107 .vendor = PCI_VENDOR_ID_SIIG,
Russell King67d74b82005-07-27 11:33:03 +01002108 .device = PCI_ANY_ID,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002109 .subvendor = PCI_ANY_ID,
2110 .subdevice = PCI_ANY_ID,
Russell King67d74b82005-07-27 11:33:03 +01002111 .init = pci_siig_init,
Andrey Panin3ec9c592006-02-02 20:15:09 +00002112 .setup = pci_siig_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002113 },
2114 /*
2115 * Titan cards
2116 */
2117 {
2118 .vendor = PCI_VENDOR_ID_TITAN,
2119 .device = PCI_DEVICE_ID_TITAN_400L,
2120 .subvendor = PCI_ANY_ID,
2121 .subdevice = PCI_ANY_ID,
2122 .setup = titan_400l_800l_setup,
2123 },
2124 {
2125 .vendor = PCI_VENDOR_ID_TITAN,
2126 .device = PCI_DEVICE_ID_TITAN_800L,
2127 .subvendor = PCI_ANY_ID,
2128 .subdevice = PCI_ANY_ID,
2129 .setup = titan_400l_800l_setup,
2130 },
2131 /*
2132 * Timedia cards
2133 */
2134 {
2135 .vendor = PCI_VENDOR_ID_TIMEDIA,
2136 .device = PCI_DEVICE_ID_TIMEDIA_1889,
2137 .subvendor = PCI_VENDOR_ID_TIMEDIA,
2138 .subdevice = PCI_ANY_ID,
Frédéric Brièreb9b24552011-05-29 15:08:04 -04002139 .probe = pci_timedia_probe,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002140 .init = pci_timedia_init,
2141 .setup = pci_timedia_setup,
2142 },
2143 {
2144 .vendor = PCI_VENDOR_ID_TIMEDIA,
2145 .device = PCI_ANY_ID,
2146 .subvendor = PCI_ANY_ID,
2147 .subdevice = PCI_ANY_ID,
2148 .setup = pci_timedia_setup,
2149 },
2150 /*
Stephen Chiversabd7bac2013-01-28 19:49:20 +11002151 * SUNIX (Timedia) cards
2152 * Do not "probe" for these cards as there is at least one combination
2153 * card that should be handled by parport_pc that doesn't match the
2154 * rule in pci_timedia_probe.
2155 * It is part number is MIO5079A but its subdevice ID is 0x0102.
2156 * There are some boards with part number SER5037AL that report
2157 * subdevice ID 0x0002.
2158 */
2159 {
2160 .vendor = PCI_VENDOR_ID_SUNIX,
2161 .device = PCI_DEVICE_ID_SUNIX_1999,
2162 .subvendor = PCI_VENDOR_ID_SUNIX,
2163 .subdevice = PCI_ANY_ID,
2164 .init = pci_timedia_init,
2165 .setup = pci_timedia_setup,
2166 },
2167 /*
Søren Holm06315342011-09-02 22:55:37 +02002168 * Exar cards
2169 */
2170 {
2171 .vendor = PCI_VENDOR_ID_EXAR,
2172 .device = PCI_DEVICE_ID_EXAR_XR17C152,
2173 .subvendor = PCI_ANY_ID,
2174 .subdevice = PCI_ANY_ID,
2175 .setup = pci_xr17c154_setup,
2176 },
2177 {
2178 .vendor = PCI_VENDOR_ID_EXAR,
2179 .device = PCI_DEVICE_ID_EXAR_XR17C154,
2180 .subvendor = PCI_ANY_ID,
2181 .subdevice = PCI_ANY_ID,
2182 .setup = pci_xr17c154_setup,
2183 },
2184 {
2185 .vendor = PCI_VENDOR_ID_EXAR,
2186 .device = PCI_DEVICE_ID_EXAR_XR17C158,
2187 .subvendor = PCI_ANY_ID,
2188 .subdevice = PCI_ANY_ID,
2189 .setup = pci_xr17c154_setup,
2190 },
Matt Schultedc96efb2012-11-19 09:12:04 -06002191 {
2192 .vendor = PCI_VENDOR_ID_EXAR,
2193 .device = PCI_DEVICE_ID_EXAR_XR17V352,
2194 .subvendor = PCI_ANY_ID,
2195 .subdevice = PCI_ANY_ID,
2196 .setup = pci_xr17v35x_setup,
2197 },
2198 {
2199 .vendor = PCI_VENDOR_ID_EXAR,
2200 .device = PCI_DEVICE_ID_EXAR_XR17V354,
2201 .subvendor = PCI_ANY_ID,
2202 .subdevice = PCI_ANY_ID,
2203 .setup = pci_xr17v35x_setup,
2204 },
2205 {
2206 .vendor = PCI_VENDOR_ID_EXAR,
2207 .device = PCI_DEVICE_ID_EXAR_XR17V358,
2208 .subvendor = PCI_ANY_ID,
2209 .subdevice = PCI_ANY_ID,
2210 .setup = pci_xr17v35x_setup,
2211 },
Søren Holm06315342011-09-02 22:55:37 +02002212 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002213 * Xircom cards
2214 */
2215 {
2216 .vendor = PCI_VENDOR_ID_XIRCOM,
2217 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2218 .subvendor = PCI_ANY_ID,
2219 .subdevice = PCI_ANY_ID,
2220 .init = pci_xircom_init,
2221 .setup = pci_default_setup,
2222 },
2223 /*
Russell King61a116e2006-07-03 15:22:35 +01002224 * Netmos cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002225 */
2226 {
2227 .vendor = PCI_VENDOR_ID_NETMOS,
2228 .device = PCI_ANY_ID,
2229 .subvendor = PCI_ANY_ID,
2230 .subdevice = PCI_ANY_ID,
2231 .init = pci_netmos_init,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002232 .setup = pci_netmos_9900_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002233 },
2234 /*
Scott Kilauaa273ae2011-05-11 15:41:59 -05002235 * For Oxford Semiconductor Tornado based devices
Russell King9f2a0362009-01-02 13:44:20 +00002236 */
2237 {
2238 .vendor = PCI_VENDOR_ID_OXSEMI,
2239 .device = PCI_ANY_ID,
2240 .subvendor = PCI_ANY_ID,
2241 .subdevice = PCI_ANY_ID,
2242 .init = pci_oxsemi_tornado_init,
2243 .setup = pci_default_setup,
2244 },
2245 {
2246 .vendor = PCI_VENDOR_ID_MAINPINE,
2247 .device = PCI_ANY_ID,
2248 .subvendor = PCI_ANY_ID,
2249 .subdevice = PCI_ANY_ID,
2250 .init = pci_oxsemi_tornado_init,
2251 .setup = pci_default_setup,
2252 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05002253 {
2254 .vendor = PCI_VENDOR_ID_DIGI,
2255 .device = PCIE_DEVICE_ID_NEO_2_OX_IBM,
2256 .subvendor = PCI_SUBVENDOR_ID_IBM,
2257 .subdevice = PCI_ANY_ID,
2258 .init = pci_oxsemi_tornado_init,
2259 .setup = pci_default_setup,
2260 },
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002261 {
2262 .vendor = PCI_VENDOR_ID_INTEL,
2263 .device = 0x8811,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002264 .subvendor = PCI_ANY_ID,
2265 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002266 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002267 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002268 },
2269 {
2270 .vendor = PCI_VENDOR_ID_INTEL,
2271 .device = 0x8812,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002272 .subvendor = PCI_ANY_ID,
2273 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002274 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002275 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002276 },
2277 {
2278 .vendor = PCI_VENDOR_ID_INTEL,
2279 .device = 0x8813,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002280 .subvendor = PCI_ANY_ID,
2281 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002282 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002283 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002284 },
2285 {
2286 .vendor = PCI_VENDOR_ID_INTEL,
2287 .device = 0x8814,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002288 .subvendor = PCI_ANY_ID,
2289 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002290 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002291 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002292 },
2293 {
2294 .vendor = 0x10DB,
2295 .device = 0x8027,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002296 .subvendor = PCI_ANY_ID,
2297 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002298 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002299 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002300 },
2301 {
2302 .vendor = 0x10DB,
2303 .device = 0x8028,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002304 .subvendor = PCI_ANY_ID,
2305 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002306 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002307 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002308 },
2309 {
2310 .vendor = 0x10DB,
2311 .device = 0x8029,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002312 .subvendor = PCI_ANY_ID,
2313 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002314 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002315 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002316 },
2317 {
2318 .vendor = 0x10DB,
2319 .device = 0x800C,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002320 .subvendor = PCI_ANY_ID,
2321 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002322 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002323 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002324 },
2325 {
2326 .vendor = 0x10DB,
2327 .device = 0x800D,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002328 .subvendor = PCI_ANY_ID,
2329 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002330 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002331 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002332 },
Russell King9f2a0362009-01-02 13:44:20 +00002333 /*
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002334 * Cronyx Omega PCI (PLX-chip based)
2335 */
2336 {
2337 .vendor = PCI_VENDOR_ID_PLX,
2338 .device = PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
2339 .subvendor = PCI_ANY_ID,
2340 .subdevice = PCI_ANY_ID,
2341 .setup = pci_omegapci_setup,
Alan Coxeb26dfe2012-07-12 13:00:31 +01002342 },
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002343 /* WCH CH353 2S1P card (16550 clone) */
2344 {
Alan Cox27788c52012-09-04 16:21:06 +01002345 .vendor = PCI_VENDOR_ID_WCH,
2346 .device = PCI_DEVICE_ID_WCH_CH353_2S1P,
2347 .subvendor = PCI_ANY_ID,
2348 .subdevice = PCI_ANY_ID,
2349 .setup = pci_wch_ch353_setup,
2350 },
2351 /* WCH CH353 4S card (16550 clone) */
2352 {
2353 .vendor = PCI_VENDOR_ID_WCH,
2354 .device = PCI_DEVICE_ID_WCH_CH353_4S,
2355 .subvendor = PCI_ANY_ID,
2356 .subdevice = PCI_ANY_ID,
2357 .setup = pci_wch_ch353_setup,
2358 },
2359 /* WCH CH353 2S1PF card (16550 clone) */
2360 {
2361 .vendor = PCI_VENDOR_ID_WCH,
2362 .device = PCI_DEVICE_ID_WCH_CH353_2S1PF,
2363 .subvendor = PCI_ANY_ID,
2364 .subdevice = PCI_ANY_ID,
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002365 .setup = pci_wch_ch353_setup,
2366 },
Wang YanQing8b5c9132013-03-05 23:16:48 +08002367 /* WCH CH352 2S card (16550 clone) */
2368 {
2369 .vendor = PCI_VENDOR_ID_WCH,
2370 .device = PCI_DEVICE_ID_WCH_CH352_2S,
2371 .subvendor = PCI_ANY_ID,
2372 .subdevice = PCI_ANY_ID,
2373 .setup = pci_wch_ch353_setup,
2374 },
Alan Coxeb26dfe2012-07-12 13:00:31 +01002375 /*
2376 * ASIX devices with FIFO bug
2377 */
2378 {
2379 .vendor = PCI_VENDOR_ID_ASIX,
2380 .device = PCI_ANY_ID,
2381 .subvendor = PCI_ANY_ID,
2382 .subdevice = PCI_ANY_ID,
2383 .setup = pci_asix_setup,
2384 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002385 /*
Matt Schulte14faa8c2012-11-21 10:35:15 -06002386 * Commtech, Inc. Fastcom adapters
2387 *
2388 */
2389 {
2390 .vendor = PCI_VENDOR_ID_COMMTECH,
2391 .device = PCI_DEVICE_ID_COMMTECH_4222PCI335,
2392 .subvendor = PCI_ANY_ID,
2393 .subdevice = PCI_ANY_ID,
2394 .setup = pci_fastcom335_setup,
2395 },
2396 {
2397 .vendor = PCI_VENDOR_ID_COMMTECH,
2398 .device = PCI_DEVICE_ID_COMMTECH_4224PCI335,
2399 .subvendor = PCI_ANY_ID,
2400 .subdevice = PCI_ANY_ID,
2401 .setup = pci_fastcom335_setup,
2402 },
2403 {
2404 .vendor = PCI_VENDOR_ID_COMMTECH,
2405 .device = PCI_DEVICE_ID_COMMTECH_2324PCI335,
2406 .subvendor = PCI_ANY_ID,
2407 .subdevice = PCI_ANY_ID,
2408 .setup = pci_fastcom335_setup,
2409 },
2410 {
2411 .vendor = PCI_VENDOR_ID_COMMTECH,
2412 .device = PCI_DEVICE_ID_COMMTECH_2328PCI335,
2413 .subvendor = PCI_ANY_ID,
2414 .subdevice = PCI_ANY_ID,
2415 .setup = pci_fastcom335_setup,
2416 },
2417 {
2418 .vendor = PCI_VENDOR_ID_COMMTECH,
2419 .device = PCI_DEVICE_ID_COMMTECH_4222PCIE,
2420 .subvendor = PCI_ANY_ID,
2421 .subdevice = PCI_ANY_ID,
2422 .setup = pci_xr17v35x_setup,
2423 },
2424 {
2425 .vendor = PCI_VENDOR_ID_COMMTECH,
2426 .device = PCI_DEVICE_ID_COMMTECH_4224PCIE,
2427 .subvendor = PCI_ANY_ID,
2428 .subdevice = PCI_ANY_ID,
2429 .setup = pci_xr17v35x_setup,
2430 },
2431 {
2432 .vendor = PCI_VENDOR_ID_COMMTECH,
2433 .device = PCI_DEVICE_ID_COMMTECH_4228PCIE,
2434 .subvendor = PCI_ANY_ID,
2435 .subdevice = PCI_ANY_ID,
2436 .setup = pci_xr17v35x_setup,
2437 },
2438 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08002439 * Broadcom TruManage (NetXtreme)
2440 */
2441 {
2442 .vendor = PCI_VENDOR_ID_BROADCOM,
2443 .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
2444 .subvendor = PCI_ANY_ID,
2445 .subdevice = PCI_ANY_ID,
2446 .setup = pci_brcm_trumanage_setup,
2447 },
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002448 {
2449 .vendor = 0x1c29,
2450 .device = 0x1104,
2451 .subvendor = PCI_ANY_ID,
2452 .subdevice = PCI_ANY_ID,
2453 .setup = pci_fintek_setup,
2454 },
2455 {
2456 .vendor = 0x1c29,
2457 .device = 0x1108,
2458 .subvendor = PCI_ANY_ID,
2459 .subdevice = PCI_ANY_ID,
2460 .setup = pci_fintek_setup,
2461 },
2462 {
2463 .vendor = 0x1c29,
2464 .device = 0x1112,
2465 .subvendor = PCI_ANY_ID,
2466 .subdevice = PCI_ANY_ID,
2467 .setup = pci_fintek_setup,
2468 },
Stephen Hurdebebd492013-01-17 14:14:53 -08002469
2470 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002471 * Default "match everything" terminator entry
2472 */
2473 {
2474 .vendor = PCI_ANY_ID,
2475 .device = PCI_ANY_ID,
2476 .subvendor = PCI_ANY_ID,
2477 .subdevice = PCI_ANY_ID,
2478 .setup = pci_default_setup,
2479 }
2480};
2481
2482static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
2483{
2484 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
2485}
2486
2487static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
2488{
2489 struct pci_serial_quirk *quirk;
2490
2491 for (quirk = pci_serial_quirks; ; quirk++)
2492 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
2493 quirk_id_matches(quirk->device, dev->device) &&
2494 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
2495 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
Alan Cox5756ee92008-02-08 04:18:51 -08002496 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002497 return quirk;
2498}
2499
Andrew Mortondd68e882006-01-05 10:55:26 +00002500static inline int get_pci_irq(struct pci_dev *dev,
Russell King975a1a7d2009-01-02 13:44:27 +00002501 const struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002502{
2503 if (board->flags & FL_NOIRQ)
2504 return 0;
2505 else
2506 return dev->irq;
2507}
2508
2509/*
2510 * This is the configuration table for all of the PCI serial boards
2511 * which we support. It is directly indexed by the pci_board_num_t enum
2512 * value, which is encoded in the pci_device_id PCI probe table's
2513 * driver_data member.
2514 *
2515 * The makeup of these names are:
Gareth Howlett26e92862006-01-04 17:00:42 +00002516 * pbn_bn{_bt}_n_baud{_offsetinhex}
Linus Torvalds1da177e2005-04-16 15:20:36 -07002517 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002518 * bn = PCI BAR number
2519 * bt = Index using PCI BARs
2520 * n = number of serial ports
2521 * baud = baud rate
2522 * offsetinhex = offset for each sequential port (in hex)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002523 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002524 * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
Russell Kingf1690f32005-05-06 10:19:09 +01002525 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07002526 * Please note: in theory if n = 1, _bt infix should make no difference.
2527 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
2528 */
2529enum pci_board_num_t {
2530 pbn_default = 0,
2531
2532 pbn_b0_1_115200,
2533 pbn_b0_2_115200,
2534 pbn_b0_4_115200,
2535 pbn_b0_5_115200,
Alan Coxbf0df632007-10-16 01:24:00 -07002536 pbn_b0_8_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002537
2538 pbn_b0_1_921600,
2539 pbn_b0_2_921600,
2540 pbn_b0_4_921600,
2541
David Ransondb1de152005-07-27 11:43:55 -07002542 pbn_b0_2_1130000,
2543
Andrey Paninfbc0dc02005-07-18 11:38:09 +01002544 pbn_b0_4_1152000,
2545
Matt Schulte14faa8c2012-11-21 10:35:15 -06002546 pbn_b0_2_1152000_200,
2547 pbn_b0_4_1152000_200,
2548 pbn_b0_8_1152000_200,
2549
Gareth Howlett26e92862006-01-04 17:00:42 +00002550 pbn_b0_2_1843200,
2551 pbn_b0_4_1843200,
2552
2553 pbn_b0_2_1843200_200,
2554 pbn_b0_4_1843200_200,
2555 pbn_b0_8_1843200_200,
2556
Lee Howard7106b4e2008-10-21 13:48:58 +01002557 pbn_b0_1_4000000,
2558
Linus Torvalds1da177e2005-04-16 15:20:36 -07002559 pbn_b0_bt_1_115200,
2560 pbn_b0_bt_2_115200,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08002561 pbn_b0_bt_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002562 pbn_b0_bt_8_115200,
2563
2564 pbn_b0_bt_1_460800,
2565 pbn_b0_bt_2_460800,
2566 pbn_b0_bt_4_460800,
2567
2568 pbn_b0_bt_1_921600,
2569 pbn_b0_bt_2_921600,
2570 pbn_b0_bt_4_921600,
2571 pbn_b0_bt_8_921600,
2572
2573 pbn_b1_1_115200,
2574 pbn_b1_2_115200,
2575 pbn_b1_4_115200,
2576 pbn_b1_8_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002577 pbn_b1_16_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002578
2579 pbn_b1_1_921600,
2580 pbn_b1_2_921600,
2581 pbn_b1_4_921600,
2582 pbn_b1_8_921600,
2583
Gareth Howlett26e92862006-01-04 17:00:42 +00002584 pbn_b1_2_1250000,
2585
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002586 pbn_b1_bt_1_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002587 pbn_b1_bt_2_115200,
2588 pbn_b1_bt_4_115200,
2589
Linus Torvalds1da177e2005-04-16 15:20:36 -07002590 pbn_b1_bt_2_921600,
2591
2592 pbn_b1_1_1382400,
2593 pbn_b1_2_1382400,
2594 pbn_b1_4_1382400,
2595 pbn_b1_8_1382400,
2596
2597 pbn_b2_1_115200,
Peter Horton737c1752006-08-26 09:07:36 +01002598 pbn_b2_2_115200,
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002599 pbn_b2_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002600 pbn_b2_8_115200,
2601
2602 pbn_b2_1_460800,
2603 pbn_b2_4_460800,
2604 pbn_b2_8_460800,
2605 pbn_b2_16_460800,
2606
2607 pbn_b2_1_921600,
2608 pbn_b2_4_921600,
2609 pbn_b2_8_921600,
2610
Lytochkin Borise8470032010-07-26 10:02:26 +04002611 pbn_b2_8_1152000,
2612
Linus Torvalds1da177e2005-04-16 15:20:36 -07002613 pbn_b2_bt_1_115200,
2614 pbn_b2_bt_2_115200,
2615 pbn_b2_bt_4_115200,
2616
2617 pbn_b2_bt_2_921600,
2618 pbn_b2_bt_4_921600,
2619
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00002620 pbn_b3_2_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002621 pbn_b3_4_115200,
2622 pbn_b3_8_115200,
2623
Yegor Yefremov66169ad2010-06-04 09:58:18 +02002624 pbn_b4_bt_2_921600,
2625 pbn_b4_bt_4_921600,
2626 pbn_b4_bt_8_921600,
2627
Linus Torvalds1da177e2005-04-16 15:20:36 -07002628 /*
2629 * Board-specific versions.
2630 */
2631 pbn_panacom,
2632 pbn_panacom2,
2633 pbn_panacom4,
2634 pbn_plx_romulus,
2635 pbn_oxsemi,
Lee Howard7106b4e2008-10-21 13:48:58 +01002636 pbn_oxsemi_1_4000000,
2637 pbn_oxsemi_2_4000000,
2638 pbn_oxsemi_4_4000000,
2639 pbn_oxsemi_8_4000000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002640 pbn_intel_i960,
2641 pbn_sgi_ioc3,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002642 pbn_computone_4,
2643 pbn_computone_6,
2644 pbn_computone_8,
2645 pbn_sbsxrsio,
2646 pbn_exar_XR17C152,
2647 pbn_exar_XR17C154,
2648 pbn_exar_XR17C158,
Matt Schultedc96efb2012-11-19 09:12:04 -06002649 pbn_exar_XR17V352,
2650 pbn_exar_XR17V354,
2651 pbn_exar_XR17V358,
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07002652 pbn_exar_ibm_saturn,
Olof Johanssonaa798502007-08-22 14:01:55 -07002653 pbn_pasemi_1682M,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002654 pbn_ni8430_2,
2655 pbn_ni8430_4,
2656 pbn_ni8430_8,
2657 pbn_ni8430_16,
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07002658 pbn_ADDIDATA_PCIe_1_3906250,
2659 pbn_ADDIDATA_PCIe_2_3906250,
2660 pbn_ADDIDATA_PCIe_4_3906250,
2661 pbn_ADDIDATA_PCIe_8_3906250,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08002662 pbn_ce4100_1_115200,
Heikki Krogerusb15e5692013-09-27 10:52:59 +03002663 pbn_byt,
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002664 pbn_omegapci,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002665 pbn_NETMOS9900_2s_115200,
Stephen Hurdebebd492013-01-17 14:14:53 -08002666 pbn_brcm_trumanage,
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002667 pbn_fintek_4,
2668 pbn_fintek_8,
2669 pbn_fintek_12,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002670};
2671
2672/*
2673 * uart_offset - the space between channels
2674 * reg_shift - describes how the UART registers are mapped
2675 * to PCI memory by the card.
2676 * For example IER register on SBS, Inc. PMC-OctPro is located at
2677 * offset 0x10 from the UART base, while UART_IER is defined as 1
2678 * in include/linux/serial_reg.h,
2679 * see first lines of serial_in() and serial_out() in 8250.c
2680*/
2681
Bill Pembertonde88b342012-11-19 13:24:32 -05002682static struct pciserial_board pci_boards[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002683 [pbn_default] = {
2684 .flags = FL_BASE0,
2685 .num_ports = 1,
2686 .base_baud = 115200,
2687 .uart_offset = 8,
2688 },
2689 [pbn_b0_1_115200] = {
2690 .flags = FL_BASE0,
2691 .num_ports = 1,
2692 .base_baud = 115200,
2693 .uart_offset = 8,
2694 },
2695 [pbn_b0_2_115200] = {
2696 .flags = FL_BASE0,
2697 .num_ports = 2,
2698 .base_baud = 115200,
2699 .uart_offset = 8,
2700 },
2701 [pbn_b0_4_115200] = {
2702 .flags = FL_BASE0,
2703 .num_ports = 4,
2704 .base_baud = 115200,
2705 .uart_offset = 8,
2706 },
2707 [pbn_b0_5_115200] = {
2708 .flags = FL_BASE0,
2709 .num_ports = 5,
2710 .base_baud = 115200,
2711 .uart_offset = 8,
2712 },
Alan Coxbf0df632007-10-16 01:24:00 -07002713 [pbn_b0_8_115200] = {
2714 .flags = FL_BASE0,
2715 .num_ports = 8,
2716 .base_baud = 115200,
2717 .uart_offset = 8,
2718 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002719 [pbn_b0_1_921600] = {
2720 .flags = FL_BASE0,
2721 .num_ports = 1,
2722 .base_baud = 921600,
2723 .uart_offset = 8,
2724 },
2725 [pbn_b0_2_921600] = {
2726 .flags = FL_BASE0,
2727 .num_ports = 2,
2728 .base_baud = 921600,
2729 .uart_offset = 8,
2730 },
2731 [pbn_b0_4_921600] = {
2732 .flags = FL_BASE0,
2733 .num_ports = 4,
2734 .base_baud = 921600,
2735 .uart_offset = 8,
2736 },
David Ransondb1de152005-07-27 11:43:55 -07002737
2738 [pbn_b0_2_1130000] = {
2739 .flags = FL_BASE0,
2740 .num_ports = 2,
2741 .base_baud = 1130000,
2742 .uart_offset = 8,
2743 },
2744
Andrey Paninfbc0dc02005-07-18 11:38:09 +01002745 [pbn_b0_4_1152000] = {
2746 .flags = FL_BASE0,
2747 .num_ports = 4,
2748 .base_baud = 1152000,
2749 .uart_offset = 8,
2750 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002751
Matt Schulte14faa8c2012-11-21 10:35:15 -06002752 [pbn_b0_2_1152000_200] = {
2753 .flags = FL_BASE0,
2754 .num_ports = 2,
2755 .base_baud = 1152000,
2756 .uart_offset = 0x200,
2757 },
2758
2759 [pbn_b0_4_1152000_200] = {
2760 .flags = FL_BASE0,
2761 .num_ports = 4,
2762 .base_baud = 1152000,
2763 .uart_offset = 0x200,
2764 },
2765
2766 [pbn_b0_8_1152000_200] = {
2767 .flags = FL_BASE0,
Matt Schulte4f7d67d2012-12-06 22:19:58 -06002768 .num_ports = 8,
Matt Schulte14faa8c2012-11-21 10:35:15 -06002769 .base_baud = 1152000,
2770 .uart_offset = 0x200,
2771 },
2772
Gareth Howlett26e92862006-01-04 17:00:42 +00002773 [pbn_b0_2_1843200] = {
2774 .flags = FL_BASE0,
2775 .num_ports = 2,
2776 .base_baud = 1843200,
2777 .uart_offset = 8,
2778 },
2779 [pbn_b0_4_1843200] = {
2780 .flags = FL_BASE0,
2781 .num_ports = 4,
2782 .base_baud = 1843200,
2783 .uart_offset = 8,
2784 },
2785
2786 [pbn_b0_2_1843200_200] = {
2787 .flags = FL_BASE0,
2788 .num_ports = 2,
2789 .base_baud = 1843200,
2790 .uart_offset = 0x200,
2791 },
2792 [pbn_b0_4_1843200_200] = {
2793 .flags = FL_BASE0,
2794 .num_ports = 4,
2795 .base_baud = 1843200,
2796 .uart_offset = 0x200,
2797 },
2798 [pbn_b0_8_1843200_200] = {
2799 .flags = FL_BASE0,
2800 .num_ports = 8,
2801 .base_baud = 1843200,
2802 .uart_offset = 0x200,
2803 },
Lee Howard7106b4e2008-10-21 13:48:58 +01002804 [pbn_b0_1_4000000] = {
2805 .flags = FL_BASE0,
2806 .num_ports = 1,
2807 .base_baud = 4000000,
2808 .uart_offset = 8,
2809 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002810
Linus Torvalds1da177e2005-04-16 15:20:36 -07002811 [pbn_b0_bt_1_115200] = {
2812 .flags = FL_BASE0|FL_BASE_BARS,
2813 .num_ports = 1,
2814 .base_baud = 115200,
2815 .uart_offset = 8,
2816 },
2817 [pbn_b0_bt_2_115200] = {
2818 .flags = FL_BASE0|FL_BASE_BARS,
2819 .num_ports = 2,
2820 .base_baud = 115200,
2821 .uart_offset = 8,
2822 },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08002823 [pbn_b0_bt_4_115200] = {
2824 .flags = FL_BASE0|FL_BASE_BARS,
2825 .num_ports = 4,
2826 .base_baud = 115200,
2827 .uart_offset = 8,
2828 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002829 [pbn_b0_bt_8_115200] = {
2830 .flags = FL_BASE0|FL_BASE_BARS,
2831 .num_ports = 8,
2832 .base_baud = 115200,
2833 .uart_offset = 8,
2834 },
2835
2836 [pbn_b0_bt_1_460800] = {
2837 .flags = FL_BASE0|FL_BASE_BARS,
2838 .num_ports = 1,
2839 .base_baud = 460800,
2840 .uart_offset = 8,
2841 },
2842 [pbn_b0_bt_2_460800] = {
2843 .flags = FL_BASE0|FL_BASE_BARS,
2844 .num_ports = 2,
2845 .base_baud = 460800,
2846 .uart_offset = 8,
2847 },
2848 [pbn_b0_bt_4_460800] = {
2849 .flags = FL_BASE0|FL_BASE_BARS,
2850 .num_ports = 4,
2851 .base_baud = 460800,
2852 .uart_offset = 8,
2853 },
2854
2855 [pbn_b0_bt_1_921600] = {
2856 .flags = FL_BASE0|FL_BASE_BARS,
2857 .num_ports = 1,
2858 .base_baud = 921600,
2859 .uart_offset = 8,
2860 },
2861 [pbn_b0_bt_2_921600] = {
2862 .flags = FL_BASE0|FL_BASE_BARS,
2863 .num_ports = 2,
2864 .base_baud = 921600,
2865 .uart_offset = 8,
2866 },
2867 [pbn_b0_bt_4_921600] = {
2868 .flags = FL_BASE0|FL_BASE_BARS,
2869 .num_ports = 4,
2870 .base_baud = 921600,
2871 .uart_offset = 8,
2872 },
2873 [pbn_b0_bt_8_921600] = {
2874 .flags = FL_BASE0|FL_BASE_BARS,
2875 .num_ports = 8,
2876 .base_baud = 921600,
2877 .uart_offset = 8,
2878 },
2879
2880 [pbn_b1_1_115200] = {
2881 .flags = FL_BASE1,
2882 .num_ports = 1,
2883 .base_baud = 115200,
2884 .uart_offset = 8,
2885 },
2886 [pbn_b1_2_115200] = {
2887 .flags = FL_BASE1,
2888 .num_ports = 2,
2889 .base_baud = 115200,
2890 .uart_offset = 8,
2891 },
2892 [pbn_b1_4_115200] = {
2893 .flags = FL_BASE1,
2894 .num_ports = 4,
2895 .base_baud = 115200,
2896 .uart_offset = 8,
2897 },
2898 [pbn_b1_8_115200] = {
2899 .flags = FL_BASE1,
2900 .num_ports = 8,
2901 .base_baud = 115200,
2902 .uart_offset = 8,
2903 },
Will Page04bf7e72009-04-06 17:32:15 +01002904 [pbn_b1_16_115200] = {
2905 .flags = FL_BASE1,
2906 .num_ports = 16,
2907 .base_baud = 115200,
2908 .uart_offset = 8,
2909 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002910
2911 [pbn_b1_1_921600] = {
2912 .flags = FL_BASE1,
2913 .num_ports = 1,
2914 .base_baud = 921600,
2915 .uart_offset = 8,
2916 },
2917 [pbn_b1_2_921600] = {
2918 .flags = FL_BASE1,
2919 .num_ports = 2,
2920 .base_baud = 921600,
2921 .uart_offset = 8,
2922 },
2923 [pbn_b1_4_921600] = {
2924 .flags = FL_BASE1,
2925 .num_ports = 4,
2926 .base_baud = 921600,
2927 .uart_offset = 8,
2928 },
2929 [pbn_b1_8_921600] = {
2930 .flags = FL_BASE1,
2931 .num_ports = 8,
2932 .base_baud = 921600,
2933 .uart_offset = 8,
2934 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002935 [pbn_b1_2_1250000] = {
2936 .flags = FL_BASE1,
2937 .num_ports = 2,
2938 .base_baud = 1250000,
2939 .uart_offset = 8,
2940 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002941
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002942 [pbn_b1_bt_1_115200] = {
2943 .flags = FL_BASE1|FL_BASE_BARS,
2944 .num_ports = 1,
2945 .base_baud = 115200,
2946 .uart_offset = 8,
2947 },
Will Page04bf7e72009-04-06 17:32:15 +01002948 [pbn_b1_bt_2_115200] = {
2949 .flags = FL_BASE1|FL_BASE_BARS,
2950 .num_ports = 2,
2951 .base_baud = 115200,
2952 .uart_offset = 8,
2953 },
2954 [pbn_b1_bt_4_115200] = {
2955 .flags = FL_BASE1|FL_BASE_BARS,
2956 .num_ports = 4,
2957 .base_baud = 115200,
2958 .uart_offset = 8,
2959 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002960
Linus Torvalds1da177e2005-04-16 15:20:36 -07002961 [pbn_b1_bt_2_921600] = {
2962 .flags = FL_BASE1|FL_BASE_BARS,
2963 .num_ports = 2,
2964 .base_baud = 921600,
2965 .uart_offset = 8,
2966 },
2967
2968 [pbn_b1_1_1382400] = {
2969 .flags = FL_BASE1,
2970 .num_ports = 1,
2971 .base_baud = 1382400,
2972 .uart_offset = 8,
2973 },
2974 [pbn_b1_2_1382400] = {
2975 .flags = FL_BASE1,
2976 .num_ports = 2,
2977 .base_baud = 1382400,
2978 .uart_offset = 8,
2979 },
2980 [pbn_b1_4_1382400] = {
2981 .flags = FL_BASE1,
2982 .num_ports = 4,
2983 .base_baud = 1382400,
2984 .uart_offset = 8,
2985 },
2986 [pbn_b1_8_1382400] = {
2987 .flags = FL_BASE1,
2988 .num_ports = 8,
2989 .base_baud = 1382400,
2990 .uart_offset = 8,
2991 },
2992
2993 [pbn_b2_1_115200] = {
2994 .flags = FL_BASE2,
2995 .num_ports = 1,
2996 .base_baud = 115200,
2997 .uart_offset = 8,
2998 },
Peter Horton737c1752006-08-26 09:07:36 +01002999 [pbn_b2_2_115200] = {
3000 .flags = FL_BASE2,
3001 .num_ports = 2,
3002 .base_baud = 115200,
3003 .uart_offset = 8,
3004 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08003005 [pbn_b2_4_115200] = {
3006 .flags = FL_BASE2,
3007 .num_ports = 4,
3008 .base_baud = 115200,
3009 .uart_offset = 8,
3010 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003011 [pbn_b2_8_115200] = {
3012 .flags = FL_BASE2,
3013 .num_ports = 8,
3014 .base_baud = 115200,
3015 .uart_offset = 8,
3016 },
3017
3018 [pbn_b2_1_460800] = {
3019 .flags = FL_BASE2,
3020 .num_ports = 1,
3021 .base_baud = 460800,
3022 .uart_offset = 8,
3023 },
3024 [pbn_b2_4_460800] = {
3025 .flags = FL_BASE2,
3026 .num_ports = 4,
3027 .base_baud = 460800,
3028 .uart_offset = 8,
3029 },
3030 [pbn_b2_8_460800] = {
3031 .flags = FL_BASE2,
3032 .num_ports = 8,
3033 .base_baud = 460800,
3034 .uart_offset = 8,
3035 },
3036 [pbn_b2_16_460800] = {
3037 .flags = FL_BASE2,
3038 .num_ports = 16,
3039 .base_baud = 460800,
3040 .uart_offset = 8,
3041 },
3042
3043 [pbn_b2_1_921600] = {
3044 .flags = FL_BASE2,
3045 .num_ports = 1,
3046 .base_baud = 921600,
3047 .uart_offset = 8,
3048 },
3049 [pbn_b2_4_921600] = {
3050 .flags = FL_BASE2,
3051 .num_ports = 4,
3052 .base_baud = 921600,
3053 .uart_offset = 8,
3054 },
3055 [pbn_b2_8_921600] = {
3056 .flags = FL_BASE2,
3057 .num_ports = 8,
3058 .base_baud = 921600,
3059 .uart_offset = 8,
3060 },
3061
Lytochkin Borise8470032010-07-26 10:02:26 +04003062 [pbn_b2_8_1152000] = {
3063 .flags = FL_BASE2,
3064 .num_ports = 8,
3065 .base_baud = 1152000,
3066 .uart_offset = 8,
3067 },
3068
Linus Torvalds1da177e2005-04-16 15:20:36 -07003069 [pbn_b2_bt_1_115200] = {
3070 .flags = FL_BASE2|FL_BASE_BARS,
3071 .num_ports = 1,
3072 .base_baud = 115200,
3073 .uart_offset = 8,
3074 },
3075 [pbn_b2_bt_2_115200] = {
3076 .flags = FL_BASE2|FL_BASE_BARS,
3077 .num_ports = 2,
3078 .base_baud = 115200,
3079 .uart_offset = 8,
3080 },
3081 [pbn_b2_bt_4_115200] = {
3082 .flags = FL_BASE2|FL_BASE_BARS,
3083 .num_ports = 4,
3084 .base_baud = 115200,
3085 .uart_offset = 8,
3086 },
3087
3088 [pbn_b2_bt_2_921600] = {
3089 .flags = FL_BASE2|FL_BASE_BARS,
3090 .num_ports = 2,
3091 .base_baud = 921600,
3092 .uart_offset = 8,
3093 },
3094 [pbn_b2_bt_4_921600] = {
3095 .flags = FL_BASE2|FL_BASE_BARS,
3096 .num_ports = 4,
3097 .base_baud = 921600,
3098 .uart_offset = 8,
3099 },
3100
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00003101 [pbn_b3_2_115200] = {
3102 .flags = FL_BASE3,
3103 .num_ports = 2,
3104 .base_baud = 115200,
3105 .uart_offset = 8,
3106 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003107 [pbn_b3_4_115200] = {
3108 .flags = FL_BASE3,
3109 .num_ports = 4,
3110 .base_baud = 115200,
3111 .uart_offset = 8,
3112 },
3113 [pbn_b3_8_115200] = {
3114 .flags = FL_BASE3,
3115 .num_ports = 8,
3116 .base_baud = 115200,
3117 .uart_offset = 8,
3118 },
3119
Yegor Yefremov66169ad2010-06-04 09:58:18 +02003120 [pbn_b4_bt_2_921600] = {
3121 .flags = FL_BASE4,
3122 .num_ports = 2,
3123 .base_baud = 921600,
3124 .uart_offset = 8,
3125 },
3126 [pbn_b4_bt_4_921600] = {
3127 .flags = FL_BASE4,
3128 .num_ports = 4,
3129 .base_baud = 921600,
3130 .uart_offset = 8,
3131 },
3132 [pbn_b4_bt_8_921600] = {
3133 .flags = FL_BASE4,
3134 .num_ports = 8,
3135 .base_baud = 921600,
3136 .uart_offset = 8,
3137 },
3138
Linus Torvalds1da177e2005-04-16 15:20:36 -07003139 /*
3140 * Entries following this are board-specific.
3141 */
3142
3143 /*
3144 * Panacom - IOMEM
3145 */
3146 [pbn_panacom] = {
3147 .flags = FL_BASE2,
3148 .num_ports = 2,
3149 .base_baud = 921600,
3150 .uart_offset = 0x400,
3151 .reg_shift = 7,
3152 },
3153 [pbn_panacom2] = {
3154 .flags = FL_BASE2|FL_BASE_BARS,
3155 .num_ports = 2,
3156 .base_baud = 921600,
3157 .uart_offset = 0x400,
3158 .reg_shift = 7,
3159 },
3160 [pbn_panacom4] = {
3161 .flags = FL_BASE2|FL_BASE_BARS,
3162 .num_ports = 4,
3163 .base_baud = 921600,
3164 .uart_offset = 0x400,
3165 .reg_shift = 7,
3166 },
3167
3168 /* I think this entry is broken - the first_offset looks wrong --rmk */
3169 [pbn_plx_romulus] = {
3170 .flags = FL_BASE2,
3171 .num_ports = 4,
3172 .base_baud = 921600,
3173 .uart_offset = 8 << 2,
3174 .reg_shift = 2,
3175 .first_offset = 0x03,
3176 },
3177
3178 /*
3179 * This board uses the size of PCI Base region 0 to
3180 * signal now many ports are available
3181 */
3182 [pbn_oxsemi] = {
3183 .flags = FL_BASE0|FL_REGION_SZ_CAP,
3184 .num_ports = 32,
3185 .base_baud = 115200,
3186 .uart_offset = 8,
3187 },
Lee Howard7106b4e2008-10-21 13:48:58 +01003188 [pbn_oxsemi_1_4000000] = {
3189 .flags = FL_BASE0,
3190 .num_ports = 1,
3191 .base_baud = 4000000,
3192 .uart_offset = 0x200,
3193 .first_offset = 0x1000,
3194 },
3195 [pbn_oxsemi_2_4000000] = {
3196 .flags = FL_BASE0,
3197 .num_ports = 2,
3198 .base_baud = 4000000,
3199 .uart_offset = 0x200,
3200 .first_offset = 0x1000,
3201 },
3202 [pbn_oxsemi_4_4000000] = {
3203 .flags = FL_BASE0,
3204 .num_ports = 4,
3205 .base_baud = 4000000,
3206 .uart_offset = 0x200,
3207 .first_offset = 0x1000,
3208 },
3209 [pbn_oxsemi_8_4000000] = {
3210 .flags = FL_BASE0,
3211 .num_ports = 8,
3212 .base_baud = 4000000,
3213 .uart_offset = 0x200,
3214 .first_offset = 0x1000,
3215 },
3216
Linus Torvalds1da177e2005-04-16 15:20:36 -07003217
3218 /*
3219 * EKF addition for i960 Boards form EKF with serial port.
3220 * Max 256 ports.
3221 */
3222 [pbn_intel_i960] = {
3223 .flags = FL_BASE0,
3224 .num_ports = 32,
3225 .base_baud = 921600,
3226 .uart_offset = 8 << 2,
3227 .reg_shift = 2,
3228 .first_offset = 0x10000,
3229 },
3230 [pbn_sgi_ioc3] = {
3231 .flags = FL_BASE0|FL_NOIRQ,
3232 .num_ports = 1,
3233 .base_baud = 458333,
3234 .uart_offset = 8,
3235 .reg_shift = 0,
3236 .first_offset = 0x20178,
3237 },
3238
3239 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003240 * Computone - uses IOMEM.
3241 */
3242 [pbn_computone_4] = {
3243 .flags = FL_BASE0,
3244 .num_ports = 4,
3245 .base_baud = 921600,
3246 .uart_offset = 0x40,
3247 .reg_shift = 2,
3248 .first_offset = 0x200,
3249 },
3250 [pbn_computone_6] = {
3251 .flags = FL_BASE0,
3252 .num_ports = 6,
3253 .base_baud = 921600,
3254 .uart_offset = 0x40,
3255 .reg_shift = 2,
3256 .first_offset = 0x200,
3257 },
3258 [pbn_computone_8] = {
3259 .flags = FL_BASE0,
3260 .num_ports = 8,
3261 .base_baud = 921600,
3262 .uart_offset = 0x40,
3263 .reg_shift = 2,
3264 .first_offset = 0x200,
3265 },
3266 [pbn_sbsxrsio] = {
3267 .flags = FL_BASE0,
3268 .num_ports = 8,
3269 .base_baud = 460800,
3270 .uart_offset = 256,
3271 .reg_shift = 4,
3272 },
3273 /*
3274 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
3275 * Only basic 16550A support.
3276 * XR17C15[24] are not tested, but they should work.
3277 */
3278 [pbn_exar_XR17C152] = {
3279 .flags = FL_BASE0,
3280 .num_ports = 2,
3281 .base_baud = 921600,
3282 .uart_offset = 0x200,
3283 },
3284 [pbn_exar_XR17C154] = {
3285 .flags = FL_BASE0,
3286 .num_ports = 4,
3287 .base_baud = 921600,
3288 .uart_offset = 0x200,
3289 },
3290 [pbn_exar_XR17C158] = {
3291 .flags = FL_BASE0,
3292 .num_ports = 8,
3293 .base_baud = 921600,
3294 .uart_offset = 0x200,
3295 },
Matt Schultedc96efb2012-11-19 09:12:04 -06003296 [pbn_exar_XR17V352] = {
3297 .flags = FL_BASE0,
3298 .num_ports = 2,
3299 .base_baud = 7812500,
3300 .uart_offset = 0x400,
3301 .reg_shift = 0,
3302 .first_offset = 0,
3303 },
3304 [pbn_exar_XR17V354] = {
3305 .flags = FL_BASE0,
3306 .num_ports = 4,
3307 .base_baud = 7812500,
3308 .uart_offset = 0x400,
3309 .reg_shift = 0,
3310 .first_offset = 0,
3311 },
3312 [pbn_exar_XR17V358] = {
3313 .flags = FL_BASE0,
3314 .num_ports = 8,
3315 .base_baud = 7812500,
3316 .uart_offset = 0x400,
3317 .reg_shift = 0,
3318 .first_offset = 0,
3319 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07003320 [pbn_exar_ibm_saturn] = {
3321 .flags = FL_BASE0,
3322 .num_ports = 1,
3323 .base_baud = 921600,
3324 .uart_offset = 0x200,
3325 },
3326
Olof Johanssonaa798502007-08-22 14:01:55 -07003327 /*
3328 * PA Semi PWRficient PA6T-1682M on-chip UART
3329 */
3330 [pbn_pasemi_1682M] = {
3331 .flags = FL_BASE0,
3332 .num_ports = 1,
3333 .base_baud = 8333333,
3334 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01003335 /*
3336 * National Instruments 843x
3337 */
3338 [pbn_ni8430_16] = {
3339 .flags = FL_BASE0,
3340 .num_ports = 16,
3341 .base_baud = 3686400,
3342 .uart_offset = 0x10,
3343 .first_offset = 0x800,
3344 },
3345 [pbn_ni8430_8] = {
3346 .flags = FL_BASE0,
3347 .num_ports = 8,
3348 .base_baud = 3686400,
3349 .uart_offset = 0x10,
3350 .first_offset = 0x800,
3351 },
3352 [pbn_ni8430_4] = {
3353 .flags = FL_BASE0,
3354 .num_ports = 4,
3355 .base_baud = 3686400,
3356 .uart_offset = 0x10,
3357 .first_offset = 0x800,
3358 },
3359 [pbn_ni8430_2] = {
3360 .flags = FL_BASE0,
3361 .num_ports = 2,
3362 .base_baud = 3686400,
3363 .uart_offset = 0x10,
3364 .first_offset = 0x800,
3365 },
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07003366 /*
3367 * ADDI-DATA GmbH PCI-Express communication cards <info@addi-data.com>
3368 */
3369 [pbn_ADDIDATA_PCIe_1_3906250] = {
3370 .flags = FL_BASE0,
3371 .num_ports = 1,
3372 .base_baud = 3906250,
3373 .uart_offset = 0x200,
3374 .first_offset = 0x1000,
3375 },
3376 [pbn_ADDIDATA_PCIe_2_3906250] = {
3377 .flags = FL_BASE0,
3378 .num_ports = 2,
3379 .base_baud = 3906250,
3380 .uart_offset = 0x200,
3381 .first_offset = 0x1000,
3382 },
3383 [pbn_ADDIDATA_PCIe_4_3906250] = {
3384 .flags = FL_BASE0,
3385 .num_ports = 4,
3386 .base_baud = 3906250,
3387 .uart_offset = 0x200,
3388 .first_offset = 0x1000,
3389 },
3390 [pbn_ADDIDATA_PCIe_8_3906250] = {
3391 .flags = FL_BASE0,
3392 .num_ports = 8,
3393 .base_baud = 3906250,
3394 .uart_offset = 0x200,
3395 .first_offset = 0x1000,
3396 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003397 [pbn_ce4100_1_115200] = {
Maxime Bizon08ec2122012-10-19 10:45:07 +02003398 .flags = FL_BASE_BARS,
3399 .num_ports = 2,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003400 .base_baud = 921600,
3401 .reg_shift = 2,
3402 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03003403 [pbn_byt] = {
3404 .flags = FL_BASE0,
3405 .num_ports = 1,
3406 .base_baud = 2764800,
3407 .uart_offset = 0x80,
3408 .reg_shift = 2,
3409 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04003410 [pbn_omegapci] = {
3411 .flags = FL_BASE0,
3412 .num_ports = 8,
3413 .base_baud = 115200,
3414 .uart_offset = 0x200,
3415 },
Nicos Gollan7808edc2011-05-05 21:00:37 +02003416 [pbn_NETMOS9900_2s_115200] = {
3417 .flags = FL_BASE0,
3418 .num_ports = 2,
3419 .base_baud = 115200,
3420 },
Stephen Hurdebebd492013-01-17 14:14:53 -08003421 [pbn_brcm_trumanage] = {
3422 .flags = FL_BASE0,
3423 .num_ports = 1,
3424 .reg_shift = 2,
3425 .base_baud = 115200,
3426 },
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07003427 [pbn_fintek_4] = {
3428 .num_ports = 4,
3429 .uart_offset = 8,
3430 .base_baud = 115200,
3431 .first_offset = 0x40,
3432 },
3433 [pbn_fintek_8] = {
3434 .num_ports = 8,
3435 .uart_offset = 8,
3436 .base_baud = 115200,
3437 .first_offset = 0x40,
3438 },
3439 [pbn_fintek_12] = {
3440 .num_ports = 12,
3441 .uart_offset = 8,
3442 .base_baud = 115200,
3443 .first_offset = 0x40,
3444 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003445};
3446
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003447static const struct pci_device_id blacklist[] = {
3448 /* softmodems */
Alan Cox5756ee92008-02-08 04:18:51 -08003449 { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
Maciej Szmigieroebf7c062010-10-26 21:48:21 +02003450 { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */
3451 { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003452
3453 /* multi-io cards handled by parport_serial */
3454 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
Christian Schmidt436bbd42007-08-22 14:01:19 -07003455};
3456
Linus Torvalds1da177e2005-04-16 15:20:36 -07003457/*
3458 * Given a complete unknown PCI device, try to use some heuristics to
3459 * guess what the configuration might be, based on the pitiful PCI
3460 * serial specs. Returns 0 on success, 1 on failure.
3461 */
Bill Pemberton9671f092012-11-19 13:21:50 -05003462static int
Russell King1c7c1fe2005-07-27 11:31:19 +01003463serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003464{
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003465 const struct pci_device_id *bldev;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003466 int num_iomem, num_port, first_port = -1, i;
Alan Cox5756ee92008-02-08 04:18:51 -08003467
Linus Torvalds1da177e2005-04-16 15:20:36 -07003468 /*
3469 * If it is not a communications device or the programming
3470 * interface is greater than 6, give up.
3471 *
3472 * (Should we try to make guesses for multiport serial devices
Alan Cox5756ee92008-02-08 04:18:51 -08003473 * later?)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003474 */
3475 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
3476 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
3477 (dev->class & 0xff) > 6)
3478 return -ENODEV;
3479
Christian Schmidt436bbd42007-08-22 14:01:19 -07003480 /*
3481 * Do not access blacklisted devices that are known not to
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003482 * feature serial ports or are handled by other modules.
Christian Schmidt436bbd42007-08-22 14:01:19 -07003483 */
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003484 for (bldev = blacklist;
3485 bldev < blacklist + ARRAY_SIZE(blacklist);
3486 bldev++) {
3487 if (dev->vendor == bldev->vendor &&
3488 dev->device == bldev->device)
Christian Schmidt436bbd42007-08-22 14:01:19 -07003489 return -ENODEV;
3490 }
3491
Linus Torvalds1da177e2005-04-16 15:20:36 -07003492 num_iomem = num_port = 0;
3493 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3494 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
3495 num_port++;
3496 if (first_port == -1)
3497 first_port = i;
3498 }
3499 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
3500 num_iomem++;
3501 }
3502
3503 /*
3504 * If there is 1 or 0 iomem regions, and exactly one port,
3505 * use it. We guess the number of ports based on the IO
3506 * region size.
3507 */
3508 if (num_iomem <= 1 && num_port == 1) {
3509 board->flags = first_port;
3510 board->num_ports = pci_resource_len(dev, first_port) / 8;
3511 return 0;
3512 }
3513
3514 /*
3515 * Now guess if we've got a board which indexes by BARs.
3516 * Each IO BAR should be 8 bytes, and they should follow
3517 * consecutively.
3518 */
3519 first_port = -1;
3520 num_port = 0;
3521 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3522 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
3523 pci_resource_len(dev, i) == 8 &&
3524 (first_port == -1 || (first_port + num_port) == i)) {
3525 num_port++;
3526 if (first_port == -1)
3527 first_port = i;
3528 }
3529 }
3530
3531 if (num_port > 1) {
3532 board->flags = first_port | FL_BASE_BARS;
3533 board->num_ports = num_port;
3534 return 0;
3535 }
3536
3537 return -ENODEV;
3538}
3539
3540static inline int
Russell King975a1a7d2009-01-02 13:44:27 +00003541serial_pci_matches(const struct pciserial_board *board,
3542 const struct pciserial_board *guessed)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003543{
3544 return
3545 board->num_ports == guessed->num_ports &&
3546 board->base_baud == guessed->base_baud &&
3547 board->uart_offset == guessed->uart_offset &&
3548 board->reg_shift == guessed->reg_shift &&
3549 board->first_offset == guessed->first_offset;
3550}
3551
Russell King241fc432005-07-27 11:35:54 +01003552struct serial_private *
Russell King975a1a7d2009-01-02 13:44:27 +00003553pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
Russell King241fc432005-07-27 11:35:54 +01003554{
Alan Cox2655a2c2012-07-12 12:59:50 +01003555 struct uart_8250_port uart;
Russell King241fc432005-07-27 11:35:54 +01003556 struct serial_private *priv;
3557 struct pci_serial_quirk *quirk;
3558 int rc, nr_ports, i;
3559
3560 nr_ports = board->num_ports;
3561
3562 /*
3563 * Find an init and setup quirks.
3564 */
3565 quirk = find_quirk(dev);
3566
3567 /*
3568 * Run the new-style initialization function.
3569 * The initialization function returns:
3570 * <0 - error
3571 * 0 - use board->num_ports
3572 * >0 - number of ports
3573 */
3574 if (quirk->init) {
3575 rc = quirk->init(dev);
3576 if (rc < 0) {
3577 priv = ERR_PTR(rc);
3578 goto err_out;
3579 }
3580 if (rc)
3581 nr_ports = rc;
3582 }
3583
Burman Yan8f31bb32007-02-14 00:33:07 -08003584 priv = kzalloc(sizeof(struct serial_private) +
Russell King241fc432005-07-27 11:35:54 +01003585 sizeof(unsigned int) * nr_ports,
3586 GFP_KERNEL);
3587 if (!priv) {
3588 priv = ERR_PTR(-ENOMEM);
3589 goto err_deinit;
3590 }
3591
Russell King241fc432005-07-27 11:35:54 +01003592 priv->dev = dev;
3593 priv->quirk = quirk;
3594
Alan Cox2655a2c2012-07-12 12:59:50 +01003595 memset(&uart, 0, sizeof(uart));
3596 uart.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
3597 uart.port.uartclk = board->base_baud * 16;
3598 uart.port.irq = get_pci_irq(dev, board);
3599 uart.port.dev = &dev->dev;
Russell King241fc432005-07-27 11:35:54 +01003600
3601 for (i = 0; i < nr_ports; i++) {
Alan Cox2655a2c2012-07-12 12:59:50 +01003602 if (quirk->setup(priv, board, &uart, i))
Russell King241fc432005-07-27 11:35:54 +01003603 break;
3604
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003605 dev_dbg(&dev->dev, "Setup PCI port: port %lx, irq %d, type %d\n",
3606 uart.port.iobase, uart.port.irq, uart.port.iotype);
Alan Cox5756ee92008-02-08 04:18:51 -08003607
Alan Cox2655a2c2012-07-12 12:59:50 +01003608 priv->line[i] = serial8250_register_8250_port(&uart);
Russell King241fc432005-07-27 11:35:54 +01003609 if (priv->line[i] < 0) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003610 dev_err(&dev->dev,
3611 "Couldn't register serial port %lx, irq %d, type %d, error %d\n",
3612 uart.port.iobase, uart.port.irq,
3613 uart.port.iotype, priv->line[i]);
Russell King241fc432005-07-27 11:35:54 +01003614 break;
3615 }
3616 }
Russell King241fc432005-07-27 11:35:54 +01003617 priv->nr = i;
Russell King241fc432005-07-27 11:35:54 +01003618 return priv;
3619
Alan Cox5756ee92008-02-08 04:18:51 -08003620err_deinit:
Russell King241fc432005-07-27 11:35:54 +01003621 if (quirk->exit)
3622 quirk->exit(dev);
Alan Cox5756ee92008-02-08 04:18:51 -08003623err_out:
Russell King241fc432005-07-27 11:35:54 +01003624 return priv;
3625}
3626EXPORT_SYMBOL_GPL(pciserial_init_ports);
3627
3628void pciserial_remove_ports(struct serial_private *priv)
3629{
3630 struct pci_serial_quirk *quirk;
3631 int i;
3632
3633 for (i = 0; i < priv->nr; i++)
3634 serial8250_unregister_port(priv->line[i]);
3635
3636 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3637 if (priv->remapped_bar[i])
3638 iounmap(priv->remapped_bar[i]);
3639 priv->remapped_bar[i] = NULL;
3640 }
3641
3642 /*
3643 * Find the exit quirks.
3644 */
3645 quirk = find_quirk(priv->dev);
3646 if (quirk->exit)
3647 quirk->exit(priv->dev);
3648
3649 kfree(priv);
3650}
3651EXPORT_SYMBOL_GPL(pciserial_remove_ports);
3652
3653void pciserial_suspend_ports(struct serial_private *priv)
3654{
3655 int i;
3656
3657 for (i = 0; i < priv->nr; i++)
3658 if (priv->line[i] >= 0)
3659 serial8250_suspend_port(priv->line[i]);
Dan Williams5f1a3892012-04-10 14:11:03 -07003660
3661 /*
3662 * Ensure that every init quirk is properly torn down
3663 */
3664 if (priv->quirk->exit)
3665 priv->quirk->exit(priv->dev);
Russell King241fc432005-07-27 11:35:54 +01003666}
3667EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
3668
3669void pciserial_resume_ports(struct serial_private *priv)
3670{
3671 int i;
3672
3673 /*
3674 * Ensure that the board is correctly configured.
3675 */
3676 if (priv->quirk->init)
3677 priv->quirk->init(priv->dev);
3678
3679 for (i = 0; i < priv->nr; i++)
3680 if (priv->line[i] >= 0)
3681 serial8250_resume_port(priv->line[i]);
3682}
3683EXPORT_SYMBOL_GPL(pciserial_resume_ports);
3684
Linus Torvalds1da177e2005-04-16 15:20:36 -07003685/*
3686 * Probe one serial board. Unfortunately, there is no rhyme nor reason
3687 * to the arrangement of serial ports on a PCI card.
3688 */
Bill Pemberton9671f092012-11-19 13:21:50 -05003689static int
Linus Torvalds1da177e2005-04-16 15:20:36 -07003690pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
3691{
Frédéric Brière5bf8f502011-05-29 15:08:03 -04003692 struct pci_serial_quirk *quirk;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003693 struct serial_private *priv;
Russell King975a1a7d2009-01-02 13:44:27 +00003694 const struct pciserial_board *board;
3695 struct pciserial_board tmp;
Russell King241fc432005-07-27 11:35:54 +01003696 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003697
Frédéric Brière5bf8f502011-05-29 15:08:03 -04003698 quirk = find_quirk(dev);
3699 if (quirk->probe) {
3700 rc = quirk->probe(dev);
3701 if (rc)
3702 return rc;
3703 }
3704
Linus Torvalds1da177e2005-04-16 15:20:36 -07003705 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003706 dev_err(&dev->dev, "invalid driver_data: %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -07003707 ent->driver_data);
3708 return -EINVAL;
3709 }
3710
3711 board = &pci_boards[ent->driver_data];
3712
3713 rc = pci_enable_device(dev);
Michael Reed28071902011-05-31 12:06:28 -05003714 pci_save_state(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003715 if (rc)
3716 return rc;
3717
3718 if (ent->driver_data == pbn_default) {
3719 /*
3720 * Use a copy of the pci_board entry for this;
3721 * avoid changing entries in the table.
3722 */
Russell King1c7c1fe2005-07-27 11:31:19 +01003723 memcpy(&tmp, board, sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07003724 board = &tmp;
3725
3726 /*
3727 * We matched one of our class entries. Try to
3728 * determine the parameters of this board.
3729 */
Russell King975a1a7d2009-01-02 13:44:27 +00003730 rc = serial_pci_guess_board(dev, &tmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003731 if (rc)
3732 goto disable;
3733 } else {
3734 /*
3735 * We matched an explicit entry. If we are able to
3736 * detect this boards settings with our heuristic,
3737 * then we no longer need this entry.
3738 */
Russell King1c7c1fe2005-07-27 11:31:19 +01003739 memcpy(&tmp, &pci_boards[pbn_default],
3740 sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07003741 rc = serial_pci_guess_board(dev, &tmp);
3742 if (rc == 0 && serial_pci_matches(board, &tmp))
3743 moan_device("Redundant entry in serial pci_table.",
3744 dev);
3745 }
3746
Russell King241fc432005-07-27 11:35:54 +01003747 priv = pciserial_init_ports(dev, board);
3748 if (!IS_ERR(priv)) {
3749 pci_set_drvdata(dev, priv);
3750 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003751 }
3752
Russell King241fc432005-07-27 11:35:54 +01003753 rc = PTR_ERR(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003754
Linus Torvalds1da177e2005-04-16 15:20:36 -07003755 disable:
3756 pci_disable_device(dev);
3757 return rc;
3758}
3759
Bill Pembertonae8d8a12012-11-19 13:26:18 -05003760static void pciserial_remove_one(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003761{
3762 struct serial_private *priv = pci_get_drvdata(dev);
3763
Russell King241fc432005-07-27 11:35:54 +01003764 pciserial_remove_ports(priv);
Russell King056a8762005-07-22 10:15:04 +01003765
3766 pci_disable_device(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003767}
3768
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07003769#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07003770static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
3771{
3772 struct serial_private *priv = pci_get_drvdata(dev);
3773
Russell King241fc432005-07-27 11:35:54 +01003774 if (priv)
3775 pciserial_suspend_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003776
Linus Torvalds1da177e2005-04-16 15:20:36 -07003777 pci_save_state(dev);
3778 pci_set_power_state(dev, pci_choose_state(dev, state));
3779 return 0;
3780}
3781
3782static int pciserial_resume_one(struct pci_dev *dev)
3783{
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003784 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003785 struct serial_private *priv = pci_get_drvdata(dev);
3786
3787 pci_set_power_state(dev, PCI_D0);
3788 pci_restore_state(dev);
3789
3790 if (priv) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003791 /*
3792 * The device may have been disabled. Re-enable it.
3793 */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003794 err = pci_enable_device(dev);
Alan Cox40836c42008-10-13 10:36:11 +01003795 /* FIXME: We cannot simply error out here */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003796 if (err)
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003797 dev_err(&dev->dev, "Unable to re-enable ports, trying to continue.\n");
Russell King241fc432005-07-27 11:35:54 +01003798 pciserial_resume_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003799 }
3800 return 0;
3801}
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07003802#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07003803
3804static struct pci_device_id serial_pci_tbl[] = {
Michael Bramer78d70d42009-01-27 11:51:16 +00003805 /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
3806 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
3807 PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
3808 pbn_b2_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003809 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3810 PCI_SUBVENDOR_ID_CONNECT_TECH,
3811 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3812 pbn_b1_8_1382400 },
3813 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3814 PCI_SUBVENDOR_ID_CONNECT_TECH,
3815 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3816 pbn_b1_4_1382400 },
3817 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3818 PCI_SUBVENDOR_ID_CONNECT_TECH,
3819 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3820 pbn_b1_2_1382400 },
3821 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3822 PCI_SUBVENDOR_ID_CONNECT_TECH,
3823 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3824 pbn_b1_8_1382400 },
3825 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3826 PCI_SUBVENDOR_ID_CONNECT_TECH,
3827 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3828 pbn_b1_4_1382400 },
3829 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3830 PCI_SUBVENDOR_ID_CONNECT_TECH,
3831 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3832 pbn_b1_2_1382400 },
3833 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3834 PCI_SUBVENDOR_ID_CONNECT_TECH,
3835 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
3836 pbn_b1_8_921600 },
3837 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3838 PCI_SUBVENDOR_ID_CONNECT_TECH,
3839 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
3840 pbn_b1_8_921600 },
3841 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3842 PCI_SUBVENDOR_ID_CONNECT_TECH,
3843 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
3844 pbn_b1_4_921600 },
3845 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3846 PCI_SUBVENDOR_ID_CONNECT_TECH,
3847 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
3848 pbn_b1_4_921600 },
3849 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3850 PCI_SUBVENDOR_ID_CONNECT_TECH,
3851 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
3852 pbn_b1_2_921600 },
3853 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3854 PCI_SUBVENDOR_ID_CONNECT_TECH,
3855 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
3856 pbn_b1_8_921600 },
3857 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3858 PCI_SUBVENDOR_ID_CONNECT_TECH,
3859 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
3860 pbn_b1_8_921600 },
3861 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3862 PCI_SUBVENDOR_ID_CONNECT_TECH,
3863 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
3864 pbn_b1_4_921600 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003865 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3866 PCI_SUBVENDOR_ID_CONNECT_TECH,
3867 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
3868 pbn_b1_2_1250000 },
3869 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3870 PCI_SUBVENDOR_ID_CONNECT_TECH,
3871 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
3872 pbn_b0_2_1843200 },
3873 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3874 PCI_SUBVENDOR_ID_CONNECT_TECH,
3875 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
3876 pbn_b0_4_1843200 },
Yoichi Yuasa85d14942006-02-08 21:46:24 +00003877 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3878 PCI_VENDOR_ID_AFAVLAB,
3879 PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
3880 pbn_b0_4_1152000 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003881 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3882 PCI_SUBVENDOR_ID_CONNECT_TECH,
3883 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232, 0, 0,
3884 pbn_b0_2_1843200_200 },
3885 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3886 PCI_SUBVENDOR_ID_CONNECT_TECH,
3887 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232, 0, 0,
3888 pbn_b0_4_1843200_200 },
3889 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3890 PCI_SUBVENDOR_ID_CONNECT_TECH,
3891 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232, 0, 0,
3892 pbn_b0_8_1843200_200 },
3893 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3894 PCI_SUBVENDOR_ID_CONNECT_TECH,
3895 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1, 0, 0,
3896 pbn_b0_2_1843200_200 },
3897 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3898 PCI_SUBVENDOR_ID_CONNECT_TECH,
3899 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2, 0, 0,
3900 pbn_b0_4_1843200_200 },
3901 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3902 PCI_SUBVENDOR_ID_CONNECT_TECH,
3903 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4, 0, 0,
3904 pbn_b0_8_1843200_200 },
3905 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3906 PCI_SUBVENDOR_ID_CONNECT_TECH,
3907 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2, 0, 0,
3908 pbn_b0_2_1843200_200 },
3909 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3910 PCI_SUBVENDOR_ID_CONNECT_TECH,
3911 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4, 0, 0,
3912 pbn_b0_4_1843200_200 },
3913 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3914 PCI_SUBVENDOR_ID_CONNECT_TECH,
3915 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8, 0, 0,
3916 pbn_b0_8_1843200_200 },
3917 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3918 PCI_SUBVENDOR_ID_CONNECT_TECH,
3919 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485, 0, 0,
3920 pbn_b0_2_1843200_200 },
3921 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3922 PCI_SUBVENDOR_ID_CONNECT_TECH,
3923 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485, 0, 0,
3924 pbn_b0_4_1843200_200 },
3925 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3926 PCI_SUBVENDOR_ID_CONNECT_TECH,
3927 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
3928 pbn_b0_8_1843200_200 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07003929 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3930 PCI_VENDOR_ID_IBM, PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT,
3931 0, 0, pbn_exar_ibm_saturn },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003932
3933 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
Alan Cox5756ee92008-02-08 04:18:51 -08003934 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003935 pbn_b2_bt_1_115200 },
3936 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
Alan Cox5756ee92008-02-08 04:18:51 -08003937 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003938 pbn_b2_bt_2_115200 },
3939 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
Alan Cox5756ee92008-02-08 04:18:51 -08003940 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003941 pbn_b2_bt_4_115200 },
3942 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
Alan Cox5756ee92008-02-08 04:18:51 -08003943 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003944 pbn_b2_bt_2_115200 },
3945 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
Alan Cox5756ee92008-02-08 04:18:51 -08003946 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003947 pbn_b2_bt_4_115200 },
3948 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
Alan Cox5756ee92008-02-08 04:18:51 -08003949 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003950 pbn_b2_8_115200 },
Flavio Leitnere65f0f82009-01-02 13:50:43 +00003951 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
3952 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3953 pbn_b2_8_460800 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003954 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
3955 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3956 pbn_b2_8_115200 },
3957
3958 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
3959 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3960 pbn_b2_bt_2_115200 },
3961 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
3962 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3963 pbn_b2_bt_2_921600 },
3964 /*
3965 * VScom SPCOM800, from sl@s.pl
3966 */
Alan Cox5756ee92008-02-08 04:18:51 -08003967 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
3968 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003969 pbn_b2_8_921600 },
3970 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
Alan Cox5756ee92008-02-08 04:18:51 -08003971 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003972 pbn_b2_4_921600 },
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07003973 /* Unknown card - subdevice 0x1584 */
3974 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3975 PCI_VENDOR_ID_PLX,
3976 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
Scott Ashcroftd13402a2013-03-03 21:35:06 +00003977 pbn_b2_4_115200 },
3978 /* Unknown card - subdevice 0x1588 */
3979 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3980 PCI_VENDOR_ID_PLX,
3981 PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
3982 pbn_b2_8_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003983 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3984 PCI_SUBVENDOR_ID_KEYSPAN,
3985 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
3986 pbn_panacom },
3987 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
3988 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3989 pbn_panacom4 },
3990 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
3991 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3992 pbn_panacom2 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08003993 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
3994 PCI_VENDOR_ID_ESDGMBH,
3995 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
3996 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003997 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3998 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003999 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004000 pbn_b2_4_460800 },
4001 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4002 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004003 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004004 pbn_b2_8_460800 },
4005 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4006 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004007 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004008 pbn_b2_16_460800 },
4009 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4010 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004011 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004012 pbn_b2_16_460800 },
4013 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4014 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08004015 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004016 pbn_b2_4_460800 },
4017 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4018 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08004019 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004020 pbn_b2_8_460800 },
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01004021 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4022 PCI_SUBVENDOR_ID_EXSYS,
4023 PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
Shawn Bohreree4cd1b2012-05-28 15:20:47 -05004024 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004025 /*
4026 * Megawolf Romulus PCI Serial Card, from Mike Hudson
4027 * (Exoray@isys.ca)
4028 */
4029 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
4030 0x10b5, 0x106a, 0, 0,
4031 pbn_plx_romulus },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304032 /*
4033 * Quatech cards. These actually have configurable clocks but for
4034 * now we just use the default.
4035 *
4036 * 100 series are RS232, 200 series RS422,
4037 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004038 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
4039 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4040 pbn_b1_4_115200 },
4041 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
4042 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4043 pbn_b1_2_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304044 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100E,
4045 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4046 pbn_b2_2_115200 },
4047 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200,
4048 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4049 pbn_b1_2_115200 },
4050 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200E,
4051 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4052 pbn_b2_2_115200 },
4053 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC200,
4054 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4055 pbn_b1_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004056 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
4057 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4058 pbn_b1_8_115200 },
4059 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
4060 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4061 pbn_b1_8_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304062 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP100,
4063 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4064 pbn_b1_4_115200 },
4065 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP100,
4066 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4067 pbn_b1_2_115200 },
4068 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP200,
4069 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4070 pbn_b1_4_115200 },
4071 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP200,
4072 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4073 pbn_b1_2_115200 },
4074 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP100,
4075 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4076 pbn_b2_4_115200 },
4077 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP100,
4078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4079 pbn_b2_2_115200 },
4080 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP100,
4081 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4082 pbn_b2_1_115200 },
4083 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP200,
4084 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4085 pbn_b2_4_115200 },
4086 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP200,
4087 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4088 pbn_b2_2_115200 },
4089 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP200,
4090 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4091 pbn_b2_1_115200 },
4092 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESCLP100,
4093 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4094 pbn_b0_8_115200 },
4095
Linus Torvalds1da177e2005-04-16 15:20:36 -07004096 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08004097 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
4098 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004099 pbn_b0_4_921600 },
4100 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08004101 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
4102 0, 0,
Andrey Paninfbc0dc02005-07-18 11:38:09 +01004103 pbn_b0_4_1152000 },
Mikulas Patockac9bd9d02010-10-26 14:20:48 -04004104 { PCI_VENDOR_ID_OXSEMI, 0x9505,
4105 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4106 pbn_b0_bt_2_921600 },
David Ransondb1de152005-07-27 11:43:55 -07004107
4108 /*
4109 * The below card is a little controversial since it is the
4110 * subject of a PCI vendor/device ID clash. (See
4111 * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
4112 * For now just used the hex ID 0x950a.
4113 */
4114 { PCI_VENDOR_ID_OXSEMI, 0x950a,
Flavio Leitner26e82202012-09-21 21:04:34 -03004115 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_00,
4116 0, 0, pbn_b0_2_115200 },
4117 { PCI_VENDOR_ID_OXSEMI, 0x950a,
4118 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_30,
4119 0, 0, pbn_b0_2_115200 },
Niels de Vos39aced62009-01-02 13:46:58 +00004120 { PCI_VENDOR_ID_OXSEMI, 0x950a,
David Ransondb1de152005-07-27 11:43:55 -07004121 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4122 pbn_b0_2_1130000 },
Andre Przywara70fd8fd2009-06-11 12:41:57 +01004123 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_C950,
4124 PCI_VENDOR_ID_OXSEMI, PCI_SUBDEVICE_ID_OXSEMI_C950, 0, 0,
4125 pbn_b0_1_921600 },
Andrey Paninfbc0dc02005-07-18 11:38:09 +01004126 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004127 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4128 pbn_b0_4_115200 },
4129 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
4130 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4131 pbn_b0_bt_2_921600 },
Lytochkin Borise8470032010-07-26 10:02:26 +04004132 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
4133 PCI_ANY_ID , PCI_ANY_ID, 0, 0,
4134 pbn_b2_8_1152000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004135
4136 /*
Lee Howard7106b4e2008-10-21 13:48:58 +01004137 * Oxford Semiconductor Inc. Tornado PCI express device range.
4138 */
4139 { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
4140 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4141 pbn_b0_1_4000000 },
4142 { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
4143 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4144 pbn_b0_1_4000000 },
4145 { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
4146 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4147 pbn_oxsemi_1_4000000 },
4148 { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
4149 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4150 pbn_oxsemi_1_4000000 },
4151 { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
4152 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4153 pbn_b0_1_4000000 },
4154 { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
4155 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4156 pbn_b0_1_4000000 },
4157 { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
4158 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4159 pbn_oxsemi_1_4000000 },
4160 { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
4161 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4162 pbn_oxsemi_1_4000000 },
4163 { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
4164 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4165 pbn_b0_1_4000000 },
4166 { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
4167 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4168 pbn_b0_1_4000000 },
4169 { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
4170 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4171 pbn_b0_1_4000000 },
4172 { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
4173 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4174 pbn_b0_1_4000000 },
4175 { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
4176 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4177 pbn_oxsemi_2_4000000 },
4178 { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
4179 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4180 pbn_oxsemi_2_4000000 },
4181 { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
4182 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4183 pbn_oxsemi_4_4000000 },
4184 { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
4185 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4186 pbn_oxsemi_4_4000000 },
4187 { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
4188 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4189 pbn_oxsemi_8_4000000 },
4190 { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
4191 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4192 pbn_oxsemi_8_4000000 },
4193 { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
4194 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4195 pbn_oxsemi_1_4000000 },
4196 { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
4197 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4198 pbn_oxsemi_1_4000000 },
4199 { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
4200 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4201 pbn_oxsemi_1_4000000 },
4202 { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
4203 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4204 pbn_oxsemi_1_4000000 },
4205 { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
4206 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4207 pbn_oxsemi_1_4000000 },
4208 { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
4209 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4210 pbn_oxsemi_1_4000000 },
4211 { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
4212 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4213 pbn_oxsemi_1_4000000 },
4214 { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
4215 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4216 pbn_oxsemi_1_4000000 },
4217 { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
4218 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4219 pbn_oxsemi_1_4000000 },
4220 { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
4221 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4222 pbn_oxsemi_1_4000000 },
4223 { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
4224 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4225 pbn_oxsemi_1_4000000 },
4226 { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
4227 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4228 pbn_oxsemi_1_4000000 },
4229 { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
4230 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4231 pbn_oxsemi_1_4000000 },
4232 { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
4233 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4234 pbn_oxsemi_1_4000000 },
4235 { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
4236 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4237 pbn_oxsemi_1_4000000 },
4238 { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
4239 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4240 pbn_oxsemi_1_4000000 },
4241 { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
4242 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4243 pbn_oxsemi_1_4000000 },
4244 { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
4245 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4246 pbn_oxsemi_1_4000000 },
4247 { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
4248 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4249 pbn_oxsemi_1_4000000 },
4250 { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
4251 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4252 pbn_oxsemi_1_4000000 },
4253 { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
4254 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4255 pbn_oxsemi_1_4000000 },
4256 { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
4257 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4258 pbn_oxsemi_1_4000000 },
4259 { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
4260 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4261 pbn_oxsemi_1_4000000 },
4262 { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
4263 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4264 pbn_oxsemi_1_4000000 },
4265 { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
4266 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4267 pbn_oxsemi_1_4000000 },
4268 { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
4269 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4270 pbn_oxsemi_1_4000000 },
Lee Howardb80de362008-10-21 13:50:14 +01004271 /*
4272 * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
4273 */
4274 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
4275 PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
4276 pbn_oxsemi_1_4000000 },
4277 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
4278 PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
4279 pbn_oxsemi_2_4000000 },
4280 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
4281 PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
4282 pbn_oxsemi_4_4000000 },
4283 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
4284 PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
4285 pbn_oxsemi_8_4000000 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05004286
4287 /*
4288 * Digi/IBM PCIe 2-port Async EIA-232 Adapter utilizing OxSemi Tornado
4289 */
4290 { PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
4291 PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
4292 pbn_oxsemi_2_4000000 },
4293
Lee Howard7106b4e2008-10-21 13:48:58 +01004294 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004295 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
4296 * from skokodyn@yahoo.com
4297 */
4298 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4299 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
4300 pbn_sbsxrsio },
4301 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4302 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
4303 pbn_sbsxrsio },
4304 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4305 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
4306 pbn_sbsxrsio },
4307 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4308 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
4309 pbn_sbsxrsio },
4310
4311 /*
4312 * Digitan DS560-558, from jimd@esoft.com
4313 */
4314 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
Alan Cox5756ee92008-02-08 04:18:51 -08004315 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004316 pbn_b1_1_115200 },
4317
4318 /*
4319 * Titan Electronic cards
4320 * The 400L and 800L have a custom setup quirk.
4321 */
4322 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
Alan Cox5756ee92008-02-08 04:18:51 -08004323 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004324 pbn_b0_1_921600 },
4325 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
Alan Cox5756ee92008-02-08 04:18:51 -08004326 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004327 pbn_b0_2_921600 },
4328 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
Alan Cox5756ee92008-02-08 04:18:51 -08004329 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004330 pbn_b0_4_921600 },
4331 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
Alan Cox5756ee92008-02-08 04:18:51 -08004332 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004333 pbn_b0_4_921600 },
4334 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
4335 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4336 pbn_b1_1_921600 },
4337 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
4338 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4339 pbn_b1_bt_2_921600 },
4340 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
4341 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4342 pbn_b0_bt_4_921600 },
4343 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
4344 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4345 pbn_b0_bt_8_921600 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004346 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200I,
4347 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4348 pbn_b4_bt_2_921600 },
4349 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400I,
4350 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4351 pbn_b4_bt_4_921600 },
4352 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800I,
4353 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4354 pbn_b4_bt_8_921600 },
4355 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400EH,
4356 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4357 pbn_b0_4_921600 },
4358 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EH,
4359 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4360 pbn_b0_4_921600 },
4361 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EHB,
4362 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4363 pbn_b0_4_921600 },
4364 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
4365 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4366 pbn_oxsemi_1_4000000 },
4367 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
4368 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4369 pbn_oxsemi_2_4000000 },
4370 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
4371 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4372 pbn_oxsemi_4_4000000 },
4373 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
4374 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4375 pbn_oxsemi_8_4000000 },
4376 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
4377 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4378 pbn_oxsemi_2_4000000 },
4379 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
4380 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4381 pbn_oxsemi_2_4000000 },
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01004382 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
4383 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4384 pbn_b0_4_921600 },
4385 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_410V3,
4386 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4387 pbn_b0_4_921600 },
4388 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3,
4389 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4390 pbn_b0_4_921600 },
4391 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3B,
4392 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4393 pbn_b0_4_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004394
4395 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
4396 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4397 pbn_b2_1_460800 },
4398 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
4399 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4400 pbn_b2_1_460800 },
4401 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
4402 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4403 pbn_b2_1_460800 },
4404 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
4405 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4406 pbn_b2_bt_2_921600 },
4407 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
4408 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4409 pbn_b2_bt_2_921600 },
4410 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
4411 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4412 pbn_b2_bt_2_921600 },
4413 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
4414 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4415 pbn_b2_bt_4_921600 },
4416 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
4417 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4418 pbn_b2_bt_4_921600 },
4419 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
4420 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4421 pbn_b2_bt_4_921600 },
4422 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
4423 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4424 pbn_b0_1_921600 },
4425 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
4426 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4427 pbn_b0_1_921600 },
4428 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
4429 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4430 pbn_b0_1_921600 },
4431 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
4432 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4433 pbn_b0_bt_2_921600 },
4434 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
4435 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4436 pbn_b0_bt_2_921600 },
4437 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
4438 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4439 pbn_b0_bt_2_921600 },
4440 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
4441 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4442 pbn_b0_bt_4_921600 },
4443 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
4444 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4445 pbn_b0_bt_4_921600 },
4446 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
4447 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4448 pbn_b0_bt_4_921600 },
Andrey Panin3ec9c592006-02-02 20:15:09 +00004449 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
4450 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4451 pbn_b0_bt_8_921600 },
4452 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
4453 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4454 pbn_b0_bt_8_921600 },
4455 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
4456 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4457 pbn_b0_bt_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004458
4459 /*
4460 * Computone devices submitted by Doug McNash dmcnash@computone.com
4461 */
4462 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4463 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
4464 0, 0, pbn_computone_4 },
4465 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4466 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
4467 0, 0, pbn_computone_8 },
4468 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4469 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
4470 0, 0, pbn_computone_6 },
4471
4472 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
4473 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4474 pbn_oxsemi },
4475 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
4476 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
4477 pbn_b0_bt_1_921600 },
4478
4479 /*
Stephen Chiversabd7bac2013-01-28 19:49:20 +11004480 * SUNIX (TIMEDIA)
4481 */
4482 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4483 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4484 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00,
4485 pbn_b0_bt_1_921600 },
4486
4487 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4488 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4489 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
4490 pbn_b0_bt_1_921600 },
4491
4492 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004493 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
4494 */
4495 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
4496 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4497 pbn_b0_bt_8_115200 },
4498 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
4499 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4500 pbn_b0_bt_8_115200 },
4501
4502 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
4503 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4504 pbn_b0_bt_2_115200 },
4505 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
4506 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4507 pbn_b0_bt_2_115200 },
4508 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
4509 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4510 pbn_b0_bt_2_115200 },
Lennert Buytenhekb87e5e22009-11-11 14:26:42 -08004511 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
4512 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4513 pbn_b0_bt_2_115200 },
4514 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
4515 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4516 pbn_b0_bt_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004517 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
4518 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4519 pbn_b0_bt_4_460800 },
4520 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
4521 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4522 pbn_b0_bt_4_460800 },
4523 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
4524 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4525 pbn_b0_bt_2_460800 },
4526 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
4527 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4528 pbn_b0_bt_2_460800 },
4529 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
4530 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4531 pbn_b0_bt_2_460800 },
4532 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
4533 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4534 pbn_b0_bt_1_115200 },
4535 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
4536 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4537 pbn_b0_bt_1_460800 },
4538
4539 /*
Russell King1fb8cac2006-12-13 14:45:46 +00004540 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
4541 * Cards are identified by their subsystem vendor IDs, which
4542 * (in hex) match the model number.
4543 *
4544 * Note that JC140x are RS422/485 cards which require ox950
4545 * ACR = 0x10, and as such are not currently fully supported.
4546 */
4547 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4548 0x1204, 0x0004, 0, 0,
4549 pbn_b0_4_921600 },
4550 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4551 0x1208, 0x0004, 0, 0,
4552 pbn_b0_4_921600 },
4553/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4554 0x1402, 0x0002, 0, 0,
4555 pbn_b0_2_921600 }, */
4556/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4557 0x1404, 0x0004, 0, 0,
4558 pbn_b0_4_921600 }, */
4559 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
4560 0x1208, 0x0004, 0, 0,
4561 pbn_b0_4_921600 },
4562
Kiros Yeh2a52fcb2009-12-21 16:26:48 -08004563 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4564 0x1204, 0x0004, 0, 0,
4565 pbn_b0_4_921600 },
4566 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4567 0x1208, 0x0004, 0, 0,
4568 pbn_b0_4_921600 },
4569 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF3,
4570 0x1208, 0x0004, 0, 0,
4571 pbn_b0_4_921600 },
Russell King1fb8cac2006-12-13 14:45:46 +00004572 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004573 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
4574 */
4575 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
4576 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4577 pbn_b1_1_1382400 },
4578
4579 /*
4580 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
4581 */
4582 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
4583 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4584 pbn_b1_1_1382400 },
4585
4586 /*
4587 * RAStel 2 port modem, gerg@moreton.com.au
4588 */
4589 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
4590 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4591 pbn_b2_bt_2_115200 },
4592
4593 /*
4594 * EKF addition for i960 Boards form EKF with serial port
4595 */
4596 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
4597 0xE4BF, PCI_ANY_ID, 0, 0,
4598 pbn_intel_i960 },
4599
4600 /*
4601 * Xircom Cardbus/Ethernet combos
4602 */
4603 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
4604 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4605 pbn_b0_1_115200 },
4606 /*
4607 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
4608 */
4609 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
4610 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4611 pbn_b0_1_115200 },
4612
4613 /*
4614 * Untested PCI modems, sent in from various folks...
4615 */
4616
4617 /*
4618 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
4619 */
4620 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
4621 0x1048, 0x1500, 0, 0,
4622 pbn_b1_1_115200 },
4623
4624 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
4625 0xFF00, 0, 0, 0,
4626 pbn_sgi_ioc3 },
4627
4628 /*
4629 * HP Diva card
4630 */
4631 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4632 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
4633 pbn_b1_1_115200 },
4634 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4635 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4636 pbn_b0_5_115200 },
4637 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
4638 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4639 pbn_b2_1_115200 },
4640
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00004641 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
4642 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4643 pbn_b3_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004644 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
4645 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4646 pbn_b3_4_115200 },
4647 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
4648 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4649 pbn_b3_8_115200 },
4650
4651 /*
4652 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
4653 */
4654 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
4655 PCI_ANY_ID, PCI_ANY_ID,
4656 0,
4657 0, pbn_exar_XR17C152 },
4658 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
4659 PCI_ANY_ID, PCI_ANY_ID,
4660 0,
4661 0, pbn_exar_XR17C154 },
4662 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
4663 PCI_ANY_ID, PCI_ANY_ID,
4664 0,
4665 0, pbn_exar_XR17C158 },
Matt Schultedc96efb2012-11-19 09:12:04 -06004666 /*
4667 * Exar Corp. XR17V35[248] Dual/Quad/Octal PCIe UARTs
4668 */
4669 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V352,
4670 PCI_ANY_ID, PCI_ANY_ID,
4671 0,
4672 0, pbn_exar_XR17V352 },
4673 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V354,
4674 PCI_ANY_ID, PCI_ANY_ID,
4675 0,
4676 0, pbn_exar_XR17V354 },
4677 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V358,
4678 PCI_ANY_ID, PCI_ANY_ID,
4679 0,
4680 0, pbn_exar_XR17V358 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004681
4682 /*
4683 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
4684 */
4685 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
4686 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4687 pbn_b0_1_115200 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07004688 /*
4689 * ITE
4690 */
4691 { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
4692 PCI_ANY_ID, PCI_ANY_ID,
4693 0, 0,
4694 pbn_b1_bt_1_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004695
4696 /*
Peter Horton737c1752006-08-26 09:07:36 +01004697 * IntaShield IS-200
4698 */
4699 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
4700 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
4701 pbn_b2_2_115200 },
Ignacio García Pérez4b6f6ce2008-05-23 13:04:28 -07004702 /*
4703 * IntaShield IS-400
4704 */
4705 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
4706 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
4707 pbn_b2_4_115200 },
Peter Horton737c1752006-08-26 09:07:36 +01004708 /*
Thomas Hoehn48212002007-02-10 01:46:05 -08004709 * Perle PCI-RAS cards
4710 */
4711 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4712 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
4713 0, 0, pbn_b2_4_921600 },
4714 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4715 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
4716 0, 0, pbn_b2_8_921600 },
Alan Coxbf0df632007-10-16 01:24:00 -07004717
4718 /*
4719 * Mainpine series cards: Fairly standard layout but fools
4720 * parts of the autodetect in some cases and uses otherwise
4721 * unmatched communications subclasses in the PCI Express case
4722 */
4723
4724 { /* RockForceDUO */
4725 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4726 PCI_VENDOR_ID_MAINPINE, 0x0200,
4727 0, 0, pbn_b0_2_115200 },
4728 { /* RockForceQUATRO */
4729 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4730 PCI_VENDOR_ID_MAINPINE, 0x0300,
4731 0, 0, pbn_b0_4_115200 },
4732 { /* RockForceDUO+ */
4733 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4734 PCI_VENDOR_ID_MAINPINE, 0x0400,
4735 0, 0, pbn_b0_2_115200 },
4736 { /* RockForceQUATRO+ */
4737 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4738 PCI_VENDOR_ID_MAINPINE, 0x0500,
4739 0, 0, pbn_b0_4_115200 },
4740 { /* RockForce+ */
4741 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4742 PCI_VENDOR_ID_MAINPINE, 0x0600,
4743 0, 0, pbn_b0_2_115200 },
4744 { /* RockForce+ */
4745 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4746 PCI_VENDOR_ID_MAINPINE, 0x0700,
4747 0, 0, pbn_b0_4_115200 },
4748 { /* RockForceOCTO+ */
4749 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4750 PCI_VENDOR_ID_MAINPINE, 0x0800,
4751 0, 0, pbn_b0_8_115200 },
4752 { /* RockForceDUO+ */
4753 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4754 PCI_VENDOR_ID_MAINPINE, 0x0C00,
4755 0, 0, pbn_b0_2_115200 },
4756 { /* RockForceQUARTRO+ */
4757 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4758 PCI_VENDOR_ID_MAINPINE, 0x0D00,
4759 0, 0, pbn_b0_4_115200 },
4760 { /* RockForceOCTO+ */
4761 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4762 PCI_VENDOR_ID_MAINPINE, 0x1D00,
4763 0, 0, pbn_b0_8_115200 },
4764 { /* RockForceD1 */
4765 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4766 PCI_VENDOR_ID_MAINPINE, 0x2000,
4767 0, 0, pbn_b0_1_115200 },
4768 { /* RockForceF1 */
4769 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4770 PCI_VENDOR_ID_MAINPINE, 0x2100,
4771 0, 0, pbn_b0_1_115200 },
4772 { /* RockForceD2 */
4773 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4774 PCI_VENDOR_ID_MAINPINE, 0x2200,
4775 0, 0, pbn_b0_2_115200 },
4776 { /* RockForceF2 */
4777 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4778 PCI_VENDOR_ID_MAINPINE, 0x2300,
4779 0, 0, pbn_b0_2_115200 },
4780 { /* RockForceD4 */
4781 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4782 PCI_VENDOR_ID_MAINPINE, 0x2400,
4783 0, 0, pbn_b0_4_115200 },
4784 { /* RockForceF4 */
4785 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4786 PCI_VENDOR_ID_MAINPINE, 0x2500,
4787 0, 0, pbn_b0_4_115200 },
4788 { /* RockForceD8 */
4789 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4790 PCI_VENDOR_ID_MAINPINE, 0x2600,
4791 0, 0, pbn_b0_8_115200 },
4792 { /* RockForceF8 */
4793 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4794 PCI_VENDOR_ID_MAINPINE, 0x2700,
4795 0, 0, pbn_b0_8_115200 },
4796 { /* IQ Express D1 */
4797 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4798 PCI_VENDOR_ID_MAINPINE, 0x3000,
4799 0, 0, pbn_b0_1_115200 },
4800 { /* IQ Express F1 */
4801 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4802 PCI_VENDOR_ID_MAINPINE, 0x3100,
4803 0, 0, pbn_b0_1_115200 },
4804 { /* IQ Express D2 */
4805 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4806 PCI_VENDOR_ID_MAINPINE, 0x3200,
4807 0, 0, pbn_b0_2_115200 },
4808 { /* IQ Express F2 */
4809 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4810 PCI_VENDOR_ID_MAINPINE, 0x3300,
4811 0, 0, pbn_b0_2_115200 },
4812 { /* IQ Express D4 */
4813 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4814 PCI_VENDOR_ID_MAINPINE, 0x3400,
4815 0, 0, pbn_b0_4_115200 },
4816 { /* IQ Express F4 */
4817 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4818 PCI_VENDOR_ID_MAINPINE, 0x3500,
4819 0, 0, pbn_b0_4_115200 },
4820 { /* IQ Express D8 */
4821 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4822 PCI_VENDOR_ID_MAINPINE, 0x3C00,
4823 0, 0, pbn_b0_8_115200 },
4824 { /* IQ Express F8 */
4825 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4826 PCI_VENDOR_ID_MAINPINE, 0x3D00,
4827 0, 0, pbn_b0_8_115200 },
4828
4829
Thomas Hoehn48212002007-02-10 01:46:05 -08004830 /*
Olof Johanssonaa798502007-08-22 14:01:55 -07004831 * PA Semi PA6T-1682M on-chip UART
4832 */
4833 { PCI_VENDOR_ID_PASEMI, 0xa004,
4834 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4835 pbn_pasemi_1682M },
4836
4837 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01004838 * National Instruments
4839 */
Will Page04bf7e72009-04-06 17:32:15 +01004840 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
4841 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4842 pbn_b1_16_115200 },
4843 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
4844 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4845 pbn_b1_8_115200 },
4846 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
4847 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4848 pbn_b1_bt_4_115200 },
4849 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
4850 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4851 pbn_b1_bt_2_115200 },
4852 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
4853 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4854 pbn_b1_bt_4_115200 },
4855 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
4856 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4857 pbn_b1_bt_2_115200 },
4858 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
4859 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4860 pbn_b1_16_115200 },
4861 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
4862 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4863 pbn_b1_8_115200 },
4864 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
4865 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4866 pbn_b1_bt_4_115200 },
4867 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
4868 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4869 pbn_b1_bt_2_115200 },
4870 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
4871 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4872 pbn_b1_bt_4_115200 },
4873 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
4874 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4875 pbn_b1_bt_2_115200 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01004876 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
4877 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4878 pbn_ni8430_2 },
4879 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
4880 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4881 pbn_ni8430_2 },
4882 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
4883 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4884 pbn_ni8430_4 },
4885 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
4886 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4887 pbn_ni8430_4 },
4888 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
4889 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4890 pbn_ni8430_8 },
4891 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
4892 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4893 pbn_ni8430_8 },
4894 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
4895 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4896 pbn_ni8430_16 },
4897 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
4898 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4899 pbn_ni8430_16 },
4900 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
4901 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4902 pbn_ni8430_2 },
4903 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
4904 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4905 pbn_ni8430_2 },
4906 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
4907 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4908 pbn_ni8430_4 },
4909 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
4910 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4911 pbn_ni8430_4 },
4912
4913 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08004914 * ADDI-DATA GmbH communication cards <info@addi-data.com>
4915 */
4916 { PCI_VENDOR_ID_ADDIDATA,
4917 PCI_DEVICE_ID_ADDIDATA_APCI7500,
4918 PCI_ANY_ID,
4919 PCI_ANY_ID,
4920 0,
4921 0,
4922 pbn_b0_4_115200 },
4923
4924 { PCI_VENDOR_ID_ADDIDATA,
4925 PCI_DEVICE_ID_ADDIDATA_APCI7420,
4926 PCI_ANY_ID,
4927 PCI_ANY_ID,
4928 0,
4929 0,
4930 pbn_b0_2_115200 },
4931
4932 { PCI_VENDOR_ID_ADDIDATA,
4933 PCI_DEVICE_ID_ADDIDATA_APCI7300,
4934 PCI_ANY_ID,
4935 PCI_ANY_ID,
4936 0,
4937 0,
4938 pbn_b0_1_115200 },
4939
Ian Abbott086231f2013-07-16 16:14:39 +01004940 { PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01004941 PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08004942 PCI_ANY_ID,
4943 PCI_ANY_ID,
4944 0,
4945 0,
4946 pbn_b1_8_115200 },
4947
4948 { PCI_VENDOR_ID_ADDIDATA,
4949 PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
4950 PCI_ANY_ID,
4951 PCI_ANY_ID,
4952 0,
4953 0,
4954 pbn_b0_4_115200 },
4955
4956 { PCI_VENDOR_ID_ADDIDATA,
4957 PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
4958 PCI_ANY_ID,
4959 PCI_ANY_ID,
4960 0,
4961 0,
4962 pbn_b0_2_115200 },
4963
4964 { PCI_VENDOR_ID_ADDIDATA,
4965 PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
4966 PCI_ANY_ID,
4967 PCI_ANY_ID,
4968 0,
4969 0,
4970 pbn_b0_1_115200 },
4971
4972 { PCI_VENDOR_ID_ADDIDATA,
4973 PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
4974 PCI_ANY_ID,
4975 PCI_ANY_ID,
4976 0,
4977 0,
4978 pbn_b0_4_115200 },
4979
4980 { PCI_VENDOR_ID_ADDIDATA,
4981 PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
4982 PCI_ANY_ID,
4983 PCI_ANY_ID,
4984 0,
4985 0,
4986 pbn_b0_2_115200 },
4987
4988 { PCI_VENDOR_ID_ADDIDATA,
4989 PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
4990 PCI_ANY_ID,
4991 PCI_ANY_ID,
4992 0,
4993 0,
4994 pbn_b0_1_115200 },
4995
4996 { PCI_VENDOR_ID_ADDIDATA,
4997 PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
4998 PCI_ANY_ID,
4999 PCI_ANY_ID,
5000 0,
5001 0,
5002 pbn_b0_8_115200 },
5003
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07005004 { PCI_VENDOR_ID_ADDIDATA,
5005 PCI_DEVICE_ID_ADDIDATA_APCIe7500,
5006 PCI_ANY_ID,
5007 PCI_ANY_ID,
5008 0,
5009 0,
5010 pbn_ADDIDATA_PCIe_4_3906250 },
5011
5012 { PCI_VENDOR_ID_ADDIDATA,
5013 PCI_DEVICE_ID_ADDIDATA_APCIe7420,
5014 PCI_ANY_ID,
5015 PCI_ANY_ID,
5016 0,
5017 0,
5018 pbn_ADDIDATA_PCIe_2_3906250 },
5019
5020 { PCI_VENDOR_ID_ADDIDATA,
5021 PCI_DEVICE_ID_ADDIDATA_APCIe7300,
5022 PCI_ANY_ID,
5023 PCI_ANY_ID,
5024 0,
5025 0,
5026 pbn_ADDIDATA_PCIe_1_3906250 },
5027
5028 { PCI_VENDOR_ID_ADDIDATA,
5029 PCI_DEVICE_ID_ADDIDATA_APCIe7800,
5030 PCI_ANY_ID,
5031 PCI_ANY_ID,
5032 0,
5033 0,
5034 pbn_ADDIDATA_PCIe_8_3906250 },
5035
Jiri Slaby25cf9bc2009-01-15 13:30:34 +00005036 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
5037 PCI_VENDOR_ID_IBM, 0x0299,
5038 0, 0, pbn_b0_bt_2_115200 },
5039
Stefan Seyfried972ce082013-07-01 09:14:21 +02005040 /*
5041 * other NetMos 9835 devices are most likely handled by the
5042 * parport_serial driver, check drivers/parport/parport_serial.c
5043 * before adding them here.
5044 */
5045
Michael Bueschc4285b42009-06-30 11:41:21 -07005046 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
5047 0xA000, 0x1000,
5048 0, 0, pbn_b0_1_115200 },
5049
Nicos Gollan7808edc2011-05-05 21:00:37 +02005050 /* the 9901 is a rebranded 9912 */
5051 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
5052 0xA000, 0x1000,
5053 0, 0, pbn_b0_1_115200 },
5054
5055 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
5056 0xA000, 0x1000,
5057 0, 0, pbn_b0_1_115200 },
5058
5059 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
5060 0xA000, 0x1000,
5061 0, 0, pbn_b0_1_115200 },
5062
5063 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5064 0xA000, 0x1000,
5065 0, 0, pbn_b0_1_115200 },
5066
5067 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5068 0xA000, 0x3002,
5069 0, 0, pbn_NETMOS9900_2s_115200 },
5070
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08005071 /*
Eric Smith44178172011-07-11 22:53:13 -06005072 * Best Connectivity and Rosewill PCI Multi I/O cards
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005073 */
5074
5075 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
5076 0xA000, 0x1000,
5077 0, 0, pbn_b0_1_115200 },
5078
5079 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Eric Smith44178172011-07-11 22:53:13 -06005080 0xA000, 0x3002,
5081 0, 0, pbn_b0_bt_2_115200 },
5082
5083 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005084 0xA000, 0x3004,
5085 0, 0, pbn_b0_bt_4_115200 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08005086 /* Intel CE4100 */
5087 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
5088 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5089 pbn_ce4100_1_115200 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03005090 /* Intel BayTrail */
5091 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART1,
5092 PCI_ANY_ID, PCI_ANY_ID,
5093 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
5094 pbn_byt },
5095 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART2,
5096 PCI_ANY_ID, PCI_ANY_ID,
5097 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
5098 pbn_byt },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08005099
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04005100 /*
5101 * Cronyx Omega PCI
5102 */
5103 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
5104 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5105 pbn_omegapci },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005106
5107 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08005108 * Broadcom TruManage
5109 */
5110 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
5111 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5112 pbn_brcm_trumanage },
5113
5114 /*
Alan Cox66835492012-08-16 12:01:33 +01005115 * AgeStar as-prs2-009
5116 */
5117 { PCI_VENDOR_ID_AGESTAR, PCI_DEVICE_ID_AGESTAR_9375,
5118 PCI_ANY_ID, PCI_ANY_ID,
5119 0, 0, pbn_b0_bt_2_115200 },
Alan Cox27788c52012-09-04 16:21:06 +01005120
5121 /*
5122 * WCH CH353 series devices: The 2S1P is handled by parport_serial
5123 * so not listed here.
5124 */
5125 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_4S,
5126 PCI_ANY_ID, PCI_ANY_ID,
5127 0, 0, pbn_b0_bt_4_115200 },
5128
5129 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_2S1PF,
5130 PCI_ANY_ID, PCI_ANY_ID,
5131 0, 0, pbn_b0_bt_2_115200 },
5132
Wang YanQing8b5c9132013-03-05 23:16:48 +08005133 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH352_2S,
5134 PCI_ANY_ID, PCI_ANY_ID,
5135 0, 0, pbn_b0_bt_2_115200 },
5136
Alan Cox66835492012-08-16 12:01:33 +01005137 /*
Matt Schulte14faa8c2012-11-21 10:35:15 -06005138 * Commtech, Inc. Fastcom adapters
5139 */
5140 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4222PCI335,
5141 PCI_ANY_ID, PCI_ANY_ID,
5142 0,
5143 0, pbn_b0_2_1152000_200 },
5144 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4224PCI335,
5145 PCI_ANY_ID, PCI_ANY_ID,
5146 0,
5147 0, pbn_b0_4_1152000_200 },
5148 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_2324PCI335,
5149 PCI_ANY_ID, PCI_ANY_ID,
5150 0,
5151 0, pbn_b0_4_1152000_200 },
5152 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_2328PCI335,
5153 PCI_ANY_ID, PCI_ANY_ID,
5154 0,
5155 0, pbn_b0_8_1152000_200 },
5156 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4222PCIE,
5157 PCI_ANY_ID, PCI_ANY_ID,
5158 0,
5159 0, pbn_exar_XR17V352 },
5160 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4224PCIE,
5161 PCI_ANY_ID, PCI_ANY_ID,
5162 0,
5163 0, pbn_exar_XR17V354 },
5164 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4228PCIE,
5165 PCI_ANY_ID, PCI_ANY_ID,
5166 0,
5167 0, pbn_exar_XR17V358 },
5168
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07005169 /* Fintek PCI serial cards */
5170 { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 },
5171 { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 },
5172 { PCI_DEVICE(0x1c29, 0x1112), .driver_data = pbn_fintek_12 },
5173
Matt Schulte14faa8c2012-11-21 10:35:15 -06005174 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07005175 * These entries match devices with class COMMUNICATION_SERIAL,
5176 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
5177 */
5178 { PCI_ANY_ID, PCI_ANY_ID,
5179 PCI_ANY_ID, PCI_ANY_ID,
5180 PCI_CLASS_COMMUNICATION_SERIAL << 8,
5181 0xffff00, pbn_default },
5182 { PCI_ANY_ID, PCI_ANY_ID,
5183 PCI_ANY_ID, PCI_ANY_ID,
5184 PCI_CLASS_COMMUNICATION_MODEM << 8,
5185 0xffff00, pbn_default },
5186 { PCI_ANY_ID, PCI_ANY_ID,
5187 PCI_ANY_ID, PCI_ANY_ID,
5188 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
5189 0xffff00, pbn_default },
5190 { 0, }
5191};
5192
Michael Reed28071902011-05-31 12:06:28 -05005193static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
5194 pci_channel_state_t state)
5195{
5196 struct serial_private *priv = pci_get_drvdata(dev);
5197
5198 if (state == pci_channel_io_perm_failure)
5199 return PCI_ERS_RESULT_DISCONNECT;
5200
5201 if (priv)
5202 pciserial_suspend_ports(priv);
5203
5204 pci_disable_device(dev);
5205
5206 return PCI_ERS_RESULT_NEED_RESET;
5207}
5208
5209static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
5210{
5211 int rc;
5212
5213 rc = pci_enable_device(dev);
5214
5215 if (rc)
5216 return PCI_ERS_RESULT_DISCONNECT;
5217
5218 pci_restore_state(dev);
5219 pci_save_state(dev);
5220
5221 return PCI_ERS_RESULT_RECOVERED;
5222}
5223
5224static void serial8250_io_resume(struct pci_dev *dev)
5225{
5226 struct serial_private *priv = pci_get_drvdata(dev);
5227
5228 if (priv)
5229 pciserial_resume_ports(priv);
5230}
5231
Stephen Hemminger1d352032012-09-07 09:33:17 -07005232static const struct pci_error_handlers serial8250_err_handler = {
Michael Reed28071902011-05-31 12:06:28 -05005233 .error_detected = serial8250_io_error_detected,
5234 .slot_reset = serial8250_io_slot_reset,
5235 .resume = serial8250_io_resume,
5236};
5237
Linus Torvalds1da177e2005-04-16 15:20:36 -07005238static struct pci_driver serial_pci_driver = {
5239 .name = "serial",
5240 .probe = pciserial_init_one,
Bill Pemberton2d47b712012-11-19 13:21:34 -05005241 .remove = pciserial_remove_one,
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07005242#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07005243 .suspend = pciserial_suspend_one,
5244 .resume = pciserial_resume_one,
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07005245#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07005246 .id_table = serial_pci_tbl,
Michael Reed28071902011-05-31 12:06:28 -05005247 .err_handler = &serial8250_err_handler,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005248};
5249
Wei Yongjun15a12e82012-10-26 23:04:22 +08005250module_pci_driver(serial_pci_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005251
5252MODULE_LICENSE("GPL");
5253MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
5254MODULE_DEVICE_TABLE(pci, serial_pci_tbl);