blob: 0774c02d6c49c63e0dce358f440e8bbda19aaacf [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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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 King975a1a72009-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
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001460static int skip_tx_en_setup(struct serial_private *priv,
1461 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001462 struct uart_8250_port *port, int idx)
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001463{
Alan Cox2655a2c2012-07-12 12:59:50 +01001464 port->port.flags |= UPF_NO_TXEN_TEST;
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001465 dev_dbg(&priv->dev->dev,
1466 "serial8250: skipping TxEn test for device [%04x:%04x] subsystem [%04x:%04x]\n",
1467 priv->dev->vendor, priv->dev->device,
1468 priv->dev->subsystem_vendor, priv->dev->subsystem_device);
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001469
1470 return pci_default_setup(priv, board, port, idx);
1471}
1472
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -07001473static void kt_handle_break(struct uart_port *p)
1474{
1475 struct uart_8250_port *up =
1476 container_of(p, struct uart_8250_port, port);
1477 /*
1478 * On receipt of a BI, serial device in Intel ME (Intel
1479 * management engine) needs to have its fifos cleared for sane
1480 * SOL (Serial Over Lan) output.
1481 */
1482 serial8250_clear_and_reinit_fifos(up);
1483}
1484
1485static unsigned int kt_serial_in(struct uart_port *p, int offset)
1486{
1487 struct uart_8250_port *up =
1488 container_of(p, struct uart_8250_port, port);
1489 unsigned int val;
1490
1491 /*
1492 * When the Intel ME (management engine) gets reset its serial
1493 * port registers could return 0 momentarily. Functions like
1494 * serial8250_console_write, read and save the IER, perform
1495 * some operation and then restore it. In order to avoid
1496 * setting IER register inadvertently to 0, if the value read
1497 * is 0, double check with ier value in uart_8250_port and use
1498 * that instead. up->ier should be the same value as what is
1499 * currently configured.
1500 */
1501 val = inb(p->iobase + offset);
1502 if (offset == UART_IER) {
1503 if (val == 0)
1504 val = up->ier;
1505 }
1506 return val;
1507}
1508
Dan Williamsbc02d152012-04-06 11:49:50 -07001509static int kt_serial_setup(struct serial_private *priv,
1510 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001511 struct uart_8250_port *port, int idx)
Dan Williamsbc02d152012-04-06 11:49:50 -07001512{
Alan Cox2655a2c2012-07-12 12:59:50 +01001513 port->port.flags |= UPF_BUG_THRE;
1514 port->port.serial_in = kt_serial_in;
1515 port->port.handle_break = kt_handle_break;
Dan Williamsbc02d152012-04-06 11:49:50 -07001516 return skip_tx_en_setup(priv, board, port, idx);
1517}
1518
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09001519static int pci_eg20t_init(struct pci_dev *dev)
1520{
1521#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
1522 return -ENODEV;
1523#else
1524 return 0;
1525#endif
1526}
1527
Søren Holm06315342011-09-02 22:55:37 +02001528static int
1529pci_xr17c154_setup(struct serial_private *priv,
1530 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001531 struct uart_8250_port *port, int idx)
Søren Holm06315342011-09-02 22:55:37 +02001532{
Alan Cox2655a2c2012-07-12 12:59:50 +01001533 port->port.flags |= UPF_EXAR_EFR;
Søren Holm06315342011-09-02 22:55:37 +02001534 return pci_default_setup(priv, board, port, idx);
1535}
1536
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001537static int
Matt Schultedc96efb2012-11-19 09:12:04 -06001538pci_xr17v35x_setup(struct serial_private *priv,
1539 const struct pciserial_board *board,
1540 struct uart_8250_port *port, int idx)
1541{
1542 u8 __iomem *p;
1543
1544 p = pci_ioremap_bar(priv->dev, 0);
Matt Schulte13c32372012-11-21 10:39:18 -06001545 if (p == NULL)
1546 return -ENOMEM;
Matt Schultedc96efb2012-11-19 09:12:04 -06001547
1548 port->port.flags |= UPF_EXAR_EFR;
1549
1550 /*
1551 * Setup Multipurpose Input/Output pins.
1552 */
1553 if (idx == 0) {
1554 writeb(0x00, p + 0x8f); /*MPIOINT[7:0]*/
1555 writeb(0x00, p + 0x90); /*MPIOLVL[7:0]*/
1556 writeb(0x00, p + 0x91); /*MPIO3T[7:0]*/
1557 writeb(0x00, p + 0x92); /*MPIOINV[7:0]*/
1558 writeb(0x00, p + 0x93); /*MPIOSEL[7:0]*/
1559 writeb(0x00, p + 0x94); /*MPIOOD[7:0]*/
1560 writeb(0x00, p + 0x95); /*MPIOINT[15:8]*/
1561 writeb(0x00, p + 0x96); /*MPIOLVL[15:8]*/
1562 writeb(0x00, p + 0x97); /*MPIO3T[15:8]*/
1563 writeb(0x00, p + 0x98); /*MPIOINV[15:8]*/
1564 writeb(0x00, p + 0x99); /*MPIOSEL[15:8]*/
1565 writeb(0x00, p + 0x9a); /*MPIOOD[15:8]*/
1566 }
Matt Schultef965b9c2012-11-20 11:25:40 -06001567 writeb(0x00, p + UART_EXAR_8XMODE);
1568 writeb(UART_FCTR_EXAR_TRGD, p + UART_EXAR_FCTR);
1569 writeb(128, p + UART_EXAR_TXTRG);
1570 writeb(128, p + UART_EXAR_RXTRG);
Matt Schultedc96efb2012-11-19 09:12:04 -06001571 iounmap(p);
1572
1573 return pci_default_setup(priv, board, port, idx);
1574}
1575
Matt Schulte14faa8c2012-11-21 10:35:15 -06001576#define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x0004
1577#define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x0002
1578#define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a
1579#define PCI_DEVICE_ID_COMMTECH_2328PCI335 0x000b
1580
1581static int
1582pci_fastcom335_setup(struct serial_private *priv,
1583 const struct pciserial_board *board,
1584 struct uart_8250_port *port, int idx)
1585{
1586 u8 __iomem *p;
1587
1588 p = pci_ioremap_bar(priv->dev, 0);
1589 if (p == NULL)
1590 return -ENOMEM;
1591
1592 port->port.flags |= UPF_EXAR_EFR;
1593
1594 /*
1595 * Setup Multipurpose Input/Output pins.
1596 */
1597 if (idx == 0) {
1598 switch (priv->dev->device) {
1599 case PCI_DEVICE_ID_COMMTECH_4222PCI335:
1600 case PCI_DEVICE_ID_COMMTECH_4224PCI335:
1601 writeb(0x78, p + 0x90); /* MPIOLVL[7:0] */
1602 writeb(0x00, p + 0x92); /* MPIOINV[7:0] */
1603 writeb(0x00, p + 0x93); /* MPIOSEL[7:0] */
1604 break;
1605 case PCI_DEVICE_ID_COMMTECH_2324PCI335:
1606 case PCI_DEVICE_ID_COMMTECH_2328PCI335:
1607 writeb(0x00, p + 0x90); /* MPIOLVL[7:0] */
1608 writeb(0xc0, p + 0x92); /* MPIOINV[7:0] */
1609 writeb(0xc0, p + 0x93); /* MPIOSEL[7:0] */
1610 break;
1611 }
1612 writeb(0x00, p + 0x8f); /* MPIOINT[7:0] */
1613 writeb(0x00, p + 0x91); /* MPIO3T[7:0] */
1614 writeb(0x00, p + 0x94); /* MPIOOD[7:0] */
1615 }
1616 writeb(0x00, p + UART_EXAR_8XMODE);
1617 writeb(UART_FCTR_EXAR_TRGD, p + UART_EXAR_FCTR);
1618 writeb(32, p + UART_EXAR_TXTRG);
1619 writeb(32, p + UART_EXAR_RXTRG);
1620 iounmap(p);
1621
1622 return pci_default_setup(priv, board, port, idx);
1623}
1624
Matt Schultedc96efb2012-11-19 09:12:04 -06001625static int
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001626pci_wch_ch353_setup(struct serial_private *priv,
1627 const struct pciserial_board *board,
1628 struct uart_8250_port *port, int idx)
1629{
1630 port->port.flags |= UPF_FIXED_TYPE;
1631 port->port.type = PORT_16550A;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001632 return pci_default_setup(priv, board, port, idx);
1633}
1634
Linus Torvalds1da177e2005-04-16 15:20:36 -07001635#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1636#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1637#define PCI_DEVICE_ID_OCTPRO 0x0001
1638#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
1639#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1640#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1641#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
Flavio Leitner26e82202012-09-21 21:04:34 -03001642#define PCI_SUBDEVICE_ID_SIIG_DUAL_00 0x2500
1643#define PCI_SUBDEVICE_ID_SIIG_DUAL_30 0x2530
Michael Bramer78d70d42009-01-27 11:51:16 +00001644#define PCI_VENDOR_ID_ADVANTECH 0x13fe
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001645#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66
Michael Bramer78d70d42009-01-27 11:51:16 +00001646#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
Yegor Yefremov66169ad2010-06-04 09:58:18 +02001647#define PCI_DEVICE_ID_TITAN_200I 0x8028
1648#define PCI_DEVICE_ID_TITAN_400I 0x8048
1649#define PCI_DEVICE_ID_TITAN_800I 0x8088
1650#define PCI_DEVICE_ID_TITAN_800EH 0xA007
1651#define PCI_DEVICE_ID_TITAN_800EHB 0xA008
1652#define PCI_DEVICE_ID_TITAN_400EH 0xA009
1653#define PCI_DEVICE_ID_TITAN_100E 0xA010
1654#define PCI_DEVICE_ID_TITAN_200E 0xA012
1655#define PCI_DEVICE_ID_TITAN_400E 0xA013
1656#define PCI_DEVICE_ID_TITAN_800E 0xA014
1657#define PCI_DEVICE_ID_TITAN_200EI 0xA016
1658#define PCI_DEVICE_ID_TITAN_200EISI 0xA017
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01001659#define PCI_DEVICE_ID_TITAN_400V3 0xA310
1660#define PCI_DEVICE_ID_TITAN_410V3 0xA312
1661#define PCI_DEVICE_ID_TITAN_800V3 0xA314
1662#define PCI_DEVICE_ID_TITAN_800V3B 0xA315
Lytochkin Borise8470032010-07-26 10:02:26 +04001663#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
Scott Kilauaa273ae2011-05-11 15:41:59 -05001664#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001665#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
Dan Williamsbc02d152012-04-06 11:49:50 -07001666#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
Alan Cox27788c52012-09-04 16:21:06 +01001667#define PCI_VENDOR_ID_WCH 0x4348
Wang YanQing8b5c9132013-03-05 23:16:48 +08001668#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
Alan Cox27788c52012-09-04 16:21:06 +01001669#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
1670#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
1671#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
Alan Cox66835492012-08-16 12:01:33 +01001672#define PCI_VENDOR_ID_AGESTAR 0x5372
1673#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
Alan Coxeb26dfe2012-07-12 13:00:31 +01001674#define PCI_VENDOR_ID_ASIX 0x9710
Matt Schulte14faa8c2012-11-21 10:35:15 -06001675#define PCI_DEVICE_ID_COMMTECH_4224PCIE 0x0020
1676#define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021
Matt Schulteb7b90412012-12-06 22:19:59 -06001677#define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022
Stephen Hurdebebd492013-01-17 14:14:53 -08001678#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001679#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
Matt Schulte14faa8c2012-11-21 10:35:15 -06001680
Stephen Chiversabd7bac2013-01-28 19:49:20 +11001681#define PCI_VENDOR_ID_SUNIX 0x1fd4
1682#define PCI_DEVICE_ID_SUNIX_1999 0x1999
1683
Linus Torvalds1da177e2005-04-16 15:20:36 -07001684
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001685/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1686#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
Scott Ashcroftd13402a2013-03-03 21:35:06 +00001687#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001688
Linus Torvalds1da177e2005-04-16 15:20:36 -07001689/*
1690 * Master list of serial port init/setup/exit quirks.
1691 * This does not describe the general nature of the port.
1692 * (ie, baud base, number and location of ports, etc)
1693 *
1694 * This list is ordered alphabetically by vendor then device.
1695 * Specific entries must come before more generic entries.
1696 */
Sam Ravnborg7a63ce52008-04-28 02:14:02 -07001697static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001698 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001699 * ADDI-DATA GmbH communication cards <info@addi-data.com>
1700 */
1701 {
Ian Abbott086231f2013-07-16 16:14:39 +01001702 .vendor = PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001703 .device = PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001704 .subvendor = PCI_ANY_ID,
1705 .subdevice = PCI_ANY_ID,
1706 .setup = addidata_apci7800_setup,
1707 },
1708 /*
Russell King61a116e2006-07-03 15:22:35 +01001709 * AFAVLAB cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001710 * It is not clear whether this applies to all products.
1711 */
1712 {
1713 .vendor = PCI_VENDOR_ID_AFAVLAB,
1714 .device = PCI_ANY_ID,
1715 .subvendor = PCI_ANY_ID,
1716 .subdevice = PCI_ANY_ID,
1717 .setup = afavlab_setup,
1718 },
1719 /*
1720 * HP Diva
1721 */
1722 {
1723 .vendor = PCI_VENDOR_ID_HP,
1724 .device = PCI_DEVICE_ID_HP_DIVA,
1725 .subvendor = PCI_ANY_ID,
1726 .subdevice = PCI_ANY_ID,
1727 .init = pci_hp_diva_init,
1728 .setup = pci_hp_diva_setup,
1729 },
1730 /*
1731 * Intel
1732 */
1733 {
1734 .vendor = PCI_VENDOR_ID_INTEL,
1735 .device = PCI_DEVICE_ID_INTEL_80960_RP,
1736 .subvendor = 0xe4bf,
1737 .subdevice = PCI_ANY_ID,
1738 .init = pci_inteli960ni_init,
1739 .setup = pci_default_setup,
1740 },
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001741 {
1742 .vendor = PCI_VENDOR_ID_INTEL,
1743 .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
1744 .subvendor = PCI_ANY_ID,
1745 .subdevice = PCI_ANY_ID,
1746 .setup = skip_tx_en_setup,
1747 },
1748 {
1749 .vendor = PCI_VENDOR_ID_INTEL,
1750 .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
1751 .subvendor = PCI_ANY_ID,
1752 .subdevice = PCI_ANY_ID,
1753 .setup = skip_tx_en_setup,
1754 },
1755 {
1756 .vendor = PCI_VENDOR_ID_INTEL,
1757 .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
1758 .subvendor = PCI_ANY_ID,
1759 .subdevice = PCI_ANY_ID,
1760 .setup = skip_tx_en_setup,
1761 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001762 {
1763 .vendor = PCI_VENDOR_ID_INTEL,
1764 .device = PCI_DEVICE_ID_INTEL_CE4100_UART,
1765 .subvendor = PCI_ANY_ID,
1766 .subdevice = PCI_ANY_ID,
1767 .setup = ce4100_serial_setup,
1768 },
Dan Williamsbc02d152012-04-06 11:49:50 -07001769 {
1770 .vendor = PCI_VENDOR_ID_INTEL,
1771 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
1772 .subvendor = PCI_ANY_ID,
1773 .subdevice = PCI_ANY_ID,
1774 .setup = kt_serial_setup,
1775 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03001776 {
1777 .vendor = PCI_VENDOR_ID_INTEL,
1778 .device = PCI_DEVICE_ID_INTEL_BYT_UART1,
1779 .subvendor = PCI_ANY_ID,
1780 .subdevice = PCI_ANY_ID,
1781 .setup = byt_serial_setup,
1782 },
1783 {
1784 .vendor = PCI_VENDOR_ID_INTEL,
1785 .device = PCI_DEVICE_ID_INTEL_BYT_UART2,
1786 .subvendor = PCI_ANY_ID,
1787 .subdevice = PCI_ANY_ID,
1788 .setup = byt_serial_setup,
1789 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001790 /*
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001791 * ITE
1792 */
1793 {
1794 .vendor = PCI_VENDOR_ID_ITE,
1795 .device = PCI_DEVICE_ID_ITE_8872,
1796 .subvendor = PCI_ANY_ID,
1797 .subdevice = PCI_ANY_ID,
1798 .init = pci_ite887x_init,
1799 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001800 .exit = pci_ite887x_exit,
Niels de Vos84f8c6f2007-08-22 14:01:14 -07001801 },
1802 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001803 * National Instruments
1804 */
1805 {
1806 .vendor = PCI_VENDOR_ID_NI,
Will Page04bf7e72009-04-06 17:32:15 +01001807 .device = PCI_DEVICE_ID_NI_PCI23216,
1808 .subvendor = PCI_ANY_ID,
1809 .subdevice = PCI_ANY_ID,
1810 .init = pci_ni8420_init,
1811 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001812 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001813 },
1814 {
1815 .vendor = PCI_VENDOR_ID_NI,
1816 .device = PCI_DEVICE_ID_NI_PCI2328,
1817 .subvendor = PCI_ANY_ID,
1818 .subdevice = PCI_ANY_ID,
1819 .init = pci_ni8420_init,
1820 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001821 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001822 },
1823 {
1824 .vendor = PCI_VENDOR_ID_NI,
1825 .device = PCI_DEVICE_ID_NI_PCI2324,
1826 .subvendor = PCI_ANY_ID,
1827 .subdevice = PCI_ANY_ID,
1828 .init = pci_ni8420_init,
1829 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001830 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001831 },
1832 {
1833 .vendor = PCI_VENDOR_ID_NI,
1834 .device = PCI_DEVICE_ID_NI_PCI2322,
1835 .subvendor = PCI_ANY_ID,
1836 .subdevice = PCI_ANY_ID,
1837 .init = pci_ni8420_init,
1838 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001839 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001840 },
1841 {
1842 .vendor = PCI_VENDOR_ID_NI,
1843 .device = PCI_DEVICE_ID_NI_PCI2324I,
1844 .subvendor = PCI_ANY_ID,
1845 .subdevice = PCI_ANY_ID,
1846 .init = pci_ni8420_init,
1847 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001848 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001849 },
1850 {
1851 .vendor = PCI_VENDOR_ID_NI,
1852 .device = PCI_DEVICE_ID_NI_PCI2322I,
1853 .subvendor = PCI_ANY_ID,
1854 .subdevice = PCI_ANY_ID,
1855 .init = pci_ni8420_init,
1856 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001857 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001858 },
1859 {
1860 .vendor = PCI_VENDOR_ID_NI,
1861 .device = PCI_DEVICE_ID_NI_PXI8420_23216,
1862 .subvendor = PCI_ANY_ID,
1863 .subdevice = PCI_ANY_ID,
1864 .init = pci_ni8420_init,
1865 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001866 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001867 },
1868 {
1869 .vendor = PCI_VENDOR_ID_NI,
1870 .device = PCI_DEVICE_ID_NI_PXI8420_2328,
1871 .subvendor = PCI_ANY_ID,
1872 .subdevice = PCI_ANY_ID,
1873 .init = pci_ni8420_init,
1874 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001875 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001876 },
1877 {
1878 .vendor = PCI_VENDOR_ID_NI,
1879 .device = PCI_DEVICE_ID_NI_PXI8420_2324,
1880 .subvendor = PCI_ANY_ID,
1881 .subdevice = PCI_ANY_ID,
1882 .init = pci_ni8420_init,
1883 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001884 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001885 },
1886 {
1887 .vendor = PCI_VENDOR_ID_NI,
1888 .device = PCI_DEVICE_ID_NI_PXI8420_2322,
1889 .subvendor = PCI_ANY_ID,
1890 .subdevice = PCI_ANY_ID,
1891 .init = pci_ni8420_init,
1892 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001893 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001894 },
1895 {
1896 .vendor = PCI_VENDOR_ID_NI,
1897 .device = PCI_DEVICE_ID_NI_PXI8422_2324,
1898 .subvendor = PCI_ANY_ID,
1899 .subdevice = PCI_ANY_ID,
1900 .init = pci_ni8420_init,
1901 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001902 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001903 },
1904 {
1905 .vendor = PCI_VENDOR_ID_NI,
1906 .device = PCI_DEVICE_ID_NI_PXI8422_2322,
1907 .subvendor = PCI_ANY_ID,
1908 .subdevice = PCI_ANY_ID,
1909 .init = pci_ni8420_init,
1910 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001911 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01001912 },
1913 {
1914 .vendor = PCI_VENDOR_ID_NI,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001915 .device = PCI_ANY_ID,
1916 .subvendor = PCI_ANY_ID,
1917 .subdevice = PCI_ANY_ID,
1918 .init = pci_ni8430_init,
1919 .setup = pci_ni8430_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001920 .exit = pci_ni8430_exit,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001921 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10301922 /* Quatech */
1923 {
1924 .vendor = PCI_VENDOR_ID_QUATECH,
1925 .device = PCI_ANY_ID,
1926 .subvendor = PCI_ANY_ID,
1927 .subdevice = PCI_ANY_ID,
1928 .init = pci_quatech_init,
1929 .setup = pci_quatech_setup,
Greg Kroah-Hartmand73dfc62013-01-15 22:44:48 -08001930 .exit = pci_quatech_exit,
Alan Cox55c7c0f2012-11-29 09:03:00 +10301931 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01001932 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07001933 * Panacom
1934 */
1935 {
1936 .vendor = PCI_VENDOR_ID_PANACOM,
1937 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
1938 .subvendor = PCI_ANY_ID,
1939 .subdevice = PCI_ANY_ID,
1940 .init = pci_plx9050_init,
1941 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001942 .exit = pci_plx9050_exit,
Alan Cox5756ee92008-02-08 04:18:51 -08001943 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001944 {
1945 .vendor = PCI_VENDOR_ID_PANACOM,
1946 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
1947 .subvendor = PCI_ANY_ID,
1948 .subdevice = PCI_ANY_ID,
1949 .init = pci_plx9050_init,
1950 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001951 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001952 },
1953 /*
1954 * PLX
1955 */
1956 {
1957 .vendor = PCI_VENDOR_ID_PLX,
Thomas Hoehn48212002007-02-10 01:46:05 -08001958 .device = PCI_DEVICE_ID_PLX_9030,
1959 .subvendor = PCI_SUBVENDOR_ID_PERLE,
1960 .subdevice = PCI_ANY_ID,
1961 .setup = pci_default_setup,
1962 },
1963 {
1964 .vendor = PCI_VENDOR_ID_PLX,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001965 .device = PCI_DEVICE_ID_PLX_9050,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01001966 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
1967 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
1968 .init = pci_plx9050_init,
1969 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001970 .exit = pci_plx9050_exit,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01001971 },
1972 {
1973 .vendor = PCI_VENDOR_ID_PLX,
1974 .device = PCI_DEVICE_ID_PLX_9050,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001975 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
1976 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
1977 .init = pci_plx9050_init,
1978 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001979 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001980 },
1981 {
1982 .vendor = PCI_VENDOR_ID_PLX,
1983 .device = PCI_DEVICE_ID_PLX_ROMULUS,
1984 .subvendor = PCI_VENDOR_ID_PLX,
1985 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
1986 .init = pci_plx9050_init,
1987 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05001988 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001989 },
1990 /*
1991 * SBS Technologies, Inc., PMC-OCTALPRO 232
1992 */
1993 {
1994 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
1995 .device = PCI_DEVICE_ID_OCTPRO,
1996 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
1997 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
1998 .init = sbs_init,
1999 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002000 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002001 },
2002 /*
2003 * SBS Technologies, Inc., PMC-OCTALPRO 422
2004 */
2005 {
2006 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2007 .device = PCI_DEVICE_ID_OCTPRO,
2008 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2009 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
2010 .init = sbs_init,
2011 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002012 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002013 },
2014 /*
2015 * SBS Technologies, Inc., P-Octal 232
2016 */
2017 {
2018 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2019 .device = PCI_DEVICE_ID_OCTPRO,
2020 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2021 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
2022 .init = sbs_init,
2023 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002024 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002025 },
2026 /*
2027 * SBS Technologies, Inc., P-Octal 422
2028 */
2029 {
2030 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2031 .device = PCI_DEVICE_ID_OCTPRO,
2032 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2033 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
2034 .init = sbs_init,
2035 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002036 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002037 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002038 /*
Russell King61a116e2006-07-03 15:22:35 +01002039 * SIIG cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002040 */
2041 {
2042 .vendor = PCI_VENDOR_ID_SIIG,
Russell King67d74b82005-07-27 11:33:03 +01002043 .device = PCI_ANY_ID,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002044 .subvendor = PCI_ANY_ID,
2045 .subdevice = PCI_ANY_ID,
Russell King67d74b82005-07-27 11:33:03 +01002046 .init = pci_siig_init,
Andrey Panin3ec9c592006-02-02 20:15:09 +00002047 .setup = pci_siig_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002048 },
2049 /*
2050 * Titan cards
2051 */
2052 {
2053 .vendor = PCI_VENDOR_ID_TITAN,
2054 .device = PCI_DEVICE_ID_TITAN_400L,
2055 .subvendor = PCI_ANY_ID,
2056 .subdevice = PCI_ANY_ID,
2057 .setup = titan_400l_800l_setup,
2058 },
2059 {
2060 .vendor = PCI_VENDOR_ID_TITAN,
2061 .device = PCI_DEVICE_ID_TITAN_800L,
2062 .subvendor = PCI_ANY_ID,
2063 .subdevice = PCI_ANY_ID,
2064 .setup = titan_400l_800l_setup,
2065 },
2066 /*
2067 * Timedia cards
2068 */
2069 {
2070 .vendor = PCI_VENDOR_ID_TIMEDIA,
2071 .device = PCI_DEVICE_ID_TIMEDIA_1889,
2072 .subvendor = PCI_VENDOR_ID_TIMEDIA,
2073 .subdevice = PCI_ANY_ID,
Frédéric Brièreb9b24552011-05-29 15:08:04 -04002074 .probe = pci_timedia_probe,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002075 .init = pci_timedia_init,
2076 .setup = pci_timedia_setup,
2077 },
2078 {
2079 .vendor = PCI_VENDOR_ID_TIMEDIA,
2080 .device = PCI_ANY_ID,
2081 .subvendor = PCI_ANY_ID,
2082 .subdevice = PCI_ANY_ID,
2083 .setup = pci_timedia_setup,
2084 },
2085 /*
Stephen Chiversabd7bac2013-01-28 19:49:20 +11002086 * SUNIX (Timedia) cards
2087 * Do not "probe" for these cards as there is at least one combination
2088 * card that should be handled by parport_pc that doesn't match the
2089 * rule in pci_timedia_probe.
2090 * It is part number is MIO5079A but its subdevice ID is 0x0102.
2091 * There are some boards with part number SER5037AL that report
2092 * subdevice ID 0x0002.
2093 */
2094 {
2095 .vendor = PCI_VENDOR_ID_SUNIX,
2096 .device = PCI_DEVICE_ID_SUNIX_1999,
2097 .subvendor = PCI_VENDOR_ID_SUNIX,
2098 .subdevice = PCI_ANY_ID,
2099 .init = pci_timedia_init,
2100 .setup = pci_timedia_setup,
2101 },
2102 /*
Søren Holm06315342011-09-02 22:55:37 +02002103 * Exar cards
2104 */
2105 {
2106 .vendor = PCI_VENDOR_ID_EXAR,
2107 .device = PCI_DEVICE_ID_EXAR_XR17C152,
2108 .subvendor = PCI_ANY_ID,
2109 .subdevice = PCI_ANY_ID,
2110 .setup = pci_xr17c154_setup,
2111 },
2112 {
2113 .vendor = PCI_VENDOR_ID_EXAR,
2114 .device = PCI_DEVICE_ID_EXAR_XR17C154,
2115 .subvendor = PCI_ANY_ID,
2116 .subdevice = PCI_ANY_ID,
2117 .setup = pci_xr17c154_setup,
2118 },
2119 {
2120 .vendor = PCI_VENDOR_ID_EXAR,
2121 .device = PCI_DEVICE_ID_EXAR_XR17C158,
2122 .subvendor = PCI_ANY_ID,
2123 .subdevice = PCI_ANY_ID,
2124 .setup = pci_xr17c154_setup,
2125 },
Matt Schultedc96efb2012-11-19 09:12:04 -06002126 {
2127 .vendor = PCI_VENDOR_ID_EXAR,
2128 .device = PCI_DEVICE_ID_EXAR_XR17V352,
2129 .subvendor = PCI_ANY_ID,
2130 .subdevice = PCI_ANY_ID,
2131 .setup = pci_xr17v35x_setup,
2132 },
2133 {
2134 .vendor = PCI_VENDOR_ID_EXAR,
2135 .device = PCI_DEVICE_ID_EXAR_XR17V354,
2136 .subvendor = PCI_ANY_ID,
2137 .subdevice = PCI_ANY_ID,
2138 .setup = pci_xr17v35x_setup,
2139 },
2140 {
2141 .vendor = PCI_VENDOR_ID_EXAR,
2142 .device = PCI_DEVICE_ID_EXAR_XR17V358,
2143 .subvendor = PCI_ANY_ID,
2144 .subdevice = PCI_ANY_ID,
2145 .setup = pci_xr17v35x_setup,
2146 },
Søren Holm06315342011-09-02 22:55:37 +02002147 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002148 * Xircom cards
2149 */
2150 {
2151 .vendor = PCI_VENDOR_ID_XIRCOM,
2152 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2153 .subvendor = PCI_ANY_ID,
2154 .subdevice = PCI_ANY_ID,
2155 .init = pci_xircom_init,
2156 .setup = pci_default_setup,
2157 },
2158 /*
Russell King61a116e2006-07-03 15:22:35 +01002159 * Netmos cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002160 */
2161 {
2162 .vendor = PCI_VENDOR_ID_NETMOS,
2163 .device = PCI_ANY_ID,
2164 .subvendor = PCI_ANY_ID,
2165 .subdevice = PCI_ANY_ID,
2166 .init = pci_netmos_init,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002167 .setup = pci_netmos_9900_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002168 },
2169 /*
Scott Kilauaa273ae2011-05-11 15:41:59 -05002170 * For Oxford Semiconductor Tornado based devices
Russell King9f2a0362009-01-02 13:44:20 +00002171 */
2172 {
2173 .vendor = PCI_VENDOR_ID_OXSEMI,
2174 .device = PCI_ANY_ID,
2175 .subvendor = PCI_ANY_ID,
2176 .subdevice = PCI_ANY_ID,
2177 .init = pci_oxsemi_tornado_init,
2178 .setup = pci_default_setup,
2179 },
2180 {
2181 .vendor = PCI_VENDOR_ID_MAINPINE,
2182 .device = PCI_ANY_ID,
2183 .subvendor = PCI_ANY_ID,
2184 .subdevice = PCI_ANY_ID,
2185 .init = pci_oxsemi_tornado_init,
2186 .setup = pci_default_setup,
2187 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05002188 {
2189 .vendor = PCI_VENDOR_ID_DIGI,
2190 .device = PCIE_DEVICE_ID_NEO_2_OX_IBM,
2191 .subvendor = PCI_SUBVENDOR_ID_IBM,
2192 .subdevice = PCI_ANY_ID,
2193 .init = pci_oxsemi_tornado_init,
2194 .setup = pci_default_setup,
2195 },
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002196 {
2197 .vendor = PCI_VENDOR_ID_INTEL,
2198 .device = 0x8811,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002199 .subvendor = PCI_ANY_ID,
2200 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002201 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002202 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002203 },
2204 {
2205 .vendor = PCI_VENDOR_ID_INTEL,
2206 .device = 0x8812,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002207 .subvendor = PCI_ANY_ID,
2208 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002209 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002210 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002211 },
2212 {
2213 .vendor = PCI_VENDOR_ID_INTEL,
2214 .device = 0x8813,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002215 .subvendor = PCI_ANY_ID,
2216 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002217 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002218 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002219 },
2220 {
2221 .vendor = PCI_VENDOR_ID_INTEL,
2222 .device = 0x8814,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002223 .subvendor = PCI_ANY_ID,
2224 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002225 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002226 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002227 },
2228 {
2229 .vendor = 0x10DB,
2230 .device = 0x8027,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002231 .subvendor = PCI_ANY_ID,
2232 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002233 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002234 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002235 },
2236 {
2237 .vendor = 0x10DB,
2238 .device = 0x8028,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002239 .subvendor = PCI_ANY_ID,
2240 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002241 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002242 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002243 },
2244 {
2245 .vendor = 0x10DB,
2246 .device = 0x8029,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002247 .subvendor = PCI_ANY_ID,
2248 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002249 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002250 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002251 },
2252 {
2253 .vendor = 0x10DB,
2254 .device = 0x800C,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002255 .subvendor = PCI_ANY_ID,
2256 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002257 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002258 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002259 },
2260 {
2261 .vendor = 0x10DB,
2262 .device = 0x800D,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002263 .subvendor = PCI_ANY_ID,
2264 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002265 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002266 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002267 },
Russell King9f2a0362009-01-02 13:44:20 +00002268 /*
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002269 * Cronyx Omega PCI (PLX-chip based)
2270 */
2271 {
2272 .vendor = PCI_VENDOR_ID_PLX,
2273 .device = PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
2274 .subvendor = PCI_ANY_ID,
2275 .subdevice = PCI_ANY_ID,
2276 .setup = pci_omegapci_setup,
Alan Coxeb26dfe2012-07-12 13:00:31 +01002277 },
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002278 /* WCH CH353 2S1P card (16550 clone) */
2279 {
Alan Cox27788c52012-09-04 16:21:06 +01002280 .vendor = PCI_VENDOR_ID_WCH,
2281 .device = PCI_DEVICE_ID_WCH_CH353_2S1P,
2282 .subvendor = PCI_ANY_ID,
2283 .subdevice = PCI_ANY_ID,
2284 .setup = pci_wch_ch353_setup,
2285 },
2286 /* WCH CH353 4S card (16550 clone) */
2287 {
2288 .vendor = PCI_VENDOR_ID_WCH,
2289 .device = PCI_DEVICE_ID_WCH_CH353_4S,
2290 .subvendor = PCI_ANY_ID,
2291 .subdevice = PCI_ANY_ID,
2292 .setup = pci_wch_ch353_setup,
2293 },
2294 /* WCH CH353 2S1PF card (16550 clone) */
2295 {
2296 .vendor = PCI_VENDOR_ID_WCH,
2297 .device = PCI_DEVICE_ID_WCH_CH353_2S1PF,
2298 .subvendor = PCI_ANY_ID,
2299 .subdevice = PCI_ANY_ID,
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002300 .setup = pci_wch_ch353_setup,
2301 },
Wang YanQing8b5c9132013-03-05 23:16:48 +08002302 /* WCH CH352 2S card (16550 clone) */
2303 {
2304 .vendor = PCI_VENDOR_ID_WCH,
2305 .device = PCI_DEVICE_ID_WCH_CH352_2S,
2306 .subvendor = PCI_ANY_ID,
2307 .subdevice = PCI_ANY_ID,
2308 .setup = pci_wch_ch353_setup,
2309 },
Alan Coxeb26dfe2012-07-12 13:00:31 +01002310 /*
2311 * ASIX devices with FIFO bug
2312 */
2313 {
2314 .vendor = PCI_VENDOR_ID_ASIX,
2315 .device = PCI_ANY_ID,
2316 .subvendor = PCI_ANY_ID,
2317 .subdevice = PCI_ANY_ID,
2318 .setup = pci_asix_setup,
2319 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002320 /*
Matt Schulte14faa8c2012-11-21 10:35:15 -06002321 * Commtech, Inc. Fastcom adapters
2322 *
2323 */
2324 {
2325 .vendor = PCI_VENDOR_ID_COMMTECH,
2326 .device = PCI_DEVICE_ID_COMMTECH_4222PCI335,
2327 .subvendor = PCI_ANY_ID,
2328 .subdevice = PCI_ANY_ID,
2329 .setup = pci_fastcom335_setup,
2330 },
2331 {
2332 .vendor = PCI_VENDOR_ID_COMMTECH,
2333 .device = PCI_DEVICE_ID_COMMTECH_4224PCI335,
2334 .subvendor = PCI_ANY_ID,
2335 .subdevice = PCI_ANY_ID,
2336 .setup = pci_fastcom335_setup,
2337 },
2338 {
2339 .vendor = PCI_VENDOR_ID_COMMTECH,
2340 .device = PCI_DEVICE_ID_COMMTECH_2324PCI335,
2341 .subvendor = PCI_ANY_ID,
2342 .subdevice = PCI_ANY_ID,
2343 .setup = pci_fastcom335_setup,
2344 },
2345 {
2346 .vendor = PCI_VENDOR_ID_COMMTECH,
2347 .device = PCI_DEVICE_ID_COMMTECH_2328PCI335,
2348 .subvendor = PCI_ANY_ID,
2349 .subdevice = PCI_ANY_ID,
2350 .setup = pci_fastcom335_setup,
2351 },
2352 {
2353 .vendor = PCI_VENDOR_ID_COMMTECH,
2354 .device = PCI_DEVICE_ID_COMMTECH_4222PCIE,
2355 .subvendor = PCI_ANY_ID,
2356 .subdevice = PCI_ANY_ID,
2357 .setup = pci_xr17v35x_setup,
2358 },
2359 {
2360 .vendor = PCI_VENDOR_ID_COMMTECH,
2361 .device = PCI_DEVICE_ID_COMMTECH_4224PCIE,
2362 .subvendor = PCI_ANY_ID,
2363 .subdevice = PCI_ANY_ID,
2364 .setup = pci_xr17v35x_setup,
2365 },
2366 {
2367 .vendor = PCI_VENDOR_ID_COMMTECH,
2368 .device = PCI_DEVICE_ID_COMMTECH_4228PCIE,
2369 .subvendor = PCI_ANY_ID,
2370 .subdevice = PCI_ANY_ID,
2371 .setup = pci_xr17v35x_setup,
2372 },
2373 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08002374 * Broadcom TruManage (NetXtreme)
2375 */
2376 {
2377 .vendor = PCI_VENDOR_ID_BROADCOM,
2378 .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
2379 .subvendor = PCI_ANY_ID,
2380 .subdevice = PCI_ANY_ID,
2381 .setup = pci_brcm_trumanage_setup,
2382 },
2383
2384 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002385 * Default "match everything" terminator entry
2386 */
2387 {
2388 .vendor = PCI_ANY_ID,
2389 .device = PCI_ANY_ID,
2390 .subvendor = PCI_ANY_ID,
2391 .subdevice = PCI_ANY_ID,
2392 .setup = pci_default_setup,
2393 }
2394};
2395
2396static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
2397{
2398 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
2399}
2400
2401static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
2402{
2403 struct pci_serial_quirk *quirk;
2404
2405 for (quirk = pci_serial_quirks; ; quirk++)
2406 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
2407 quirk_id_matches(quirk->device, dev->device) &&
2408 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
2409 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
Alan Cox5756ee92008-02-08 04:18:51 -08002410 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002411 return quirk;
2412}
2413
Andrew Mortondd68e882006-01-05 10:55:26 +00002414static inline int get_pci_irq(struct pci_dev *dev,
Russell King975a1a72009-01-02 13:44:27 +00002415 const struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002416{
2417 if (board->flags & FL_NOIRQ)
2418 return 0;
2419 else
2420 return dev->irq;
2421}
2422
2423/*
2424 * This is the configuration table for all of the PCI serial boards
2425 * which we support. It is directly indexed by the pci_board_num_t enum
2426 * value, which is encoded in the pci_device_id PCI probe table's
2427 * driver_data member.
2428 *
2429 * The makeup of these names are:
Gareth Howlett26e92862006-01-04 17:00:42 +00002430 * pbn_bn{_bt}_n_baud{_offsetinhex}
Linus Torvalds1da177e2005-04-16 15:20:36 -07002431 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002432 * bn = PCI BAR number
2433 * bt = Index using PCI BARs
2434 * n = number of serial ports
2435 * baud = baud rate
2436 * offsetinhex = offset for each sequential port (in hex)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002437 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002438 * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
Russell Kingf1690f32005-05-06 10:19:09 +01002439 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07002440 * Please note: in theory if n = 1, _bt infix should make no difference.
2441 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
2442 */
2443enum pci_board_num_t {
2444 pbn_default = 0,
2445
2446 pbn_b0_1_115200,
2447 pbn_b0_2_115200,
2448 pbn_b0_4_115200,
2449 pbn_b0_5_115200,
Alan Coxbf0df632007-10-16 01:24:00 -07002450 pbn_b0_8_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002451
2452 pbn_b0_1_921600,
2453 pbn_b0_2_921600,
2454 pbn_b0_4_921600,
2455
David Ransondb1de152005-07-27 11:43:55 -07002456 pbn_b0_2_1130000,
2457
Andrey Paninfbc0dc02005-07-18 11:38:09 +01002458 pbn_b0_4_1152000,
2459
Matt Schulte14faa8c2012-11-21 10:35:15 -06002460 pbn_b0_2_1152000_200,
2461 pbn_b0_4_1152000_200,
2462 pbn_b0_8_1152000_200,
2463
Gareth Howlett26e92862006-01-04 17:00:42 +00002464 pbn_b0_2_1843200,
2465 pbn_b0_4_1843200,
2466
2467 pbn_b0_2_1843200_200,
2468 pbn_b0_4_1843200_200,
2469 pbn_b0_8_1843200_200,
2470
Lee Howard7106b4e2008-10-21 13:48:58 +01002471 pbn_b0_1_4000000,
2472
Linus Torvalds1da177e2005-04-16 15:20:36 -07002473 pbn_b0_bt_1_115200,
2474 pbn_b0_bt_2_115200,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08002475 pbn_b0_bt_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002476 pbn_b0_bt_8_115200,
2477
2478 pbn_b0_bt_1_460800,
2479 pbn_b0_bt_2_460800,
2480 pbn_b0_bt_4_460800,
2481
2482 pbn_b0_bt_1_921600,
2483 pbn_b0_bt_2_921600,
2484 pbn_b0_bt_4_921600,
2485 pbn_b0_bt_8_921600,
2486
2487 pbn_b1_1_115200,
2488 pbn_b1_2_115200,
2489 pbn_b1_4_115200,
2490 pbn_b1_8_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002491 pbn_b1_16_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002492
2493 pbn_b1_1_921600,
2494 pbn_b1_2_921600,
2495 pbn_b1_4_921600,
2496 pbn_b1_8_921600,
2497
Gareth Howlett26e92862006-01-04 17:00:42 +00002498 pbn_b1_2_1250000,
2499
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002500 pbn_b1_bt_1_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002501 pbn_b1_bt_2_115200,
2502 pbn_b1_bt_4_115200,
2503
Linus Torvalds1da177e2005-04-16 15:20:36 -07002504 pbn_b1_bt_2_921600,
2505
2506 pbn_b1_1_1382400,
2507 pbn_b1_2_1382400,
2508 pbn_b1_4_1382400,
2509 pbn_b1_8_1382400,
2510
2511 pbn_b2_1_115200,
Peter Horton737c1752006-08-26 09:07:36 +01002512 pbn_b2_2_115200,
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002513 pbn_b2_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002514 pbn_b2_8_115200,
2515
2516 pbn_b2_1_460800,
2517 pbn_b2_4_460800,
2518 pbn_b2_8_460800,
2519 pbn_b2_16_460800,
2520
2521 pbn_b2_1_921600,
2522 pbn_b2_4_921600,
2523 pbn_b2_8_921600,
2524
Lytochkin Borise8470032010-07-26 10:02:26 +04002525 pbn_b2_8_1152000,
2526
Linus Torvalds1da177e2005-04-16 15:20:36 -07002527 pbn_b2_bt_1_115200,
2528 pbn_b2_bt_2_115200,
2529 pbn_b2_bt_4_115200,
2530
2531 pbn_b2_bt_2_921600,
2532 pbn_b2_bt_4_921600,
2533
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00002534 pbn_b3_2_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002535 pbn_b3_4_115200,
2536 pbn_b3_8_115200,
2537
Yegor Yefremov66169ad2010-06-04 09:58:18 +02002538 pbn_b4_bt_2_921600,
2539 pbn_b4_bt_4_921600,
2540 pbn_b4_bt_8_921600,
2541
Linus Torvalds1da177e2005-04-16 15:20:36 -07002542 /*
2543 * Board-specific versions.
2544 */
2545 pbn_panacom,
2546 pbn_panacom2,
2547 pbn_panacom4,
2548 pbn_plx_romulus,
2549 pbn_oxsemi,
Lee Howard7106b4e2008-10-21 13:48:58 +01002550 pbn_oxsemi_1_4000000,
2551 pbn_oxsemi_2_4000000,
2552 pbn_oxsemi_4_4000000,
2553 pbn_oxsemi_8_4000000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002554 pbn_intel_i960,
2555 pbn_sgi_ioc3,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002556 pbn_computone_4,
2557 pbn_computone_6,
2558 pbn_computone_8,
2559 pbn_sbsxrsio,
2560 pbn_exar_XR17C152,
2561 pbn_exar_XR17C154,
2562 pbn_exar_XR17C158,
Matt Schultedc96efb2012-11-19 09:12:04 -06002563 pbn_exar_XR17V352,
2564 pbn_exar_XR17V354,
2565 pbn_exar_XR17V358,
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07002566 pbn_exar_ibm_saturn,
Olof Johanssonaa798502007-08-22 14:01:55 -07002567 pbn_pasemi_1682M,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002568 pbn_ni8430_2,
2569 pbn_ni8430_4,
2570 pbn_ni8430_8,
2571 pbn_ni8430_16,
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07002572 pbn_ADDIDATA_PCIe_1_3906250,
2573 pbn_ADDIDATA_PCIe_2_3906250,
2574 pbn_ADDIDATA_PCIe_4_3906250,
2575 pbn_ADDIDATA_PCIe_8_3906250,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08002576 pbn_ce4100_1_115200,
Heikki Krogerusb15e5692013-09-27 10:52:59 +03002577 pbn_byt,
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002578 pbn_omegapci,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002579 pbn_NETMOS9900_2s_115200,
Stephen Hurdebebd492013-01-17 14:14:53 -08002580 pbn_brcm_trumanage,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002581};
2582
2583/*
2584 * uart_offset - the space between channels
2585 * reg_shift - describes how the UART registers are mapped
2586 * to PCI memory by the card.
2587 * For example IER register on SBS, Inc. PMC-OctPro is located at
2588 * offset 0x10 from the UART base, while UART_IER is defined as 1
2589 * in include/linux/serial_reg.h,
2590 * see first lines of serial_in() and serial_out() in 8250.c
2591*/
2592
Bill Pembertonde88b342012-11-19 13:24:32 -05002593static struct pciserial_board pci_boards[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002594 [pbn_default] = {
2595 .flags = FL_BASE0,
2596 .num_ports = 1,
2597 .base_baud = 115200,
2598 .uart_offset = 8,
2599 },
2600 [pbn_b0_1_115200] = {
2601 .flags = FL_BASE0,
2602 .num_ports = 1,
2603 .base_baud = 115200,
2604 .uart_offset = 8,
2605 },
2606 [pbn_b0_2_115200] = {
2607 .flags = FL_BASE0,
2608 .num_ports = 2,
2609 .base_baud = 115200,
2610 .uart_offset = 8,
2611 },
2612 [pbn_b0_4_115200] = {
2613 .flags = FL_BASE0,
2614 .num_ports = 4,
2615 .base_baud = 115200,
2616 .uart_offset = 8,
2617 },
2618 [pbn_b0_5_115200] = {
2619 .flags = FL_BASE0,
2620 .num_ports = 5,
2621 .base_baud = 115200,
2622 .uart_offset = 8,
2623 },
Alan Coxbf0df632007-10-16 01:24:00 -07002624 [pbn_b0_8_115200] = {
2625 .flags = FL_BASE0,
2626 .num_ports = 8,
2627 .base_baud = 115200,
2628 .uart_offset = 8,
2629 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002630 [pbn_b0_1_921600] = {
2631 .flags = FL_BASE0,
2632 .num_ports = 1,
2633 .base_baud = 921600,
2634 .uart_offset = 8,
2635 },
2636 [pbn_b0_2_921600] = {
2637 .flags = FL_BASE0,
2638 .num_ports = 2,
2639 .base_baud = 921600,
2640 .uart_offset = 8,
2641 },
2642 [pbn_b0_4_921600] = {
2643 .flags = FL_BASE0,
2644 .num_ports = 4,
2645 .base_baud = 921600,
2646 .uart_offset = 8,
2647 },
David Ransondb1de152005-07-27 11:43:55 -07002648
2649 [pbn_b0_2_1130000] = {
2650 .flags = FL_BASE0,
2651 .num_ports = 2,
2652 .base_baud = 1130000,
2653 .uart_offset = 8,
2654 },
2655
Andrey Paninfbc0dc02005-07-18 11:38:09 +01002656 [pbn_b0_4_1152000] = {
2657 .flags = FL_BASE0,
2658 .num_ports = 4,
2659 .base_baud = 1152000,
2660 .uart_offset = 8,
2661 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002662
Matt Schulte14faa8c2012-11-21 10:35:15 -06002663 [pbn_b0_2_1152000_200] = {
2664 .flags = FL_BASE0,
2665 .num_ports = 2,
2666 .base_baud = 1152000,
2667 .uart_offset = 0x200,
2668 },
2669
2670 [pbn_b0_4_1152000_200] = {
2671 .flags = FL_BASE0,
2672 .num_ports = 4,
2673 .base_baud = 1152000,
2674 .uart_offset = 0x200,
2675 },
2676
2677 [pbn_b0_8_1152000_200] = {
2678 .flags = FL_BASE0,
Matt Schulte4f7d67d2012-12-06 22:19:58 -06002679 .num_ports = 8,
Matt Schulte14faa8c2012-11-21 10:35:15 -06002680 .base_baud = 1152000,
2681 .uart_offset = 0x200,
2682 },
2683
Gareth Howlett26e92862006-01-04 17:00:42 +00002684 [pbn_b0_2_1843200] = {
2685 .flags = FL_BASE0,
2686 .num_ports = 2,
2687 .base_baud = 1843200,
2688 .uart_offset = 8,
2689 },
2690 [pbn_b0_4_1843200] = {
2691 .flags = FL_BASE0,
2692 .num_ports = 4,
2693 .base_baud = 1843200,
2694 .uart_offset = 8,
2695 },
2696
2697 [pbn_b0_2_1843200_200] = {
2698 .flags = FL_BASE0,
2699 .num_ports = 2,
2700 .base_baud = 1843200,
2701 .uart_offset = 0x200,
2702 },
2703 [pbn_b0_4_1843200_200] = {
2704 .flags = FL_BASE0,
2705 .num_ports = 4,
2706 .base_baud = 1843200,
2707 .uart_offset = 0x200,
2708 },
2709 [pbn_b0_8_1843200_200] = {
2710 .flags = FL_BASE0,
2711 .num_ports = 8,
2712 .base_baud = 1843200,
2713 .uart_offset = 0x200,
2714 },
Lee Howard7106b4e2008-10-21 13:48:58 +01002715 [pbn_b0_1_4000000] = {
2716 .flags = FL_BASE0,
2717 .num_ports = 1,
2718 .base_baud = 4000000,
2719 .uart_offset = 8,
2720 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002721
Linus Torvalds1da177e2005-04-16 15:20:36 -07002722 [pbn_b0_bt_1_115200] = {
2723 .flags = FL_BASE0|FL_BASE_BARS,
2724 .num_ports = 1,
2725 .base_baud = 115200,
2726 .uart_offset = 8,
2727 },
2728 [pbn_b0_bt_2_115200] = {
2729 .flags = FL_BASE0|FL_BASE_BARS,
2730 .num_ports = 2,
2731 .base_baud = 115200,
2732 .uart_offset = 8,
2733 },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08002734 [pbn_b0_bt_4_115200] = {
2735 .flags = FL_BASE0|FL_BASE_BARS,
2736 .num_ports = 4,
2737 .base_baud = 115200,
2738 .uart_offset = 8,
2739 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002740 [pbn_b0_bt_8_115200] = {
2741 .flags = FL_BASE0|FL_BASE_BARS,
2742 .num_ports = 8,
2743 .base_baud = 115200,
2744 .uart_offset = 8,
2745 },
2746
2747 [pbn_b0_bt_1_460800] = {
2748 .flags = FL_BASE0|FL_BASE_BARS,
2749 .num_ports = 1,
2750 .base_baud = 460800,
2751 .uart_offset = 8,
2752 },
2753 [pbn_b0_bt_2_460800] = {
2754 .flags = FL_BASE0|FL_BASE_BARS,
2755 .num_ports = 2,
2756 .base_baud = 460800,
2757 .uart_offset = 8,
2758 },
2759 [pbn_b0_bt_4_460800] = {
2760 .flags = FL_BASE0|FL_BASE_BARS,
2761 .num_ports = 4,
2762 .base_baud = 460800,
2763 .uart_offset = 8,
2764 },
2765
2766 [pbn_b0_bt_1_921600] = {
2767 .flags = FL_BASE0|FL_BASE_BARS,
2768 .num_ports = 1,
2769 .base_baud = 921600,
2770 .uart_offset = 8,
2771 },
2772 [pbn_b0_bt_2_921600] = {
2773 .flags = FL_BASE0|FL_BASE_BARS,
2774 .num_ports = 2,
2775 .base_baud = 921600,
2776 .uart_offset = 8,
2777 },
2778 [pbn_b0_bt_4_921600] = {
2779 .flags = FL_BASE0|FL_BASE_BARS,
2780 .num_ports = 4,
2781 .base_baud = 921600,
2782 .uart_offset = 8,
2783 },
2784 [pbn_b0_bt_8_921600] = {
2785 .flags = FL_BASE0|FL_BASE_BARS,
2786 .num_ports = 8,
2787 .base_baud = 921600,
2788 .uart_offset = 8,
2789 },
2790
2791 [pbn_b1_1_115200] = {
2792 .flags = FL_BASE1,
2793 .num_ports = 1,
2794 .base_baud = 115200,
2795 .uart_offset = 8,
2796 },
2797 [pbn_b1_2_115200] = {
2798 .flags = FL_BASE1,
2799 .num_ports = 2,
2800 .base_baud = 115200,
2801 .uart_offset = 8,
2802 },
2803 [pbn_b1_4_115200] = {
2804 .flags = FL_BASE1,
2805 .num_ports = 4,
2806 .base_baud = 115200,
2807 .uart_offset = 8,
2808 },
2809 [pbn_b1_8_115200] = {
2810 .flags = FL_BASE1,
2811 .num_ports = 8,
2812 .base_baud = 115200,
2813 .uart_offset = 8,
2814 },
Will Page04bf7e72009-04-06 17:32:15 +01002815 [pbn_b1_16_115200] = {
2816 .flags = FL_BASE1,
2817 .num_ports = 16,
2818 .base_baud = 115200,
2819 .uart_offset = 8,
2820 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002821
2822 [pbn_b1_1_921600] = {
2823 .flags = FL_BASE1,
2824 .num_ports = 1,
2825 .base_baud = 921600,
2826 .uart_offset = 8,
2827 },
2828 [pbn_b1_2_921600] = {
2829 .flags = FL_BASE1,
2830 .num_ports = 2,
2831 .base_baud = 921600,
2832 .uart_offset = 8,
2833 },
2834 [pbn_b1_4_921600] = {
2835 .flags = FL_BASE1,
2836 .num_ports = 4,
2837 .base_baud = 921600,
2838 .uart_offset = 8,
2839 },
2840 [pbn_b1_8_921600] = {
2841 .flags = FL_BASE1,
2842 .num_ports = 8,
2843 .base_baud = 921600,
2844 .uart_offset = 8,
2845 },
Gareth Howlett26e92862006-01-04 17:00:42 +00002846 [pbn_b1_2_1250000] = {
2847 .flags = FL_BASE1,
2848 .num_ports = 2,
2849 .base_baud = 1250000,
2850 .uart_offset = 8,
2851 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002852
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002853 [pbn_b1_bt_1_115200] = {
2854 .flags = FL_BASE1|FL_BASE_BARS,
2855 .num_ports = 1,
2856 .base_baud = 115200,
2857 .uart_offset = 8,
2858 },
Will Page04bf7e72009-04-06 17:32:15 +01002859 [pbn_b1_bt_2_115200] = {
2860 .flags = FL_BASE1|FL_BASE_BARS,
2861 .num_ports = 2,
2862 .base_baud = 115200,
2863 .uart_offset = 8,
2864 },
2865 [pbn_b1_bt_4_115200] = {
2866 .flags = FL_BASE1|FL_BASE_BARS,
2867 .num_ports = 4,
2868 .base_baud = 115200,
2869 .uart_offset = 8,
2870 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002871
Linus Torvalds1da177e2005-04-16 15:20:36 -07002872 [pbn_b1_bt_2_921600] = {
2873 .flags = FL_BASE1|FL_BASE_BARS,
2874 .num_ports = 2,
2875 .base_baud = 921600,
2876 .uart_offset = 8,
2877 },
2878
2879 [pbn_b1_1_1382400] = {
2880 .flags = FL_BASE1,
2881 .num_ports = 1,
2882 .base_baud = 1382400,
2883 .uart_offset = 8,
2884 },
2885 [pbn_b1_2_1382400] = {
2886 .flags = FL_BASE1,
2887 .num_ports = 2,
2888 .base_baud = 1382400,
2889 .uart_offset = 8,
2890 },
2891 [pbn_b1_4_1382400] = {
2892 .flags = FL_BASE1,
2893 .num_ports = 4,
2894 .base_baud = 1382400,
2895 .uart_offset = 8,
2896 },
2897 [pbn_b1_8_1382400] = {
2898 .flags = FL_BASE1,
2899 .num_ports = 8,
2900 .base_baud = 1382400,
2901 .uart_offset = 8,
2902 },
2903
2904 [pbn_b2_1_115200] = {
2905 .flags = FL_BASE2,
2906 .num_ports = 1,
2907 .base_baud = 115200,
2908 .uart_offset = 8,
2909 },
Peter Horton737c1752006-08-26 09:07:36 +01002910 [pbn_b2_2_115200] = {
2911 .flags = FL_BASE2,
2912 .num_ports = 2,
2913 .base_baud = 115200,
2914 .uart_offset = 8,
2915 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002916 [pbn_b2_4_115200] = {
2917 .flags = FL_BASE2,
2918 .num_ports = 4,
2919 .base_baud = 115200,
2920 .uart_offset = 8,
2921 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002922 [pbn_b2_8_115200] = {
2923 .flags = FL_BASE2,
2924 .num_ports = 8,
2925 .base_baud = 115200,
2926 .uart_offset = 8,
2927 },
2928
2929 [pbn_b2_1_460800] = {
2930 .flags = FL_BASE2,
2931 .num_ports = 1,
2932 .base_baud = 460800,
2933 .uart_offset = 8,
2934 },
2935 [pbn_b2_4_460800] = {
2936 .flags = FL_BASE2,
2937 .num_ports = 4,
2938 .base_baud = 460800,
2939 .uart_offset = 8,
2940 },
2941 [pbn_b2_8_460800] = {
2942 .flags = FL_BASE2,
2943 .num_ports = 8,
2944 .base_baud = 460800,
2945 .uart_offset = 8,
2946 },
2947 [pbn_b2_16_460800] = {
2948 .flags = FL_BASE2,
2949 .num_ports = 16,
2950 .base_baud = 460800,
2951 .uart_offset = 8,
2952 },
2953
2954 [pbn_b2_1_921600] = {
2955 .flags = FL_BASE2,
2956 .num_ports = 1,
2957 .base_baud = 921600,
2958 .uart_offset = 8,
2959 },
2960 [pbn_b2_4_921600] = {
2961 .flags = FL_BASE2,
2962 .num_ports = 4,
2963 .base_baud = 921600,
2964 .uart_offset = 8,
2965 },
2966 [pbn_b2_8_921600] = {
2967 .flags = FL_BASE2,
2968 .num_ports = 8,
2969 .base_baud = 921600,
2970 .uart_offset = 8,
2971 },
2972
Lytochkin Borise8470032010-07-26 10:02:26 +04002973 [pbn_b2_8_1152000] = {
2974 .flags = FL_BASE2,
2975 .num_ports = 8,
2976 .base_baud = 1152000,
2977 .uart_offset = 8,
2978 },
2979
Linus Torvalds1da177e2005-04-16 15:20:36 -07002980 [pbn_b2_bt_1_115200] = {
2981 .flags = FL_BASE2|FL_BASE_BARS,
2982 .num_ports = 1,
2983 .base_baud = 115200,
2984 .uart_offset = 8,
2985 },
2986 [pbn_b2_bt_2_115200] = {
2987 .flags = FL_BASE2|FL_BASE_BARS,
2988 .num_ports = 2,
2989 .base_baud = 115200,
2990 .uart_offset = 8,
2991 },
2992 [pbn_b2_bt_4_115200] = {
2993 .flags = FL_BASE2|FL_BASE_BARS,
2994 .num_ports = 4,
2995 .base_baud = 115200,
2996 .uart_offset = 8,
2997 },
2998
2999 [pbn_b2_bt_2_921600] = {
3000 .flags = FL_BASE2|FL_BASE_BARS,
3001 .num_ports = 2,
3002 .base_baud = 921600,
3003 .uart_offset = 8,
3004 },
3005 [pbn_b2_bt_4_921600] = {
3006 .flags = FL_BASE2|FL_BASE_BARS,
3007 .num_ports = 4,
3008 .base_baud = 921600,
3009 .uart_offset = 8,
3010 },
3011
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00003012 [pbn_b3_2_115200] = {
3013 .flags = FL_BASE3,
3014 .num_ports = 2,
3015 .base_baud = 115200,
3016 .uart_offset = 8,
3017 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003018 [pbn_b3_4_115200] = {
3019 .flags = FL_BASE3,
3020 .num_ports = 4,
3021 .base_baud = 115200,
3022 .uart_offset = 8,
3023 },
3024 [pbn_b3_8_115200] = {
3025 .flags = FL_BASE3,
3026 .num_ports = 8,
3027 .base_baud = 115200,
3028 .uart_offset = 8,
3029 },
3030
Yegor Yefremov66169ad2010-06-04 09:58:18 +02003031 [pbn_b4_bt_2_921600] = {
3032 .flags = FL_BASE4,
3033 .num_ports = 2,
3034 .base_baud = 921600,
3035 .uart_offset = 8,
3036 },
3037 [pbn_b4_bt_4_921600] = {
3038 .flags = FL_BASE4,
3039 .num_ports = 4,
3040 .base_baud = 921600,
3041 .uart_offset = 8,
3042 },
3043 [pbn_b4_bt_8_921600] = {
3044 .flags = FL_BASE4,
3045 .num_ports = 8,
3046 .base_baud = 921600,
3047 .uart_offset = 8,
3048 },
3049
Linus Torvalds1da177e2005-04-16 15:20:36 -07003050 /*
3051 * Entries following this are board-specific.
3052 */
3053
3054 /*
3055 * Panacom - IOMEM
3056 */
3057 [pbn_panacom] = {
3058 .flags = FL_BASE2,
3059 .num_ports = 2,
3060 .base_baud = 921600,
3061 .uart_offset = 0x400,
3062 .reg_shift = 7,
3063 },
3064 [pbn_panacom2] = {
3065 .flags = FL_BASE2|FL_BASE_BARS,
3066 .num_ports = 2,
3067 .base_baud = 921600,
3068 .uart_offset = 0x400,
3069 .reg_shift = 7,
3070 },
3071 [pbn_panacom4] = {
3072 .flags = FL_BASE2|FL_BASE_BARS,
3073 .num_ports = 4,
3074 .base_baud = 921600,
3075 .uart_offset = 0x400,
3076 .reg_shift = 7,
3077 },
3078
3079 /* I think this entry is broken - the first_offset looks wrong --rmk */
3080 [pbn_plx_romulus] = {
3081 .flags = FL_BASE2,
3082 .num_ports = 4,
3083 .base_baud = 921600,
3084 .uart_offset = 8 << 2,
3085 .reg_shift = 2,
3086 .first_offset = 0x03,
3087 },
3088
3089 /*
3090 * This board uses the size of PCI Base region 0 to
3091 * signal now many ports are available
3092 */
3093 [pbn_oxsemi] = {
3094 .flags = FL_BASE0|FL_REGION_SZ_CAP,
3095 .num_ports = 32,
3096 .base_baud = 115200,
3097 .uart_offset = 8,
3098 },
Lee Howard7106b4e2008-10-21 13:48:58 +01003099 [pbn_oxsemi_1_4000000] = {
3100 .flags = FL_BASE0,
3101 .num_ports = 1,
3102 .base_baud = 4000000,
3103 .uart_offset = 0x200,
3104 .first_offset = 0x1000,
3105 },
3106 [pbn_oxsemi_2_4000000] = {
3107 .flags = FL_BASE0,
3108 .num_ports = 2,
3109 .base_baud = 4000000,
3110 .uart_offset = 0x200,
3111 .first_offset = 0x1000,
3112 },
3113 [pbn_oxsemi_4_4000000] = {
3114 .flags = FL_BASE0,
3115 .num_ports = 4,
3116 .base_baud = 4000000,
3117 .uart_offset = 0x200,
3118 .first_offset = 0x1000,
3119 },
3120 [pbn_oxsemi_8_4000000] = {
3121 .flags = FL_BASE0,
3122 .num_ports = 8,
3123 .base_baud = 4000000,
3124 .uart_offset = 0x200,
3125 .first_offset = 0x1000,
3126 },
3127
Linus Torvalds1da177e2005-04-16 15:20:36 -07003128
3129 /*
3130 * EKF addition for i960 Boards form EKF with serial port.
3131 * Max 256 ports.
3132 */
3133 [pbn_intel_i960] = {
3134 .flags = FL_BASE0,
3135 .num_ports = 32,
3136 .base_baud = 921600,
3137 .uart_offset = 8 << 2,
3138 .reg_shift = 2,
3139 .first_offset = 0x10000,
3140 },
3141 [pbn_sgi_ioc3] = {
3142 .flags = FL_BASE0|FL_NOIRQ,
3143 .num_ports = 1,
3144 .base_baud = 458333,
3145 .uart_offset = 8,
3146 .reg_shift = 0,
3147 .first_offset = 0x20178,
3148 },
3149
3150 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003151 * Computone - uses IOMEM.
3152 */
3153 [pbn_computone_4] = {
3154 .flags = FL_BASE0,
3155 .num_ports = 4,
3156 .base_baud = 921600,
3157 .uart_offset = 0x40,
3158 .reg_shift = 2,
3159 .first_offset = 0x200,
3160 },
3161 [pbn_computone_6] = {
3162 .flags = FL_BASE0,
3163 .num_ports = 6,
3164 .base_baud = 921600,
3165 .uart_offset = 0x40,
3166 .reg_shift = 2,
3167 .first_offset = 0x200,
3168 },
3169 [pbn_computone_8] = {
3170 .flags = FL_BASE0,
3171 .num_ports = 8,
3172 .base_baud = 921600,
3173 .uart_offset = 0x40,
3174 .reg_shift = 2,
3175 .first_offset = 0x200,
3176 },
3177 [pbn_sbsxrsio] = {
3178 .flags = FL_BASE0,
3179 .num_ports = 8,
3180 .base_baud = 460800,
3181 .uart_offset = 256,
3182 .reg_shift = 4,
3183 },
3184 /*
3185 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
3186 * Only basic 16550A support.
3187 * XR17C15[24] are not tested, but they should work.
3188 */
3189 [pbn_exar_XR17C152] = {
3190 .flags = FL_BASE0,
3191 .num_ports = 2,
3192 .base_baud = 921600,
3193 .uart_offset = 0x200,
3194 },
3195 [pbn_exar_XR17C154] = {
3196 .flags = FL_BASE0,
3197 .num_ports = 4,
3198 .base_baud = 921600,
3199 .uart_offset = 0x200,
3200 },
3201 [pbn_exar_XR17C158] = {
3202 .flags = FL_BASE0,
3203 .num_ports = 8,
3204 .base_baud = 921600,
3205 .uart_offset = 0x200,
3206 },
Matt Schultedc96efb2012-11-19 09:12:04 -06003207 [pbn_exar_XR17V352] = {
3208 .flags = FL_BASE0,
3209 .num_ports = 2,
3210 .base_baud = 7812500,
3211 .uart_offset = 0x400,
3212 .reg_shift = 0,
3213 .first_offset = 0,
3214 },
3215 [pbn_exar_XR17V354] = {
3216 .flags = FL_BASE0,
3217 .num_ports = 4,
3218 .base_baud = 7812500,
3219 .uart_offset = 0x400,
3220 .reg_shift = 0,
3221 .first_offset = 0,
3222 },
3223 [pbn_exar_XR17V358] = {
3224 .flags = FL_BASE0,
3225 .num_ports = 8,
3226 .base_baud = 7812500,
3227 .uart_offset = 0x400,
3228 .reg_shift = 0,
3229 .first_offset = 0,
3230 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07003231 [pbn_exar_ibm_saturn] = {
3232 .flags = FL_BASE0,
3233 .num_ports = 1,
3234 .base_baud = 921600,
3235 .uart_offset = 0x200,
3236 },
3237
Olof Johanssonaa798502007-08-22 14:01:55 -07003238 /*
3239 * PA Semi PWRficient PA6T-1682M on-chip UART
3240 */
3241 [pbn_pasemi_1682M] = {
3242 .flags = FL_BASE0,
3243 .num_ports = 1,
3244 .base_baud = 8333333,
3245 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01003246 /*
3247 * National Instruments 843x
3248 */
3249 [pbn_ni8430_16] = {
3250 .flags = FL_BASE0,
3251 .num_ports = 16,
3252 .base_baud = 3686400,
3253 .uart_offset = 0x10,
3254 .first_offset = 0x800,
3255 },
3256 [pbn_ni8430_8] = {
3257 .flags = FL_BASE0,
3258 .num_ports = 8,
3259 .base_baud = 3686400,
3260 .uart_offset = 0x10,
3261 .first_offset = 0x800,
3262 },
3263 [pbn_ni8430_4] = {
3264 .flags = FL_BASE0,
3265 .num_ports = 4,
3266 .base_baud = 3686400,
3267 .uart_offset = 0x10,
3268 .first_offset = 0x800,
3269 },
3270 [pbn_ni8430_2] = {
3271 .flags = FL_BASE0,
3272 .num_ports = 2,
3273 .base_baud = 3686400,
3274 .uart_offset = 0x10,
3275 .first_offset = 0x800,
3276 },
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07003277 /*
3278 * ADDI-DATA GmbH PCI-Express communication cards <info@addi-data.com>
3279 */
3280 [pbn_ADDIDATA_PCIe_1_3906250] = {
3281 .flags = FL_BASE0,
3282 .num_ports = 1,
3283 .base_baud = 3906250,
3284 .uart_offset = 0x200,
3285 .first_offset = 0x1000,
3286 },
3287 [pbn_ADDIDATA_PCIe_2_3906250] = {
3288 .flags = FL_BASE0,
3289 .num_ports = 2,
3290 .base_baud = 3906250,
3291 .uart_offset = 0x200,
3292 .first_offset = 0x1000,
3293 },
3294 [pbn_ADDIDATA_PCIe_4_3906250] = {
3295 .flags = FL_BASE0,
3296 .num_ports = 4,
3297 .base_baud = 3906250,
3298 .uart_offset = 0x200,
3299 .first_offset = 0x1000,
3300 },
3301 [pbn_ADDIDATA_PCIe_8_3906250] = {
3302 .flags = FL_BASE0,
3303 .num_ports = 8,
3304 .base_baud = 3906250,
3305 .uart_offset = 0x200,
3306 .first_offset = 0x1000,
3307 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003308 [pbn_ce4100_1_115200] = {
Maxime Bizon08ec2122012-10-19 10:45:07 +02003309 .flags = FL_BASE_BARS,
3310 .num_ports = 2,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003311 .base_baud = 921600,
3312 .reg_shift = 2,
3313 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03003314 [pbn_byt] = {
3315 .flags = FL_BASE0,
3316 .num_ports = 1,
3317 .base_baud = 2764800,
3318 .uart_offset = 0x80,
3319 .reg_shift = 2,
3320 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04003321 [pbn_omegapci] = {
3322 .flags = FL_BASE0,
3323 .num_ports = 8,
3324 .base_baud = 115200,
3325 .uart_offset = 0x200,
3326 },
Nicos Gollan7808edc2011-05-05 21:00:37 +02003327 [pbn_NETMOS9900_2s_115200] = {
3328 .flags = FL_BASE0,
3329 .num_ports = 2,
3330 .base_baud = 115200,
3331 },
Stephen Hurdebebd492013-01-17 14:14:53 -08003332 [pbn_brcm_trumanage] = {
3333 .flags = FL_BASE0,
3334 .num_ports = 1,
3335 .reg_shift = 2,
3336 .base_baud = 115200,
3337 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003338};
3339
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003340static const struct pci_device_id blacklist[] = {
3341 /* softmodems */
Alan Cox5756ee92008-02-08 04:18:51 -08003342 { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
Maciej Szmigieroebf7c062010-10-26 21:48:21 +02003343 { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */
3344 { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003345
3346 /* multi-io cards handled by parport_serial */
3347 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
Christian Schmidt436bbd42007-08-22 14:01:19 -07003348};
3349
Linus Torvalds1da177e2005-04-16 15:20:36 -07003350/*
3351 * Given a complete unknown PCI device, try to use some heuristics to
3352 * guess what the configuration might be, based on the pitiful PCI
3353 * serial specs. Returns 0 on success, 1 on failure.
3354 */
Bill Pemberton9671f092012-11-19 13:21:50 -05003355static int
Russell King1c7c1fe2005-07-27 11:31:19 +01003356serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003357{
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003358 const struct pci_device_id *bldev;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003359 int num_iomem, num_port, first_port = -1, i;
Alan Cox5756ee92008-02-08 04:18:51 -08003360
Linus Torvalds1da177e2005-04-16 15:20:36 -07003361 /*
3362 * If it is not a communications device or the programming
3363 * interface is greater than 6, give up.
3364 *
3365 * (Should we try to make guesses for multiport serial devices
Alan Cox5756ee92008-02-08 04:18:51 -08003366 * later?)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003367 */
3368 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
3369 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
3370 (dev->class & 0xff) > 6)
3371 return -ENODEV;
3372
Christian Schmidt436bbd42007-08-22 14:01:19 -07003373 /*
3374 * Do not access blacklisted devices that are known not to
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003375 * feature serial ports or are handled by other modules.
Christian Schmidt436bbd42007-08-22 14:01:19 -07003376 */
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003377 for (bldev = blacklist;
3378 bldev < blacklist + ARRAY_SIZE(blacklist);
3379 bldev++) {
3380 if (dev->vendor == bldev->vendor &&
3381 dev->device == bldev->device)
Christian Schmidt436bbd42007-08-22 14:01:19 -07003382 return -ENODEV;
3383 }
3384
Linus Torvalds1da177e2005-04-16 15:20:36 -07003385 num_iomem = num_port = 0;
3386 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3387 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
3388 num_port++;
3389 if (first_port == -1)
3390 first_port = i;
3391 }
3392 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
3393 num_iomem++;
3394 }
3395
3396 /*
3397 * If there is 1 or 0 iomem regions, and exactly one port,
3398 * use it. We guess the number of ports based on the IO
3399 * region size.
3400 */
3401 if (num_iomem <= 1 && num_port == 1) {
3402 board->flags = first_port;
3403 board->num_ports = pci_resource_len(dev, first_port) / 8;
3404 return 0;
3405 }
3406
3407 /*
3408 * Now guess if we've got a board which indexes by BARs.
3409 * Each IO BAR should be 8 bytes, and they should follow
3410 * consecutively.
3411 */
3412 first_port = -1;
3413 num_port = 0;
3414 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3415 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
3416 pci_resource_len(dev, i) == 8 &&
3417 (first_port == -1 || (first_port + num_port) == i)) {
3418 num_port++;
3419 if (first_port == -1)
3420 first_port = i;
3421 }
3422 }
3423
3424 if (num_port > 1) {
3425 board->flags = first_port | FL_BASE_BARS;
3426 board->num_ports = num_port;
3427 return 0;
3428 }
3429
3430 return -ENODEV;
3431}
3432
3433static inline int
Russell King975a1a72009-01-02 13:44:27 +00003434serial_pci_matches(const struct pciserial_board *board,
3435 const struct pciserial_board *guessed)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003436{
3437 return
3438 board->num_ports == guessed->num_ports &&
3439 board->base_baud == guessed->base_baud &&
3440 board->uart_offset == guessed->uart_offset &&
3441 board->reg_shift == guessed->reg_shift &&
3442 board->first_offset == guessed->first_offset;
3443}
3444
Russell King241fc432005-07-27 11:35:54 +01003445struct serial_private *
Russell King975a1a72009-01-02 13:44:27 +00003446pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
Russell King241fc432005-07-27 11:35:54 +01003447{
Alan Cox2655a2c2012-07-12 12:59:50 +01003448 struct uart_8250_port uart;
Russell King241fc432005-07-27 11:35:54 +01003449 struct serial_private *priv;
3450 struct pci_serial_quirk *quirk;
3451 int rc, nr_ports, i;
3452
3453 nr_ports = board->num_ports;
3454
3455 /*
3456 * Find an init and setup quirks.
3457 */
3458 quirk = find_quirk(dev);
3459
3460 /*
3461 * Run the new-style initialization function.
3462 * The initialization function returns:
3463 * <0 - error
3464 * 0 - use board->num_ports
3465 * >0 - number of ports
3466 */
3467 if (quirk->init) {
3468 rc = quirk->init(dev);
3469 if (rc < 0) {
3470 priv = ERR_PTR(rc);
3471 goto err_out;
3472 }
3473 if (rc)
3474 nr_ports = rc;
3475 }
3476
Burman Yan8f31bb32007-02-14 00:33:07 -08003477 priv = kzalloc(sizeof(struct serial_private) +
Russell King241fc432005-07-27 11:35:54 +01003478 sizeof(unsigned int) * nr_ports,
3479 GFP_KERNEL);
3480 if (!priv) {
3481 priv = ERR_PTR(-ENOMEM);
3482 goto err_deinit;
3483 }
3484
Russell King241fc432005-07-27 11:35:54 +01003485 priv->dev = dev;
3486 priv->quirk = quirk;
3487
Alan Cox2655a2c2012-07-12 12:59:50 +01003488 memset(&uart, 0, sizeof(uart));
3489 uart.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
3490 uart.port.uartclk = board->base_baud * 16;
3491 uart.port.irq = get_pci_irq(dev, board);
3492 uart.port.dev = &dev->dev;
Russell King241fc432005-07-27 11:35:54 +01003493
3494 for (i = 0; i < nr_ports; i++) {
Alan Cox2655a2c2012-07-12 12:59:50 +01003495 if (quirk->setup(priv, board, &uart, i))
Russell King241fc432005-07-27 11:35:54 +01003496 break;
3497
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003498 dev_dbg(&dev->dev, "Setup PCI port: port %lx, irq %d, type %d\n",
3499 uart.port.iobase, uart.port.irq, uart.port.iotype);
Alan Cox5756ee92008-02-08 04:18:51 -08003500
Alan Cox2655a2c2012-07-12 12:59:50 +01003501 priv->line[i] = serial8250_register_8250_port(&uart);
Russell King241fc432005-07-27 11:35:54 +01003502 if (priv->line[i] < 0) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003503 dev_err(&dev->dev,
3504 "Couldn't register serial port %lx, irq %d, type %d, error %d\n",
3505 uart.port.iobase, uart.port.irq,
3506 uart.port.iotype, priv->line[i]);
Russell King241fc432005-07-27 11:35:54 +01003507 break;
3508 }
3509 }
Russell King241fc432005-07-27 11:35:54 +01003510 priv->nr = i;
Russell King241fc432005-07-27 11:35:54 +01003511 return priv;
3512
Alan Cox5756ee92008-02-08 04:18:51 -08003513err_deinit:
Russell King241fc432005-07-27 11:35:54 +01003514 if (quirk->exit)
3515 quirk->exit(dev);
Alan Cox5756ee92008-02-08 04:18:51 -08003516err_out:
Russell King241fc432005-07-27 11:35:54 +01003517 return priv;
3518}
3519EXPORT_SYMBOL_GPL(pciserial_init_ports);
3520
3521void pciserial_remove_ports(struct serial_private *priv)
3522{
3523 struct pci_serial_quirk *quirk;
3524 int i;
3525
3526 for (i = 0; i < priv->nr; i++)
3527 serial8250_unregister_port(priv->line[i]);
3528
3529 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3530 if (priv->remapped_bar[i])
3531 iounmap(priv->remapped_bar[i]);
3532 priv->remapped_bar[i] = NULL;
3533 }
3534
3535 /*
3536 * Find the exit quirks.
3537 */
3538 quirk = find_quirk(priv->dev);
3539 if (quirk->exit)
3540 quirk->exit(priv->dev);
3541
3542 kfree(priv);
3543}
3544EXPORT_SYMBOL_GPL(pciserial_remove_ports);
3545
3546void pciserial_suspend_ports(struct serial_private *priv)
3547{
3548 int i;
3549
3550 for (i = 0; i < priv->nr; i++)
3551 if (priv->line[i] >= 0)
3552 serial8250_suspend_port(priv->line[i]);
Dan Williams5f1a3892012-04-10 14:11:03 -07003553
3554 /*
3555 * Ensure that every init quirk is properly torn down
3556 */
3557 if (priv->quirk->exit)
3558 priv->quirk->exit(priv->dev);
Russell King241fc432005-07-27 11:35:54 +01003559}
3560EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
3561
3562void pciserial_resume_ports(struct serial_private *priv)
3563{
3564 int i;
3565
3566 /*
3567 * Ensure that the board is correctly configured.
3568 */
3569 if (priv->quirk->init)
3570 priv->quirk->init(priv->dev);
3571
3572 for (i = 0; i < priv->nr; i++)
3573 if (priv->line[i] >= 0)
3574 serial8250_resume_port(priv->line[i]);
3575}
3576EXPORT_SYMBOL_GPL(pciserial_resume_ports);
3577
Linus Torvalds1da177e2005-04-16 15:20:36 -07003578/*
3579 * Probe one serial board. Unfortunately, there is no rhyme nor reason
3580 * to the arrangement of serial ports on a PCI card.
3581 */
Bill Pemberton9671f092012-11-19 13:21:50 -05003582static int
Linus Torvalds1da177e2005-04-16 15:20:36 -07003583pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
3584{
Frédéric Brière5bf8f502011-05-29 15:08:03 -04003585 struct pci_serial_quirk *quirk;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003586 struct serial_private *priv;
Russell King975a1a72009-01-02 13:44:27 +00003587 const struct pciserial_board *board;
3588 struct pciserial_board tmp;
Russell King241fc432005-07-27 11:35:54 +01003589 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003590
Frédéric Brière5bf8f502011-05-29 15:08:03 -04003591 quirk = find_quirk(dev);
3592 if (quirk->probe) {
3593 rc = quirk->probe(dev);
3594 if (rc)
3595 return rc;
3596 }
3597
Linus Torvalds1da177e2005-04-16 15:20:36 -07003598 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003599 dev_err(&dev->dev, "invalid driver_data: %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -07003600 ent->driver_data);
3601 return -EINVAL;
3602 }
3603
3604 board = &pci_boards[ent->driver_data];
3605
3606 rc = pci_enable_device(dev);
Michael Reed28071902011-05-31 12:06:28 -05003607 pci_save_state(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003608 if (rc)
3609 return rc;
3610
3611 if (ent->driver_data == pbn_default) {
3612 /*
3613 * Use a copy of the pci_board entry for this;
3614 * avoid changing entries in the table.
3615 */
Russell King1c7c1fe2005-07-27 11:31:19 +01003616 memcpy(&tmp, board, sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07003617 board = &tmp;
3618
3619 /*
3620 * We matched one of our class entries. Try to
3621 * determine the parameters of this board.
3622 */
Russell King975a1a72009-01-02 13:44:27 +00003623 rc = serial_pci_guess_board(dev, &tmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003624 if (rc)
3625 goto disable;
3626 } else {
3627 /*
3628 * We matched an explicit entry. If we are able to
3629 * detect this boards settings with our heuristic,
3630 * then we no longer need this entry.
3631 */
Russell King1c7c1fe2005-07-27 11:31:19 +01003632 memcpy(&tmp, &pci_boards[pbn_default],
3633 sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07003634 rc = serial_pci_guess_board(dev, &tmp);
3635 if (rc == 0 && serial_pci_matches(board, &tmp))
3636 moan_device("Redundant entry in serial pci_table.",
3637 dev);
3638 }
3639
Russell King241fc432005-07-27 11:35:54 +01003640 priv = pciserial_init_ports(dev, board);
3641 if (!IS_ERR(priv)) {
3642 pci_set_drvdata(dev, priv);
3643 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003644 }
3645
Russell King241fc432005-07-27 11:35:54 +01003646 rc = PTR_ERR(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003647
Linus Torvalds1da177e2005-04-16 15:20:36 -07003648 disable:
3649 pci_disable_device(dev);
3650 return rc;
3651}
3652
Bill Pembertonae8d8a12012-11-19 13:26:18 -05003653static void pciserial_remove_one(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003654{
3655 struct serial_private *priv = pci_get_drvdata(dev);
3656
Russell King241fc432005-07-27 11:35:54 +01003657 pciserial_remove_ports(priv);
Russell King056a8762005-07-22 10:15:04 +01003658
3659 pci_disable_device(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003660}
3661
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07003662#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07003663static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
3664{
3665 struct serial_private *priv = pci_get_drvdata(dev);
3666
Russell King241fc432005-07-27 11:35:54 +01003667 if (priv)
3668 pciserial_suspend_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003669
Linus Torvalds1da177e2005-04-16 15:20:36 -07003670 pci_save_state(dev);
3671 pci_set_power_state(dev, pci_choose_state(dev, state));
3672 return 0;
3673}
3674
3675static int pciserial_resume_one(struct pci_dev *dev)
3676{
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003677 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003678 struct serial_private *priv = pci_get_drvdata(dev);
3679
3680 pci_set_power_state(dev, PCI_D0);
3681 pci_restore_state(dev);
3682
3683 if (priv) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003684 /*
3685 * The device may have been disabled. Re-enable it.
3686 */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003687 err = pci_enable_device(dev);
Alan Cox40836c42008-10-13 10:36:11 +01003688 /* FIXME: We cannot simply error out here */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07003689 if (err)
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07003690 dev_err(&dev->dev, "Unable to re-enable ports, trying to continue.\n");
Russell King241fc432005-07-27 11:35:54 +01003691 pciserial_resume_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003692 }
3693 return 0;
3694}
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07003695#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07003696
3697static struct pci_device_id serial_pci_tbl[] = {
Michael Bramer78d70d42009-01-27 11:51:16 +00003698 /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
3699 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
3700 PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
3701 pbn_b2_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003702 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3703 PCI_SUBVENDOR_ID_CONNECT_TECH,
3704 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3705 pbn_b1_8_1382400 },
3706 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3707 PCI_SUBVENDOR_ID_CONNECT_TECH,
3708 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3709 pbn_b1_4_1382400 },
3710 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3711 PCI_SUBVENDOR_ID_CONNECT_TECH,
3712 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3713 pbn_b1_2_1382400 },
3714 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3715 PCI_SUBVENDOR_ID_CONNECT_TECH,
3716 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3717 pbn_b1_8_1382400 },
3718 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3719 PCI_SUBVENDOR_ID_CONNECT_TECH,
3720 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3721 pbn_b1_4_1382400 },
3722 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3723 PCI_SUBVENDOR_ID_CONNECT_TECH,
3724 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3725 pbn_b1_2_1382400 },
3726 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3727 PCI_SUBVENDOR_ID_CONNECT_TECH,
3728 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
3729 pbn_b1_8_921600 },
3730 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3731 PCI_SUBVENDOR_ID_CONNECT_TECH,
3732 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
3733 pbn_b1_8_921600 },
3734 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3735 PCI_SUBVENDOR_ID_CONNECT_TECH,
3736 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
3737 pbn_b1_4_921600 },
3738 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3739 PCI_SUBVENDOR_ID_CONNECT_TECH,
3740 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
3741 pbn_b1_4_921600 },
3742 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3743 PCI_SUBVENDOR_ID_CONNECT_TECH,
3744 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
3745 pbn_b1_2_921600 },
3746 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3747 PCI_SUBVENDOR_ID_CONNECT_TECH,
3748 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
3749 pbn_b1_8_921600 },
3750 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3751 PCI_SUBVENDOR_ID_CONNECT_TECH,
3752 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
3753 pbn_b1_8_921600 },
3754 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3755 PCI_SUBVENDOR_ID_CONNECT_TECH,
3756 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
3757 pbn_b1_4_921600 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003758 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3759 PCI_SUBVENDOR_ID_CONNECT_TECH,
3760 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
3761 pbn_b1_2_1250000 },
3762 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3763 PCI_SUBVENDOR_ID_CONNECT_TECH,
3764 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
3765 pbn_b0_2_1843200 },
3766 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3767 PCI_SUBVENDOR_ID_CONNECT_TECH,
3768 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
3769 pbn_b0_4_1843200 },
Yoichi Yuasa85d14942006-02-08 21:46:24 +00003770 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3771 PCI_VENDOR_ID_AFAVLAB,
3772 PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
3773 pbn_b0_4_1152000 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003774 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3775 PCI_SUBVENDOR_ID_CONNECT_TECH,
3776 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232, 0, 0,
3777 pbn_b0_2_1843200_200 },
3778 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3779 PCI_SUBVENDOR_ID_CONNECT_TECH,
3780 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232, 0, 0,
3781 pbn_b0_4_1843200_200 },
3782 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3783 PCI_SUBVENDOR_ID_CONNECT_TECH,
3784 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232, 0, 0,
3785 pbn_b0_8_1843200_200 },
3786 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3787 PCI_SUBVENDOR_ID_CONNECT_TECH,
3788 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1, 0, 0,
3789 pbn_b0_2_1843200_200 },
3790 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3791 PCI_SUBVENDOR_ID_CONNECT_TECH,
3792 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2, 0, 0,
3793 pbn_b0_4_1843200_200 },
3794 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3795 PCI_SUBVENDOR_ID_CONNECT_TECH,
3796 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4, 0, 0,
3797 pbn_b0_8_1843200_200 },
3798 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3799 PCI_SUBVENDOR_ID_CONNECT_TECH,
3800 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2, 0, 0,
3801 pbn_b0_2_1843200_200 },
3802 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3803 PCI_SUBVENDOR_ID_CONNECT_TECH,
3804 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4, 0, 0,
3805 pbn_b0_4_1843200_200 },
3806 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3807 PCI_SUBVENDOR_ID_CONNECT_TECH,
3808 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8, 0, 0,
3809 pbn_b0_8_1843200_200 },
3810 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3811 PCI_SUBVENDOR_ID_CONNECT_TECH,
3812 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485, 0, 0,
3813 pbn_b0_2_1843200_200 },
3814 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
3815 PCI_SUBVENDOR_ID_CONNECT_TECH,
3816 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485, 0, 0,
3817 pbn_b0_4_1843200_200 },
3818 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
3819 PCI_SUBVENDOR_ID_CONNECT_TECH,
3820 PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
3821 pbn_b0_8_1843200_200 },
Benjamin Herrenschmidtc68d2b12009-10-26 16:50:05 -07003822 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
3823 PCI_VENDOR_ID_IBM, PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT,
3824 0, 0, pbn_exar_ibm_saturn },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003825
3826 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
Alan Cox5756ee92008-02-08 04:18:51 -08003827 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003828 pbn_b2_bt_1_115200 },
3829 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
Alan Cox5756ee92008-02-08 04:18:51 -08003830 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003831 pbn_b2_bt_2_115200 },
3832 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
Alan Cox5756ee92008-02-08 04:18:51 -08003833 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003834 pbn_b2_bt_4_115200 },
3835 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
Alan Cox5756ee92008-02-08 04:18:51 -08003836 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003837 pbn_b2_bt_2_115200 },
3838 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
Alan Cox5756ee92008-02-08 04:18:51 -08003839 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003840 pbn_b2_bt_4_115200 },
3841 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
Alan Cox5756ee92008-02-08 04:18:51 -08003842 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003843 pbn_b2_8_115200 },
Flavio Leitnere65f0f82009-01-02 13:50:43 +00003844 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
3845 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3846 pbn_b2_8_460800 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003847 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
3848 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3849 pbn_b2_8_115200 },
3850
3851 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
3852 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3853 pbn_b2_bt_2_115200 },
3854 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
3855 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3856 pbn_b2_bt_2_921600 },
3857 /*
3858 * VScom SPCOM800, from sl@s.pl
3859 */
Alan Cox5756ee92008-02-08 04:18:51 -08003860 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
3861 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003862 pbn_b2_8_921600 },
3863 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
Alan Cox5756ee92008-02-08 04:18:51 -08003864 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003865 pbn_b2_4_921600 },
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07003866 /* Unknown card - subdevice 0x1584 */
3867 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3868 PCI_VENDOR_ID_PLX,
3869 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
Scott Ashcroftd13402a2013-03-03 21:35:06 +00003870 pbn_b2_4_115200 },
3871 /* Unknown card - subdevice 0x1588 */
3872 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3873 PCI_VENDOR_ID_PLX,
3874 PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
3875 pbn_b2_8_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003876 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3877 PCI_SUBVENDOR_ID_KEYSPAN,
3878 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
3879 pbn_panacom },
3880 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
3881 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3882 pbn_panacom4 },
3883 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
3884 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3885 pbn_panacom2 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08003886 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
3887 PCI_VENDOR_ID_ESDGMBH,
3888 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
3889 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003890 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3891 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003892 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003893 pbn_b2_4_460800 },
3894 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3895 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003896 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003897 pbn_b2_8_460800 },
3898 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3899 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003900 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003901 pbn_b2_16_460800 },
3902 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3903 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08003904 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003905 pbn_b2_16_460800 },
3906 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3907 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08003908 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003909 pbn_b2_4_460800 },
3910 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3911 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08003912 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003913 pbn_b2_8_460800 },
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01003914 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3915 PCI_SUBVENDOR_ID_EXSYS,
3916 PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
Shawn Bohreree4cd1b2012-05-28 15:20:47 -05003917 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003918 /*
3919 * Megawolf Romulus PCI Serial Card, from Mike Hudson
3920 * (Exoray@isys.ca)
3921 */
3922 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
3923 0x10b5, 0x106a, 0, 0,
3924 pbn_plx_romulus },
Alan Cox55c7c0f2012-11-29 09:03:00 +10303925 /*
3926 * Quatech cards. These actually have configurable clocks but for
3927 * now we just use the default.
3928 *
3929 * 100 series are RS232, 200 series RS422,
3930 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003931 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
3932 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3933 pbn_b1_4_115200 },
3934 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
3935 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3936 pbn_b1_2_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10303937 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100E,
3938 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3939 pbn_b2_2_115200 },
3940 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200,
3941 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3942 pbn_b1_2_115200 },
3943 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200E,
3944 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3945 pbn_b2_2_115200 },
3946 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC200,
3947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3948 pbn_b1_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003949 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
3950 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3951 pbn_b1_8_115200 },
3952 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
3953 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3954 pbn_b1_8_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10303955 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP100,
3956 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3957 pbn_b1_4_115200 },
3958 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP100,
3959 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3960 pbn_b1_2_115200 },
3961 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP200,
3962 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3963 pbn_b1_4_115200 },
3964 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP200,
3965 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3966 pbn_b1_2_115200 },
3967 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP100,
3968 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3969 pbn_b2_4_115200 },
3970 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP100,
3971 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3972 pbn_b2_2_115200 },
3973 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP100,
3974 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3975 pbn_b2_1_115200 },
3976 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP200,
3977 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3978 pbn_b2_4_115200 },
3979 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP200,
3980 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3981 pbn_b2_2_115200 },
3982 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP200,
3983 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3984 pbn_b2_1_115200 },
3985 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESCLP100,
3986 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3987 pbn_b0_8_115200 },
3988
Linus Torvalds1da177e2005-04-16 15:20:36 -07003989 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08003990 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
3991 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003992 pbn_b0_4_921600 },
3993 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08003994 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
3995 0, 0,
Andrey Paninfbc0dc02005-07-18 11:38:09 +01003996 pbn_b0_4_1152000 },
Mikulas Patockac9bd9d02010-10-26 14:20:48 -04003997 { PCI_VENDOR_ID_OXSEMI, 0x9505,
3998 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3999 pbn_b0_bt_2_921600 },
David Ransondb1de152005-07-27 11:43:55 -07004000
4001 /*
4002 * The below card is a little controversial since it is the
4003 * subject of a PCI vendor/device ID clash. (See
4004 * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
4005 * For now just used the hex ID 0x950a.
4006 */
4007 { PCI_VENDOR_ID_OXSEMI, 0x950a,
Flavio Leitner26e82202012-09-21 21:04:34 -03004008 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_00,
4009 0, 0, pbn_b0_2_115200 },
4010 { PCI_VENDOR_ID_OXSEMI, 0x950a,
4011 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_30,
4012 0, 0, pbn_b0_2_115200 },
Niels de Vos39aced62009-01-02 13:46:58 +00004013 { PCI_VENDOR_ID_OXSEMI, 0x950a,
David Ransondb1de152005-07-27 11:43:55 -07004014 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4015 pbn_b0_2_1130000 },
Andre Przywara70fd8fd2009-06-11 12:41:57 +01004016 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_C950,
4017 PCI_VENDOR_ID_OXSEMI, PCI_SUBDEVICE_ID_OXSEMI_C950, 0, 0,
4018 pbn_b0_1_921600 },
Andrey Paninfbc0dc02005-07-18 11:38:09 +01004019 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004020 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4021 pbn_b0_4_115200 },
4022 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
4023 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4024 pbn_b0_bt_2_921600 },
Lytochkin Borise8470032010-07-26 10:02:26 +04004025 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
4026 PCI_ANY_ID , PCI_ANY_ID, 0, 0,
4027 pbn_b2_8_1152000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004028
4029 /*
Lee Howard7106b4e2008-10-21 13:48:58 +01004030 * Oxford Semiconductor Inc. Tornado PCI express device range.
4031 */
4032 { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
4033 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4034 pbn_b0_1_4000000 },
4035 { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
4036 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4037 pbn_b0_1_4000000 },
4038 { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
4039 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4040 pbn_oxsemi_1_4000000 },
4041 { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
4042 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4043 pbn_oxsemi_1_4000000 },
4044 { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
4045 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4046 pbn_b0_1_4000000 },
4047 { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
4048 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4049 pbn_b0_1_4000000 },
4050 { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
4051 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4052 pbn_oxsemi_1_4000000 },
4053 { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
4054 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4055 pbn_oxsemi_1_4000000 },
4056 { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
4057 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4058 pbn_b0_1_4000000 },
4059 { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
4060 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4061 pbn_b0_1_4000000 },
4062 { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
4063 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4064 pbn_b0_1_4000000 },
4065 { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
4066 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4067 pbn_b0_1_4000000 },
4068 { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
4069 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4070 pbn_oxsemi_2_4000000 },
4071 { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
4072 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4073 pbn_oxsemi_2_4000000 },
4074 { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
4075 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4076 pbn_oxsemi_4_4000000 },
4077 { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
4078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4079 pbn_oxsemi_4_4000000 },
4080 { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
4081 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4082 pbn_oxsemi_8_4000000 },
4083 { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
4084 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4085 pbn_oxsemi_8_4000000 },
4086 { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
4087 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4088 pbn_oxsemi_1_4000000 },
4089 { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
4090 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4091 pbn_oxsemi_1_4000000 },
4092 { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
4093 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4094 pbn_oxsemi_1_4000000 },
4095 { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
4096 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4097 pbn_oxsemi_1_4000000 },
4098 { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
4099 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4100 pbn_oxsemi_1_4000000 },
4101 { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
4102 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4103 pbn_oxsemi_1_4000000 },
4104 { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
4105 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4106 pbn_oxsemi_1_4000000 },
4107 { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
4108 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4109 pbn_oxsemi_1_4000000 },
4110 { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
4111 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4112 pbn_oxsemi_1_4000000 },
4113 { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
4114 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4115 pbn_oxsemi_1_4000000 },
4116 { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
4117 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4118 pbn_oxsemi_1_4000000 },
4119 { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
4120 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4121 pbn_oxsemi_1_4000000 },
4122 { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
4123 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4124 pbn_oxsemi_1_4000000 },
4125 { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
4126 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4127 pbn_oxsemi_1_4000000 },
4128 { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
4129 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4130 pbn_oxsemi_1_4000000 },
4131 { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
4132 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4133 pbn_oxsemi_1_4000000 },
4134 { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
4135 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4136 pbn_oxsemi_1_4000000 },
4137 { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
4138 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4139 pbn_oxsemi_1_4000000 },
4140 { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
4141 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4142 pbn_oxsemi_1_4000000 },
4143 { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
4144 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4145 pbn_oxsemi_1_4000000 },
4146 { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
4147 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4148 pbn_oxsemi_1_4000000 },
4149 { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
4150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4151 pbn_oxsemi_1_4000000 },
4152 { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
4153 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4154 pbn_oxsemi_1_4000000 },
4155 { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
4156 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4157 pbn_oxsemi_1_4000000 },
4158 { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
4159 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4160 pbn_oxsemi_1_4000000 },
4161 { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
4162 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4163 pbn_oxsemi_1_4000000 },
Lee Howardb80de362008-10-21 13:50:14 +01004164 /*
4165 * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
4166 */
4167 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
4168 PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
4169 pbn_oxsemi_1_4000000 },
4170 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
4171 PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
4172 pbn_oxsemi_2_4000000 },
4173 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
4174 PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
4175 pbn_oxsemi_4_4000000 },
4176 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
4177 PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
4178 pbn_oxsemi_8_4000000 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05004179
4180 /*
4181 * Digi/IBM PCIe 2-port Async EIA-232 Adapter utilizing OxSemi Tornado
4182 */
4183 { PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
4184 PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
4185 pbn_oxsemi_2_4000000 },
4186
Lee Howard7106b4e2008-10-21 13:48:58 +01004187 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004188 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
4189 * from skokodyn@yahoo.com
4190 */
4191 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4192 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
4193 pbn_sbsxrsio },
4194 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4195 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
4196 pbn_sbsxrsio },
4197 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4198 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
4199 pbn_sbsxrsio },
4200 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4201 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
4202 pbn_sbsxrsio },
4203
4204 /*
4205 * Digitan DS560-558, from jimd@esoft.com
4206 */
4207 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
Alan Cox5756ee92008-02-08 04:18:51 -08004208 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004209 pbn_b1_1_115200 },
4210
4211 /*
4212 * Titan Electronic cards
4213 * The 400L and 800L have a custom setup quirk.
4214 */
4215 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
Alan Cox5756ee92008-02-08 04:18:51 -08004216 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004217 pbn_b0_1_921600 },
4218 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
Alan Cox5756ee92008-02-08 04:18:51 -08004219 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004220 pbn_b0_2_921600 },
4221 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
Alan Cox5756ee92008-02-08 04:18:51 -08004222 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004223 pbn_b0_4_921600 },
4224 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
Alan Cox5756ee92008-02-08 04:18:51 -08004225 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004226 pbn_b0_4_921600 },
4227 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
4228 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4229 pbn_b1_1_921600 },
4230 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
4231 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4232 pbn_b1_bt_2_921600 },
4233 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
4234 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4235 pbn_b0_bt_4_921600 },
4236 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
4237 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4238 pbn_b0_bt_8_921600 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004239 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200I,
4240 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4241 pbn_b4_bt_2_921600 },
4242 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400I,
4243 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4244 pbn_b4_bt_4_921600 },
4245 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800I,
4246 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4247 pbn_b4_bt_8_921600 },
4248 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400EH,
4249 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4250 pbn_b0_4_921600 },
4251 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EH,
4252 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4253 pbn_b0_4_921600 },
4254 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EHB,
4255 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4256 pbn_b0_4_921600 },
4257 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
4258 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4259 pbn_oxsemi_1_4000000 },
4260 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
4261 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4262 pbn_oxsemi_2_4000000 },
4263 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
4264 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4265 pbn_oxsemi_4_4000000 },
4266 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
4267 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4268 pbn_oxsemi_8_4000000 },
4269 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
4270 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4271 pbn_oxsemi_2_4000000 },
4272 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
4273 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4274 pbn_oxsemi_2_4000000 },
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01004275 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
4276 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4277 pbn_b0_4_921600 },
4278 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_410V3,
4279 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4280 pbn_b0_4_921600 },
4281 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3,
4282 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4283 pbn_b0_4_921600 },
4284 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3B,
4285 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4286 pbn_b0_4_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004287
4288 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
4289 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4290 pbn_b2_1_460800 },
4291 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
4292 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4293 pbn_b2_1_460800 },
4294 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
4295 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4296 pbn_b2_1_460800 },
4297 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
4298 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4299 pbn_b2_bt_2_921600 },
4300 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
4301 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4302 pbn_b2_bt_2_921600 },
4303 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
4304 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4305 pbn_b2_bt_2_921600 },
4306 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
4307 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4308 pbn_b2_bt_4_921600 },
4309 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
4310 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4311 pbn_b2_bt_4_921600 },
4312 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
4313 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4314 pbn_b2_bt_4_921600 },
4315 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
4316 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4317 pbn_b0_1_921600 },
4318 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
4319 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4320 pbn_b0_1_921600 },
4321 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
4322 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4323 pbn_b0_1_921600 },
4324 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
4325 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4326 pbn_b0_bt_2_921600 },
4327 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
4328 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4329 pbn_b0_bt_2_921600 },
4330 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
4331 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4332 pbn_b0_bt_2_921600 },
4333 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
4334 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4335 pbn_b0_bt_4_921600 },
4336 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
4337 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4338 pbn_b0_bt_4_921600 },
4339 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
4340 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4341 pbn_b0_bt_4_921600 },
Andrey Panin3ec9c592006-02-02 20:15:09 +00004342 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
4343 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4344 pbn_b0_bt_8_921600 },
4345 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
4346 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4347 pbn_b0_bt_8_921600 },
4348 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
4349 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4350 pbn_b0_bt_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004351
4352 /*
4353 * Computone devices submitted by Doug McNash dmcnash@computone.com
4354 */
4355 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4356 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
4357 0, 0, pbn_computone_4 },
4358 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4359 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
4360 0, 0, pbn_computone_8 },
4361 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4362 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
4363 0, 0, pbn_computone_6 },
4364
4365 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
4366 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4367 pbn_oxsemi },
4368 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
4369 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
4370 pbn_b0_bt_1_921600 },
4371
4372 /*
Stephen Chiversabd7bac2013-01-28 19:49:20 +11004373 * SUNIX (TIMEDIA)
4374 */
4375 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4376 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4377 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00,
4378 pbn_b0_bt_1_921600 },
4379
4380 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4381 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4382 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
4383 pbn_b0_bt_1_921600 },
4384
4385 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004386 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
4387 */
4388 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
4389 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4390 pbn_b0_bt_8_115200 },
4391 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
4392 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4393 pbn_b0_bt_8_115200 },
4394
4395 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
4396 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4397 pbn_b0_bt_2_115200 },
4398 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
4399 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4400 pbn_b0_bt_2_115200 },
4401 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
4402 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4403 pbn_b0_bt_2_115200 },
Lennert Buytenhekb87e5e22009-11-11 14:26:42 -08004404 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
4405 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4406 pbn_b0_bt_2_115200 },
4407 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
4408 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4409 pbn_b0_bt_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004410 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
4411 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4412 pbn_b0_bt_4_460800 },
4413 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
4414 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4415 pbn_b0_bt_4_460800 },
4416 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
4417 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4418 pbn_b0_bt_2_460800 },
4419 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
4420 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4421 pbn_b0_bt_2_460800 },
4422 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
4423 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4424 pbn_b0_bt_2_460800 },
4425 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
4426 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4427 pbn_b0_bt_1_115200 },
4428 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
4429 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4430 pbn_b0_bt_1_460800 },
4431
4432 /*
Russell King1fb8cac2006-12-13 14:45:46 +00004433 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
4434 * Cards are identified by their subsystem vendor IDs, which
4435 * (in hex) match the model number.
4436 *
4437 * Note that JC140x are RS422/485 cards which require ox950
4438 * ACR = 0x10, and as such are not currently fully supported.
4439 */
4440 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4441 0x1204, 0x0004, 0, 0,
4442 pbn_b0_4_921600 },
4443 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4444 0x1208, 0x0004, 0, 0,
4445 pbn_b0_4_921600 },
4446/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4447 0x1402, 0x0002, 0, 0,
4448 pbn_b0_2_921600 }, */
4449/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4450 0x1404, 0x0004, 0, 0,
4451 pbn_b0_4_921600 }, */
4452 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
4453 0x1208, 0x0004, 0, 0,
4454 pbn_b0_4_921600 },
4455
Kiros Yeh2a52fcb2009-12-21 16:26:48 -08004456 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4457 0x1204, 0x0004, 0, 0,
4458 pbn_b0_4_921600 },
4459 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4460 0x1208, 0x0004, 0, 0,
4461 pbn_b0_4_921600 },
4462 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF3,
4463 0x1208, 0x0004, 0, 0,
4464 pbn_b0_4_921600 },
Russell King1fb8cac2006-12-13 14:45:46 +00004465 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004466 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
4467 */
4468 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
4469 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4470 pbn_b1_1_1382400 },
4471
4472 /*
4473 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
4474 */
4475 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
4476 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4477 pbn_b1_1_1382400 },
4478
4479 /*
4480 * RAStel 2 port modem, gerg@moreton.com.au
4481 */
4482 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
4483 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4484 pbn_b2_bt_2_115200 },
4485
4486 /*
4487 * EKF addition for i960 Boards form EKF with serial port
4488 */
4489 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
4490 0xE4BF, PCI_ANY_ID, 0, 0,
4491 pbn_intel_i960 },
4492
4493 /*
4494 * Xircom Cardbus/Ethernet combos
4495 */
4496 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
4497 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4498 pbn_b0_1_115200 },
4499 /*
4500 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
4501 */
4502 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
4503 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4504 pbn_b0_1_115200 },
4505
4506 /*
4507 * Untested PCI modems, sent in from various folks...
4508 */
4509
4510 /*
4511 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
4512 */
4513 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
4514 0x1048, 0x1500, 0, 0,
4515 pbn_b1_1_115200 },
4516
4517 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
4518 0xFF00, 0, 0, 0,
4519 pbn_sgi_ioc3 },
4520
4521 /*
4522 * HP Diva card
4523 */
4524 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4525 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
4526 pbn_b1_1_115200 },
4527 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4528 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4529 pbn_b0_5_115200 },
4530 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
4531 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4532 pbn_b2_1_115200 },
4533
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00004534 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
4535 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4536 pbn_b3_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004537 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
4538 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4539 pbn_b3_4_115200 },
4540 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
4541 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4542 pbn_b3_8_115200 },
4543
4544 /*
4545 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
4546 */
4547 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
4548 PCI_ANY_ID, PCI_ANY_ID,
4549 0,
4550 0, pbn_exar_XR17C152 },
4551 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
4552 PCI_ANY_ID, PCI_ANY_ID,
4553 0,
4554 0, pbn_exar_XR17C154 },
4555 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
4556 PCI_ANY_ID, PCI_ANY_ID,
4557 0,
4558 0, pbn_exar_XR17C158 },
Matt Schultedc96efb2012-11-19 09:12:04 -06004559 /*
4560 * Exar Corp. XR17V35[248] Dual/Quad/Octal PCIe UARTs
4561 */
4562 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V352,
4563 PCI_ANY_ID, PCI_ANY_ID,
4564 0,
4565 0, pbn_exar_XR17V352 },
4566 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V354,
4567 PCI_ANY_ID, PCI_ANY_ID,
4568 0,
4569 0, pbn_exar_XR17V354 },
4570 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V358,
4571 PCI_ANY_ID, PCI_ANY_ID,
4572 0,
4573 0, pbn_exar_XR17V358 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004574
4575 /*
4576 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
4577 */
4578 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
4579 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4580 pbn_b0_1_115200 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07004581 /*
4582 * ITE
4583 */
4584 { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
4585 PCI_ANY_ID, PCI_ANY_ID,
4586 0, 0,
4587 pbn_b1_bt_1_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004588
4589 /*
Peter Horton737c1752006-08-26 09:07:36 +01004590 * IntaShield IS-200
4591 */
4592 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
4593 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
4594 pbn_b2_2_115200 },
Ignacio García Pérez4b6f6ce2008-05-23 13:04:28 -07004595 /*
4596 * IntaShield IS-400
4597 */
4598 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
4599 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
4600 pbn_b2_4_115200 },
Peter Horton737c1752006-08-26 09:07:36 +01004601 /*
Thomas Hoehn48212002007-02-10 01:46:05 -08004602 * Perle PCI-RAS cards
4603 */
4604 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4605 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
4606 0, 0, pbn_b2_4_921600 },
4607 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4608 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
4609 0, 0, pbn_b2_8_921600 },
Alan Coxbf0df632007-10-16 01:24:00 -07004610
4611 /*
4612 * Mainpine series cards: Fairly standard layout but fools
4613 * parts of the autodetect in some cases and uses otherwise
4614 * unmatched communications subclasses in the PCI Express case
4615 */
4616
4617 { /* RockForceDUO */
4618 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4619 PCI_VENDOR_ID_MAINPINE, 0x0200,
4620 0, 0, pbn_b0_2_115200 },
4621 { /* RockForceQUATRO */
4622 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4623 PCI_VENDOR_ID_MAINPINE, 0x0300,
4624 0, 0, pbn_b0_4_115200 },
4625 { /* RockForceDUO+ */
4626 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4627 PCI_VENDOR_ID_MAINPINE, 0x0400,
4628 0, 0, pbn_b0_2_115200 },
4629 { /* RockForceQUATRO+ */
4630 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4631 PCI_VENDOR_ID_MAINPINE, 0x0500,
4632 0, 0, pbn_b0_4_115200 },
4633 { /* RockForce+ */
4634 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4635 PCI_VENDOR_ID_MAINPINE, 0x0600,
4636 0, 0, pbn_b0_2_115200 },
4637 { /* RockForce+ */
4638 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4639 PCI_VENDOR_ID_MAINPINE, 0x0700,
4640 0, 0, pbn_b0_4_115200 },
4641 { /* RockForceOCTO+ */
4642 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4643 PCI_VENDOR_ID_MAINPINE, 0x0800,
4644 0, 0, pbn_b0_8_115200 },
4645 { /* RockForceDUO+ */
4646 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4647 PCI_VENDOR_ID_MAINPINE, 0x0C00,
4648 0, 0, pbn_b0_2_115200 },
4649 { /* RockForceQUARTRO+ */
4650 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4651 PCI_VENDOR_ID_MAINPINE, 0x0D00,
4652 0, 0, pbn_b0_4_115200 },
4653 { /* RockForceOCTO+ */
4654 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4655 PCI_VENDOR_ID_MAINPINE, 0x1D00,
4656 0, 0, pbn_b0_8_115200 },
4657 { /* RockForceD1 */
4658 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4659 PCI_VENDOR_ID_MAINPINE, 0x2000,
4660 0, 0, pbn_b0_1_115200 },
4661 { /* RockForceF1 */
4662 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4663 PCI_VENDOR_ID_MAINPINE, 0x2100,
4664 0, 0, pbn_b0_1_115200 },
4665 { /* RockForceD2 */
4666 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4667 PCI_VENDOR_ID_MAINPINE, 0x2200,
4668 0, 0, pbn_b0_2_115200 },
4669 { /* RockForceF2 */
4670 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4671 PCI_VENDOR_ID_MAINPINE, 0x2300,
4672 0, 0, pbn_b0_2_115200 },
4673 { /* RockForceD4 */
4674 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4675 PCI_VENDOR_ID_MAINPINE, 0x2400,
4676 0, 0, pbn_b0_4_115200 },
4677 { /* RockForceF4 */
4678 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4679 PCI_VENDOR_ID_MAINPINE, 0x2500,
4680 0, 0, pbn_b0_4_115200 },
4681 { /* RockForceD8 */
4682 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4683 PCI_VENDOR_ID_MAINPINE, 0x2600,
4684 0, 0, pbn_b0_8_115200 },
4685 { /* RockForceF8 */
4686 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4687 PCI_VENDOR_ID_MAINPINE, 0x2700,
4688 0, 0, pbn_b0_8_115200 },
4689 { /* IQ Express D1 */
4690 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4691 PCI_VENDOR_ID_MAINPINE, 0x3000,
4692 0, 0, pbn_b0_1_115200 },
4693 { /* IQ Express F1 */
4694 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4695 PCI_VENDOR_ID_MAINPINE, 0x3100,
4696 0, 0, pbn_b0_1_115200 },
4697 { /* IQ Express D2 */
4698 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4699 PCI_VENDOR_ID_MAINPINE, 0x3200,
4700 0, 0, pbn_b0_2_115200 },
4701 { /* IQ Express F2 */
4702 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4703 PCI_VENDOR_ID_MAINPINE, 0x3300,
4704 0, 0, pbn_b0_2_115200 },
4705 { /* IQ Express D4 */
4706 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4707 PCI_VENDOR_ID_MAINPINE, 0x3400,
4708 0, 0, pbn_b0_4_115200 },
4709 { /* IQ Express F4 */
4710 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4711 PCI_VENDOR_ID_MAINPINE, 0x3500,
4712 0, 0, pbn_b0_4_115200 },
4713 { /* IQ Express D8 */
4714 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4715 PCI_VENDOR_ID_MAINPINE, 0x3C00,
4716 0, 0, pbn_b0_8_115200 },
4717 { /* IQ Express F8 */
4718 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4719 PCI_VENDOR_ID_MAINPINE, 0x3D00,
4720 0, 0, pbn_b0_8_115200 },
4721
4722
Thomas Hoehn48212002007-02-10 01:46:05 -08004723 /*
Olof Johanssonaa798502007-08-22 14:01:55 -07004724 * PA Semi PA6T-1682M on-chip UART
4725 */
4726 { PCI_VENDOR_ID_PASEMI, 0xa004,
4727 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4728 pbn_pasemi_1682M },
4729
4730 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01004731 * National Instruments
4732 */
Will Page04bf7e72009-04-06 17:32:15 +01004733 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
4734 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4735 pbn_b1_16_115200 },
4736 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
4737 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4738 pbn_b1_8_115200 },
4739 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
4740 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4741 pbn_b1_bt_4_115200 },
4742 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
4743 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4744 pbn_b1_bt_2_115200 },
4745 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
4746 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4747 pbn_b1_bt_4_115200 },
4748 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
4749 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4750 pbn_b1_bt_2_115200 },
4751 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
4752 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4753 pbn_b1_16_115200 },
4754 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
4755 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4756 pbn_b1_8_115200 },
4757 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
4758 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4759 pbn_b1_bt_4_115200 },
4760 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
4761 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4762 pbn_b1_bt_2_115200 },
4763 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
4764 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4765 pbn_b1_bt_4_115200 },
4766 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
4767 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4768 pbn_b1_bt_2_115200 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01004769 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
4770 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4771 pbn_ni8430_2 },
4772 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
4773 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4774 pbn_ni8430_2 },
4775 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
4776 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4777 pbn_ni8430_4 },
4778 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
4779 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4780 pbn_ni8430_4 },
4781 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
4782 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4783 pbn_ni8430_8 },
4784 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
4785 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4786 pbn_ni8430_8 },
4787 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
4788 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4789 pbn_ni8430_16 },
4790 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
4791 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4792 pbn_ni8430_16 },
4793 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
4794 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4795 pbn_ni8430_2 },
4796 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
4797 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4798 pbn_ni8430_2 },
4799 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
4800 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4801 pbn_ni8430_4 },
4802 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
4803 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4804 pbn_ni8430_4 },
4805
4806 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08004807 * ADDI-DATA GmbH communication cards <info@addi-data.com>
4808 */
4809 { PCI_VENDOR_ID_ADDIDATA,
4810 PCI_DEVICE_ID_ADDIDATA_APCI7500,
4811 PCI_ANY_ID,
4812 PCI_ANY_ID,
4813 0,
4814 0,
4815 pbn_b0_4_115200 },
4816
4817 { PCI_VENDOR_ID_ADDIDATA,
4818 PCI_DEVICE_ID_ADDIDATA_APCI7420,
4819 PCI_ANY_ID,
4820 PCI_ANY_ID,
4821 0,
4822 0,
4823 pbn_b0_2_115200 },
4824
4825 { PCI_VENDOR_ID_ADDIDATA,
4826 PCI_DEVICE_ID_ADDIDATA_APCI7300,
4827 PCI_ANY_ID,
4828 PCI_ANY_ID,
4829 0,
4830 0,
4831 pbn_b0_1_115200 },
4832
Ian Abbott086231f2013-07-16 16:14:39 +01004833 { PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01004834 PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08004835 PCI_ANY_ID,
4836 PCI_ANY_ID,
4837 0,
4838 0,
4839 pbn_b1_8_115200 },
4840
4841 { PCI_VENDOR_ID_ADDIDATA,
4842 PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
4843 PCI_ANY_ID,
4844 PCI_ANY_ID,
4845 0,
4846 0,
4847 pbn_b0_4_115200 },
4848
4849 { PCI_VENDOR_ID_ADDIDATA,
4850 PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
4851 PCI_ANY_ID,
4852 PCI_ANY_ID,
4853 0,
4854 0,
4855 pbn_b0_2_115200 },
4856
4857 { PCI_VENDOR_ID_ADDIDATA,
4858 PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
4859 PCI_ANY_ID,
4860 PCI_ANY_ID,
4861 0,
4862 0,
4863 pbn_b0_1_115200 },
4864
4865 { PCI_VENDOR_ID_ADDIDATA,
4866 PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
4867 PCI_ANY_ID,
4868 PCI_ANY_ID,
4869 0,
4870 0,
4871 pbn_b0_4_115200 },
4872
4873 { PCI_VENDOR_ID_ADDIDATA,
4874 PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
4875 PCI_ANY_ID,
4876 PCI_ANY_ID,
4877 0,
4878 0,
4879 pbn_b0_2_115200 },
4880
4881 { PCI_VENDOR_ID_ADDIDATA,
4882 PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
4883 PCI_ANY_ID,
4884 PCI_ANY_ID,
4885 0,
4886 0,
4887 pbn_b0_1_115200 },
4888
4889 { PCI_VENDOR_ID_ADDIDATA,
4890 PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
4891 PCI_ANY_ID,
4892 PCI_ANY_ID,
4893 0,
4894 0,
4895 pbn_b0_8_115200 },
4896
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07004897 { PCI_VENDOR_ID_ADDIDATA,
4898 PCI_DEVICE_ID_ADDIDATA_APCIe7500,
4899 PCI_ANY_ID,
4900 PCI_ANY_ID,
4901 0,
4902 0,
4903 pbn_ADDIDATA_PCIe_4_3906250 },
4904
4905 { PCI_VENDOR_ID_ADDIDATA,
4906 PCI_DEVICE_ID_ADDIDATA_APCIe7420,
4907 PCI_ANY_ID,
4908 PCI_ANY_ID,
4909 0,
4910 0,
4911 pbn_ADDIDATA_PCIe_2_3906250 },
4912
4913 { PCI_VENDOR_ID_ADDIDATA,
4914 PCI_DEVICE_ID_ADDIDATA_APCIe7300,
4915 PCI_ANY_ID,
4916 PCI_ANY_ID,
4917 0,
4918 0,
4919 pbn_ADDIDATA_PCIe_1_3906250 },
4920
4921 { PCI_VENDOR_ID_ADDIDATA,
4922 PCI_DEVICE_ID_ADDIDATA_APCIe7800,
4923 PCI_ANY_ID,
4924 PCI_ANY_ID,
4925 0,
4926 0,
4927 pbn_ADDIDATA_PCIe_8_3906250 },
4928
Jiri Slaby25cf9bc2009-01-15 13:30:34 +00004929 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
4930 PCI_VENDOR_ID_IBM, 0x0299,
4931 0, 0, pbn_b0_bt_2_115200 },
4932
Stefan Seyfried972ce082013-07-01 09:14:21 +02004933 /*
4934 * other NetMos 9835 devices are most likely handled by the
4935 * parport_serial driver, check drivers/parport/parport_serial.c
4936 * before adding them here.
4937 */
4938
Michael Bueschc4285b42009-06-30 11:41:21 -07004939 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
4940 0xA000, 0x1000,
4941 0, 0, pbn_b0_1_115200 },
4942
Nicos Gollan7808edc2011-05-05 21:00:37 +02004943 /* the 9901 is a rebranded 9912 */
4944 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
4945 0xA000, 0x1000,
4946 0, 0, pbn_b0_1_115200 },
4947
4948 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
4949 0xA000, 0x1000,
4950 0, 0, pbn_b0_1_115200 },
4951
4952 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
4953 0xA000, 0x1000,
4954 0, 0, pbn_b0_1_115200 },
4955
4956 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
4957 0xA000, 0x1000,
4958 0, 0, pbn_b0_1_115200 },
4959
4960 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
4961 0xA000, 0x3002,
4962 0, 0, pbn_NETMOS9900_2s_115200 },
4963
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08004964 /*
Eric Smith44178172011-07-11 22:53:13 -06004965 * Best Connectivity and Rosewill PCI Multi I/O cards
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08004966 */
4967
4968 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
4969 0xA000, 0x1000,
4970 0, 0, pbn_b0_1_115200 },
4971
4972 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Eric Smith44178172011-07-11 22:53:13 -06004973 0xA000, 0x3002,
4974 0, 0, pbn_b0_bt_2_115200 },
4975
4976 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08004977 0xA000, 0x3004,
4978 0, 0, pbn_b0_bt_4_115200 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08004979 /* Intel CE4100 */
4980 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
4981 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4982 pbn_ce4100_1_115200 },
Heikki Krogerusb15e5692013-09-27 10:52:59 +03004983 /* Intel BayTrail */
4984 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART1,
4985 PCI_ANY_ID, PCI_ANY_ID,
4986 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
4987 pbn_byt },
4988 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART2,
4989 PCI_ANY_ID, PCI_ANY_ID,
4990 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
4991 pbn_byt },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08004992
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04004993 /*
4994 * Cronyx Omega PCI
4995 */
4996 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
4997 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4998 pbn_omegapci },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08004999
5000 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08005001 * Broadcom TruManage
5002 */
5003 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
5004 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5005 pbn_brcm_trumanage },
5006
5007 /*
Alan Cox66835492012-08-16 12:01:33 +01005008 * AgeStar as-prs2-009
5009 */
5010 { PCI_VENDOR_ID_AGESTAR, PCI_DEVICE_ID_AGESTAR_9375,
5011 PCI_ANY_ID, PCI_ANY_ID,
5012 0, 0, pbn_b0_bt_2_115200 },
Alan Cox27788c52012-09-04 16:21:06 +01005013
5014 /*
5015 * WCH CH353 series devices: The 2S1P is handled by parport_serial
5016 * so not listed here.
5017 */
5018 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_4S,
5019 PCI_ANY_ID, PCI_ANY_ID,
5020 0, 0, pbn_b0_bt_4_115200 },
5021
5022 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_2S1PF,
5023 PCI_ANY_ID, PCI_ANY_ID,
5024 0, 0, pbn_b0_bt_2_115200 },
5025
Wang YanQing8b5c9132013-03-05 23:16:48 +08005026 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH352_2S,
5027 PCI_ANY_ID, PCI_ANY_ID,
5028 0, 0, pbn_b0_bt_2_115200 },
5029
Alan Cox66835492012-08-16 12:01:33 +01005030 /*
Matt Schulte14faa8c2012-11-21 10:35:15 -06005031 * Commtech, Inc. Fastcom adapters
5032 */
5033 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4222PCI335,
5034 PCI_ANY_ID, PCI_ANY_ID,
5035 0,
5036 0, pbn_b0_2_1152000_200 },
5037 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4224PCI335,
5038 PCI_ANY_ID, PCI_ANY_ID,
5039 0,
5040 0, pbn_b0_4_1152000_200 },
5041 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_2324PCI335,
5042 PCI_ANY_ID, PCI_ANY_ID,
5043 0,
5044 0, pbn_b0_4_1152000_200 },
5045 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_2328PCI335,
5046 PCI_ANY_ID, PCI_ANY_ID,
5047 0,
5048 0, pbn_b0_8_1152000_200 },
5049 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4222PCIE,
5050 PCI_ANY_ID, PCI_ANY_ID,
5051 0,
5052 0, pbn_exar_XR17V352 },
5053 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4224PCIE,
5054 PCI_ANY_ID, PCI_ANY_ID,
5055 0,
5056 0, pbn_exar_XR17V354 },
5057 { PCI_VENDOR_ID_COMMTECH, PCI_DEVICE_ID_COMMTECH_4228PCIE,
5058 PCI_ANY_ID, PCI_ANY_ID,
5059 0,
5060 0, pbn_exar_XR17V358 },
5061
5062 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07005063 * These entries match devices with class COMMUNICATION_SERIAL,
5064 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
5065 */
5066 { PCI_ANY_ID, PCI_ANY_ID,
5067 PCI_ANY_ID, PCI_ANY_ID,
5068 PCI_CLASS_COMMUNICATION_SERIAL << 8,
5069 0xffff00, pbn_default },
5070 { PCI_ANY_ID, PCI_ANY_ID,
5071 PCI_ANY_ID, PCI_ANY_ID,
5072 PCI_CLASS_COMMUNICATION_MODEM << 8,
5073 0xffff00, pbn_default },
5074 { PCI_ANY_ID, PCI_ANY_ID,
5075 PCI_ANY_ID, PCI_ANY_ID,
5076 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
5077 0xffff00, pbn_default },
5078 { 0, }
5079};
5080
Michael Reed28071902011-05-31 12:06:28 -05005081static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
5082 pci_channel_state_t state)
5083{
5084 struct serial_private *priv = pci_get_drvdata(dev);
5085
5086 if (state == pci_channel_io_perm_failure)
5087 return PCI_ERS_RESULT_DISCONNECT;
5088
5089 if (priv)
5090 pciserial_suspend_ports(priv);
5091
5092 pci_disable_device(dev);
5093
5094 return PCI_ERS_RESULT_NEED_RESET;
5095}
5096
5097static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
5098{
5099 int rc;
5100
5101 rc = pci_enable_device(dev);
5102
5103 if (rc)
5104 return PCI_ERS_RESULT_DISCONNECT;
5105
5106 pci_restore_state(dev);
5107 pci_save_state(dev);
5108
5109 return PCI_ERS_RESULT_RECOVERED;
5110}
5111
5112static void serial8250_io_resume(struct pci_dev *dev)
5113{
5114 struct serial_private *priv = pci_get_drvdata(dev);
5115
5116 if (priv)
5117 pciserial_resume_ports(priv);
5118}
5119
Stephen Hemminger1d352032012-09-07 09:33:17 -07005120static const struct pci_error_handlers serial8250_err_handler = {
Michael Reed28071902011-05-31 12:06:28 -05005121 .error_detected = serial8250_io_error_detected,
5122 .slot_reset = serial8250_io_slot_reset,
5123 .resume = serial8250_io_resume,
5124};
5125
Linus Torvalds1da177e2005-04-16 15:20:36 -07005126static struct pci_driver serial_pci_driver = {
5127 .name = "serial",
5128 .probe = pciserial_init_one,
Bill Pemberton2d47b712012-11-19 13:21:34 -05005129 .remove = pciserial_remove_one,
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07005130#ifdef CONFIG_PM
Linus Torvalds1da177e2005-04-16 15:20:36 -07005131 .suspend = pciserial_suspend_one,
5132 .resume = pciserial_resume_one,
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07005133#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07005134 .id_table = serial_pci_tbl,
Michael Reed28071902011-05-31 12:06:28 -05005135 .err_handler = &serial8250_err_handler,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005136};
5137
Wei Yongjun15a12e82012-10-26 23:04:22 +08005138module_pci_driver(serial_pci_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005139
5140MODULE_LICENSE("GPL");
5141MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
5142MODULE_DEVICE_TABLE(pci, serial_pci_tbl);