blob: 02985cf90ef2965423c3102b180475809ddc8b3e [file] [log] [blame]
Greg Kroah-Hartmane3b3d0f2017-11-06 18:11:51 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Probe module for 8250/16550-type PCI serial ports.
4 *
5 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
6 *
7 * Copyright (C) 2001 Russell King, All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07009#undef DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/pci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/string.h>
13#include <linux/kernel.h>
14#include <linux/slab.h>
15#include <linux/delay.h>
16#include <linux/tty.h>
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -070017#include <linux/serial_reg.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/serial_core.h>
19#include <linux/8250_pci.h>
20#include <linux/bitops.h>
21
22#include <asm/byteorder.h>
23#include <asm/io.h>
24
25#include "8250.h"
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 * init function returns:
29 * > 0 - number of ports
30 * = 0 - use board->num_ports
31 * < 0 - error
32 */
33struct pci_serial_quirk {
34 u32 vendor;
35 u32 device;
36 u32 subvendor;
37 u32 subdevice;
Frédéric Brière5bf8f502011-05-29 15:08:03 -040038 int (*probe)(struct pci_dev *dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 int (*init)(struct pci_dev *dev);
Russell King975a1a7d2009-01-02 13:44:27 +000040 int (*setup)(struct serial_private *,
41 const struct pciserial_board *,
Alan Cox2655a2c2012-07-12 12:59:50 +010042 struct uart_8250_port *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 void (*exit)(struct pci_dev *dev);
44};
45
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +080046struct f815xxa_data {
47 spinlock_t lock;
48 int idx;
49};
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051struct serial_private {
Russell King70db3d92005-07-27 11:34:27 +010052 struct pci_dev *dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 unsigned int nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 struct pci_serial_quirk *quirk;
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -020055 const struct pciserial_board *board;
Gustavo A. R. Silva02042a42020-02-12 18:44:26 -060056 int line[];
Linus Torvalds1da177e2005-04-16 15:20:36 -070057};
58
Randy Wrighte0e24202021-05-14 10:26:54 -060059#define PCI_DEVICE_ID_HPE_PCI_SERIAL 0x37e
60
Ralf Ramsauer84284132019-08-12 13:21:52 +020061static const struct pci_device_id pci_use_msi[] = {
62 { PCI_DEVICE_SUB(PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
63 0xA000, 0x1000) },
64 { PCI_DEVICE_SUB(PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
65 0xA000, 0x1000) },
66 { PCI_DEVICE_SUB(PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
67 0xA000, 0x1000) },
Randy Wrighte0e24202021-05-14 10:26:54 -060068 { PCI_DEVICE_SUB(PCI_VENDOR_ID_HP_3PAR, PCI_DEVICE_ID_HPE_PCI_SERIAL,
69 PCI_ANY_ID, PCI_ANY_ID) },
Ralf Ramsauer84284132019-08-12 13:21:52 +020070 { }
71};
72
Nicos Gollan7808edc2011-05-05 21:00:37 +020073static int pci_default_setup(struct serial_private*,
Alan Cox2655a2c2012-07-12 12:59:50 +010074 const struct pciserial_board*, struct uart_8250_port *, int);
Nicos Gollan7808edc2011-05-05 21:00:37 +020075
Linus Torvalds1da177e2005-04-16 15:20:36 -070076static void moan_device(const char *str, struct pci_dev *dev)
77{
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -070078 dev_err(&dev->dev,
Joe Perchesad361c92009-07-06 13:05:40 -070079 "%s: %s\n"
80 "Please send the output of lspci -vv, this\n"
81 "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
82 "manufacturer and name of serial board or\n"
Russell Kingf2e0ea82015-03-06 10:49:21 +000083 "modem board to <linux-serial@vger.kernel.org>.\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 pci_name(dev), str, dev->vendor, dev->device,
85 dev->subsystem_vendor, dev->subsystem_device);
86}
87
88static int
Alan Cox2655a2c2012-07-12 12:59:50 +010089setup_port(struct serial_private *priv, struct uart_8250_port *port,
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 int bar, int offset, int regshift)
91{
Russell King70db3d92005-07-27 11:34:27 +010092 struct pci_dev *dev = priv->dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Denis Efremovc9c13ba2019-09-28 02:43:08 +030094 if (bar >= PCI_STD_NUM_BARS)
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 return -EINVAL;
96
97 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +020098 if (!pcim_iomap(dev, bar, 0) && !pcim_iomap_table(dev))
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 return -ENOMEM;
100
Alan Cox2655a2c2012-07-12 12:59:50 +0100101 port->port.iotype = UPIO_MEM;
102 port->port.iobase = 0;
Aaron Sierra398a9db2014-10-30 19:49:45 -0500103 port->port.mapbase = pci_resource_start(dev, bar) + offset;
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +0200104 port->port.membase = pcim_iomap_table(dev)[bar] + offset;
Alan Cox2655a2c2012-07-12 12:59:50 +0100105 port->port.regshift = regshift;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 } else {
Alan Cox2655a2c2012-07-12 12:59:50 +0100107 port->port.iotype = UPIO_PORT;
Aaron Sierra398a9db2014-10-30 19:49:45 -0500108 port->port.iobase = pci_resource_start(dev, bar) + offset;
Alan Cox2655a2c2012-07-12 12:59:50 +0100109 port->port.mapbase = 0;
110 port->port.membase = NULL;
111 port->port.regshift = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 }
113 return 0;
114}
115
116/*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -0800117 * ADDI-DATA GmbH communication cards <info@addi-data.com>
118 */
119static int addidata_apci7800_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000120 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100121 struct uart_8250_port *port, int idx)
Krauth.Julien02c9b5c2008-02-04 22:27:49 -0800122{
123 unsigned int bar = 0, offset = board->first_offset;
124 bar = FL_GET_BASE(board->flags);
125
126 if (idx < 2) {
127 offset += idx * board->uart_offset;
128 } else if ((idx >= 2) && (idx < 4)) {
129 bar += 1;
130 offset += ((idx - 2) * board->uart_offset);
131 } else if ((idx >= 4) && (idx < 6)) {
132 bar += 2;
133 offset += ((idx - 4) * board->uart_offset);
134 } else if (idx >= 6) {
135 bar += 3;
136 offset += ((idx - 6) * board->uart_offset);
137 }
138
139 return setup_port(priv, port, bar, offset, board->reg_shift);
140}
141
142/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143 * AFAVLAB uses a different mixture of BARs and offsets
144 * Not that ugly ;) -- HW
145 */
146static int
Russell King975a1a7d2009-01-02 13:44:27 +0000147afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100148 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149{
150 unsigned int bar, offset = board->first_offset;
Alan Cox5756ee92008-02-08 04:18:51 -0800151
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 bar = FL_GET_BASE(board->flags);
153 if (idx < 4)
154 bar += idx;
155 else {
156 bar = 4;
157 offset += (idx - 4) * board->uart_offset;
158 }
159
Russell King70db3d92005-07-27 11:34:27 +0100160 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161}
162
163/*
164 * HP's Remote Management Console. The Diva chip came in several
165 * different versions. N-class, L2000 and A500 have two Diva chips, each
166 * with 3 UARTs (the third UART on the second chip is unused). Superdome
167 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
168 * one Diva chip, but it has been expanded to 5 UARTs.
169 */
Russell King61a116e2006-07-03 15:22:35 +0100170static int pci_hp_diva_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171{
172 int rc = 0;
173
174 switch (dev->subsystem_device) {
175 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
176 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
177 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
178 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
179 rc = 3;
180 break;
181 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
182 rc = 2;
183 break;
184 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
185 rc = 4;
186 break;
187 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
Justin Chen551f8f02005-10-24 22:16:38 +0100188 case PCI_DEVICE_ID_HP_DIVA_HURRICANE:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189 rc = 1;
190 break;
191 }
192
193 return rc;
194}
195
196/*
197 * HP's Diva chip puts the 4th/5th serial port further out, and
198 * some serial ports are supposed to be hidden on certain models.
199 */
200static int
Russell King975a1a7d2009-01-02 13:44:27 +0000201pci_hp_diva_setup(struct serial_private *priv,
202 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100203 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204{
205 unsigned int offset = board->first_offset;
206 unsigned int bar = FL_GET_BASE(board->flags);
207
Russell King70db3d92005-07-27 11:34:27 +0100208 switch (priv->dev->subsystem_device) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
210 if (idx == 3)
211 idx++;
212 break;
213 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
214 if (idx > 0)
215 idx++;
216 if (idx > 2)
217 idx++;
218 break;
219 }
220 if (idx > 2)
221 offset = 0x18;
222
223 offset += idx * board->uart_offset;
224
Russell King70db3d92005-07-27 11:34:27 +0100225 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226}
227
228/*
229 * Added for EKF Intel i960 serial boards
230 */
Russell King61a116e2006-07-03 15:22:35 +0100231static int pci_inteli960ni_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232{
Heikki Krogerus0a0d4122015-01-12 13:47:46 +0200233 u32 oldval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
235 if (!(dev->subsystem_device & 0x1000))
236 return -ENODEV;
237
238 /* is firmware started? */
Heikki Krogerus0a0d4122015-01-12 13:47:46 +0200239 pci_read_config_dword(dev, 0x44, &oldval);
Alan Cox5756ee92008-02-08 04:18:51 -0800240 if (oldval == 0x00001000L) { /* RESET value */
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -0700241 dev_dbg(&dev->dev, "Local i960 firmware missing\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 return -ENODEV;
243 }
244 return 0;
245}
246
247/*
248 * Some PCI serial cards using the PLX 9050 PCI interface chip require
249 * that the card interrupt be explicitly enabled or disabled. This
250 * seems to be mainly needed on card using the PLX which also use I/O
251 * mapped memory.
252 */
Russell King61a116e2006-07-03 15:22:35 +0100253static int pci_plx9050_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254{
255 u8 irq_config;
256 void __iomem *p;
257
258 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
259 moan_device("no memory in bar 0", dev);
260 return 0;
261 }
262
263 irq_config = 0x41;
Bjorn Helgaasadd7b582005-10-24 22:11:57 +0100264 if (dev->vendor == PCI_VENDOR_ID_PANACOM ||
Alan Cox5756ee92008-02-08 04:18:51 -0800265 dev->subsystem_vendor == PCI_SUBVENDOR_ID_EXSYS)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266 irq_config = 0x43;
Alan Cox5756ee92008-02-08 04:18:51 -0800267
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
Alan Cox5756ee92008-02-08 04:18:51 -0800269 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270 /*
271 * As the megawolf cards have the int pins active
272 * high, and have 2 UART chips, both ints must be
273 * enabled on the 9050. Also, the UARTS are set in
274 * 16450 mode by default, so we have to enable the
275 * 16C950 'enhanced' mode so that we can use the
276 * deep FIFOs
277 */
278 irq_config = 0x5b;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700279 /*
280 * enable/disable interrupts
281 */
Christoph Hellwig4bdc0d62020-01-06 09:43:50 +0100282 p = ioremap(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 if (p == NULL)
284 return -ENOMEM;
285 writel(irq_config, p + 0x4c);
286
287 /*
288 * Read the register back to ensure that it took effect.
289 */
290 readl(p + 0x4c);
291 iounmap(p);
292
293 return 0;
294}
295
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500296static void pci_plx9050_exit(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297{
298 u8 __iomem *p;
299
300 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
301 return;
302
303 /*
304 * disable interrupts
305 */
Christoph Hellwig4bdc0d62020-01-06 09:43:50 +0100306 p = ioremap(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307 if (p != NULL) {
308 writel(0, p + 0x4c);
309
310 /*
311 * Read the register back to ensure that it took effect.
312 */
313 readl(p + 0x4c);
314 iounmap(p);
315 }
316}
317
Will Page04bf7e72009-04-06 17:32:15 +0100318#define NI8420_INT_ENABLE_REG 0x38
319#define NI8420_INT_ENABLE_BIT 0x2000
320
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500321static void pci_ni8420_exit(struct pci_dev *dev)
Will Page04bf7e72009-04-06 17:32:15 +0100322{
323 void __iomem *p;
Will Page04bf7e72009-04-06 17:32:15 +0100324 unsigned int bar = 0;
325
326 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
327 moan_device("no memory in bar", dev);
328 return;
329 }
330
Aaron Sierra398a9db2014-10-30 19:49:45 -0500331 p = pci_ioremap_bar(dev, bar);
Will Page04bf7e72009-04-06 17:32:15 +0100332 if (p == NULL)
333 return;
334
335 /* Disable the CPU Interrupt */
336 writel(readl(p + NI8420_INT_ENABLE_REG) & ~(NI8420_INT_ENABLE_BIT),
337 p + NI8420_INT_ENABLE_REG);
338 iounmap(p);
339}
340
341
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100342/* MITE registers */
343#define MITE_IOWBSR1 0xc4
344#define MITE_IOWCR1 0xf4
345#define MITE_LCIMR1 0x08
346#define MITE_LCIMR2 0x10
347
348#define MITE_LCIMR2_CLR_CPU_IE (1 << 30)
349
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500350static void pci_ni8430_exit(struct pci_dev *dev)
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100351{
352 void __iomem *p;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100353 unsigned int bar = 0;
354
355 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
356 moan_device("no memory in bar", dev);
357 return;
358 }
359
Aaron Sierra398a9db2014-10-30 19:49:45 -0500360 p = pci_ioremap_bar(dev, bar);
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100361 if (p == NULL)
362 return;
363
364 /* Disable the CPU Interrupt */
365 writel(MITE_LCIMR2_CLR_CPU_IE, p + MITE_LCIMR2);
366 iounmap(p);
367}
368
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
370static int
Russell King975a1a7d2009-01-02 13:44:27 +0000371sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100372 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373{
374 unsigned int bar, offset = board->first_offset;
375
376 bar = 0;
377
378 if (idx < 4) {
379 /* first four channels map to 0, 0x100, 0x200, 0x300 */
380 offset += idx * board->uart_offset;
381 } else if (idx < 8) {
382 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
383 offset += idx * board->uart_offset + 0xC00;
384 } else /* we have only 8 ports on PMC-OCTALPRO */
385 return 1;
386
Russell King70db3d92005-07-27 11:34:27 +0100387 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388}
389
390/*
391* This does initialization for PMC OCTALPRO cards:
392* maps the device memory, resets the UARTs (needed, bc
393* if the module is removed and inserted again, the card
394* is in the sleep mode) and enables global interrupt.
395*/
396
397/* global control register offset for SBS PMC-OctalPro */
398#define OCT_REG_CR_OFF 0x500
399
Russell King61a116e2006-07-03 15:22:35 +0100400static int sbs_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401{
402 u8 __iomem *p;
403
Arjan van de Ven24ed3ab2009-06-24 18:34:58 +0100404 p = pci_ioremap_bar(dev, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405
406 if (p == NULL)
407 return -ENOMEM;
408 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
Alan Cox5756ee92008-02-08 04:18:51 -0800409 writeb(0x10, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 udelay(50);
Alan Cox5756ee92008-02-08 04:18:51 -0800411 writeb(0x0, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
413 /* Set bit-2 (INTENABLE) of Control Register */
414 writeb(0x4, p + OCT_REG_CR_OFF);
415 iounmap(p);
416
417 return 0;
418}
419
420/*
421 * Disables the global interrupt of PMC-OctalPro
422 */
423
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500424static void sbs_exit(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425{
426 u8 __iomem *p;
427
Arjan van de Ven24ed3ab2009-06-24 18:34:58 +0100428 p = pci_ioremap_bar(dev, 0);
Alan Cox5756ee92008-02-08 04:18:51 -0800429 /* FIXME: What if resource_len < OCT_REG_CR_OFF */
430 if (p != NULL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 writeb(0, p + OCT_REG_CR_OFF);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 iounmap(p);
433}
434
435/*
436 * SIIG serial cards have an PCI interface chip which also controls
437 * the UART clocking frequency. Each UART can be clocked independently
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300438 * (except cards equipped with 4 UARTs) and initial clocking settings
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 * are stored in the EEPROM chip. It can cause problems because this
440 * version of serial driver doesn't support differently clocked UART's
441 * on single PCI card. To prevent this, initialization functions set
442 * high frequency clocking for all UART's on given card. It is safe (I
443 * hope) because it doesn't touch EEPROM settings to prevent conflicts
444 * with other OSes (like M$ DOS).
445 *
446 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
Alan Cox5756ee92008-02-08 04:18:51 -0800447 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 * There is two family of SIIG serial cards with different PCI
449 * interface chip and different configuration methods:
450 * - 10x cards have control registers in IO and/or memory space;
451 * - 20x cards have control registers in standard PCI configuration space.
452 *
Russell King67d74b82005-07-27 11:33:03 +0100453 * Note: all 10x cards have PCI device ids 0x10..
454 * all 20x cards have PCI device ids 0x20..
455 *
Andrey Paninfbc0dc02005-07-18 11:38:09 +0100456 * There are also Quartet Serial cards which use Oxford Semiconductor
457 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
458 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459 * Note: some SIIG cards are probed by the parport_serial object.
460 */
461
462#define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
463#define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
464
465static int pci_siig10x_init(struct pci_dev *dev)
466{
467 u16 data;
468 void __iomem *p;
469
470 switch (dev->device & 0xfff8) {
471 case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
472 data = 0xffdf;
473 break;
474 case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
475 data = 0xf7ff;
476 break;
477 default: /* 1S1P, 4S */
478 data = 0xfffb;
479 break;
480 }
481
Christoph Hellwig4bdc0d62020-01-06 09:43:50 +0100482 p = ioremap(pci_resource_start(dev, 0), 0x80);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 if (p == NULL)
484 return -ENOMEM;
485
486 writew(readw(p + 0x28) & data, p + 0x28);
487 readw(p + 0x28);
488 iounmap(p);
489 return 0;
490}
491
492#define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
493#define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
494
495static int pci_siig20x_init(struct pci_dev *dev)
496{
497 u8 data;
498
499 /* Change clock frequency for the first UART. */
500 pci_read_config_byte(dev, 0x6f, &data);
501 pci_write_config_byte(dev, 0x6f, data & 0xef);
502
503 /* If this card has 2 UART, we have to do the same with second UART. */
504 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
505 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
506 pci_read_config_byte(dev, 0x73, &data);
507 pci_write_config_byte(dev, 0x73, data & 0xef);
508 }
509 return 0;
510}
511
Russell King67d74b82005-07-27 11:33:03 +0100512static int pci_siig_init(struct pci_dev *dev)
513{
514 unsigned int type = dev->device & 0xff00;
515
516 if (type == 0x1000)
517 return pci_siig10x_init(dev);
518 else if (type == 0x2000)
519 return pci_siig20x_init(dev);
520
521 moan_device("Unknown SIIG card", dev);
522 return -ENODEV;
523}
524
Andrey Panin3ec9c592006-02-02 20:15:09 +0000525static int pci_siig_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000526 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100527 struct uart_8250_port *port, int idx)
Andrey Panin3ec9c592006-02-02 20:15:09 +0000528{
529 unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
530
531 if (idx > 3) {
532 bar = 4;
533 offset = (idx - 4) * 8;
534 }
535
536 return setup_port(priv, port, bar, offset, 0);
537}
538
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539/*
540 * Timedia has an explosion of boards, and to avoid the PCI table from
541 * growing *huge*, we use this function to collapse some 70 entries
542 * in the PCI table into one, for sanity's and compactness's sake.
543 */
Helge Dellere9422e02006-08-29 21:57:29 +0200544static const unsigned short timedia_single_port[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
546};
547
Helge Dellere9422e02006-08-29 21:57:29 +0200548static const unsigned short timedia_dual_port[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
Alan Cox5756ee92008-02-08 04:18:51 -0800550 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
551 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
553 0xD079, 0
554};
555
Helge Dellere9422e02006-08-29 21:57:29 +0200556static const unsigned short timedia_quad_port[] = {
Alan Cox5756ee92008-02-08 04:18:51 -0800557 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
558 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
560 0xB157, 0
561};
562
Helge Dellere9422e02006-08-29 21:57:29 +0200563static const unsigned short timedia_eight_port[] = {
Alan Cox5756ee92008-02-08 04:18:51 -0800564 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700565 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
566};
567
Arjan van de Vencb3592b2005-11-28 21:04:11 +0000568static const struct timedia_struct {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 int num;
Helge Dellere9422e02006-08-29 21:57:29 +0200570 const unsigned short *ids;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571} timedia_data[] = {
572 { 1, timedia_single_port },
573 { 2, timedia_dual_port },
574 { 4, timedia_quad_port },
Helge Dellere9422e02006-08-29 21:57:29 +0200575 { 8, timedia_eight_port }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576};
577
Frédéric Brièreb9b24552011-05-29 15:08:04 -0400578/*
579 * There are nearly 70 different Timedia/SUNIX PCI serial devices. Instead of
580 * listing them individually, this driver merely grabs them all with
581 * PCI_ANY_ID. Some of these devices, however, also feature a parallel port,
582 * and should be left free to be claimed by parport_serial instead.
583 */
584static int pci_timedia_probe(struct pci_dev *dev)
585{
586 /*
587 * Check the third digit of the subdevice ID
588 * (0,2,3,5,6: serial only -- 7,8,9: serial + parallel)
589 */
590 if ((dev->subsystem_device & 0x00f0) >= 0x70) {
591 dev_info(&dev->dev,
592 "ignoring Timedia subdevice %04x for parport_serial\n",
593 dev->subsystem_device);
594 return -ENODEV;
595 }
596
597 return 0;
598}
599
Russell King61a116e2006-07-03 15:22:35 +0100600static int pci_timedia_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601{
Helge Dellere9422e02006-08-29 21:57:29 +0200602 const unsigned short *ids;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 int i, j;
604
Helge Dellere9422e02006-08-29 21:57:29 +0200605 for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606 ids = timedia_data[i].ids;
607 for (j = 0; ids[j]; j++)
608 if (dev->subsystem_device == ids[j])
609 return timedia_data[i].num;
610 }
611 return 0;
612}
613
614/*
615 * Timedia/SUNIX uses a mixture of BARs and offsets
616 * Ugh, this is ugly as all hell --- TYT
617 */
618static int
Russell King975a1a7d2009-01-02 13:44:27 +0000619pci_timedia_setup(struct serial_private *priv,
620 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100621 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700622{
623 unsigned int bar = 0, offset = board->first_offset;
624
625 switch (idx) {
626 case 0:
627 bar = 0;
628 break;
629 case 1:
630 offset = board->uart_offset;
631 bar = 0;
632 break;
633 case 2:
634 bar = 1;
635 break;
636 case 3:
637 offset = board->uart_offset;
Gustavo A. R. Silvadf561f662020-08-23 17:36:59 -0500638 fallthrough;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 case 4: /* BAR 2 */
640 case 5: /* BAR 3 */
641 case 6: /* BAR 4 */
642 case 7: /* BAR 5 */
643 bar = idx - 2;
644 }
645
Russell King70db3d92005-07-27 11:34:27 +0100646 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647}
648
649/*
650 * Some Titan cards are also a little weird
651 */
652static int
Russell King70db3d92005-07-27 11:34:27 +0100653titan_400l_800l_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +0000654 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +0100655 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656{
657 unsigned int bar, offset = board->first_offset;
658
659 switch (idx) {
660 case 0:
661 bar = 1;
662 break;
663 case 1:
664 bar = 2;
665 break;
666 default:
667 bar = 4;
668 offset = (idx - 2) * board->uart_offset;
669 }
670
Russell King70db3d92005-07-27 11:34:27 +0100671 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700672}
673
Russell King61a116e2006-07-03 15:22:35 +0100674static int pci_xircom_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675{
676 msleep(100);
677 return 0;
678}
679
Will Page04bf7e72009-04-06 17:32:15 +0100680static int pci_ni8420_init(struct pci_dev *dev)
681{
682 void __iomem *p;
Will Page04bf7e72009-04-06 17:32:15 +0100683 unsigned int bar = 0;
684
685 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
686 moan_device("no memory in bar", dev);
687 return 0;
688 }
689
Aaron Sierra398a9db2014-10-30 19:49:45 -0500690 p = pci_ioremap_bar(dev, bar);
Will Page04bf7e72009-04-06 17:32:15 +0100691 if (p == NULL)
692 return -ENOMEM;
693
694 /* Enable CPU Interrupt */
695 writel(readl(p + NI8420_INT_ENABLE_REG) | NI8420_INT_ENABLE_BIT,
696 p + NI8420_INT_ENABLE_REG);
697
698 iounmap(p);
699 return 0;
700}
701
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100702#define MITE_IOWBSR1_WSIZE 0xa
703#define MITE_IOWBSR1_WIN_OFFSET 0x800
704#define MITE_IOWBSR1_WENAB (1 << 7)
705#define MITE_LCIMR1_IO_IE_0 (1 << 24)
706#define MITE_LCIMR2_SET_CPU_IE (1 << 31)
707#define MITE_IOWCR1_RAMSEL_MASK 0xfffffffe
708
709static int pci_ni8430_init(struct pci_dev *dev)
710{
711 void __iomem *p;
Aaron Sierra398a9db2014-10-30 19:49:45 -0500712 struct pci_bus_region region;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100713 u32 device_window;
714 unsigned int bar = 0;
715
716 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
717 moan_device("no memory in bar", dev);
718 return 0;
719 }
720
Aaron Sierra398a9db2014-10-30 19:49:45 -0500721 p = pci_ioremap_bar(dev, bar);
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100722 if (p == NULL)
723 return -ENOMEM;
724
Aaron Sierra398a9db2014-10-30 19:49:45 -0500725 /*
726 * Set device window address and size in BAR0, while acknowledging that
727 * the resource structure may contain a translated address that differs
728 * from the address the device responds to.
729 */
730 pcibios_resource_to_bus(dev->bus, &region, &dev->resource[bar]);
731 device_window = ((region.start + MITE_IOWBSR1_WIN_OFFSET) & 0xffffff00)
Anton Wuerfel6d7c1572016-01-14 16:08:11 +0100732 | MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100733 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 */
Je Yen Tam27ed14d2019-11-27 15:53:01 +0800750#define NI8430_PORTCON 0x0f
751#define NI8430_PORTCON_TXVR_ENABLE (1 << 3)
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100752
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{
Aaron Sierra398a9db2014-10-30 19:49:45 -0500758 struct pci_dev *dev = priv->dev;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100759 void __iomem *p;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100760 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
Aaron Sierra398a9db2014-10-30 19:49:45 -0500768 p = pci_ioremap_bar(dev, bar);
Aaron Sierra5d14bba2014-10-30 19:49:52 -0500769 if (!p)
770 return -ENOMEM;
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100771
Joe Perches7c9d4402011-06-23 11:39:20 -0700772 /* enable the transceiver */
Je Yen Tam27ed14d2019-11-27 15:53:01 +0800773 writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,
774 p + offset + NI8430_PORTCON);
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100775
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
Dmitry Eremin-Solenikov333c0852014-02-11 14:18:13 +0400787 if ((priv->dev->device != PCI_DEVICE_ID_NETMOS_9865) &&
788 (priv->dev->subsystem_device & 0xff00) == 0x3000) {
Nicos Gollan7808edc2011-05-05 21:00:37 +0200789 /* netmos apparently orders BARs by datasheet layout, so serial
790 * ports get BARs 0 and 3 (or 1 and 4 for memmapped)
791 */
792 bar = 3 * idx;
793
794 return setup_port(priv, port, bar, 0, board->reg_shift);
795 } else {
796 return pci_default_setup(priv, board, port, idx);
797 }
798}
799
800/* the 99xx series comes with a range of device IDs and a variety
801 * of capabilities:
802 *
803 * 9900 has varying capabilities and can cascade to sub-controllers
804 * (cascading should be purely internal)
805 * 9904 is hardwired with 4 serial ports
806 * 9912 and 9922 are hardwired with 2 serial ports
807 */
808static int pci_netmos_9900_numports(struct pci_dev *dev)
809{
810 unsigned int c = dev->class;
811 unsigned int pi;
812 unsigned short sub_serports;
813
Anton Wuerfel149a44c2016-01-14 16:08:17 +0100814 pi = c & 0xff;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200815
Anton Wuerfelc2f5fde2016-01-14 16:08:14 +0100816 if (pi == 2)
Nicos Gollan7808edc2011-05-05 21:00:37 +0200817 return 1;
Anton Wuerfelc2f5fde2016-01-14 16:08:14 +0100818
819 if ((pi == 0) && (dev->device == PCI_DEVICE_ID_NETMOS_9900)) {
Nicos Gollan7808edc2011-05-05 21:00:37 +0200820 /* two possibilities: 0x30ps encodes number of parallel and
821 * serial ports, or 0x1000 indicates *something*. This is not
822 * immediately obvious, since the 2s1p+4s configuration seems
823 * to offer all functionality on functions 0..2, while still
824 * advertising the same function 3 as the 4s+2s1p config.
825 */
826 sub_serports = dev->subsystem_device & 0xf;
Anton Wuerfelc2f5fde2016-01-14 16:08:14 +0100827 if (sub_serports > 0)
Nicos Gollan7808edc2011-05-05 21:00:37 +0200828 return sub_serports;
Anton Wuerfelc2f5fde2016-01-14 16:08:14 +0100829
830 dev_err(&dev->dev,
831 "NetMos/Mostech serial driver ignoring port on ambiguous config.\n");
832 return 0;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200833 }
834
835 moan_device("unknown NetMos/Mostech program interface", dev);
836 return 0;
837}
Shawn Bohrer46a0fac2009-04-06 17:32:07 +0100838
Russell King61a116e2006-07-03 15:22:35 +0100839static int pci_netmos_init(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840{
841 /* subdevice 0x00PS means <P> parallel, <S> serial */
842 unsigned int num_serial = dev->subsystem_device & 0xf;
843
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -0800844 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) ||
845 (dev->device == PCI_DEVICE_ID_NETMOS_9865))
Michael Bueschc4285b42009-06-30 11:41:21 -0700846 return 0;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200847
Jiri Slaby25cf9bc2009-01-15 13:30:34 +0000848 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
849 dev->subsystem_device == 0x0299)
850 return 0;
851
Nicos Gollan7808edc2011-05-05 21:00:37 +0200852 switch (dev->device) { /* FALLTHROUGH on all */
Anton Wuerfelb3d67932016-01-14 16:08:23 +0100853 case PCI_DEVICE_ID_NETMOS_9904:
854 case PCI_DEVICE_ID_NETMOS_9912:
855 case PCI_DEVICE_ID_NETMOS_9922:
856 case PCI_DEVICE_ID_NETMOS_9900:
857 num_serial = pci_netmos_9900_numports(dev);
858 break;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200859
Anton Wuerfelb3d67932016-01-14 16:08:23 +0100860 default:
861 break;
Nicos Gollan7808edc2011-05-05 21:00:37 +0200862 }
863
Anton Wuerfel829b0002016-01-14 16:08:22 +0100864 if (num_serial == 0) {
865 moan_device("unknown NetMos/Mostech device", dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866 return -ENODEV;
Anton Wuerfel829b0002016-01-14 16:08:22 +0100867 }
Nicos Gollan7808edc2011-05-05 21:00:37 +0200868
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869 return num_serial;
870}
871
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700872/*
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700873 * These chips are available with optionally one parallel port and up to
874 * two serial ports. Unfortunately they all have the same product id.
875 *
876 * Basic configuration is done over a region of 32 I/O ports. The base
877 * ioport is called INTA or INTC, depending on docs/other drivers.
878 *
879 * The region of the 32 I/O ports is configured in POSIO0R...
880 */
881
882/* registers */
883#define ITE_887x_MISCR 0x9c
884#define ITE_887x_INTCBAR 0x78
885#define ITE_887x_UARTBAR 0x7c
886#define ITE_887x_PS0BAR 0x10
887#define ITE_887x_POSIO0 0x60
888
889/* I/O space size */
890#define ITE_887x_IOSIZE 32
891/* I/O space size (bits 26-24; 8 bytes = 011b) */
892#define ITE_887x_POSIO_IOSIZE_8 (3 << 24)
893/* I/O space size (bits 26-24; 32 bytes = 101b) */
894#define ITE_887x_POSIO_IOSIZE_32 (5 << 24)
895/* Decoding speed (1 = slow, 2 = medium, 3 = fast) */
896#define ITE_887x_POSIO_SPEED (3 << 29)
897/* enable IO_Space bit */
898#define ITE_887x_POSIO_ENABLE (1 << 31)
899
Ralf Baechlef79abb82007-08-30 23:56:31 -0700900static int pci_ite887x_init(struct pci_dev *dev)
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700901{
902 /* inta_addr are the configuration addresses of the ITE */
903 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
904 0x200, 0x280, 0 };
905 int ret, i, type;
906 struct resource *iobase = NULL;
907 u32 miscr, uartbar, ioport;
908
909 /* search for the base-ioport */
910 i = 0;
911 while (inta_addr[i] && iobase == NULL) {
912 iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
913 "ite887x");
914 if (iobase != NULL) {
915 /* write POSIO0R - speed | size | ioport */
916 pci_write_config_dword(dev, ITE_887x_POSIO0,
917 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
918 ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
919 /* write INTCBAR - ioport */
Alan Cox5756ee92008-02-08 04:18:51 -0800920 pci_write_config_dword(dev, ITE_887x_INTCBAR,
921 inta_addr[i]);
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700922 ret = inb(inta_addr[i]);
923 if (ret != 0xff) {
924 /* ioport connected */
925 break;
926 }
927 release_region(iobase->start, ITE_887x_IOSIZE);
928 iobase = NULL;
929 }
930 i++;
931 }
932
933 if (!inta_addr[i]) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -0700934 dev_err(&dev->dev, "ite887x: could not find iobase\n");
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700935 return -ENODEV;
936 }
937
938 /* start of undocumented type checking (see parport_pc.c) */
939 type = inb(iobase->start + 0x18) & 0x0f;
940
941 switch (type) {
942 case 0x2: /* ITE8871 (1P) */
943 case 0xa: /* ITE8875 (1P) */
944 ret = 0;
945 break;
946 case 0xe: /* ITE8872 (2S1P) */
947 ret = 2;
948 break;
949 case 0x6: /* ITE8873 (1S) */
950 ret = 1;
951 break;
952 case 0x8: /* ITE8874 (2S) */
953 ret = 2;
954 break;
955 default:
956 moan_device("Unknown ITE887x", dev);
957 ret = -ENODEV;
958 }
959
960 /* configure all serial ports */
961 for (i = 0; i < ret; i++) {
962 /* read the I/O port from the device */
963 pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)),
964 &ioport);
965 ioport &= 0x0000FF00; /* the actual base address */
966 pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)),
967 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
968 ITE_887x_POSIO_IOSIZE_8 | ioport);
969
970 /* write the ioport to the UARTBAR */
971 pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar);
972 uartbar &= ~(0xffff << (16 * i)); /* clear half the reg */
973 uartbar |= (ioport << (16 * i)); /* set the ioport */
974 pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar);
975
976 /* get current config */
977 pci_read_config_dword(dev, ITE_887x_MISCR, &miscr);
978 /* disable interrupts (UARTx_Routing[3:0]) */
979 miscr &= ~(0xf << (12 - 4 * i));
980 /* activate the UART (UARTx_En) */
981 miscr |= 1 << (23 - i);
982 /* write new config with activated UART */
983 pci_write_config_dword(dev, ITE_887x_MISCR, miscr);
984 }
985
986 if (ret <= 0) {
987 /* the device has no UARTs if we get here */
988 release_region(iobase->start, ITE_887x_IOSIZE);
989 }
990
991 return ret;
992}
993
Bill Pembertonae8d8a12012-11-19 13:26:18 -0500994static void pci_ite887x_exit(struct pci_dev *dev)
Niels de Vos84f8c6f2007-08-22 14:01:14 -0700995{
996 u32 ioport;
997 /* the ioport is bit 0-15 in POSIO0R */
998 pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport);
999 ioport &= 0xffff;
1000 release_region(ioport, ITE_887x_IOSIZE);
1001}
1002
Russell King9f2a0362009-01-02 13:44:20 +00001003/*
Mike Skoog1bc8cde2014-10-16 13:10:01 -07001004 * EndRun Technologies.
1005 * Determine the number of ports available on the device.
1006 */
1007#define PCI_VENDOR_ID_ENDRUN 0x7401
1008#define PCI_DEVICE_ID_ENDRUN_1588 0xe100
1009
1010static int pci_endrun_init(struct pci_dev *dev)
1011{
1012 u8 __iomem *p;
1013 unsigned long deviceID;
1014 unsigned int number_uarts = 0;
1015
1016 /* EndRun device is all 0xexxx */
1017 if (dev->vendor == PCI_VENDOR_ID_ENDRUN &&
1018 (dev->device & 0xf000) != 0xe000)
1019 return 0;
1020
1021 p = pci_iomap(dev, 0, 5);
1022 if (p == NULL)
1023 return -ENOMEM;
1024
1025 deviceID = ioread32(p);
1026 /* EndRun device */
1027 if (deviceID == 0x07000200) {
1028 number_uarts = ioread8(p + 4);
1029 dev_dbg(&dev->dev,
1030 "%d ports detected on EndRun PCI Express device\n",
1031 number_uarts);
1032 }
1033 pci_iounmap(dev, p);
1034 return number_uarts;
1035}
1036
1037/*
Russell King9f2a0362009-01-02 13:44:20 +00001038 * Oxford Semiconductor Inc.
1039 * Check that device is part of the Tornado range of devices, then determine
1040 * the number of ports available on the device.
1041 */
1042static int pci_oxsemi_tornado_init(struct pci_dev *dev)
1043{
1044 u8 __iomem *p;
1045 unsigned long deviceID;
1046 unsigned int number_uarts = 0;
1047
1048 /* OxSemi Tornado devices are all 0xCxxx */
1049 if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
1050 (dev->device & 0xF000) != 0xC000)
1051 return 0;
1052
1053 p = pci_iomap(dev, 0, 5);
1054 if (p == NULL)
1055 return -ENOMEM;
1056
1057 deviceID = ioread32(p);
1058 /* Tornado device */
1059 if (deviceID == 0x07000200) {
1060 number_uarts = ioread8(p + 4);
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001061 dev_dbg(&dev->dev,
Russell King9f2a0362009-01-02 13:44:20 +00001062 "%d ports detected on Oxford PCI Express device\n",
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001063 number_uarts);
Russell King9f2a0362009-01-02 13:44:20 +00001064 }
1065 pci_iounmap(dev, p);
1066 return number_uarts;
1067}
1068
Alan Coxeb26dfe2012-07-12 13:00:31 +01001069static int pci_asix_setup(struct serial_private *priv,
Russell King975a1a7d2009-01-02 13:44:27 +00001070 const struct pciserial_board *board,
Alan Coxeb26dfe2012-07-12 13:00:31 +01001071 struct uart_8250_port *port, int idx)
1072{
1073 port->bugs |= UART_BUG_PARITY;
1074 return pci_default_setup(priv, board, port, idx);
1075}
1076
Alan Cox55c7c0f2012-11-29 09:03:00 +10301077/* Quatech devices have their own extra interface features */
1078
1079struct quatech_feature {
1080 u16 devid;
1081 bool amcc;
1082};
1083
1084#define QPCR_TEST_FOR1 0x3F
1085#define QPCR_TEST_GET1 0x00
1086#define QPCR_TEST_FOR2 0x40
1087#define QPCR_TEST_GET2 0x40
1088#define QPCR_TEST_FOR3 0x80
1089#define QPCR_TEST_GET3 0x40
1090#define QPCR_TEST_FOR4 0xC0
1091#define QPCR_TEST_GET4 0x80
1092
1093#define QOPR_CLOCK_X1 0x0000
1094#define QOPR_CLOCK_X2 0x0001
1095#define QOPR_CLOCK_X4 0x0002
1096#define QOPR_CLOCK_X8 0x0003
1097#define QOPR_CLOCK_RATE_MASK 0x0003
1098
1099
1100static struct quatech_feature quatech_cards[] = {
1101 { PCI_DEVICE_ID_QUATECH_QSC100, 1 },
1102 { PCI_DEVICE_ID_QUATECH_DSC100, 1 },
1103 { PCI_DEVICE_ID_QUATECH_DSC100E, 0 },
1104 { PCI_DEVICE_ID_QUATECH_DSC200, 1 },
1105 { PCI_DEVICE_ID_QUATECH_DSC200E, 0 },
1106 { PCI_DEVICE_ID_QUATECH_ESC100D, 1 },
1107 { PCI_DEVICE_ID_QUATECH_ESC100M, 1 },
1108 { PCI_DEVICE_ID_QUATECH_QSCP100, 1 },
1109 { PCI_DEVICE_ID_QUATECH_DSCP100, 1 },
1110 { PCI_DEVICE_ID_QUATECH_QSCP200, 1 },
1111 { PCI_DEVICE_ID_QUATECH_DSCP200, 1 },
1112 { PCI_DEVICE_ID_QUATECH_ESCLP100, 0 },
1113 { PCI_DEVICE_ID_QUATECH_QSCLP100, 0 },
1114 { PCI_DEVICE_ID_QUATECH_DSCLP100, 0 },
1115 { PCI_DEVICE_ID_QUATECH_SSCLP100, 0 },
1116 { PCI_DEVICE_ID_QUATECH_QSCLP200, 0 },
1117 { PCI_DEVICE_ID_QUATECH_DSCLP200, 0 },
1118 { PCI_DEVICE_ID_QUATECH_SSCLP200, 0 },
1119 { PCI_DEVICE_ID_QUATECH_SPPXP_100, 0 },
1120 { 0, }
1121};
1122
1123static int pci_quatech_amcc(u16 devid)
1124{
1125 struct quatech_feature *qf = &quatech_cards[0];
1126 while (qf->devid) {
1127 if (qf->devid == devid)
1128 return qf->amcc;
1129 qf++;
1130 }
1131 pr_err("quatech: unknown port type '0x%04X'.\n", devid);
1132 return 0;
1133};
1134
1135static int pci_quatech_rqopr(struct uart_8250_port *port)
1136{
1137 unsigned long base = port->port.iobase;
1138 u8 LCR, val;
1139
1140 LCR = inb(base + UART_LCR);
1141 outb(0xBF, base + UART_LCR);
1142 val = inb(base + UART_SCR);
1143 outb(LCR, base + UART_LCR);
1144 return val;
1145}
1146
1147static void pci_quatech_wqopr(struct uart_8250_port *port, u8 qopr)
1148{
1149 unsigned long base = port->port.iobase;
Jiri Slaby17b27202016-06-23 13:34:22 +02001150 u8 LCR;
Alan Cox55c7c0f2012-11-29 09:03:00 +10301151
1152 LCR = inb(base + UART_LCR);
1153 outb(0xBF, base + UART_LCR);
Jiri Slaby17b27202016-06-23 13:34:22 +02001154 inb(base + UART_SCR);
Alan Cox55c7c0f2012-11-29 09:03:00 +10301155 outb(qopr, base + UART_SCR);
1156 outb(LCR, base + UART_LCR);
1157}
1158
1159static int pci_quatech_rqmcr(struct uart_8250_port *port)
1160{
1161 unsigned long base = port->port.iobase;
1162 u8 LCR, val, qmcr;
1163
1164 LCR = inb(base + UART_LCR);
1165 outb(0xBF, base + UART_LCR);
1166 val = inb(base + UART_SCR);
1167 outb(val | 0x10, base + UART_SCR);
1168 qmcr = inb(base + UART_MCR);
1169 outb(val, base + UART_SCR);
1170 outb(LCR, base + UART_LCR);
1171
1172 return qmcr;
1173}
1174
1175static void pci_quatech_wqmcr(struct uart_8250_port *port, u8 qmcr)
1176{
1177 unsigned long base = port->port.iobase;
1178 u8 LCR, val;
1179
1180 LCR = inb(base + UART_LCR);
1181 outb(0xBF, base + UART_LCR);
1182 val = inb(base + UART_SCR);
1183 outb(val | 0x10, base + UART_SCR);
1184 outb(qmcr, base + UART_MCR);
1185 outb(val, base + UART_SCR);
1186 outb(LCR, base + UART_LCR);
1187}
1188
1189static int pci_quatech_has_qmcr(struct uart_8250_port *port)
1190{
1191 unsigned long base = port->port.iobase;
1192 u8 LCR, val;
1193
1194 LCR = inb(base + UART_LCR);
1195 outb(0xBF, base + UART_LCR);
1196 val = inb(base + UART_SCR);
1197 if (val & 0x20) {
1198 outb(0x80, UART_LCR);
1199 if (!(inb(UART_SCR) & 0x20)) {
1200 outb(LCR, base + UART_LCR);
1201 return 1;
1202 }
1203 }
1204 return 0;
1205}
1206
1207static int pci_quatech_test(struct uart_8250_port *port)
1208{
Anton Wuerfel1a33e342016-01-14 16:08:10 +01001209 u8 reg, qopr;
1210
1211 qopr = pci_quatech_rqopr(port);
Alan Cox55c7c0f2012-11-29 09:03:00 +10301212 pci_quatech_wqopr(port, qopr & QPCR_TEST_FOR1);
1213 reg = pci_quatech_rqopr(port) & 0xC0;
1214 if (reg != QPCR_TEST_GET1)
1215 return -EINVAL;
1216 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR2);
1217 reg = pci_quatech_rqopr(port) & 0xC0;
1218 if (reg != QPCR_TEST_GET2)
1219 return -EINVAL;
1220 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR3);
1221 reg = pci_quatech_rqopr(port) & 0xC0;
1222 if (reg != QPCR_TEST_GET3)
1223 return -EINVAL;
1224 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR4);
1225 reg = pci_quatech_rqopr(port) & 0xC0;
1226 if (reg != QPCR_TEST_GET4)
1227 return -EINVAL;
1228
1229 pci_quatech_wqopr(port, qopr);
1230 return 0;
1231}
1232
1233static int pci_quatech_clock(struct uart_8250_port *port)
1234{
1235 u8 qopr, reg, set;
1236 unsigned long clock;
1237
1238 if (pci_quatech_test(port) < 0)
1239 return 1843200;
1240
1241 qopr = pci_quatech_rqopr(port);
1242
1243 pci_quatech_wqopr(port, qopr & ~QOPR_CLOCK_X8);
1244 reg = pci_quatech_rqopr(port);
1245 if (reg & QOPR_CLOCK_X8) {
1246 clock = 1843200;
1247 goto out;
1248 }
1249 pci_quatech_wqopr(port, qopr | QOPR_CLOCK_X8);
1250 reg = pci_quatech_rqopr(port);
1251 if (!(reg & QOPR_CLOCK_X8)) {
1252 clock = 1843200;
1253 goto out;
1254 }
1255 reg &= QOPR_CLOCK_X8;
1256 if (reg == QOPR_CLOCK_X2) {
1257 clock = 3685400;
1258 set = QOPR_CLOCK_X2;
1259 } else if (reg == QOPR_CLOCK_X4) {
1260 clock = 7372800;
1261 set = QOPR_CLOCK_X4;
1262 } else if (reg == QOPR_CLOCK_X8) {
1263 clock = 14745600;
1264 set = QOPR_CLOCK_X8;
1265 } else {
1266 clock = 1843200;
1267 set = QOPR_CLOCK_X1;
1268 }
1269 qopr &= ~QOPR_CLOCK_RATE_MASK;
1270 qopr |= set;
1271
1272out:
1273 pci_quatech_wqopr(port, qopr);
1274 return clock;
1275}
1276
1277static int pci_quatech_rs422(struct uart_8250_port *port)
1278{
1279 u8 qmcr;
1280 int rs422 = 0;
1281
1282 if (!pci_quatech_has_qmcr(port))
1283 return 0;
1284 qmcr = pci_quatech_rqmcr(port);
1285 pci_quatech_wqmcr(port, 0xFF);
1286 if (pci_quatech_rqmcr(port))
1287 rs422 = 1;
1288 pci_quatech_wqmcr(port, qmcr);
1289 return rs422;
1290}
1291
1292static int pci_quatech_init(struct pci_dev *dev)
1293{
1294 if (pci_quatech_amcc(dev->device)) {
1295 unsigned long base = pci_resource_start(dev, 0);
1296 if (base) {
1297 u32 tmp;
Anton Wuerfel1a33e342016-01-14 16:08:10 +01001298
Jonathan Woithe9c5320f2013-12-09 16:33:08 +10301299 outl(inl(base + 0x38) | 0x00002000, base + 0x38);
Alan Cox55c7c0f2012-11-29 09:03:00 +10301300 tmp = inl(base + 0x3c);
1301 outl(tmp | 0x01000000, base + 0x3c);
Jonathan Woithe9c5320f2013-12-09 16:33:08 +10301302 outl(tmp &= ~0x01000000, base + 0x3c);
Alan Cox55c7c0f2012-11-29 09:03:00 +10301303 }
1304 }
1305 return 0;
1306}
1307
1308static int pci_quatech_setup(struct serial_private *priv,
1309 const struct pciserial_board *board,
1310 struct uart_8250_port *port, int idx)
1311{
1312 /* Needed by pci_quatech calls below */
1313 port->port.iobase = pci_resource_start(priv->dev, FL_GET_BASE(board->flags));
1314 /* Set up the clocking */
1315 port->port.uartclk = pci_quatech_clock(port);
1316 /* For now just warn about RS422 */
1317 if (pci_quatech_rs422(port))
1318 pr_warn("quatech: software control of RS422 features not currently supported.\n");
1319 return pci_default_setup(priv, board, port, idx);
1320}
1321
Greg Kroah-Hartmand73dfc62013-01-15 22:44:48 -08001322static void pci_quatech_exit(struct pci_dev *dev)
Alan Cox55c7c0f2012-11-29 09:03:00 +10301323{
1324}
1325
Alan Coxeb26dfe2012-07-12 13:00:31 +01001326static int pci_default_setup(struct serial_private *priv,
Russell King70db3d92005-07-27 11:34:27 +01001327 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001328 struct uart_8250_port *port, int idx)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001329{
1330 unsigned int bar, offset = board->first_offset, maxnr;
1331
1332 bar = FL_GET_BASE(board->flags);
1333 if (board->flags & FL_BASE_BARS)
1334 bar += idx;
1335 else
1336 offset += idx * board->uart_offset;
1337
Greg Kroah-Hartman2427ddd2006-06-12 17:07:52 -07001338 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1339 (board->reg_shift + 3);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001340
1341 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1342 return 1;
Alan Cox5756ee92008-02-08 04:18:51 -08001343
Russell King70db3d92005-07-27 11:34:27 +01001344 return setup_port(priv, port, bar, offset, board->reg_shift);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001345}
kbuild test robot607ea692019-06-18 19:23:51 +08001346static void
Jay Dolan6bf4e422019-06-11 04:47:15 -07001347pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
1348 unsigned int quot, unsigned int quot_frac)
1349{
1350 int scr;
1351 int lcr;
1352 int actual_baud;
1353 int tolerance;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001354
Jay Dolan6bf4e422019-06-11 04:47:15 -07001355 for (scr = 5 ; scr <= 15 ; scr++) {
1356 actual_baud = 921600 * 16 / scr;
1357 tolerance = actual_baud / 50;
1358
1359 if ((baud < actual_baud + tolerance) &&
1360 (baud > actual_baud - tolerance)) {
1361
1362 lcr = serial_port_in(port, UART_LCR);
1363 serial_port_out(port, UART_LCR, lcr | 0x80);
1364
1365 serial_port_out(port, UART_DLL, 1);
1366 serial_port_out(port, UART_DLM, 0);
1367 serial_port_out(port, 2, 16 - scr);
1368 serial_port_out(port, UART_LCR, lcr);
1369 return;
1370 } else if (baud > actual_baud) {
1371 break;
1372 }
1373 }
1374 serial8250_do_set_divisor(port, baud, quot, quot_frac);
1375}
Angelo Butti5c31ef92016-11-07 16:39:03 +01001376static int pci_pericom_setup(struct serial_private *priv,
1377 const struct pciserial_board *board,
1378 struct uart_8250_port *port, int idx)
1379{
1380 unsigned int bar, offset = board->first_offset, maxnr;
1381
1382 bar = FL_GET_BASE(board->flags);
1383 if (board->flags & FL_BASE_BARS)
1384 bar += idx;
1385 else
1386 offset += idx * board->uart_offset;
1387
Jay Dolan6bf4e422019-06-11 04:47:15 -07001388
1389 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1390 (board->reg_shift + 3);
1391
1392 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1393 return 1;
1394
1395 port->port.set_divisor = pericom_do_set_divisor;
1396
1397 return setup_port(priv, port, bar, offset, board->reg_shift);
1398}
1399
1400static int pci_pericom_setup_four_at_eight(struct serial_private *priv,
1401 const struct pciserial_board *board,
1402 struct uart_8250_port *port, int idx)
1403{
1404 unsigned int bar, offset = board->first_offset, maxnr;
1405
1406 bar = FL_GET_BASE(board->flags);
1407 if (board->flags & FL_BASE_BARS)
1408 bar += idx;
1409 else
1410 offset += idx * board->uart_offset;
1411
Angelo Butti5c31ef92016-11-07 16:39:03 +01001412 if (idx==3)
1413 offset = 0x38;
1414
1415 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1416 (board->reg_shift + 3);
1417
1418 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1419 return 1;
1420
Jay Dolan6bf4e422019-06-11 04:47:15 -07001421 port->port.set_divisor = pericom_do_set_divisor;
1422
Angelo Butti5c31ef92016-11-07 16:39:03 +01001423 return setup_port(priv, port, bar, offset, board->reg_shift);
1424}
1425
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001426static int
1427ce4100_serial_setup(struct serial_private *priv,
1428 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001429 struct uart_8250_port *port, int idx)
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001430{
1431 int ret;
1432
Maxime Bizon08ec2122012-10-19 10:45:07 +02001433 ret = setup_port(priv, port, idx, 0, board->reg_shift);
Alan Cox2655a2c2012-07-12 12:59:50 +01001434 port->port.iotype = UPIO_MEM32;
1435 port->port.type = PORT_XSCALE;
1436 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1437 port->port.regshift = 2;
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001438
1439 return ret;
1440}
1441
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001442static int
1443pci_omegapci_setup(struct serial_private *priv,
Alan Cox1798ca12011-05-24 12:35:48 +01001444 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001445 struct uart_8250_port *port, int idx)
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001446{
1447 return setup_port(priv, port, 2, idx * 8, 0);
1448}
1449
Stephen Hurdebebd492013-01-17 14:14:53 -08001450static int
1451pci_brcm_trumanage_setup(struct serial_private *priv,
1452 const struct pciserial_board *board,
1453 struct uart_8250_port *port, int idx)
1454{
1455 int ret = pci_default_setup(priv, board, port, idx);
1456
1457 port->port.type = PORT_BRCM_TRUMANAGE;
1458 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1459 return ret;
1460}
1461
Peter Hungfecf27a2015-07-28 11:59:24 +08001462/* RTS will control by MCR if this bit is 0 */
1463#define FINTEK_RTS_CONTROL_BY_HW BIT(4)
1464/* only worked with FINTEK_RTS_CONTROL_BY_HW on */
1465#define FINTEK_RTS_INVERT BIT(5)
1466
1467/* We should do proper H/W transceiver setting before change to RS485 mode */
1468static int pci_fintek_rs485_config(struct uart_port *port,
1469 struct serial_rs485 *rs485)
1470{
Geliang Tang30c6c352015-12-27 22:29:42 +08001471 struct pci_dev *pci_dev = to_pci_dev(port->dev);
Peter Hungfecf27a2015-07-28 11:59:24 +08001472 u8 setting;
1473 u8 *index = (u8 *) port->private_data;
Peter Hungfecf27a2015-07-28 11:59:24 +08001474
1475 pci_read_config_byte(pci_dev, 0x40 + 8 * *index + 7, &setting);
1476
Peter Hungd3159452015-08-05 14:44:53 +08001477 if (!rs485)
1478 rs485 = &port->rs485;
1479 else if (rs485->flags & SER_RS485_ENABLED)
Peter Hungfecf27a2015-07-28 11:59:24 +08001480 memset(rs485->padding, 0, sizeof(rs485->padding));
1481 else
1482 memset(rs485, 0, sizeof(*rs485));
1483
1484 /* F81504/508/512 not support RTS delay before or after send */
1485 rs485->flags &= SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND;
1486
1487 if (rs485->flags & SER_RS485_ENABLED) {
1488 /* Enable RTS H/W control mode */
1489 setting |= FINTEK_RTS_CONTROL_BY_HW;
1490
1491 if (rs485->flags & SER_RS485_RTS_ON_SEND) {
1492 /* RTS driving high on TX */
1493 setting &= ~FINTEK_RTS_INVERT;
1494 } else {
1495 /* RTS driving low on TX */
1496 setting |= FINTEK_RTS_INVERT;
1497 }
1498
1499 rs485->delay_rts_after_send = 0;
1500 rs485->delay_rts_before_send = 0;
1501 } else {
1502 /* Disable RTS H/W control mode */
1503 setting &= ~(FINTEK_RTS_CONTROL_BY_HW | FINTEK_RTS_INVERT);
1504 }
1505
1506 pci_write_config_byte(pci_dev, 0x40 + 8 * *index + 7, setting);
Peter Hungd3159452015-08-05 14:44:53 +08001507
1508 if (rs485 != &port->rs485)
1509 port->rs485 = *rs485;
1510
Peter Hungfecf27a2015-07-28 11:59:24 +08001511 return 0;
1512}
1513
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001514static int pci_fintek_setup(struct serial_private *priv,
1515 const struct pciserial_board *board,
1516 struct uart_8250_port *port, int idx)
1517{
1518 struct pci_dev *pdev = priv->dev;
Peter Hungfecf27a2015-07-28 11:59:24 +08001519 u8 *data;
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001520 u8 config_base;
Peter Hung6a8bc232015-04-01 14:00:21 +08001521 u16 iobase;
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001522
Peter Hung6a8bc232015-04-01 14:00:21 +08001523 config_base = 0x40 + 0x08 * idx;
1524
1525 /* Get the io address from configuration space */
1526 pci_read_config_word(pdev, config_base + 4, &iobase);
1527
1528 dev_dbg(&pdev->dev, "%s: idx=%d iobase=0x%x", __func__, idx, iobase);
1529
1530 port->port.iotype = UPIO_PORT;
1531 port->port.iobase = iobase;
Peter Hungfecf27a2015-07-28 11:59:24 +08001532 port->port.rs485_config = pci_fintek_rs485_config;
1533
1534 data = devm_kzalloc(&pdev->dev, sizeof(u8), GFP_KERNEL);
1535 if (!data)
1536 return -ENOMEM;
1537
1538 /* preserve index in PCI configuration space */
1539 *data = idx;
1540 port->port.private_data = data;
Peter Hung6a8bc232015-04-01 14:00:21 +08001541
1542 return 0;
1543}
1544
1545static int pci_fintek_init(struct pci_dev *dev)
1546{
1547 unsigned long iobase;
1548 u32 max_port, i;
Ji-Ze Hong (Peter Hong)6def0472016-12-23 09:41:20 +08001549 resource_size_t bar_data[3];
Peter Hung6a8bc232015-04-01 14:00:21 +08001550 u8 config_base;
Peter Hungd3159452015-08-05 14:44:53 +08001551 struct serial_private *priv = pci_get_drvdata(dev);
1552 struct uart_8250_port *port;
Peter Hung6a8bc232015-04-01 14:00:21 +08001553
Ji-Ze Hong (Peter Hong)6def0472016-12-23 09:41:20 +08001554 if (!(pci_resource_flags(dev, 5) & IORESOURCE_IO) ||
1555 !(pci_resource_flags(dev, 4) & IORESOURCE_IO) ||
1556 !(pci_resource_flags(dev, 3) & IORESOURCE_IO))
1557 return -ENODEV;
1558
Peter Hung6a8bc232015-04-01 14:00:21 +08001559 switch (dev->device) {
1560 case 0x1104: /* 4 ports */
1561 case 0x1108: /* 8 ports */
1562 max_port = dev->device & 0xff;
Peter Hungcb8ee9f2014-11-19 13:22:27 +08001563 break;
Peter Hung6a8bc232015-04-01 14:00:21 +08001564 case 0x1112: /* 12 ports */
1565 max_port = 12;
Peter Hungcb8ee9f2014-11-19 13:22:27 +08001566 break;
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001567 default:
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001568 return -EINVAL;
1569 }
1570
Peter Hungcb8ee9f2014-11-19 13:22:27 +08001571 /* Get the io address dispatch from the BIOS */
Ji-Ze Hong (Peter Hong)6def0472016-12-23 09:41:20 +08001572 bar_data[0] = pci_resource_start(dev, 5);
1573 bar_data[1] = pci_resource_start(dev, 4);
1574 bar_data[2] = pci_resource_start(dev, 3);
Peter Hungcb8ee9f2014-11-19 13:22:27 +08001575
Peter Hung6a8bc232015-04-01 14:00:21 +08001576 for (i = 0; i < max_port; ++i) {
1577 /* UART0 configuration offset start from 0x40 */
1578 config_base = 0x40 + 0x08 * i;
Peter Hungcb8ee9f2014-11-19 13:22:27 +08001579
Peter Hung6a8bc232015-04-01 14:00:21 +08001580 /* Calculate Real IO Port */
1581 iobase = (bar_data[i / 4] & 0xffffffe0) + (i % 4) * 8;
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001582
Peter Hung6a8bc232015-04-01 14:00:21 +08001583 /* Enable UART I/O port */
1584 pci_write_config_byte(dev, config_base + 0x00, 0x01);
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001585
Peter Hung6a8bc232015-04-01 14:00:21 +08001586 /* Select 128-byte FIFO and 8x FIFO threshold */
1587 pci_write_config_byte(dev, config_base + 0x01, 0x33);
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001588
Peter Hung6a8bc232015-04-01 14:00:21 +08001589 /* LSB UART */
1590 pci_write_config_byte(dev, config_base + 0x04,
1591 (u8)(iobase & 0xff));
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001592
Peter Hung6a8bc232015-04-01 14:00:21 +08001593 /* MSB UART */
1594 pci_write_config_byte(dev, config_base + 0x05,
1595 (u8)((iobase & 0xff00) >> 8));
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001596
Peter Hung6a8bc232015-04-01 14:00:21 +08001597 pci_write_config_byte(dev, config_base + 0x06, dev->irq);
Peter Hungfecf27a2015-07-28 11:59:24 +08001598
Peter Hungd3159452015-08-05 14:44:53 +08001599 if (priv) {
1600 /* re-apply RS232/485 mode when
1601 * pciserial_resume_ports()
1602 */
1603 port = serial8250_get_port(priv->line[i]);
1604 pci_fintek_rs485_config(&port->port, NULL);
1605 } else {
1606 /* First init without port data
1607 * force init to RS232 Mode
1608 */
1609 pci_write_config_byte(dev, config_base + 0x07, 0x01);
1610 }
Peter Hung6a8bc232015-04-01 14:00:21 +08001611 }
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001612
Peter Hung6a8bc232015-04-01 14:00:21 +08001613 return max_port;
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07001614}
1615
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +08001616static void f815xxa_mem_serial_out(struct uart_port *p, int offset, int value)
1617{
1618 struct f815xxa_data *data = p->private_data;
1619 unsigned long flags;
1620
1621 spin_lock_irqsave(&data->lock, flags);
1622 writeb(value, p->membase + offset);
1623 readb(p->membase + UART_SCR); /* Dummy read for flush pcie tx queue */
1624 spin_unlock_irqrestore(&data->lock, flags);
1625}
1626
1627static int pci_fintek_f815xxa_setup(struct serial_private *priv,
1628 const struct pciserial_board *board,
1629 struct uart_8250_port *port, int idx)
1630{
1631 struct pci_dev *pdev = priv->dev;
1632 struct f815xxa_data *data;
1633
1634 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
1635 if (!data)
1636 return -ENOMEM;
1637
1638 data->idx = idx;
1639 spin_lock_init(&data->lock);
1640
1641 port->port.private_data = data;
1642 port->port.iotype = UPIO_MEM;
1643 port->port.flags |= UPF_IOREMAP;
1644 port->port.mapbase = pci_resource_start(pdev, 0) + 8 * idx;
1645 port->port.serial_out = f815xxa_mem_serial_out;
1646
1647 return 0;
1648}
1649
1650static int pci_fintek_f815xxa_init(struct pci_dev *dev)
1651{
1652 u32 max_port, i;
1653 int config_base;
1654
1655 if (!(pci_resource_flags(dev, 0) & IORESOURCE_MEM))
1656 return -ENODEV;
1657
1658 switch (dev->device) {
1659 case 0x1204: /* 4 ports */
1660 case 0x1208: /* 8 ports */
1661 max_port = dev->device & 0xff;
1662 break;
1663 case 0x1212: /* 12 ports */
1664 max_port = 12;
1665 break;
1666 default:
1667 return -EINVAL;
1668 }
1669
1670 /* Set to mmio decode */
1671 pci_write_config_byte(dev, 0x209, 0x40);
1672
1673 for (i = 0; i < max_port; ++i) {
1674 /* UART0 configuration offset start from 0x2A0 */
1675 config_base = 0x2A0 + 0x08 * i;
1676
1677 /* Select 128-byte FIFO and 8x FIFO threshold */
1678 pci_write_config_byte(dev, config_base + 0x01, 0x33);
1679
1680 /* Enable UART I/O port */
1681 pci_write_config_byte(dev, config_base + 0, 0x01);
1682 }
1683
1684 return max_port;
1685}
1686
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001687static int skip_tx_en_setup(struct serial_private *priv,
1688 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001689 struct uart_8250_port *port, int idx)
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001690{
Andy Shevchenkoc7ac15c2017-07-25 20:39:58 +03001691 port->port.quirks |= UPQ_NO_TXEN_TEST;
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07001692 dev_dbg(&priv->dev->dev,
1693 "serial8250: skipping TxEn test for device [%04x:%04x] subsystem [%04x:%04x]\n",
1694 priv->dev->vendor, priv->dev->device,
1695 priv->dev->subsystem_vendor, priv->dev->subsystem_device);
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08001696
1697 return pci_default_setup(priv, board, port, idx);
1698}
1699
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -07001700static void kt_handle_break(struct uart_port *p)
1701{
Andy Shevchenkob1261c82014-07-14 14:26:14 +03001702 struct uart_8250_port *up = up_to_u8250p(p);
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -07001703 /*
1704 * On receipt of a BI, serial device in Intel ME (Intel
1705 * management engine) needs to have its fifos cleared for sane
1706 * SOL (Serial Over Lan) output.
1707 */
1708 serial8250_clear_and_reinit_fifos(up);
1709}
1710
1711static unsigned int kt_serial_in(struct uart_port *p, int offset)
1712{
Andy Shevchenkob1261c82014-07-14 14:26:14 +03001713 struct uart_8250_port *up = up_to_u8250p(p);
Sudhakar Mamillapalli0ad372b2012-04-10 14:10:58 -07001714 unsigned int val;
1715
1716 /*
1717 * When the Intel ME (management engine) gets reset its serial
1718 * port registers could return 0 momentarily. Functions like
1719 * serial8250_console_write, read and save the IER, perform
1720 * some operation and then restore it. In order to avoid
1721 * setting IER register inadvertently to 0, if the value read
1722 * is 0, double check with ier value in uart_8250_port and use
1723 * that instead. up->ier should be the same value as what is
1724 * currently configured.
1725 */
1726 val = inb(p->iobase + offset);
1727 if (offset == UART_IER) {
1728 if (val == 0)
1729 val = up->ier;
1730 }
1731 return val;
1732}
1733
Dan Williamsbc02d152012-04-06 11:49:50 -07001734static int kt_serial_setup(struct serial_private *priv,
1735 const struct pciserial_board *board,
Alan Cox2655a2c2012-07-12 12:59:50 +01001736 struct uart_8250_port *port, int idx)
Dan Williamsbc02d152012-04-06 11:49:50 -07001737{
Alan Cox2655a2c2012-07-12 12:59:50 +01001738 port->port.flags |= UPF_BUG_THRE;
1739 port->port.serial_in = kt_serial_in;
1740 port->port.handle_break = kt_handle_break;
Dan Williamsbc02d152012-04-06 11:49:50 -07001741 return skip_tx_en_setup(priv, board, port, idx);
1742}
1743
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09001744static int pci_eg20t_init(struct pci_dev *dev)
1745{
1746#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
1747 return -ENODEV;
1748#else
1749 return 0;
1750#endif
1751}
1752
Matt Schultedc96efb2012-11-19 09:12:04 -06001753static int
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001754pci_wch_ch353_setup(struct serial_private *priv,
Anton Wuerfel6d7c1572016-01-14 16:08:11 +01001755 const struct pciserial_board *board,
1756 struct uart_8250_port *port, int idx)
Guainluca Anzolin6971c632012-09-04 15:56:12 +01001757{
1758 port->port.flags |= UPF_FIXED_TYPE;
1759 port->port.type = PORT_16550A;
Søren Holm06315342011-09-02 22:55:37 +02001760 return pci_default_setup(priv, board, port, idx);
1761}
1762
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03001763static int
Alexandr Petrenko55c368c2016-05-23 10:04:54 +03001764pci_wch_ch355_setup(struct serial_private *priv,
1765 const struct pciserial_board *board,
1766 struct uart_8250_port *port, int idx)
1767{
1768 port->port.flags |= UPF_FIXED_TYPE;
1769 port->port.type = PORT_16550A;
1770 return pci_default_setup(priv, board, port, idx);
1771}
1772
1773static int
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03001774pci_wch_ch38x_setup(struct serial_private *priv,
Anton Wuerfel6d7c1572016-01-14 16:08:11 +01001775 const struct pciserial_board *board,
1776 struct uart_8250_port *port, int idx)
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03001777{
1778 port->port.flags |= UPF_FIXED_TYPE;
1779 port->port.type = PORT_16850;
1780 return pci_default_setup(priv, board, port, idx);
1781}
1782
Du Huanpeng04b6ff52020-08-22 09:47:28 +08001783
1784#define CH384_XINT_ENABLE_REG 0xEB
1785#define CH384_XINT_ENABLE_BIT 0x02
1786
1787static int pci_wch_ch38x_init(struct pci_dev *dev)
1788{
1789 int max_port;
1790 unsigned long iobase;
1791
1792
1793 switch (dev->device) {
1794 case 0x3853: /* 8 ports */
1795 max_port = 8;
1796 break;
1797 default:
1798 return -EINVAL;
1799 }
1800
1801 iobase = pci_resource_start(dev, 0);
1802 outb(CH384_XINT_ENABLE_BIT, iobase + CH384_XINT_ENABLE_REG);
1803
1804 return max_port;
1805}
1806
1807static void pci_wch_ch38x_exit(struct pci_dev *dev)
1808{
1809 unsigned long iobase;
1810
1811 iobase = pci_resource_start(dev, 0);
1812 outb(0x0, iobase + CH384_XINT_ENABLE_REG);
1813}
1814
1815
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08001816static int
1817pci_sunix_setup(struct serial_private *priv,
1818 const struct pciserial_board *board,
1819 struct uart_8250_port *port, int idx)
1820{
1821 int bar;
1822 int offset;
1823
1824 port->port.flags |= UPF_FIXED_TYPE;
1825 port->port.type = PORT_SUNIX;
1826
1827 if (idx < 4) {
1828 bar = 0;
1829 offset = idx * board->uart_offset;
1830 } else {
1831 bar = 1;
1832 idx -= 4;
1833 idx = div_s64_rem(idx, 4, &offset);
1834 offset = idx * 64 + offset * board->uart_offset;
1835 }
1836
1837 return setup_port(priv, port, bar, offset, 0);
1838}
1839
Kai-Heng Fengd193db72019-08-17 00:51:24 +08001840static int
1841pci_moxa_setup(struct serial_private *priv,
1842 const struct pciserial_board *board,
1843 struct uart_8250_port *port, int idx)
1844{
1845 unsigned int bar = FL_GET_BASE(board->flags);
1846 int offset;
1847
1848 if (board->num_ports == 4 && idx == 3)
1849 offset = 7 * board->uart_offset;
1850 else
1851 offset = idx * board->uart_offset;
1852
1853 return setup_port(priv, port, bar, offset, 0);
1854}
1855
Linus Torvalds1da177e2005-04-16 15:20:36 -07001856#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1857#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1858#define PCI_DEVICE_ID_OCTPRO 0x0001
1859#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
1860#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1861#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1862#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
Flavio Leitner26e82202012-09-21 21:04:34 -03001863#define PCI_SUBDEVICE_ID_SIIG_DUAL_00 0x2500
1864#define PCI_SUBDEVICE_ID_SIIG_DUAL_30 0x2530
Michael Bramer78d70d42009-01-27 11:51:16 +00001865#define PCI_VENDOR_ID_ADVANTECH 0x13fe
Dirk Brandewie095e24b2010-11-17 07:35:20 -08001866#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66
Michael Bramer78d70d42009-01-27 11:51:16 +00001867#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
Thomee Wright0c6d7742014-05-19 20:30:51 +00001868#define PCI_DEVICE_ID_ADVANTECH_PCI3618 0x3618
1869#define PCI_DEVICE_ID_ADVANTECH_PCIf618 0xf618
Yegor Yefremov66169ad2010-06-04 09:58:18 +02001870#define PCI_DEVICE_ID_TITAN_200I 0x8028
1871#define PCI_DEVICE_ID_TITAN_400I 0x8048
1872#define PCI_DEVICE_ID_TITAN_800I 0x8088
1873#define PCI_DEVICE_ID_TITAN_800EH 0xA007
1874#define PCI_DEVICE_ID_TITAN_800EHB 0xA008
1875#define PCI_DEVICE_ID_TITAN_400EH 0xA009
1876#define PCI_DEVICE_ID_TITAN_100E 0xA010
1877#define PCI_DEVICE_ID_TITAN_200E 0xA012
1878#define PCI_DEVICE_ID_TITAN_400E 0xA013
1879#define PCI_DEVICE_ID_TITAN_800E 0xA014
1880#define PCI_DEVICE_ID_TITAN_200EI 0xA016
1881#define PCI_DEVICE_ID_TITAN_200EISI 0xA017
Yegor Yefremov48c02472013-12-09 12:11:15 +01001882#define PCI_DEVICE_ID_TITAN_200V3 0xA306
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01001883#define PCI_DEVICE_ID_TITAN_400V3 0xA310
1884#define PCI_DEVICE_ID_TITAN_410V3 0xA312
1885#define PCI_DEVICE_ID_TITAN_800V3 0xA314
1886#define PCI_DEVICE_ID_TITAN_800V3B 0xA315
Lytochkin Borise8470032010-07-26 10:02:26 +04001887#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
Scott Kilauaa273ae2011-05-11 15:41:59 -05001888#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04001889#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
Dan Williamsbc02d152012-04-06 11:49:50 -07001890#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
Alan Cox27788c52012-09-04 16:21:06 +01001891#define PCI_VENDOR_ID_WCH 0x4348
Wang YanQing8b5c9132013-03-05 23:16:48 +08001892#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
Alan Cox27788c52012-09-04 16:21:06 +01001893#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
1894#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
Ezequiel Garciafeb58142014-05-24 15:24:51 -03001895#define PCI_DEVICE_ID_WCH_CH353_1S1P 0x5053
Alan Cox27788c52012-09-04 16:21:06 +01001896#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
Alexandr Petrenko55c368c2016-05-23 10:04:54 +03001897#define PCI_DEVICE_ID_WCH_CH355_4S 0x7173
Alan Cox66835492012-08-16 12:01:33 +01001898#define PCI_VENDOR_ID_AGESTAR 0x5372
1899#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
Alan Coxeb26dfe2012-07-12 13:00:31 +01001900#define PCI_VENDOR_ID_ASIX 0x9710
Stephen Hurdebebd492013-01-17 14:14:53 -08001901#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001902#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
Matt Schulte14faa8c2012-11-21 10:35:15 -06001903
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03001904#define PCIE_VENDOR_ID_WCH 0x1c00
1905#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03001906#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
Du Huanpeng04b6ff52020-08-22 09:47:28 +08001907#define PCIE_DEVICE_ID_WCH_CH384_8S 0x3853
Jeremy McNicoll7dde5572016-02-02 13:00:45 -08001908#define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
Linus Torvalds1da177e2005-04-16 15:20:36 -07001909
Jimi Damonc8d19242016-07-20 17:00:40 -07001910#define PCI_VENDOR_ID_ACCESIO 0x494f
1911#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB 0x1051
1912#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S 0x1053
1913#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB 0x105C
1914#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S 0x105E
1915#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB 0x1091
1916#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2 0x1093
1917#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB 0x1099
1918#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4 0x109B
1919#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB 0x10D1
1920#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM 0x10D3
1921#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB 0x10DA
1922#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM 0x10DC
1923#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1 0x1108
1924#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2 0x1110
1925#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2 0x1111
1926#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4 0x1118
1927#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4 0x1119
1928#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S 0x1152
1929#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S 0x115A
1930#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2 0x1190
1931#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2 0x1191
1932#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4 0x1198
1933#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4 0x1199
1934#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM 0x11D0
1935#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4 0x105A
1936#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4 0x105B
1937#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8 0x106A
1938#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8 0x106B
1939#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4 0x1098
1940#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8 0x10A9
1941#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM 0x10D9
1942#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM 0x10E9
1943#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM 0x11D8
1944
1945
Kai-Heng Fengd193db72019-08-17 00:51:24 +08001946#define PCI_DEVICE_ID_MOXA_CP102E 0x1024
1947#define PCI_DEVICE_ID_MOXA_CP102EL 0x1025
1948#define PCI_DEVICE_ID_MOXA_CP104EL_A 0x1045
1949#define PCI_DEVICE_ID_MOXA_CP114EL 0x1144
1950#define PCI_DEVICE_ID_MOXA_CP116E_A_A 0x1160
1951#define PCI_DEVICE_ID_MOXA_CP116E_A_B 0x1161
1952#define PCI_DEVICE_ID_MOXA_CP118EL_A 0x1182
1953#define PCI_DEVICE_ID_MOXA_CP118E_A_I 0x1183
1954#define PCI_DEVICE_ID_MOXA_CP132EL 0x1322
1955#define PCI_DEVICE_ID_MOXA_CP134EL_A 0x1342
1956#define PCI_DEVICE_ID_MOXA_CP138E_A 0x1381
1957#define PCI_DEVICE_ID_MOXA_CP168EL_A 0x1683
Jimi Damonc8d19242016-07-20 17:00:40 -07001958
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001959/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
1960#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
Scott Ashcroftd13402a2013-03-03 21:35:06 +00001961#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07001962
Linus Torvalds1da177e2005-04-16 15:20:36 -07001963/*
1964 * Master list of serial port init/setup/exit quirks.
1965 * This does not describe the general nature of the port.
1966 * (ie, baud base, number and location of ports, etc)
1967 *
1968 * This list is ordered alphabetically by vendor then device.
1969 * Specific entries must come before more generic entries.
1970 */
Geert Uytterhoevenc3ae3dc2020-12-11 14:39:07 +01001971static struct pci_serial_quirk pci_serial_quirks[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001972 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001973 * ADDI-DATA GmbH communication cards <info@addi-data.com>
1974 */
1975 {
Ian Abbott086231f2013-07-16 16:14:39 +01001976 .vendor = PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01001977 .device = PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08001978 .subvendor = PCI_ANY_ID,
1979 .subdevice = PCI_ANY_ID,
1980 .setup = addidata_apci7800_setup,
1981 },
1982 /*
Russell King61a116e2006-07-03 15:22:35 +01001983 * AFAVLAB cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07001984 * It is not clear whether this applies to all products.
1985 */
1986 {
1987 .vendor = PCI_VENDOR_ID_AFAVLAB,
1988 .device = PCI_ANY_ID,
1989 .subvendor = PCI_ANY_ID,
1990 .subdevice = PCI_ANY_ID,
1991 .setup = afavlab_setup,
1992 },
1993 /*
1994 * HP Diva
1995 */
1996 {
1997 .vendor = PCI_VENDOR_ID_HP,
1998 .device = PCI_DEVICE_ID_HP_DIVA,
1999 .subvendor = PCI_ANY_ID,
2000 .subdevice = PCI_ANY_ID,
2001 .init = pci_hp_diva_init,
2002 .setup = pci_hp_diva_setup,
2003 },
2004 /*
Randy Wrighte0e24202021-05-14 10:26:54 -06002005 * HPE PCI serial device
2006 */
2007 {
2008 .vendor = PCI_VENDOR_ID_HP_3PAR,
2009 .device = PCI_DEVICE_ID_HPE_PCI_SERIAL,
2010 .subvendor = PCI_ANY_ID,
2011 .subdevice = PCI_ANY_ID,
2012 .setup = pci_hp_diva_setup,
2013 },
2014 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002015 * Intel
2016 */
2017 {
2018 .vendor = PCI_VENDOR_ID_INTEL,
2019 .device = PCI_DEVICE_ID_INTEL_80960_RP,
2020 .subvendor = 0xe4bf,
2021 .subdevice = PCI_ANY_ID,
2022 .init = pci_inteli960ni_init,
2023 .setup = pci_default_setup,
2024 },
Mauro Carvalho Chehabb6adea32009-02-20 15:38:52 -08002025 {
2026 .vendor = PCI_VENDOR_ID_INTEL,
2027 .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
2028 .subvendor = PCI_ANY_ID,
2029 .subdevice = PCI_ANY_ID,
2030 .setup = skip_tx_en_setup,
2031 },
2032 {
2033 .vendor = PCI_VENDOR_ID_INTEL,
2034 .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
2035 .subvendor = PCI_ANY_ID,
2036 .subdevice = PCI_ANY_ID,
2037 .setup = skip_tx_en_setup,
2038 },
2039 {
2040 .vendor = PCI_VENDOR_ID_INTEL,
2041 .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
2042 .subvendor = PCI_ANY_ID,
2043 .subdevice = PCI_ANY_ID,
2044 .setup = skip_tx_en_setup,
2045 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08002046 {
2047 .vendor = PCI_VENDOR_ID_INTEL,
2048 .device = PCI_DEVICE_ID_INTEL_CE4100_UART,
2049 .subvendor = PCI_ANY_ID,
2050 .subdevice = PCI_ANY_ID,
2051 .setup = ce4100_serial_setup,
2052 },
Dan Williamsbc02d152012-04-06 11:49:50 -07002053 {
2054 .vendor = PCI_VENDOR_ID_INTEL,
2055 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
2056 .subvendor = PCI_ANY_ID,
2057 .subdevice = PCI_ANY_ID,
2058 .setup = kt_serial_setup,
2059 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002060 /*
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002061 * ITE
2062 */
2063 {
2064 .vendor = PCI_VENDOR_ID_ITE,
2065 .device = PCI_DEVICE_ID_ITE_8872,
2066 .subvendor = PCI_ANY_ID,
2067 .subdevice = PCI_ANY_ID,
2068 .init = pci_ite887x_init,
2069 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002070 .exit = pci_ite887x_exit,
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002071 },
2072 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002073 * National Instruments
2074 */
2075 {
2076 .vendor = PCI_VENDOR_ID_NI,
Will Page04bf7e72009-04-06 17:32:15 +01002077 .device = PCI_DEVICE_ID_NI_PCI23216,
2078 .subvendor = PCI_ANY_ID,
2079 .subdevice = PCI_ANY_ID,
2080 .init = pci_ni8420_init,
2081 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002082 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002083 },
2084 {
2085 .vendor = PCI_VENDOR_ID_NI,
2086 .device = PCI_DEVICE_ID_NI_PCI2328,
2087 .subvendor = PCI_ANY_ID,
2088 .subdevice = PCI_ANY_ID,
2089 .init = pci_ni8420_init,
2090 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002091 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002092 },
2093 {
2094 .vendor = PCI_VENDOR_ID_NI,
2095 .device = PCI_DEVICE_ID_NI_PCI2324,
2096 .subvendor = PCI_ANY_ID,
2097 .subdevice = PCI_ANY_ID,
2098 .init = pci_ni8420_init,
2099 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002100 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002101 },
2102 {
2103 .vendor = PCI_VENDOR_ID_NI,
2104 .device = PCI_DEVICE_ID_NI_PCI2322,
2105 .subvendor = PCI_ANY_ID,
2106 .subdevice = PCI_ANY_ID,
2107 .init = pci_ni8420_init,
2108 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002109 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002110 },
2111 {
2112 .vendor = PCI_VENDOR_ID_NI,
2113 .device = PCI_DEVICE_ID_NI_PCI2324I,
2114 .subvendor = PCI_ANY_ID,
2115 .subdevice = PCI_ANY_ID,
2116 .init = pci_ni8420_init,
2117 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002118 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002119 },
2120 {
2121 .vendor = PCI_VENDOR_ID_NI,
2122 .device = PCI_DEVICE_ID_NI_PCI2322I,
2123 .subvendor = PCI_ANY_ID,
2124 .subdevice = PCI_ANY_ID,
2125 .init = pci_ni8420_init,
2126 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002127 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002128 },
2129 {
2130 .vendor = PCI_VENDOR_ID_NI,
2131 .device = PCI_DEVICE_ID_NI_PXI8420_23216,
2132 .subvendor = PCI_ANY_ID,
2133 .subdevice = PCI_ANY_ID,
2134 .init = pci_ni8420_init,
2135 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002136 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002137 },
2138 {
2139 .vendor = PCI_VENDOR_ID_NI,
2140 .device = PCI_DEVICE_ID_NI_PXI8420_2328,
2141 .subvendor = PCI_ANY_ID,
2142 .subdevice = PCI_ANY_ID,
2143 .init = pci_ni8420_init,
2144 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002145 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002146 },
2147 {
2148 .vendor = PCI_VENDOR_ID_NI,
2149 .device = PCI_DEVICE_ID_NI_PXI8420_2324,
2150 .subvendor = PCI_ANY_ID,
2151 .subdevice = PCI_ANY_ID,
2152 .init = pci_ni8420_init,
2153 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002154 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002155 },
2156 {
2157 .vendor = PCI_VENDOR_ID_NI,
2158 .device = PCI_DEVICE_ID_NI_PXI8420_2322,
2159 .subvendor = PCI_ANY_ID,
2160 .subdevice = PCI_ANY_ID,
2161 .init = pci_ni8420_init,
2162 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002163 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002164 },
2165 {
2166 .vendor = PCI_VENDOR_ID_NI,
2167 .device = PCI_DEVICE_ID_NI_PXI8422_2324,
2168 .subvendor = PCI_ANY_ID,
2169 .subdevice = PCI_ANY_ID,
2170 .init = pci_ni8420_init,
2171 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002172 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002173 },
2174 {
2175 .vendor = PCI_VENDOR_ID_NI,
2176 .device = PCI_DEVICE_ID_NI_PXI8422_2322,
2177 .subvendor = PCI_ANY_ID,
2178 .subdevice = PCI_ANY_ID,
2179 .init = pci_ni8420_init,
2180 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002181 .exit = pci_ni8420_exit,
Will Page04bf7e72009-04-06 17:32:15 +01002182 },
2183 {
2184 .vendor = PCI_VENDOR_ID_NI,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002185 .device = PCI_ANY_ID,
2186 .subvendor = PCI_ANY_ID,
2187 .subdevice = PCI_ANY_ID,
2188 .init = pci_ni8430_init,
2189 .setup = pci_ni8430_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002190 .exit = pci_ni8430_exit,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002191 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10302192 /* Quatech */
2193 {
2194 .vendor = PCI_VENDOR_ID_QUATECH,
2195 .device = PCI_ANY_ID,
2196 .subvendor = PCI_ANY_ID,
2197 .subdevice = PCI_ANY_ID,
2198 .init = pci_quatech_init,
2199 .setup = pci_quatech_setup,
Greg Kroah-Hartmand73dfc62013-01-15 22:44:48 -08002200 .exit = pci_quatech_exit,
Alan Cox55c7c0f2012-11-29 09:03:00 +10302201 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002202 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002203 * Panacom
2204 */
2205 {
2206 .vendor = PCI_VENDOR_ID_PANACOM,
2207 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
2208 .subvendor = PCI_ANY_ID,
2209 .subdevice = PCI_ANY_ID,
2210 .init = pci_plx9050_init,
2211 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002212 .exit = pci_plx9050_exit,
Alan Cox5756ee92008-02-08 04:18:51 -08002213 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002214 {
2215 .vendor = PCI_VENDOR_ID_PANACOM,
2216 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
2217 .subvendor = PCI_ANY_ID,
2218 .subdevice = PCI_ANY_ID,
2219 .init = pci_plx9050_init,
2220 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002221 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002222 },
2223 /*
Angelo Butti5c31ef92016-11-07 16:39:03 +01002224 * Pericom (Only 7954 - It have a offset jump for port 4)
2225 */
2226 {
2227 .vendor = PCI_VENDOR_ID_PERICOM,
2228 .device = PCI_DEVICE_ID_PERICOM_PI7C9X7954,
2229 .subvendor = PCI_ANY_ID,
2230 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002231 .setup = pci_pericom_setup_four_at_eight,
Angelo Butti5c31ef92016-11-07 16:39:03 +01002232 },
2233 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002234 * PLX
2235 */
2236 {
2237 .vendor = PCI_VENDOR_ID_PLX,
2238 .device = PCI_DEVICE_ID_PLX_9050,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01002239 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
2240 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
2241 .init = pci_plx9050_init,
2242 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002243 .exit = pci_plx9050_exit,
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01002244 },
2245 {
2246 .vendor = PCI_VENDOR_ID_PLX,
2247 .device = PCI_DEVICE_ID_PLX_9050,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002248 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
2249 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
2250 .init = pci_plx9050_init,
2251 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002252 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002253 },
2254 {
2255 .vendor = PCI_VENDOR_ID_PLX,
2256 .device = PCI_DEVICE_ID_PLX_ROMULUS,
2257 .subvendor = PCI_VENDOR_ID_PLX,
2258 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
2259 .init = pci_plx9050_init,
2260 .setup = pci_default_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002261 .exit = pci_plx9050_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002262 },
Jay Dolan78d38202019-02-12 21:43:12 -08002263 {
2264 .vendor = PCI_VENDOR_ID_ACCESIO,
2265 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB,
2266 .subvendor = PCI_ANY_ID,
2267 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002268 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002269 },
2270 {
2271 .vendor = PCI_VENDOR_ID_ACCESIO,
2272 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S,
2273 .subvendor = PCI_ANY_ID,
2274 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002275 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002276 },
2277 {
2278 .vendor = PCI_VENDOR_ID_ACCESIO,
2279 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB,
2280 .subvendor = PCI_ANY_ID,
2281 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002282 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002283 },
2284 {
2285 .vendor = PCI_VENDOR_ID_ACCESIO,
2286 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4,
2287 .subvendor = PCI_ANY_ID,
2288 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002289 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002290 },
2291 {
2292 .vendor = PCI_VENDOR_ID_ACCESIO,
2293 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB,
2294 .subvendor = PCI_ANY_ID,
2295 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002296 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002297 },
2298 {
2299 .vendor = PCI_VENDOR_ID_ACCESIO,
2300 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM,
2301 .subvendor = PCI_ANY_ID,
2302 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002303 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002304 },
2305 {
2306 .vendor = PCI_VENDOR_ID_ACCESIO,
2307 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4,
2308 .subvendor = PCI_ANY_ID,
2309 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002310 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002311 },
2312 {
2313 .vendor = PCI_VENDOR_ID_ACCESIO,
2314 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4,
2315 .subvendor = PCI_ANY_ID,
2316 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002317 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002318 },
2319 {
2320 .vendor = PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S,
2321 .device = PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4,
2322 .subvendor = PCI_ANY_ID,
2323 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002324 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002325 },
2326 {
2327 .vendor = PCI_VENDOR_ID_ACCESIO,
2328 .device = PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4,
2329 .subvendor = PCI_ANY_ID,
2330 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002331 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002332 },
2333 {
2334 .vendor = PCI_VENDOR_ID_ACCESIO,
2335 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4,
2336 .subvendor = PCI_ANY_ID,
2337 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002338 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002339 },
2340 {
2341 .vendor = PCI_VENDOR_ID_ACCESIO,
2342 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4,
2343 .subvendor = PCI_ANY_ID,
2344 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002345 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002346 },
2347 {
2348 .vendor = PCI_VENDOR_ID_ACCESIO,
2349 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4,
2350 .subvendor = PCI_ANY_ID,
2351 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002352 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002353 },
2354 {
2355 .vendor = PCI_VENDOR_ID_ACCESIO,
2356 .device = PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM,
2357 .subvendor = PCI_ANY_ID,
2358 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002359 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002360 },
2361 {
2362 .vendor = PCI_VENDOR_ID_ACCESIO,
2363 .device = PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM,
2364 .subvendor = PCI_ANY_ID,
2365 .subdevice = PCI_ANY_ID,
Jay Dolan6bf4e422019-06-11 04:47:15 -07002366 .setup = pci_pericom_setup_four_at_eight,
Jay Dolan78d38202019-02-12 21:43:12 -08002367 },
Jay Dolan6bf4e422019-06-11 04:47:15 -07002368 {
2369 .vendor = PCI_VENDOR_ID_ACCESIO,
2370 .device = PCI_ANY_ID,
2371 .subvendor = PCI_ANY_ID,
2372 .subdevice = PCI_ANY_ID,
2373 .setup = pci_pericom_setup,
2374 }, /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002375 * SBS Technologies, Inc., PMC-OCTALPRO 232
2376 */
2377 {
2378 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2379 .device = PCI_DEVICE_ID_OCTPRO,
2380 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2381 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
2382 .init = sbs_init,
2383 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002384 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002385 },
2386 /*
2387 * SBS Technologies, Inc., PMC-OCTALPRO 422
2388 */
2389 {
2390 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2391 .device = PCI_DEVICE_ID_OCTPRO,
2392 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2393 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
2394 .init = sbs_init,
2395 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002396 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002397 },
2398 /*
2399 * SBS Technologies, Inc., P-Octal 232
2400 */
2401 {
2402 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2403 .device = PCI_DEVICE_ID_OCTPRO,
2404 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2405 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
2406 .init = sbs_init,
2407 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002408 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002409 },
2410 /*
2411 * SBS Technologies, Inc., P-Octal 422
2412 */
2413 {
2414 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2415 .device = PCI_DEVICE_ID_OCTPRO,
2416 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2417 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
2418 .init = sbs_init,
2419 .setup = sbs_setup,
Bill Pemberton2d47b712012-11-19 13:21:34 -05002420 .exit = sbs_exit,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002421 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002422 /*
Russell King61a116e2006-07-03 15:22:35 +01002423 * SIIG cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002424 */
2425 {
2426 .vendor = PCI_VENDOR_ID_SIIG,
Russell King67d74b82005-07-27 11:33:03 +01002427 .device = PCI_ANY_ID,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002428 .subvendor = PCI_ANY_ID,
2429 .subdevice = PCI_ANY_ID,
Russell King67d74b82005-07-27 11:33:03 +01002430 .init = pci_siig_init,
Andrey Panin3ec9c592006-02-02 20:15:09 +00002431 .setup = pci_siig_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002432 },
2433 /*
2434 * Titan cards
2435 */
2436 {
2437 .vendor = PCI_VENDOR_ID_TITAN,
2438 .device = PCI_DEVICE_ID_TITAN_400L,
2439 .subvendor = PCI_ANY_ID,
2440 .subdevice = PCI_ANY_ID,
2441 .setup = titan_400l_800l_setup,
2442 },
2443 {
2444 .vendor = PCI_VENDOR_ID_TITAN,
2445 .device = PCI_DEVICE_ID_TITAN_800L,
2446 .subvendor = PCI_ANY_ID,
2447 .subdevice = PCI_ANY_ID,
2448 .setup = titan_400l_800l_setup,
2449 },
2450 /*
2451 * Timedia cards
2452 */
2453 {
2454 .vendor = PCI_VENDOR_ID_TIMEDIA,
2455 .device = PCI_DEVICE_ID_TIMEDIA_1889,
2456 .subvendor = PCI_VENDOR_ID_TIMEDIA,
2457 .subdevice = PCI_ANY_ID,
Frédéric Brièreb9b24552011-05-29 15:08:04 -04002458 .probe = pci_timedia_probe,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002459 .init = pci_timedia_init,
2460 .setup = pci_timedia_setup,
2461 },
2462 {
2463 .vendor = PCI_VENDOR_ID_TIMEDIA,
2464 .device = PCI_ANY_ID,
2465 .subvendor = PCI_ANY_ID,
2466 .subdevice = PCI_ANY_ID,
2467 .setup = pci_timedia_setup,
2468 },
2469 /*
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08002470 * Sunix PCI serial boards
Stephen Chiversabd7bac2013-01-28 19:49:20 +11002471 */
2472 {
2473 .vendor = PCI_VENDOR_ID_SUNIX,
2474 .device = PCI_DEVICE_ID_SUNIX_1999,
2475 .subvendor = PCI_VENDOR_ID_SUNIX,
2476 .subdevice = PCI_ANY_ID,
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08002477 .setup = pci_sunix_setup,
Stephen Chiversabd7bac2013-01-28 19:49:20 +11002478 },
2479 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002480 * Xircom cards
2481 */
2482 {
2483 .vendor = PCI_VENDOR_ID_XIRCOM,
2484 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2485 .subvendor = PCI_ANY_ID,
2486 .subdevice = PCI_ANY_ID,
2487 .init = pci_xircom_init,
2488 .setup = pci_default_setup,
2489 },
2490 /*
Russell King61a116e2006-07-03 15:22:35 +01002491 * Netmos cards - these may be called via parport_serial
Linus Torvalds1da177e2005-04-16 15:20:36 -07002492 */
2493 {
2494 .vendor = PCI_VENDOR_ID_NETMOS,
2495 .device = PCI_ANY_ID,
2496 .subvendor = PCI_ANY_ID,
2497 .subdevice = PCI_ANY_ID,
2498 .init = pci_netmos_init,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002499 .setup = pci_netmos_9900_setup,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002500 },
2501 /*
Mike Skoog1bc8cde2014-10-16 13:10:01 -07002502 * EndRun Technologies
2503 */
2504 {
2505 .vendor = PCI_VENDOR_ID_ENDRUN,
2506 .device = PCI_ANY_ID,
2507 .subvendor = PCI_ANY_ID,
2508 .subdevice = PCI_ANY_ID,
2509 .init = pci_endrun_init,
2510 .setup = pci_default_setup,
2511 },
2512 /*
Scott Kilauaa273ae2011-05-11 15:41:59 -05002513 * For Oxford Semiconductor Tornado based devices
Russell King9f2a0362009-01-02 13:44:20 +00002514 */
2515 {
2516 .vendor = PCI_VENDOR_ID_OXSEMI,
2517 .device = PCI_ANY_ID,
2518 .subvendor = PCI_ANY_ID,
2519 .subdevice = PCI_ANY_ID,
2520 .init = pci_oxsemi_tornado_init,
2521 .setup = pci_default_setup,
2522 },
2523 {
2524 .vendor = PCI_VENDOR_ID_MAINPINE,
2525 .device = PCI_ANY_ID,
2526 .subvendor = PCI_ANY_ID,
2527 .subdevice = PCI_ANY_ID,
2528 .init = pci_oxsemi_tornado_init,
2529 .setup = pci_default_setup,
2530 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05002531 {
2532 .vendor = PCI_VENDOR_ID_DIGI,
2533 .device = PCIE_DEVICE_ID_NEO_2_OX_IBM,
2534 .subvendor = PCI_SUBVENDOR_ID_IBM,
2535 .subdevice = PCI_ANY_ID,
2536 .init = pci_oxsemi_tornado_init,
2537 .setup = pci_default_setup,
2538 },
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002539 {
2540 .vendor = PCI_VENDOR_ID_INTEL,
2541 .device = 0x8811,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002542 .subvendor = PCI_ANY_ID,
2543 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002544 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002545 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002546 },
2547 {
2548 .vendor = PCI_VENDOR_ID_INTEL,
2549 .device = 0x8812,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002550 .subvendor = PCI_ANY_ID,
2551 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002552 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002553 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002554 },
2555 {
2556 .vendor = PCI_VENDOR_ID_INTEL,
2557 .device = 0x8813,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002558 .subvendor = PCI_ANY_ID,
2559 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002560 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002561 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002562 },
2563 {
2564 .vendor = PCI_VENDOR_ID_INTEL,
2565 .device = 0x8814,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002566 .subvendor = PCI_ANY_ID,
2567 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002568 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002569 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002570 },
2571 {
2572 .vendor = 0x10DB,
2573 .device = 0x8027,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002574 .subvendor = PCI_ANY_ID,
2575 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002576 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002577 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002578 },
2579 {
2580 .vendor = 0x10DB,
2581 .device = 0x8028,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002582 .subvendor = PCI_ANY_ID,
2583 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002584 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002585 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002586 },
2587 {
2588 .vendor = 0x10DB,
2589 .device = 0x8029,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002590 .subvendor = PCI_ANY_ID,
2591 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002592 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002593 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002594 },
2595 {
2596 .vendor = 0x10DB,
2597 .device = 0x800C,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002598 .subvendor = PCI_ANY_ID,
2599 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002600 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002601 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002602 },
2603 {
2604 .vendor = 0x10DB,
2605 .device = 0x800D,
Arnaud Patardaaa10eb2012-04-25 12:17:24 +02002606 .subvendor = PCI_ANY_ID,
2607 .subdevice = PCI_ANY_ID,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002608 .init = pci_eg20t_init,
Tomoya MORINAGA64d91cf2011-10-07 13:39:49 +09002609 .setup = pci_default_setup,
Tomoya MORINAGAeb7073d2011-06-02 11:31:29 +09002610 },
Russell King9f2a0362009-01-02 13:44:20 +00002611 /*
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002612 * Cronyx Omega PCI (PLX-chip based)
2613 */
2614 {
2615 .vendor = PCI_VENDOR_ID_PLX,
2616 .device = PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
2617 .subvendor = PCI_ANY_ID,
2618 .subdevice = PCI_ANY_ID,
2619 .setup = pci_omegapci_setup,
Alan Coxeb26dfe2012-07-12 13:00:31 +01002620 },
Ezequiel Garciafeb58142014-05-24 15:24:51 -03002621 /* WCH CH353 1S1P card (16550 clone) */
2622 {
2623 .vendor = PCI_VENDOR_ID_WCH,
2624 .device = PCI_DEVICE_ID_WCH_CH353_1S1P,
2625 .subvendor = PCI_ANY_ID,
2626 .subdevice = PCI_ANY_ID,
2627 .setup = pci_wch_ch353_setup,
2628 },
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002629 /* WCH CH353 2S1P card (16550 clone) */
2630 {
Alan Cox27788c52012-09-04 16:21:06 +01002631 .vendor = PCI_VENDOR_ID_WCH,
2632 .device = PCI_DEVICE_ID_WCH_CH353_2S1P,
2633 .subvendor = PCI_ANY_ID,
2634 .subdevice = PCI_ANY_ID,
2635 .setup = pci_wch_ch353_setup,
2636 },
2637 /* WCH CH353 4S card (16550 clone) */
2638 {
2639 .vendor = PCI_VENDOR_ID_WCH,
2640 .device = PCI_DEVICE_ID_WCH_CH353_4S,
2641 .subvendor = PCI_ANY_ID,
2642 .subdevice = PCI_ANY_ID,
2643 .setup = pci_wch_ch353_setup,
2644 },
2645 /* WCH CH353 2S1PF card (16550 clone) */
2646 {
2647 .vendor = PCI_VENDOR_ID_WCH,
2648 .device = PCI_DEVICE_ID_WCH_CH353_2S1PF,
2649 .subvendor = PCI_ANY_ID,
2650 .subdevice = PCI_ANY_ID,
Guainluca Anzolin6971c632012-09-04 15:56:12 +01002651 .setup = pci_wch_ch353_setup,
2652 },
Wang YanQing8b5c9132013-03-05 23:16:48 +08002653 /* WCH CH352 2S card (16550 clone) */
2654 {
2655 .vendor = PCI_VENDOR_ID_WCH,
2656 .device = PCI_DEVICE_ID_WCH_CH352_2S,
2657 .subvendor = PCI_ANY_ID,
2658 .subdevice = PCI_ANY_ID,
2659 .setup = pci_wch_ch353_setup,
2660 },
Alexandr Petrenko55c368c2016-05-23 10:04:54 +03002661 /* WCH CH355 4S card (16550 clone) */
2662 {
2663 .vendor = PCI_VENDOR_ID_WCH,
2664 .device = PCI_DEVICE_ID_WCH_CH355_4S,
2665 .subvendor = PCI_ANY_ID,
2666 .subdevice = PCI_ANY_ID,
2667 .setup = pci_wch_ch355_setup,
2668 },
Jeremy McNicoll7dde5572016-02-02 13:00:45 -08002669 /* WCH CH382 2S card (16850 clone) */
2670 {
2671 .vendor = PCIE_VENDOR_ID_WCH,
2672 .device = PCIE_DEVICE_ID_WCH_CH382_2S,
2673 .subvendor = PCI_ANY_ID,
2674 .subdevice = PCI_ANY_ID,
2675 .setup = pci_wch_ch38x_setup,
2676 },
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03002677 /* WCH CH382 2S1P card (16850 clone) */
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03002678 {
2679 .vendor = PCIE_VENDOR_ID_WCH,
2680 .device = PCIE_DEVICE_ID_WCH_CH382_2S1P,
2681 .subvendor = PCI_ANY_ID,
2682 .subdevice = PCI_ANY_ID,
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03002683 .setup = pci_wch_ch38x_setup,
2684 },
2685 /* WCH CH384 4S card (16850 clone) */
2686 {
2687 .vendor = PCIE_VENDOR_ID_WCH,
2688 .device = PCIE_DEVICE_ID_WCH_CH384_4S,
2689 .subvendor = PCI_ANY_ID,
2690 .subdevice = PCI_ANY_ID,
2691 .setup = pci_wch_ch38x_setup,
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03002692 },
Du Huanpeng04b6ff52020-08-22 09:47:28 +08002693 /* WCH CH384 8S card (16850 clone) */
2694 {
2695 .vendor = PCIE_VENDOR_ID_WCH,
2696 .device = PCIE_DEVICE_ID_WCH_CH384_8S,
2697 .subvendor = PCI_ANY_ID,
2698 .subdevice = PCI_ANY_ID,
2699 .init = pci_wch_ch38x_init,
2700 .exit = pci_wch_ch38x_exit,
2701 .setup = pci_wch_ch38x_setup,
2702 },
Alan Coxeb26dfe2012-07-12 13:00:31 +01002703 /*
2704 * ASIX devices with FIFO bug
2705 */
2706 {
2707 .vendor = PCI_VENDOR_ID_ASIX,
2708 .device = PCI_ANY_ID,
2709 .subvendor = PCI_ANY_ID,
2710 .subdevice = PCI_ANY_ID,
2711 .setup = pci_asix_setup,
2712 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002713 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08002714 * Broadcom TruManage (NetXtreme)
2715 */
2716 {
2717 .vendor = PCI_VENDOR_ID_BROADCOM,
2718 .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
2719 .subvendor = PCI_ANY_ID,
2720 .subdevice = PCI_ANY_ID,
2721 .setup = pci_brcm_trumanage_setup,
2722 },
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002723 {
2724 .vendor = 0x1c29,
2725 .device = 0x1104,
2726 .subvendor = PCI_ANY_ID,
2727 .subdevice = PCI_ANY_ID,
2728 .setup = pci_fintek_setup,
Peter Hung6a8bc232015-04-01 14:00:21 +08002729 .init = pci_fintek_init,
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002730 },
2731 {
2732 .vendor = 0x1c29,
2733 .device = 0x1108,
2734 .subvendor = PCI_ANY_ID,
2735 .subdevice = PCI_ANY_ID,
2736 .setup = pci_fintek_setup,
Peter Hung6a8bc232015-04-01 14:00:21 +08002737 .init = pci_fintek_init,
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002738 },
2739 {
2740 .vendor = 0x1c29,
2741 .device = 0x1112,
2742 .subvendor = PCI_ANY_ID,
2743 .subdevice = PCI_ANY_ID,
2744 .setup = pci_fintek_setup,
Peter Hung6a8bc232015-04-01 14:00:21 +08002745 .init = pci_fintek_init,
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002746 },
Kai-Heng Fengd193db72019-08-17 00:51:24 +08002747 /*
2748 * MOXA
2749 */
2750 {
2751 .vendor = PCI_VENDOR_ID_MOXA,
2752 .device = PCI_ANY_ID,
2753 .subvendor = PCI_ANY_ID,
2754 .subdevice = PCI_ANY_ID,
2755 .setup = pci_moxa_setup,
2756 },
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +08002757 {
2758 .vendor = 0x1c29,
2759 .device = 0x1204,
2760 .subvendor = PCI_ANY_ID,
2761 .subdevice = PCI_ANY_ID,
2762 .setup = pci_fintek_f815xxa_setup,
2763 .init = pci_fintek_f815xxa_init,
2764 },
2765 {
2766 .vendor = 0x1c29,
2767 .device = 0x1208,
2768 .subvendor = PCI_ANY_ID,
2769 .subdevice = PCI_ANY_ID,
2770 .setup = pci_fintek_f815xxa_setup,
2771 .init = pci_fintek_f815xxa_init,
2772 },
2773 {
2774 .vendor = 0x1c29,
2775 .device = 0x1212,
2776 .subvendor = PCI_ANY_ID,
2777 .subdevice = PCI_ANY_ID,
2778 .setup = pci_fintek_f815xxa_setup,
2779 .init = pci_fintek_f815xxa_init,
2780 },
Stephen Hurdebebd492013-01-17 14:14:53 -08002781
2782 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002783 * Default "match everything" terminator entry
2784 */
2785 {
2786 .vendor = PCI_ANY_ID,
2787 .device = PCI_ANY_ID,
2788 .subvendor = PCI_ANY_ID,
2789 .subdevice = PCI_ANY_ID,
2790 .setup = pci_default_setup,
2791 }
2792};
2793
2794static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
2795{
2796 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
2797}
2798
2799static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
2800{
2801 struct pci_serial_quirk *quirk;
2802
2803 for (quirk = pci_serial_quirks; ; quirk++)
2804 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
2805 quirk_id_matches(quirk->device, dev->device) &&
2806 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
2807 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
Alan Cox5756ee92008-02-08 04:18:51 -08002808 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002809 return quirk;
2810}
2811
Linus Torvalds1da177e2005-04-16 15:20:36 -07002812/*
2813 * This is the configuration table for all of the PCI serial boards
2814 * which we support. It is directly indexed by the pci_board_num_t enum
2815 * value, which is encoded in the pci_device_id PCI probe table's
2816 * driver_data member.
2817 *
2818 * The makeup of these names are:
Gareth Howlett26e92862006-01-04 17:00:42 +00002819 * pbn_bn{_bt}_n_baud{_offsetinhex}
Linus Torvalds1da177e2005-04-16 15:20:36 -07002820 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002821 * bn = PCI BAR number
2822 * bt = Index using PCI BARs
2823 * n = number of serial ports
2824 * baud = baud rate
2825 * offsetinhex = offset for each sequential port (in hex)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002826 *
Gareth Howlett26e92862006-01-04 17:00:42 +00002827 * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
Russell Kingf1690f32005-05-06 10:19:09 +01002828 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07002829 * Please note: in theory if n = 1, _bt infix should make no difference.
2830 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
2831 */
2832enum pci_board_num_t {
2833 pbn_default = 0,
2834
2835 pbn_b0_1_115200,
2836 pbn_b0_2_115200,
2837 pbn_b0_4_115200,
2838 pbn_b0_5_115200,
Alan Coxbf0df632007-10-16 01:24:00 -07002839 pbn_b0_8_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002840
2841 pbn_b0_1_921600,
2842 pbn_b0_2_921600,
2843 pbn_b0_4_921600,
2844
David Ransondb1de152005-07-27 11:43:55 -07002845 pbn_b0_2_1130000,
2846
Andrey Paninfbc0dc02005-07-18 11:38:09 +01002847 pbn_b0_4_1152000,
2848
Ian Abbott1c9c8582017-02-03 20:25:00 +00002849 pbn_b0_4_1250000,
2850
Gareth Howlett26e92862006-01-04 17:00:42 +00002851 pbn_b0_2_1843200,
2852 pbn_b0_4_1843200,
2853
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02002854 pbn_b0_1_3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01002855
Linus Torvalds1da177e2005-04-16 15:20:36 -07002856 pbn_b0_bt_1_115200,
2857 pbn_b0_bt_2_115200,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08002858 pbn_b0_bt_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002859 pbn_b0_bt_8_115200,
2860
2861 pbn_b0_bt_1_460800,
2862 pbn_b0_bt_2_460800,
2863 pbn_b0_bt_4_460800,
2864
2865 pbn_b0_bt_1_921600,
2866 pbn_b0_bt_2_921600,
2867 pbn_b0_bt_4_921600,
2868 pbn_b0_bt_8_921600,
2869
2870 pbn_b1_1_115200,
2871 pbn_b1_2_115200,
2872 pbn_b1_4_115200,
2873 pbn_b1_8_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002874 pbn_b1_16_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002875
2876 pbn_b1_1_921600,
2877 pbn_b1_2_921600,
2878 pbn_b1_4_921600,
2879 pbn_b1_8_921600,
2880
Gareth Howlett26e92862006-01-04 17:00:42 +00002881 pbn_b1_2_1250000,
2882
Niels de Vos84f8c6f2007-08-22 14:01:14 -07002883 pbn_b1_bt_1_115200,
Will Page04bf7e72009-04-06 17:32:15 +01002884 pbn_b1_bt_2_115200,
2885 pbn_b1_bt_4_115200,
2886
Linus Torvalds1da177e2005-04-16 15:20:36 -07002887 pbn_b1_bt_2_921600,
2888
2889 pbn_b1_1_1382400,
2890 pbn_b1_2_1382400,
2891 pbn_b1_4_1382400,
2892 pbn_b1_8_1382400,
2893
2894 pbn_b2_1_115200,
Peter Horton737c1752006-08-26 09:07:36 +01002895 pbn_b2_2_115200,
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08002896 pbn_b2_4_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002897 pbn_b2_8_115200,
2898
2899 pbn_b2_1_460800,
2900 pbn_b2_4_460800,
2901 pbn_b2_8_460800,
2902 pbn_b2_16_460800,
2903
2904 pbn_b2_1_921600,
2905 pbn_b2_4_921600,
2906 pbn_b2_8_921600,
2907
Lytochkin Borise8470032010-07-26 10:02:26 +04002908 pbn_b2_8_1152000,
2909
Linus Torvalds1da177e2005-04-16 15:20:36 -07002910 pbn_b2_bt_1_115200,
2911 pbn_b2_bt_2_115200,
2912 pbn_b2_bt_4_115200,
2913
2914 pbn_b2_bt_2_921600,
2915 pbn_b2_bt_4_921600,
2916
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00002917 pbn_b3_2_115200,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002918 pbn_b3_4_115200,
2919 pbn_b3_8_115200,
2920
Yegor Yefremov66169ad2010-06-04 09:58:18 +02002921 pbn_b4_bt_2_921600,
2922 pbn_b4_bt_4_921600,
2923 pbn_b4_bt_8_921600,
2924
Linus Torvalds1da177e2005-04-16 15:20:36 -07002925 /*
2926 * Board-specific versions.
2927 */
2928 pbn_panacom,
2929 pbn_panacom2,
2930 pbn_panacom4,
2931 pbn_plx_romulus,
Mike Skoog1bc8cde2014-10-16 13:10:01 -07002932 pbn_endrun_2_4000000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002933 pbn_oxsemi,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02002934 pbn_oxsemi_1_3906250,
2935 pbn_oxsemi_2_3906250,
2936 pbn_oxsemi_4_3906250,
2937 pbn_oxsemi_8_3906250,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002938 pbn_intel_i960,
2939 pbn_sgi_ioc3,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002940 pbn_computone_4,
2941 pbn_computone_6,
2942 pbn_computone_8,
2943 pbn_sbsxrsio,
Olof Johanssonaa798502007-08-22 14:01:55 -07002944 pbn_pasemi_1682M,
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01002945 pbn_ni8430_2,
2946 pbn_ni8430_4,
2947 pbn_ni8430_8,
2948 pbn_ni8430_16,
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07002949 pbn_ADDIDATA_PCIe_1_3906250,
2950 pbn_ADDIDATA_PCIe_2_3906250,
2951 pbn_ADDIDATA_PCIe_4_3906250,
2952 pbn_ADDIDATA_PCIe_8_3906250,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08002953 pbn_ce4100_1_115200,
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04002954 pbn_omegapci,
Nicos Gollan7808edc2011-05-05 21:00:37 +02002955 pbn_NETMOS9900_2s_115200,
Stephen Hurdebebd492013-01-17 14:14:53 -08002956 pbn_brcm_trumanage,
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07002957 pbn_fintek_4,
2958 pbn_fintek_8,
2959 pbn_fintek_12,
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +08002960 pbn_fintek_F81504A,
2961 pbn_fintek_F81508A,
2962 pbn_fintek_F81512A,
Jeremy McNicoll7dde5572016-02-02 13:00:45 -08002963 pbn_wch382_2,
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03002964 pbn_wch384_4,
Du Huanpeng04b6ff52020-08-22 09:47:28 +08002965 pbn_wch384_8,
Adam Lee89c043a2015-08-03 13:28:13 +08002966 pbn_pericom_PI7C9X7951,
2967 pbn_pericom_PI7C9X7952,
2968 pbn_pericom_PI7C9X7954,
2969 pbn_pericom_PI7C9X7958,
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08002970 pbn_sunix_pci_1s,
2971 pbn_sunix_pci_2s,
2972 pbn_sunix_pci_4s,
2973 pbn_sunix_pci_8s,
2974 pbn_sunix_pci_16s,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02002975 pbn_titan_1_4000000,
2976 pbn_titan_2_4000000,
2977 pbn_titan_4_4000000,
2978 pbn_titan_8_4000000,
Kai-Heng Fengd193db72019-08-17 00:51:24 +08002979 pbn_moxa8250_2p,
2980 pbn_moxa8250_4p,
2981 pbn_moxa8250_8p,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002982};
2983
2984/*
2985 * uart_offset - the space between channels
2986 * reg_shift - describes how the UART registers are mapped
2987 * to PCI memory by the card.
2988 * For example IER register on SBS, Inc. PMC-OctPro is located at
2989 * offset 0x10 from the UART base, while UART_IER is defined as 1
2990 * in include/linux/serial_reg.h,
2991 * see first lines of serial_in() and serial_out() in 8250.c
2992*/
2993
Bill Pembertonde88b342012-11-19 13:24:32 -05002994static struct pciserial_board pci_boards[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07002995 [pbn_default] = {
2996 .flags = FL_BASE0,
2997 .num_ports = 1,
2998 .base_baud = 115200,
2999 .uart_offset = 8,
3000 },
3001 [pbn_b0_1_115200] = {
3002 .flags = FL_BASE0,
3003 .num_ports = 1,
3004 .base_baud = 115200,
3005 .uart_offset = 8,
3006 },
3007 [pbn_b0_2_115200] = {
3008 .flags = FL_BASE0,
3009 .num_ports = 2,
3010 .base_baud = 115200,
3011 .uart_offset = 8,
3012 },
3013 [pbn_b0_4_115200] = {
3014 .flags = FL_BASE0,
3015 .num_ports = 4,
3016 .base_baud = 115200,
3017 .uart_offset = 8,
3018 },
3019 [pbn_b0_5_115200] = {
3020 .flags = FL_BASE0,
3021 .num_ports = 5,
3022 .base_baud = 115200,
3023 .uart_offset = 8,
3024 },
Alan Coxbf0df632007-10-16 01:24:00 -07003025 [pbn_b0_8_115200] = {
3026 .flags = FL_BASE0,
3027 .num_ports = 8,
3028 .base_baud = 115200,
3029 .uart_offset = 8,
3030 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003031 [pbn_b0_1_921600] = {
3032 .flags = FL_BASE0,
3033 .num_ports = 1,
3034 .base_baud = 921600,
3035 .uart_offset = 8,
3036 },
3037 [pbn_b0_2_921600] = {
3038 .flags = FL_BASE0,
3039 .num_ports = 2,
3040 .base_baud = 921600,
3041 .uart_offset = 8,
3042 },
3043 [pbn_b0_4_921600] = {
3044 .flags = FL_BASE0,
3045 .num_ports = 4,
3046 .base_baud = 921600,
3047 .uart_offset = 8,
3048 },
David Ransondb1de152005-07-27 11:43:55 -07003049
3050 [pbn_b0_2_1130000] = {
3051 .flags = FL_BASE0,
3052 .num_ports = 2,
3053 .base_baud = 1130000,
3054 .uart_offset = 8,
3055 },
3056
Andrey Paninfbc0dc02005-07-18 11:38:09 +01003057 [pbn_b0_4_1152000] = {
3058 .flags = FL_BASE0,
3059 .num_ports = 4,
3060 .base_baud = 1152000,
3061 .uart_offset = 8,
3062 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003063
Ian Abbott1c9c8582017-02-03 20:25:00 +00003064 [pbn_b0_4_1250000] = {
3065 .flags = FL_BASE0,
3066 .num_ports = 4,
3067 .base_baud = 1250000,
3068 .uart_offset = 8,
3069 },
3070
Gareth Howlett26e92862006-01-04 17:00:42 +00003071 [pbn_b0_2_1843200] = {
3072 .flags = FL_BASE0,
3073 .num_ports = 2,
3074 .base_baud = 1843200,
3075 .uart_offset = 8,
3076 },
3077 [pbn_b0_4_1843200] = {
3078 .flags = FL_BASE0,
3079 .num_ports = 4,
3080 .base_baud = 1843200,
3081 .uart_offset = 8,
3082 },
3083
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003084 [pbn_b0_1_3906250] = {
Lee Howard7106b4e2008-10-21 13:48:58 +01003085 .flags = FL_BASE0,
3086 .num_ports = 1,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003087 .base_baud = 3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01003088 .uart_offset = 8,
3089 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003090
Linus Torvalds1da177e2005-04-16 15:20:36 -07003091 [pbn_b0_bt_1_115200] = {
3092 .flags = FL_BASE0|FL_BASE_BARS,
3093 .num_ports = 1,
3094 .base_baud = 115200,
3095 .uart_offset = 8,
3096 },
3097 [pbn_b0_bt_2_115200] = {
3098 .flags = FL_BASE0|FL_BASE_BARS,
3099 .num_ports = 2,
3100 .base_baud = 115200,
3101 .uart_offset = 8,
3102 },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08003103 [pbn_b0_bt_4_115200] = {
3104 .flags = FL_BASE0|FL_BASE_BARS,
3105 .num_ports = 4,
3106 .base_baud = 115200,
3107 .uart_offset = 8,
3108 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003109 [pbn_b0_bt_8_115200] = {
3110 .flags = FL_BASE0|FL_BASE_BARS,
3111 .num_ports = 8,
3112 .base_baud = 115200,
3113 .uart_offset = 8,
3114 },
3115
3116 [pbn_b0_bt_1_460800] = {
3117 .flags = FL_BASE0|FL_BASE_BARS,
3118 .num_ports = 1,
3119 .base_baud = 460800,
3120 .uart_offset = 8,
3121 },
3122 [pbn_b0_bt_2_460800] = {
3123 .flags = FL_BASE0|FL_BASE_BARS,
3124 .num_ports = 2,
3125 .base_baud = 460800,
3126 .uart_offset = 8,
3127 },
3128 [pbn_b0_bt_4_460800] = {
3129 .flags = FL_BASE0|FL_BASE_BARS,
3130 .num_ports = 4,
3131 .base_baud = 460800,
3132 .uart_offset = 8,
3133 },
3134
3135 [pbn_b0_bt_1_921600] = {
3136 .flags = FL_BASE0|FL_BASE_BARS,
3137 .num_ports = 1,
3138 .base_baud = 921600,
3139 .uart_offset = 8,
3140 },
3141 [pbn_b0_bt_2_921600] = {
3142 .flags = FL_BASE0|FL_BASE_BARS,
3143 .num_ports = 2,
3144 .base_baud = 921600,
3145 .uart_offset = 8,
3146 },
3147 [pbn_b0_bt_4_921600] = {
3148 .flags = FL_BASE0|FL_BASE_BARS,
3149 .num_ports = 4,
3150 .base_baud = 921600,
3151 .uart_offset = 8,
3152 },
3153 [pbn_b0_bt_8_921600] = {
3154 .flags = FL_BASE0|FL_BASE_BARS,
3155 .num_ports = 8,
3156 .base_baud = 921600,
3157 .uart_offset = 8,
3158 },
3159
3160 [pbn_b1_1_115200] = {
3161 .flags = FL_BASE1,
3162 .num_ports = 1,
3163 .base_baud = 115200,
3164 .uart_offset = 8,
3165 },
3166 [pbn_b1_2_115200] = {
3167 .flags = FL_BASE1,
3168 .num_ports = 2,
3169 .base_baud = 115200,
3170 .uart_offset = 8,
3171 },
3172 [pbn_b1_4_115200] = {
3173 .flags = FL_BASE1,
3174 .num_ports = 4,
3175 .base_baud = 115200,
3176 .uart_offset = 8,
3177 },
3178 [pbn_b1_8_115200] = {
3179 .flags = FL_BASE1,
3180 .num_ports = 8,
3181 .base_baud = 115200,
3182 .uart_offset = 8,
3183 },
Will Page04bf7e72009-04-06 17:32:15 +01003184 [pbn_b1_16_115200] = {
3185 .flags = FL_BASE1,
3186 .num_ports = 16,
3187 .base_baud = 115200,
3188 .uart_offset = 8,
3189 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003190
3191 [pbn_b1_1_921600] = {
3192 .flags = FL_BASE1,
3193 .num_ports = 1,
3194 .base_baud = 921600,
3195 .uart_offset = 8,
3196 },
3197 [pbn_b1_2_921600] = {
3198 .flags = FL_BASE1,
3199 .num_ports = 2,
3200 .base_baud = 921600,
3201 .uart_offset = 8,
3202 },
3203 [pbn_b1_4_921600] = {
3204 .flags = FL_BASE1,
3205 .num_ports = 4,
3206 .base_baud = 921600,
3207 .uart_offset = 8,
3208 },
3209 [pbn_b1_8_921600] = {
3210 .flags = FL_BASE1,
3211 .num_ports = 8,
3212 .base_baud = 921600,
3213 .uart_offset = 8,
3214 },
Gareth Howlett26e92862006-01-04 17:00:42 +00003215 [pbn_b1_2_1250000] = {
3216 .flags = FL_BASE1,
3217 .num_ports = 2,
3218 .base_baud = 1250000,
3219 .uart_offset = 8,
3220 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003221
Niels de Vos84f8c6f2007-08-22 14:01:14 -07003222 [pbn_b1_bt_1_115200] = {
3223 .flags = FL_BASE1|FL_BASE_BARS,
3224 .num_ports = 1,
3225 .base_baud = 115200,
3226 .uart_offset = 8,
3227 },
Will Page04bf7e72009-04-06 17:32:15 +01003228 [pbn_b1_bt_2_115200] = {
3229 .flags = FL_BASE1|FL_BASE_BARS,
3230 .num_ports = 2,
3231 .base_baud = 115200,
3232 .uart_offset = 8,
3233 },
3234 [pbn_b1_bt_4_115200] = {
3235 .flags = FL_BASE1|FL_BASE_BARS,
3236 .num_ports = 4,
3237 .base_baud = 115200,
3238 .uart_offset = 8,
3239 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07003240
Linus Torvalds1da177e2005-04-16 15:20:36 -07003241 [pbn_b1_bt_2_921600] = {
3242 .flags = FL_BASE1|FL_BASE_BARS,
3243 .num_ports = 2,
3244 .base_baud = 921600,
3245 .uart_offset = 8,
3246 },
3247
3248 [pbn_b1_1_1382400] = {
3249 .flags = FL_BASE1,
3250 .num_ports = 1,
3251 .base_baud = 1382400,
3252 .uart_offset = 8,
3253 },
3254 [pbn_b1_2_1382400] = {
3255 .flags = FL_BASE1,
3256 .num_ports = 2,
3257 .base_baud = 1382400,
3258 .uart_offset = 8,
3259 },
3260 [pbn_b1_4_1382400] = {
3261 .flags = FL_BASE1,
3262 .num_ports = 4,
3263 .base_baud = 1382400,
3264 .uart_offset = 8,
3265 },
3266 [pbn_b1_8_1382400] = {
3267 .flags = FL_BASE1,
3268 .num_ports = 8,
3269 .base_baud = 1382400,
3270 .uart_offset = 8,
3271 },
3272
3273 [pbn_b2_1_115200] = {
3274 .flags = FL_BASE2,
3275 .num_ports = 1,
3276 .base_baud = 115200,
3277 .uart_offset = 8,
3278 },
Peter Horton737c1752006-08-26 09:07:36 +01003279 [pbn_b2_2_115200] = {
3280 .flags = FL_BASE2,
3281 .num_ports = 2,
3282 .base_baud = 115200,
3283 .uart_offset = 8,
3284 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08003285 [pbn_b2_4_115200] = {
3286 .flags = FL_BASE2,
3287 .num_ports = 4,
3288 .base_baud = 115200,
3289 .uart_offset = 8,
3290 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003291 [pbn_b2_8_115200] = {
3292 .flags = FL_BASE2,
3293 .num_ports = 8,
3294 .base_baud = 115200,
3295 .uart_offset = 8,
3296 },
3297
3298 [pbn_b2_1_460800] = {
3299 .flags = FL_BASE2,
3300 .num_ports = 1,
3301 .base_baud = 460800,
3302 .uart_offset = 8,
3303 },
3304 [pbn_b2_4_460800] = {
3305 .flags = FL_BASE2,
3306 .num_ports = 4,
3307 .base_baud = 460800,
3308 .uart_offset = 8,
3309 },
3310 [pbn_b2_8_460800] = {
3311 .flags = FL_BASE2,
3312 .num_ports = 8,
3313 .base_baud = 460800,
3314 .uart_offset = 8,
3315 },
3316 [pbn_b2_16_460800] = {
3317 .flags = FL_BASE2,
3318 .num_ports = 16,
3319 .base_baud = 460800,
3320 .uart_offset = 8,
3321 },
3322
3323 [pbn_b2_1_921600] = {
3324 .flags = FL_BASE2,
3325 .num_ports = 1,
3326 .base_baud = 921600,
3327 .uart_offset = 8,
3328 },
3329 [pbn_b2_4_921600] = {
3330 .flags = FL_BASE2,
3331 .num_ports = 4,
3332 .base_baud = 921600,
3333 .uart_offset = 8,
3334 },
3335 [pbn_b2_8_921600] = {
3336 .flags = FL_BASE2,
3337 .num_ports = 8,
3338 .base_baud = 921600,
3339 .uart_offset = 8,
3340 },
3341
Lytochkin Borise8470032010-07-26 10:02:26 +04003342 [pbn_b2_8_1152000] = {
3343 .flags = FL_BASE2,
3344 .num_ports = 8,
3345 .base_baud = 1152000,
3346 .uart_offset = 8,
3347 },
3348
Linus Torvalds1da177e2005-04-16 15:20:36 -07003349 [pbn_b2_bt_1_115200] = {
3350 .flags = FL_BASE2|FL_BASE_BARS,
3351 .num_ports = 1,
3352 .base_baud = 115200,
3353 .uart_offset = 8,
3354 },
3355 [pbn_b2_bt_2_115200] = {
3356 .flags = FL_BASE2|FL_BASE_BARS,
3357 .num_ports = 2,
3358 .base_baud = 115200,
3359 .uart_offset = 8,
3360 },
3361 [pbn_b2_bt_4_115200] = {
3362 .flags = FL_BASE2|FL_BASE_BARS,
3363 .num_ports = 4,
3364 .base_baud = 115200,
3365 .uart_offset = 8,
3366 },
3367
3368 [pbn_b2_bt_2_921600] = {
3369 .flags = FL_BASE2|FL_BASE_BARS,
3370 .num_ports = 2,
3371 .base_baud = 921600,
3372 .uart_offset = 8,
3373 },
3374 [pbn_b2_bt_4_921600] = {
3375 .flags = FL_BASE2|FL_BASE_BARS,
3376 .num_ports = 4,
3377 .base_baud = 921600,
3378 .uart_offset = 8,
3379 },
3380
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00003381 [pbn_b3_2_115200] = {
3382 .flags = FL_BASE3,
3383 .num_ports = 2,
3384 .base_baud = 115200,
3385 .uart_offset = 8,
3386 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003387 [pbn_b3_4_115200] = {
3388 .flags = FL_BASE3,
3389 .num_ports = 4,
3390 .base_baud = 115200,
3391 .uart_offset = 8,
3392 },
3393 [pbn_b3_8_115200] = {
3394 .flags = FL_BASE3,
3395 .num_ports = 8,
3396 .base_baud = 115200,
3397 .uart_offset = 8,
3398 },
3399
Yegor Yefremov66169ad2010-06-04 09:58:18 +02003400 [pbn_b4_bt_2_921600] = {
3401 .flags = FL_BASE4,
3402 .num_ports = 2,
3403 .base_baud = 921600,
3404 .uart_offset = 8,
3405 },
3406 [pbn_b4_bt_4_921600] = {
3407 .flags = FL_BASE4,
3408 .num_ports = 4,
3409 .base_baud = 921600,
3410 .uart_offset = 8,
3411 },
3412 [pbn_b4_bt_8_921600] = {
3413 .flags = FL_BASE4,
3414 .num_ports = 8,
3415 .base_baud = 921600,
3416 .uart_offset = 8,
3417 },
3418
Linus Torvalds1da177e2005-04-16 15:20:36 -07003419 /*
3420 * Entries following this are board-specific.
3421 */
3422
3423 /*
3424 * Panacom - IOMEM
3425 */
3426 [pbn_panacom] = {
3427 .flags = FL_BASE2,
3428 .num_ports = 2,
3429 .base_baud = 921600,
3430 .uart_offset = 0x400,
3431 .reg_shift = 7,
3432 },
3433 [pbn_panacom2] = {
3434 .flags = FL_BASE2|FL_BASE_BARS,
3435 .num_ports = 2,
3436 .base_baud = 921600,
3437 .uart_offset = 0x400,
3438 .reg_shift = 7,
3439 },
3440 [pbn_panacom4] = {
3441 .flags = FL_BASE2|FL_BASE_BARS,
3442 .num_ports = 4,
3443 .base_baud = 921600,
3444 .uart_offset = 0x400,
3445 .reg_shift = 7,
3446 },
3447
3448 /* I think this entry is broken - the first_offset looks wrong --rmk */
3449 [pbn_plx_romulus] = {
3450 .flags = FL_BASE2,
3451 .num_ports = 4,
3452 .base_baud = 921600,
3453 .uart_offset = 8 << 2,
3454 .reg_shift = 2,
3455 .first_offset = 0x03,
3456 },
3457
3458 /*
Mike Skoog1bc8cde2014-10-16 13:10:01 -07003459 * EndRun Technologies
3460 * Uses the size of PCI Base region 0 to
3461 * signal now many ports are available
3462 * 2 port 952 Uart support
3463 */
3464 [pbn_endrun_2_4000000] = {
3465 .flags = FL_BASE0,
3466 .num_ports = 2,
3467 .base_baud = 4000000,
3468 .uart_offset = 0x200,
3469 .first_offset = 0x1000,
3470 },
3471
3472 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003473 * This board uses the size of PCI Base region 0 to
3474 * signal now many ports are available
3475 */
3476 [pbn_oxsemi] = {
3477 .flags = FL_BASE0|FL_REGION_SZ_CAP,
3478 .num_ports = 32,
3479 .base_baud = 115200,
3480 .uart_offset = 8,
3481 },
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003482 [pbn_oxsemi_1_3906250] = {
Lee Howard7106b4e2008-10-21 13:48:58 +01003483 .flags = FL_BASE0,
3484 .num_ports = 1,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003485 .base_baud = 3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01003486 .uart_offset = 0x200,
3487 .first_offset = 0x1000,
3488 },
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003489 [pbn_oxsemi_2_3906250] = {
Lee Howard7106b4e2008-10-21 13:48:58 +01003490 .flags = FL_BASE0,
3491 .num_ports = 2,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003492 .base_baud = 3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01003493 .uart_offset = 0x200,
3494 .first_offset = 0x1000,
3495 },
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003496 [pbn_oxsemi_4_3906250] = {
Lee Howard7106b4e2008-10-21 13:48:58 +01003497 .flags = FL_BASE0,
3498 .num_ports = 4,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003499 .base_baud = 3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01003500 .uart_offset = 0x200,
3501 .first_offset = 0x1000,
3502 },
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003503 [pbn_oxsemi_8_3906250] = {
Lee Howard7106b4e2008-10-21 13:48:58 +01003504 .flags = FL_BASE0,
3505 .num_ports = 8,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02003506 .base_baud = 3906250,
Lee Howard7106b4e2008-10-21 13:48:58 +01003507 .uart_offset = 0x200,
3508 .first_offset = 0x1000,
3509 },
3510
Linus Torvalds1da177e2005-04-16 15:20:36 -07003511
3512 /*
3513 * EKF addition for i960 Boards form EKF with serial port.
3514 * Max 256 ports.
3515 */
3516 [pbn_intel_i960] = {
3517 .flags = FL_BASE0,
3518 .num_ports = 32,
3519 .base_baud = 921600,
3520 .uart_offset = 8 << 2,
3521 .reg_shift = 2,
3522 .first_offset = 0x10000,
3523 },
3524 [pbn_sgi_ioc3] = {
3525 .flags = FL_BASE0|FL_NOIRQ,
3526 .num_ports = 1,
3527 .base_baud = 458333,
3528 .uart_offset = 8,
3529 .reg_shift = 0,
3530 .first_offset = 0x20178,
3531 },
3532
3533 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003534 * Computone - uses IOMEM.
3535 */
3536 [pbn_computone_4] = {
3537 .flags = FL_BASE0,
3538 .num_ports = 4,
3539 .base_baud = 921600,
3540 .uart_offset = 0x40,
3541 .reg_shift = 2,
3542 .first_offset = 0x200,
3543 },
3544 [pbn_computone_6] = {
3545 .flags = FL_BASE0,
3546 .num_ports = 6,
3547 .base_baud = 921600,
3548 .uart_offset = 0x40,
3549 .reg_shift = 2,
3550 .first_offset = 0x200,
3551 },
3552 [pbn_computone_8] = {
3553 .flags = FL_BASE0,
3554 .num_ports = 8,
3555 .base_baud = 921600,
3556 .uart_offset = 0x40,
3557 .reg_shift = 2,
3558 .first_offset = 0x200,
3559 },
3560 [pbn_sbsxrsio] = {
3561 .flags = FL_BASE0,
3562 .num_ports = 8,
3563 .base_baud = 460800,
3564 .uart_offset = 256,
3565 .reg_shift = 4,
3566 },
3567 /*
Olof Johanssonaa798502007-08-22 14:01:55 -07003568 * PA Semi PWRficient PA6T-1682M on-chip UART
3569 */
3570 [pbn_pasemi_1682M] = {
3571 .flags = FL_BASE0,
3572 .num_ports = 1,
3573 .base_baud = 8333333,
3574 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01003575 /*
3576 * National Instruments 843x
3577 */
3578 [pbn_ni8430_16] = {
3579 .flags = FL_BASE0,
3580 .num_ports = 16,
3581 .base_baud = 3686400,
3582 .uart_offset = 0x10,
3583 .first_offset = 0x800,
3584 },
3585 [pbn_ni8430_8] = {
3586 .flags = FL_BASE0,
3587 .num_ports = 8,
3588 .base_baud = 3686400,
3589 .uart_offset = 0x10,
3590 .first_offset = 0x800,
3591 },
3592 [pbn_ni8430_4] = {
3593 .flags = FL_BASE0,
3594 .num_ports = 4,
3595 .base_baud = 3686400,
3596 .uart_offset = 0x10,
3597 .first_offset = 0x800,
3598 },
3599 [pbn_ni8430_2] = {
3600 .flags = FL_BASE0,
3601 .num_ports = 2,
3602 .base_baud = 3686400,
3603 .uart_offset = 0x10,
3604 .first_offset = 0x800,
3605 },
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07003606 /*
3607 * ADDI-DATA GmbH PCI-Express communication cards <info@addi-data.com>
3608 */
3609 [pbn_ADDIDATA_PCIe_1_3906250] = {
3610 .flags = FL_BASE0,
3611 .num_ports = 1,
3612 .base_baud = 3906250,
3613 .uart_offset = 0x200,
3614 .first_offset = 0x1000,
3615 },
3616 [pbn_ADDIDATA_PCIe_2_3906250] = {
3617 .flags = FL_BASE0,
3618 .num_ports = 2,
3619 .base_baud = 3906250,
3620 .uart_offset = 0x200,
3621 .first_offset = 0x1000,
3622 },
3623 [pbn_ADDIDATA_PCIe_4_3906250] = {
3624 .flags = FL_BASE0,
3625 .num_ports = 4,
3626 .base_baud = 3906250,
3627 .uart_offset = 0x200,
3628 .first_offset = 0x1000,
3629 },
3630 [pbn_ADDIDATA_PCIe_8_3906250] = {
3631 .flags = FL_BASE0,
3632 .num_ports = 8,
3633 .base_baud = 3906250,
3634 .uart_offset = 0x200,
3635 .first_offset = 0x1000,
3636 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003637 [pbn_ce4100_1_115200] = {
Maxime Bizon08ec2122012-10-19 10:45:07 +02003638 .flags = FL_BASE_BARS,
3639 .num_ports = 2,
Dirk Brandewie095e24b2010-11-17 07:35:20 -08003640 .base_baud = 921600,
3641 .reg_shift = 2,
3642 },
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04003643 [pbn_omegapci] = {
3644 .flags = FL_BASE0,
3645 .num_ports = 8,
3646 .base_baud = 115200,
3647 .uart_offset = 0x200,
3648 },
Nicos Gollan7808edc2011-05-05 21:00:37 +02003649 [pbn_NETMOS9900_2s_115200] = {
3650 .flags = FL_BASE0,
3651 .num_ports = 2,
3652 .base_baud = 115200,
3653 },
Stephen Hurdebebd492013-01-17 14:14:53 -08003654 [pbn_brcm_trumanage] = {
3655 .flags = FL_BASE0,
3656 .num_ports = 1,
3657 .reg_shift = 2,
3658 .base_baud = 115200,
3659 },
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07003660 [pbn_fintek_4] = {
3661 .num_ports = 4,
3662 .uart_offset = 8,
3663 .base_baud = 115200,
3664 .first_offset = 0x40,
3665 },
3666 [pbn_fintek_8] = {
3667 .num_ports = 8,
3668 .uart_offset = 8,
3669 .base_baud = 115200,
3670 .first_offset = 0x40,
3671 },
3672 [pbn_fintek_12] = {
3673 .num_ports = 12,
3674 .uart_offset = 8,
3675 .base_baud = 115200,
3676 .first_offset = 0x40,
3677 },
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +08003678 [pbn_fintek_F81504A] = {
3679 .num_ports = 4,
3680 .uart_offset = 8,
3681 .base_baud = 115200,
3682 },
3683 [pbn_fintek_F81508A] = {
3684 .num_ports = 8,
3685 .uart_offset = 8,
3686 .base_baud = 115200,
3687 },
3688 [pbn_fintek_F81512A] = {
3689 .num_ports = 12,
3690 .uart_offset = 8,
3691 .base_baud = 115200,
3692 },
Jeremy McNicoll7dde5572016-02-02 13:00:45 -08003693 [pbn_wch382_2] = {
3694 .flags = FL_BASE0,
3695 .num_ports = 2,
3696 .base_baud = 115200,
3697 .uart_offset = 8,
3698 .first_offset = 0xC0,
3699 },
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03003700 [pbn_wch384_4] = {
3701 .flags = FL_BASE0,
3702 .num_ports = 4,
3703 .base_baud = 115200,
3704 .uart_offset = 8,
3705 .first_offset = 0xC0,
3706 },
Du Huanpeng04b6ff52020-08-22 09:47:28 +08003707 [pbn_wch384_8] = {
3708 .flags = FL_BASE0,
3709 .num_ports = 8,
3710 .base_baud = 115200,
3711 .uart_offset = 8,
3712 .first_offset = 0x00,
3713 },
Adam Lee89c043a2015-08-03 13:28:13 +08003714 /*
3715 * Pericom PI7C9X795[1248] Uno/Dual/Quad/Octal UART
3716 */
3717 [pbn_pericom_PI7C9X7951] = {
3718 .flags = FL_BASE0,
3719 .num_ports = 1,
3720 .base_baud = 921600,
3721 .uart_offset = 0x8,
3722 },
3723 [pbn_pericom_PI7C9X7952] = {
3724 .flags = FL_BASE0,
3725 .num_ports = 2,
3726 .base_baud = 921600,
3727 .uart_offset = 0x8,
3728 },
3729 [pbn_pericom_PI7C9X7954] = {
3730 .flags = FL_BASE0,
3731 .num_ports = 4,
3732 .base_baud = 921600,
3733 .uart_offset = 0x8,
3734 },
3735 [pbn_pericom_PI7C9X7958] = {
3736 .flags = FL_BASE0,
3737 .num_ports = 8,
3738 .base_baud = 921600,
3739 .uart_offset = 0x8,
3740 },
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08003741 [pbn_sunix_pci_1s] = {
3742 .num_ports = 1,
3743 .base_baud = 921600,
3744 .uart_offset = 0x8,
3745 },
3746 [pbn_sunix_pci_2s] = {
3747 .num_ports = 2,
3748 .base_baud = 921600,
3749 .uart_offset = 0x8,
3750 },
3751 [pbn_sunix_pci_4s] = {
3752 .num_ports = 4,
3753 .base_baud = 921600,
3754 .uart_offset = 0x8,
3755 },
3756 [pbn_sunix_pci_8s] = {
3757 .num_ports = 8,
3758 .base_baud = 921600,
3759 .uart_offset = 0x8,
3760 },
3761 [pbn_sunix_pci_16s] = {
3762 .num_ports = 16,
3763 .base_baud = 921600,
3764 .uart_offset = 0x8,
3765 },
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02003766 [pbn_titan_1_4000000] = {
3767 .flags = FL_BASE0,
3768 .num_ports = 1,
3769 .base_baud = 4000000,
3770 .uart_offset = 0x200,
3771 .first_offset = 0x1000,
3772 },
3773 [pbn_titan_2_4000000] = {
3774 .flags = FL_BASE0,
3775 .num_ports = 2,
3776 .base_baud = 4000000,
3777 .uart_offset = 0x200,
3778 .first_offset = 0x1000,
3779 },
3780 [pbn_titan_4_4000000] = {
3781 .flags = FL_BASE0,
3782 .num_ports = 4,
3783 .base_baud = 4000000,
3784 .uart_offset = 0x200,
3785 .first_offset = 0x1000,
3786 },
3787 [pbn_titan_8_4000000] = {
3788 .flags = FL_BASE0,
3789 .num_ports = 8,
3790 .base_baud = 4000000,
3791 .uart_offset = 0x200,
3792 .first_offset = 0x1000,
3793 },
Kai-Heng Fengd193db72019-08-17 00:51:24 +08003794 [pbn_moxa8250_2p] = {
3795 .flags = FL_BASE1,
3796 .num_ports = 2,
3797 .base_baud = 921600,
3798 .uart_offset = 0x200,
3799 },
3800 [pbn_moxa8250_4p] = {
3801 .flags = FL_BASE1,
3802 .num_ports = 4,
3803 .base_baud = 921600,
3804 .uart_offset = 0x200,
3805 },
3806 [pbn_moxa8250_8p] = {
3807 .flags = FL_BASE1,
3808 .num_ports = 8,
3809 .base_baud = 921600,
3810 .uart_offset = 0x200,
3811 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07003812};
3813
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003814static const struct pci_device_id blacklist[] = {
3815 /* softmodems */
Alan Cox5756ee92008-02-08 04:18:51 -08003816 { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
Maciej Szmigieroebf7c062010-10-26 21:48:21 +02003817 { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */
3818 { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */
Guainluca Anzolin6971c632012-09-04 15:56:12 +01003819
3820 /* multi-io cards handled by parport_serial */
3821 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
Ezequiel Garciafeb58142014-05-24 15:24:51 -03003822 { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */
Sergej Pupykin2fdd8c82014-11-06 14:36:31 +03003823 { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */
Heikki Krogerusd9eda9b2015-10-13 13:29:02 +03003824
3825 /* Intel platforms with MID UART */
3826 { PCI_VDEVICE(INTEL, 0x081b), },
3827 { PCI_VDEVICE(INTEL, 0x081c), },
3828 { PCI_VDEVICE(INTEL, 0x081d), },
3829 { PCI_VDEVICE(INTEL, 0x1191), },
Andy Shevchenkodaf39302017-09-22 15:11:56 +03003830 { PCI_VDEVICE(INTEL, 0x18d8), },
Heikki Krogerus6ede6dc2015-10-13 13:29:06 +03003831 { PCI_VDEVICE(INTEL, 0x19d8), },
Andy Shevchenkoa13e19c2016-08-17 19:20:27 +03003832
3833 /* Intel platforms with DesignWare UART */
Andy Shevchenko6bb5d752016-08-17 19:20:28 +03003834 { PCI_VDEVICE(INTEL, 0x0936), },
Andy Shevchenkoa13e19c2016-08-17 19:20:27 +03003835 { PCI_VDEVICE(INTEL, 0x0f0a), },
3836 { PCI_VDEVICE(INTEL, 0x0f0c), },
3837 { PCI_VDEVICE(INTEL, 0x228a), },
3838 { PCI_VDEVICE(INTEL, 0x228c), },
Andy Shevchenko7f0909d2021-07-13 13:17:39 +03003839 { PCI_VDEVICE(INTEL, 0x4b96), },
3840 { PCI_VDEVICE(INTEL, 0x4b97), },
3841 { PCI_VDEVICE(INTEL, 0x4b98), },
3842 { PCI_VDEVICE(INTEL, 0x4b99), },
3843 { PCI_VDEVICE(INTEL, 0x4b9a), },
3844 { PCI_VDEVICE(INTEL, 0x4b9b), },
Andy Shevchenkoa13e19c2016-08-17 19:20:27 +03003845 { PCI_VDEVICE(INTEL, 0x9ce3), },
3846 { PCI_VDEVICE(INTEL, 0x9ce4), },
Sudip Mukherjee5d1a2382017-01-30 22:28:22 +00003847
3848 /* Exar devices */
3849 { PCI_VDEVICE(EXAR, PCI_ANY_ID), },
Jan Kiszkafc6cc962017-02-08 17:09:06 +01003850 { PCI_VDEVICE(COMMTECH, PCI_ANY_ID), },
Heikki Krogerus54b2f302019-01-24 23:51:22 +02003851
3852 /* End of the black list */
3853 { }
Christian Schmidt436bbd42007-08-22 14:01:19 -07003854};
3855
Andy Shevchenko7d8905d2017-07-24 20:28:32 +03003856static int serial_pci_is_class_communication(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003857{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003858 /*
3859 * If it is not a communications device or the programming
3860 * interface is greater than 6, give up.
Linus Torvalds1da177e2005-04-16 15:20:36 -07003861 */
3862 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
Andy Shevchenkoe7f3e992018-02-02 20:39:13 +02003863 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MULTISERIAL) &&
Linus Torvalds1da177e2005-04-16 15:20:36 -07003864 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
3865 (dev->class & 0xff) > 6)
3866 return -ENODEV;
3867
Andy Shevchenko7d8905d2017-07-24 20:28:32 +03003868 return 0;
3869}
3870
Andy Shevchenko7d8905d2017-07-24 20:28:32 +03003871/*
3872 * Given a complete unknown PCI device, try to use some heuristics to
3873 * guess what the configuration might be, based on the pitiful PCI
3874 * serial specs. Returns 0 on success, -ENODEV on failure.
3875 */
3876static int
3877serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
3878{
3879 int num_iomem, num_port, first_port = -1, i;
Andy Shevchenko824d17c2019-01-24 23:51:21 +02003880 int rc;
3881
3882 rc = serial_pci_is_class_communication(dev);
3883 if (rc)
3884 return rc;
Andy Shevchenko7d8905d2017-07-24 20:28:32 +03003885
Andy Shevchenkoe7f3e992018-02-02 20:39:13 +02003886 /*
3887 * Should we try to make guesses for multiport serial devices later?
3888 */
3889 if ((dev->class >> 8) == PCI_CLASS_COMMUNICATION_MULTISERIAL)
3890 return -ENODEV;
3891
Linus Torvalds1da177e2005-04-16 15:20:36 -07003892 num_iomem = num_port = 0;
Denis Efremovc9c13ba2019-09-28 02:43:08 +03003893 for (i = 0; i < PCI_STD_NUM_BARS; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003894 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
3895 num_port++;
3896 if (first_port == -1)
3897 first_port = i;
3898 }
3899 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
3900 num_iomem++;
3901 }
3902
3903 /*
3904 * If there is 1 or 0 iomem regions, and exactly one port,
3905 * use it. We guess the number of ports based on the IO
3906 * region size.
3907 */
3908 if (num_iomem <= 1 && num_port == 1) {
3909 board->flags = first_port;
3910 board->num_ports = pci_resource_len(dev, first_port) / 8;
3911 return 0;
3912 }
3913
3914 /*
3915 * Now guess if we've got a board which indexes by BARs.
3916 * Each IO BAR should be 8 bytes, and they should follow
3917 * consecutively.
3918 */
3919 first_port = -1;
3920 num_port = 0;
Denis Efremovc9c13ba2019-09-28 02:43:08 +03003921 for (i = 0; i < PCI_STD_NUM_BARS; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003922 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
3923 pci_resource_len(dev, i) == 8 &&
3924 (first_port == -1 || (first_port + num_port) == i)) {
3925 num_port++;
3926 if (first_port == -1)
3927 first_port = i;
3928 }
3929 }
3930
3931 if (num_port > 1) {
3932 board->flags = first_port | FL_BASE_BARS;
3933 board->num_ports = num_port;
3934 return 0;
3935 }
3936
3937 return -ENODEV;
3938}
3939
3940static inline int
Russell King975a1a7d2009-01-02 13:44:27 +00003941serial_pci_matches(const struct pciserial_board *board,
3942 const struct pciserial_board *guessed)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003943{
3944 return
3945 board->num_ports == guessed->num_ports &&
3946 board->base_baud == guessed->base_baud &&
3947 board->uart_offset == guessed->uart_offset &&
3948 board->reg_shift == guessed->reg_shift &&
3949 board->first_offset == guessed->first_offset;
3950}
3951
Russell King241fc432005-07-27 11:35:54 +01003952struct serial_private *
Russell King975a1a7d2009-01-02 13:44:27 +00003953pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
Russell King241fc432005-07-27 11:35:54 +01003954{
Alan Cox2655a2c2012-07-12 12:59:50 +01003955 struct uart_8250_port uart;
Russell King241fc432005-07-27 11:35:54 +01003956 struct serial_private *priv;
3957 struct pci_serial_quirk *quirk;
3958 int rc, nr_ports, i;
3959
3960 nr_ports = board->num_ports;
3961
3962 /*
3963 * Find an init and setup quirks.
3964 */
3965 quirk = find_quirk(dev);
3966
3967 /*
3968 * Run the new-style initialization function.
3969 * The initialization function returns:
3970 * <0 - error
3971 * 0 - use board->num_ports
3972 * >0 - number of ports
3973 */
3974 if (quirk->init) {
3975 rc = quirk->init(dev);
3976 if (rc < 0) {
3977 priv = ERR_PTR(rc);
3978 goto err_out;
3979 }
3980 if (rc)
3981 nr_ports = rc;
3982 }
3983
Burman Yan8f31bb32007-02-14 00:33:07 -08003984 priv = kzalloc(sizeof(struct serial_private) +
Russell King241fc432005-07-27 11:35:54 +01003985 sizeof(unsigned int) * nr_ports,
3986 GFP_KERNEL);
3987 if (!priv) {
3988 priv = ERR_PTR(-ENOMEM);
3989 goto err_deinit;
3990 }
3991
Russell King241fc432005-07-27 11:35:54 +01003992 priv->dev = dev;
3993 priv->quirk = quirk;
3994
Alan Cox2655a2c2012-07-12 12:59:50 +01003995 memset(&uart, 0, sizeof(uart));
3996 uart.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
3997 uart.port.uartclk = board->base_baud * 16;
Ralf Ramsauer84284132019-08-12 13:21:52 +02003998
Christian Gmeiner9808f9b2021-05-27 11:54:40 +02003999 if (board->flags & FL_NOIRQ) {
4000 uart.port.irq = 0;
Ralf Ramsauer84284132019-08-12 13:21:52 +02004001 } else {
Christian Gmeiner9808f9b2021-05-27 11:54:40 +02004002 if (pci_match_id(pci_use_msi, dev)) {
4003 dev_dbg(&dev->dev, "Using MSI(-X) interrupts\n");
4004 pci_set_master(dev);
4005 rc = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_ALL_TYPES);
4006 } else {
4007 dev_dbg(&dev->dev, "Using legacy interrupts\n");
4008 rc = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_LEGACY);
4009 }
4010 if (rc < 0) {
4011 kfree(priv);
4012 priv = ERR_PTR(rc);
4013 goto err_deinit;
4014 }
4015
4016 uart.port.irq = pci_irq_vector(dev, 0);
Ralf Ramsauer84284132019-08-12 13:21:52 +02004017 }
4018
Alan Cox2655a2c2012-07-12 12:59:50 +01004019 uart.port.dev = &dev->dev;
Russell King241fc432005-07-27 11:35:54 +01004020
4021 for (i = 0; i < nr_ports; i++) {
Alan Cox2655a2c2012-07-12 12:59:50 +01004022 if (quirk->setup(priv, board, &uart, i))
Russell King241fc432005-07-27 11:35:54 +01004023 break;
4024
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07004025 dev_dbg(&dev->dev, "Setup PCI port: port %lx, irq %d, type %d\n",
4026 uart.port.iobase, uart.port.irq, uart.port.iotype);
Alan Cox5756ee92008-02-08 04:18:51 -08004027
Alan Cox2655a2c2012-07-12 12:59:50 +01004028 priv->line[i] = serial8250_register_8250_port(&uart);
Russell King241fc432005-07-27 11:35:54 +01004029 if (priv->line[i] < 0) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07004030 dev_err(&dev->dev,
4031 "Couldn't register serial port %lx, irq %d, type %d, error %d\n",
4032 uart.port.iobase, uart.port.irq,
4033 uart.port.iotype, priv->line[i]);
Russell King241fc432005-07-27 11:35:54 +01004034 break;
4035 }
4036 }
Russell King241fc432005-07-27 11:35:54 +01004037 priv->nr = i;
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02004038 priv->board = board;
Russell King241fc432005-07-27 11:35:54 +01004039 return priv;
4040
Alan Cox5756ee92008-02-08 04:18:51 -08004041err_deinit:
Russell King241fc432005-07-27 11:35:54 +01004042 if (quirk->exit)
4043 quirk->exit(dev);
Alan Cox5756ee92008-02-08 04:18:51 -08004044err_out:
Russell King241fc432005-07-27 11:35:54 +01004045 return priv;
4046}
4047EXPORT_SYMBOL_GPL(pciserial_init_ports);
4048
Wei Yongjun80cd94e2017-02-05 16:12:34 +00004049static void pciserial_detach_ports(struct serial_private *priv)
Russell King241fc432005-07-27 11:35:54 +01004050{
4051 struct pci_serial_quirk *quirk;
4052 int i;
4053
4054 for (i = 0; i < priv->nr; i++)
4055 serial8250_unregister_port(priv->line[i]);
4056
Russell King241fc432005-07-27 11:35:54 +01004057 /*
4058 * Find the exit quirks.
4059 */
4060 quirk = find_quirk(priv->dev);
4061 if (quirk->exit)
4062 quirk->exit(priv->dev);
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02004063}
Russell King241fc432005-07-27 11:35:54 +01004064
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02004065void pciserial_remove_ports(struct serial_private *priv)
4066{
4067 pciserial_detach_ports(priv);
Russell King241fc432005-07-27 11:35:54 +01004068 kfree(priv);
4069}
4070EXPORT_SYMBOL_GPL(pciserial_remove_ports);
4071
4072void pciserial_suspend_ports(struct serial_private *priv)
4073{
4074 int i;
4075
4076 for (i = 0; i < priv->nr; i++)
4077 if (priv->line[i] >= 0)
4078 serial8250_suspend_port(priv->line[i]);
Dan Williams5f1a3892012-04-10 14:11:03 -07004079
4080 /*
4081 * Ensure that every init quirk is properly torn down
4082 */
4083 if (priv->quirk->exit)
4084 priv->quirk->exit(priv->dev);
Russell King241fc432005-07-27 11:35:54 +01004085}
4086EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
4087
4088void pciserial_resume_ports(struct serial_private *priv)
4089{
4090 int i;
4091
4092 /*
4093 * Ensure that the board is correctly configured.
4094 */
4095 if (priv->quirk->init)
4096 priv->quirk->init(priv->dev);
4097
4098 for (i = 0; i < priv->nr; i++)
4099 if (priv->line[i] >= 0)
4100 serial8250_resume_port(priv->line[i]);
4101}
4102EXPORT_SYMBOL_GPL(pciserial_resume_ports);
4103
Linus Torvalds1da177e2005-04-16 15:20:36 -07004104/*
4105 * Probe one serial board. Unfortunately, there is no rhyme nor reason
4106 * to the arrangement of serial ports on a PCI card.
4107 */
Bill Pemberton9671f092012-11-19 13:21:50 -05004108static int
Linus Torvalds1da177e2005-04-16 15:20:36 -07004109pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
4110{
Frédéric Brière5bf8f502011-05-29 15:08:03 -04004111 struct pci_serial_quirk *quirk;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004112 struct serial_private *priv;
Russell King975a1a7d2009-01-02 13:44:27 +00004113 const struct pciserial_board *board;
Heikki Krogerus54b2f302019-01-24 23:51:22 +02004114 const struct pci_device_id *exclude;
Russell King975a1a7d2009-01-02 13:44:27 +00004115 struct pciserial_board tmp;
Russell King241fc432005-07-27 11:35:54 +01004116 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004117
Frédéric Brière5bf8f502011-05-29 15:08:03 -04004118 quirk = find_quirk(dev);
4119 if (quirk->probe) {
4120 rc = quirk->probe(dev);
4121 if (rc)
4122 return rc;
4123 }
4124
Linus Torvalds1da177e2005-04-16 15:20:36 -07004125 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
Greg Kroah-Hartmanaf8c5b82013-09-28 13:01:59 -07004126 dev_err(&dev->dev, "invalid driver_data: %ld\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -07004127 ent->driver_data);
4128 return -EINVAL;
4129 }
4130
4131 board = &pci_boards[ent->driver_data];
4132
Heikki Krogerus54b2f302019-01-24 23:51:22 +02004133 exclude = pci_match_id(blacklist, dev);
4134 if (exclude)
4135 return -ENODEV;
Andy Shevchenko7d8905d2017-07-24 20:28:32 +03004136
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +02004137 rc = pcim_enable_device(dev);
Michael Reed28071902011-05-31 12:06:28 -05004138 pci_save_state(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004139 if (rc)
4140 return rc;
4141
4142 if (ent->driver_data == pbn_default) {
4143 /*
4144 * Use a copy of the pci_board entry for this;
4145 * avoid changing entries in the table.
4146 */
Russell King1c7c1fe2005-07-27 11:31:19 +01004147 memcpy(&tmp, board, sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07004148 board = &tmp;
4149
4150 /*
4151 * We matched one of our class entries. Try to
4152 * determine the parameters of this board.
4153 */
Russell King975a1a7d2009-01-02 13:44:27 +00004154 rc = serial_pci_guess_board(dev, &tmp);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004155 if (rc)
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +02004156 return rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004157 } else {
4158 /*
4159 * We matched an explicit entry. If we are able to
4160 * detect this boards settings with our heuristic,
4161 * then we no longer need this entry.
4162 */
Russell King1c7c1fe2005-07-27 11:31:19 +01004163 memcpy(&tmp, &pci_boards[pbn_default],
4164 sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07004165 rc = serial_pci_guess_board(dev, &tmp);
4166 if (rc == 0 && serial_pci_matches(board, &tmp))
4167 moan_device("Redundant entry in serial pci_table.",
4168 dev);
4169 }
4170
Russell King241fc432005-07-27 11:35:54 +01004171 priv = pciserial_init_ports(dev, board);
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +02004172 if (IS_ERR(priv))
4173 return PTR_ERR(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004174
Andy Shevchenko3f64b1d2016-02-15 18:01:51 +02004175 pci_set_drvdata(dev, priv);
4176 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004177}
4178
Bill Pembertonae8d8a12012-11-19 13:26:18 -05004179static void pciserial_remove_one(struct pci_dev *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004180{
4181 struct serial_private *priv = pci_get_drvdata(dev);
4182
Russell King241fc432005-07-27 11:35:54 +01004183 pciserial_remove_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004184}
4185
Andy Shevchenko61702c32015-02-02 14:53:26 +02004186#ifdef CONFIG_PM_SLEEP
4187static int pciserial_suspend_one(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004188{
Chuhong Yuan76b41062019-07-24 21:17:58 +08004189 struct serial_private *priv = dev_get_drvdata(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004190
Russell King241fc432005-07-27 11:35:54 +01004191 if (priv)
4192 pciserial_suspend_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004193
Linus Torvalds1da177e2005-04-16 15:20:36 -07004194 return 0;
4195}
4196
Andy Shevchenko61702c32015-02-02 14:53:26 +02004197static int pciserial_resume_one(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004198{
Andy Shevchenko61702c32015-02-02 14:53:26 +02004199 struct pci_dev *pdev = to_pci_dev(dev);
4200 struct serial_private *priv = pci_get_drvdata(pdev);
Dirk Hohndelccb9d592007-10-29 06:28:17 -07004201 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004202
4203 if (priv) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004204 /*
4205 * The device may have been disabled. Re-enable it.
4206 */
Andy Shevchenko61702c32015-02-02 14:53:26 +02004207 err = pci_enable_device(pdev);
Alan Cox40836c42008-10-13 10:36:11 +01004208 /* FIXME: We cannot simply error out here */
Dirk Hohndelccb9d592007-10-29 06:28:17 -07004209 if (err)
Andy Shevchenko61702c32015-02-02 14:53:26 +02004210 dev_err(dev, "Unable to re-enable ports, trying to continue.\n");
Russell King241fc432005-07-27 11:35:54 +01004211 pciserial_resume_ports(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004212 }
4213 return 0;
4214}
Alexey Dobriyan1d5e7992006-09-25 16:51:27 -07004215#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07004216
Andy Shevchenko61702c32015-02-02 14:53:26 +02004217static SIMPLE_DEV_PM_OPS(pciserial_pm_ops, pciserial_suspend_one,
4218 pciserial_resume_one);
4219
Arvind Yadavc40f7162017-07-23 15:31:06 +05304220static const struct pci_device_id serial_pci_tbl[] = {
Michael Bramer78d70d42009-01-27 11:51:16 +00004221 /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
4222 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
4223 PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
4224 pbn_b2_8_921600 },
Thomee Wright0c6d7742014-05-19 20:30:51 +00004225 /* Advantech also use 0x3618 and 0xf618 */
4226 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3618,
4227 PCI_DEVICE_ID_ADVANTECH_PCI3618, PCI_ANY_ID, 0, 0,
4228 pbn_b0_4_921600 },
4229 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCIf618,
4230 PCI_DEVICE_ID_ADVANTECH_PCI3618, PCI_ANY_ID, 0, 0,
4231 pbn_b0_4_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004232 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
4233 PCI_SUBVENDOR_ID_CONNECT_TECH,
4234 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
4235 pbn_b1_8_1382400 },
4236 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
4237 PCI_SUBVENDOR_ID_CONNECT_TECH,
4238 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
4239 pbn_b1_4_1382400 },
4240 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
4241 PCI_SUBVENDOR_ID_CONNECT_TECH,
4242 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
4243 pbn_b1_2_1382400 },
4244 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4245 PCI_SUBVENDOR_ID_CONNECT_TECH,
4246 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
4247 pbn_b1_8_1382400 },
4248 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4249 PCI_SUBVENDOR_ID_CONNECT_TECH,
4250 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
4251 pbn_b1_4_1382400 },
4252 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4253 PCI_SUBVENDOR_ID_CONNECT_TECH,
4254 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
4255 pbn_b1_2_1382400 },
4256 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4257 PCI_SUBVENDOR_ID_CONNECT_TECH,
4258 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
4259 pbn_b1_8_921600 },
4260 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4261 PCI_SUBVENDOR_ID_CONNECT_TECH,
4262 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
4263 pbn_b1_8_921600 },
4264 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4265 PCI_SUBVENDOR_ID_CONNECT_TECH,
4266 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
4267 pbn_b1_4_921600 },
4268 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4269 PCI_SUBVENDOR_ID_CONNECT_TECH,
4270 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
4271 pbn_b1_4_921600 },
4272 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4273 PCI_SUBVENDOR_ID_CONNECT_TECH,
4274 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
4275 pbn_b1_2_921600 },
4276 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4277 PCI_SUBVENDOR_ID_CONNECT_TECH,
4278 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
4279 pbn_b1_8_921600 },
4280 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4281 PCI_SUBVENDOR_ID_CONNECT_TECH,
4282 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
4283 pbn_b1_8_921600 },
4284 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4285 PCI_SUBVENDOR_ID_CONNECT_TECH,
4286 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
4287 pbn_b1_4_921600 },
Gareth Howlett26e92862006-01-04 17:00:42 +00004288 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
4289 PCI_SUBVENDOR_ID_CONNECT_TECH,
4290 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
4291 pbn_b1_2_1250000 },
4292 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
4293 PCI_SUBVENDOR_ID_CONNECT_TECH,
4294 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
4295 pbn_b0_2_1843200 },
4296 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
4297 PCI_SUBVENDOR_ID_CONNECT_TECH,
4298 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
4299 pbn_b0_4_1843200 },
Yoichi Yuasa85d14942006-02-08 21:46:24 +00004300 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
4301 PCI_VENDOR_ID_AFAVLAB,
4302 PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
4303 pbn_b0_4_1152000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004304 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
Alan Cox5756ee92008-02-08 04:18:51 -08004305 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004306 pbn_b2_bt_1_115200 },
4307 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
Alan Cox5756ee92008-02-08 04:18:51 -08004308 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004309 pbn_b2_bt_2_115200 },
4310 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
Alan Cox5756ee92008-02-08 04:18:51 -08004311 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004312 pbn_b2_bt_4_115200 },
4313 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
Alan Cox5756ee92008-02-08 04:18:51 -08004314 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004315 pbn_b2_bt_2_115200 },
4316 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
Alan Cox5756ee92008-02-08 04:18:51 -08004317 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004318 pbn_b2_bt_4_115200 },
4319 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
Alan Cox5756ee92008-02-08 04:18:51 -08004320 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004321 pbn_b2_8_115200 },
Flavio Leitnere65f0f82009-01-02 13:50:43 +00004322 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
4323 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4324 pbn_b2_8_460800 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004325 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
4326 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4327 pbn_b2_8_115200 },
4328
4329 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
4330 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4331 pbn_b2_bt_2_115200 },
4332 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
4333 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4334 pbn_b2_bt_2_921600 },
4335 /*
4336 * VScom SPCOM800, from sl@s.pl
4337 */
Alan Cox5756ee92008-02-08 04:18:51 -08004338 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
4339 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004340 pbn_b2_8_921600 },
4341 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
Alan Cox5756ee92008-02-08 04:18:51 -08004342 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004343 pbn_b2_4_921600 },
Catalin(ux) M BOIEb76c5a02008-07-23 21:29:46 -07004344 /* Unknown card - subdevice 0x1584 */
4345 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4346 PCI_VENDOR_ID_PLX,
4347 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
Scott Ashcroftd13402a2013-03-03 21:35:06 +00004348 pbn_b2_4_115200 },
4349 /* Unknown card - subdevice 0x1588 */
4350 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4351 PCI_VENDOR_ID_PLX,
4352 PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
4353 pbn_b2_8_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004354 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4355 PCI_SUBVENDOR_ID_KEYSPAN,
4356 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
4357 pbn_panacom },
4358 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
4359 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4360 pbn_panacom4 },
4361 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
4362 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4363 pbn_panacom2 },
Matthias Fuchsa9cccd32007-02-10 01:46:05 -08004364 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4365 PCI_VENDOR_ID_ESDGMBH,
4366 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
4367 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004368 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4369 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004370 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004371 pbn_b2_4_460800 },
4372 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4373 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004374 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004375 pbn_b2_8_460800 },
4376 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4377 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004378 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004379 pbn_b2_16_460800 },
4380 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4381 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
Alan Cox5756ee92008-02-08 04:18:51 -08004382 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004383 pbn_b2_16_460800 },
4384 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4385 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08004386 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004387 pbn_b2_4_460800 },
4388 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4389 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
Alan Cox5756ee92008-02-08 04:18:51 -08004390 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004391 pbn_b2_8_460800 },
Bjorn Helgaasadd7b582005-10-24 22:11:57 +01004392 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
4393 PCI_SUBVENDOR_ID_EXSYS,
4394 PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
Shawn Bohreree4cd1b2012-05-28 15:20:47 -05004395 pbn_b2_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004396 /*
4397 * Megawolf Romulus PCI Serial Card, from Mike Hudson
4398 * (Exoray@isys.ca)
4399 */
4400 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
4401 0x10b5, 0x106a, 0, 0,
4402 pbn_plx_romulus },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304403 /*
Mike Skoog1bc8cde2014-10-16 13:10:01 -07004404 * EndRun Technologies. PCI express device range.
4405 * EndRun PTP/1588 has 2 Native UARTs.
4406 */
4407 { PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588,
4408 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4409 pbn_endrun_2_4000000 },
4410 /*
Alan Cox55c7c0f2012-11-29 09:03:00 +10304411 * Quatech cards. These actually have configurable clocks but for
4412 * now we just use the default.
4413 *
4414 * 100 series are RS232, 200 series RS422,
4415 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004416 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
4417 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4418 pbn_b1_4_115200 },
4419 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
4420 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4421 pbn_b1_2_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304422 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100E,
4423 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4424 pbn_b2_2_115200 },
4425 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200,
4426 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4427 pbn_b1_2_115200 },
4428 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200E,
4429 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4430 pbn_b2_2_115200 },
4431 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC200,
4432 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4433 pbn_b1_4_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004434 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
4435 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4436 pbn_b1_8_115200 },
4437 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
4438 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4439 pbn_b1_8_115200 },
Alan Cox55c7c0f2012-11-29 09:03:00 +10304440 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP100,
4441 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4442 pbn_b1_4_115200 },
4443 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP100,
4444 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4445 pbn_b1_2_115200 },
4446 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP200,
4447 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4448 pbn_b1_4_115200 },
4449 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP200,
4450 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4451 pbn_b1_2_115200 },
4452 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP100,
4453 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4454 pbn_b2_4_115200 },
4455 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP100,
4456 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4457 pbn_b2_2_115200 },
4458 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP100,
4459 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4460 pbn_b2_1_115200 },
4461 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP200,
4462 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4463 pbn_b2_4_115200 },
4464 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP200,
4465 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4466 pbn_b2_2_115200 },
4467 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP200,
4468 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4469 pbn_b2_1_115200 },
4470 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESCLP100,
4471 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4472 pbn_b0_8_115200 },
4473
Linus Torvalds1da177e2005-04-16 15:20:36 -07004474 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08004475 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
4476 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004477 pbn_b0_4_921600 },
4478 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Alan Cox5756ee92008-02-08 04:18:51 -08004479 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
4480 0, 0,
Andrey Paninfbc0dc02005-07-18 11:38:09 +01004481 pbn_b0_4_1152000 },
Mikulas Patockac9bd9d02010-10-26 14:20:48 -04004482 { PCI_VENDOR_ID_OXSEMI, 0x9505,
4483 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4484 pbn_b0_bt_2_921600 },
David Ransondb1de152005-07-27 11:43:55 -07004485
4486 /*
4487 * The below card is a little controversial since it is the
4488 * subject of a PCI vendor/device ID clash. (See
4489 * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
4490 * For now just used the hex ID 0x950a.
4491 */
4492 { PCI_VENDOR_ID_OXSEMI, 0x950a,
Flavio Leitner26e82202012-09-21 21:04:34 -03004493 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_00,
4494 0, 0, pbn_b0_2_115200 },
4495 { PCI_VENDOR_ID_OXSEMI, 0x950a,
4496 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_30,
4497 0, 0, pbn_b0_2_115200 },
Niels de Vos39aced62009-01-02 13:46:58 +00004498 { PCI_VENDOR_ID_OXSEMI, 0x950a,
David Ransondb1de152005-07-27 11:43:55 -07004499 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4500 pbn_b0_2_1130000 },
Andre Przywara70fd8fd2009-06-11 12:41:57 +01004501 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_C950,
4502 PCI_VENDOR_ID_OXSEMI, PCI_SUBDEVICE_ID_OXSEMI_C950, 0, 0,
4503 pbn_b0_1_921600 },
Andrey Paninfbc0dc02005-07-18 11:38:09 +01004504 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004505 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4506 pbn_b0_4_115200 },
4507 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
4508 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4509 pbn_b0_bt_2_921600 },
Lytochkin Borise8470032010-07-26 10:02:26 +04004510 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
Anton Wuerfel1a33e342016-01-14 16:08:10 +01004511 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Lytochkin Borise8470032010-07-26 10:02:26 +04004512 pbn_b2_8_1152000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004513
4514 /*
Lee Howard7106b4e2008-10-21 13:48:58 +01004515 * Oxford Semiconductor Inc. Tornado PCI express device range.
4516 */
4517 { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
4518 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004519 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004520 { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
4521 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004522 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004523 { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
4524 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004525 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004526 { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
4527 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004528 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004529 { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
4530 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004531 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004532 { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
4533 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004534 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004535 { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
4536 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004537 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004538 { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
4539 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004540 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004541 { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
4542 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004543 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004544 { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
4545 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004546 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004547 { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
4548 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004549 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004550 { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
4551 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004552 pbn_b0_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004553 { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
4554 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004555 pbn_oxsemi_2_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004556 { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
4557 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004558 pbn_oxsemi_2_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004559 { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
4560 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004561 pbn_oxsemi_4_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004562 { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
4563 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004564 pbn_oxsemi_4_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004565 { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
4566 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004567 pbn_oxsemi_8_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004568 { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
4569 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004570 pbn_oxsemi_8_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004571 { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
4572 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004573 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004574 { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
4575 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004576 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004577 { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
4578 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004579 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004580 { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
4581 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004582 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004583 { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
4584 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004585 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004586 { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
4587 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004588 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004589 { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
4590 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004591 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004592 { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
4593 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004594 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004595 { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
4596 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004597 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004598 { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
4599 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004600 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004601 { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
4602 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004603 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004604 { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
4605 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004606 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004607 { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
4608 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004609 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004610 { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
4611 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004612 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004613 { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
4614 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004615 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004616 { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
4617 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004618 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004619 { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
4620 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004621 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004622 { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
4623 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004624 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004625 { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
4626 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004627 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004628 { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
4629 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004630 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004631 { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
4632 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004633 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004634 { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
4635 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004636 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004637 { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
4638 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004639 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004640 { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
4641 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004642 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004643 { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
4644 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004645 pbn_oxsemi_1_3906250 },
Lee Howard7106b4e2008-10-21 13:48:58 +01004646 { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
4647 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004648 pbn_oxsemi_1_3906250 },
Lee Howardb80de362008-10-21 13:50:14 +01004649 /*
4650 * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
4651 */
4652 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
4653 PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004654 pbn_oxsemi_1_3906250 },
Lee Howardb80de362008-10-21 13:50:14 +01004655 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
4656 PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004657 pbn_oxsemi_2_3906250 },
Lee Howardb80de362008-10-21 13:50:14 +01004658 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
4659 PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004660 pbn_oxsemi_4_3906250 },
Lee Howardb80de362008-10-21 13:50:14 +01004661 { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
4662 PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004663 pbn_oxsemi_8_3906250 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05004664
4665 /*
4666 * Digi/IBM PCIe 2-port Async EIA-232 Adapter utilizing OxSemi Tornado
4667 */
4668 { PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
4669 PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
Maciej W. Rozycki6cbe45d2021-06-10 20:39:03 +02004670 pbn_oxsemi_2_3906250 },
Scott Kilauaa273ae2011-05-11 15:41:59 -05004671
Lee Howard7106b4e2008-10-21 13:48:58 +01004672 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004673 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
4674 * from skokodyn@yahoo.com
4675 */
4676 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4677 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
4678 pbn_sbsxrsio },
4679 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4680 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
4681 pbn_sbsxrsio },
4682 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4683 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
4684 pbn_sbsxrsio },
4685 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4686 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
4687 pbn_sbsxrsio },
4688
4689 /*
4690 * Digitan DS560-558, from jimd@esoft.com
4691 */
4692 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
Alan Cox5756ee92008-02-08 04:18:51 -08004693 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004694 pbn_b1_1_115200 },
4695
4696 /*
4697 * Titan Electronic cards
4698 * The 400L and 800L have a custom setup quirk.
4699 */
4700 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
Alan Cox5756ee92008-02-08 04:18:51 -08004701 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004702 pbn_b0_1_921600 },
4703 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
Alan Cox5756ee92008-02-08 04:18:51 -08004704 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004705 pbn_b0_2_921600 },
4706 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
Alan Cox5756ee92008-02-08 04:18:51 -08004707 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004708 pbn_b0_4_921600 },
4709 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
Alan Cox5756ee92008-02-08 04:18:51 -08004710 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004711 pbn_b0_4_921600 },
4712 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
4713 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4714 pbn_b1_1_921600 },
4715 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
4716 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4717 pbn_b1_bt_2_921600 },
4718 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
4719 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4720 pbn_b0_bt_4_921600 },
4721 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
4722 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4723 pbn_b0_bt_8_921600 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004724 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200I,
4725 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4726 pbn_b4_bt_2_921600 },
4727 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400I,
4728 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4729 pbn_b4_bt_4_921600 },
4730 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800I,
4731 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4732 pbn_b4_bt_8_921600 },
4733 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400EH,
4734 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4735 pbn_b0_4_921600 },
4736 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EH,
4737 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4738 pbn_b0_4_921600 },
4739 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EHB,
4740 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4741 pbn_b0_4_921600 },
4742 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
4743 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004744 pbn_titan_1_4000000 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004745 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
4746 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004747 pbn_titan_2_4000000 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004748 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
4749 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004750 pbn_titan_4_4000000 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004751 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
4752 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004753 pbn_titan_8_4000000 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004754 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
4755 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004756 pbn_titan_2_4000000 },
Yegor Yefremov66169ad2010-06-04 09:58:18 +02004757 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
4758 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Maciej W. Rozyckif771a342021-06-10 20:38:59 +02004759 pbn_titan_2_4000000 },
Yegor Yefremov48c02472013-12-09 12:11:15 +01004760 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3,
4761 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4762 pbn_b0_bt_2_921600 },
Yegor Yefremov1e9deb12011-12-27 15:47:37 +01004763 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
4764 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4765 pbn_b0_4_921600 },
4766 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_410V3,
4767 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4768 pbn_b0_4_921600 },
4769 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3,
4770 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4771 pbn_b0_4_921600 },
4772 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3B,
4773 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4774 pbn_b0_4_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004775
4776 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
4777 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4778 pbn_b2_1_460800 },
4779 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
4780 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4781 pbn_b2_1_460800 },
4782 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
4783 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4784 pbn_b2_1_460800 },
4785 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
4786 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4787 pbn_b2_bt_2_921600 },
4788 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
4789 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4790 pbn_b2_bt_2_921600 },
4791 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
4792 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4793 pbn_b2_bt_2_921600 },
4794 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
4795 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4796 pbn_b2_bt_4_921600 },
4797 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
4798 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4799 pbn_b2_bt_4_921600 },
4800 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
4801 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4802 pbn_b2_bt_4_921600 },
4803 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
4804 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4805 pbn_b0_1_921600 },
4806 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
4807 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4808 pbn_b0_1_921600 },
4809 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
4810 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4811 pbn_b0_1_921600 },
4812 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
4813 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4814 pbn_b0_bt_2_921600 },
4815 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
4816 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4817 pbn_b0_bt_2_921600 },
4818 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
4819 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4820 pbn_b0_bt_2_921600 },
4821 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
4822 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4823 pbn_b0_bt_4_921600 },
4824 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
4825 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4826 pbn_b0_bt_4_921600 },
4827 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
4828 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4829 pbn_b0_bt_4_921600 },
Andrey Panin3ec9c592006-02-02 20:15:09 +00004830 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
4831 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4832 pbn_b0_bt_8_921600 },
4833 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
4834 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4835 pbn_b0_bt_8_921600 },
4836 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
4837 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4838 pbn_b0_bt_8_921600 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004839
4840 /*
4841 * Computone devices submitted by Doug McNash dmcnash@computone.com
4842 */
4843 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4844 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
4845 0, 0, pbn_computone_4 },
4846 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4847 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
4848 0, 0, pbn_computone_8 },
4849 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4850 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
4851 0, 0, pbn_computone_6 },
4852
4853 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
4854 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4855 pbn_oxsemi },
4856 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
4857 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
4858 pbn_b0_bt_1_921600 },
4859
4860 /*
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08004861 * Sunix PCI serial boards
Stephen Chiversabd7bac2013-01-28 19:49:20 +11004862 */
4863 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08004864 PCI_VENDOR_ID_SUNIX, 0x0001, 0, 0,
4865 pbn_sunix_pci_1s },
Stephen Chiversabd7bac2013-01-28 19:49:20 +11004866 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
Kai-Heng Feng8515dbc2019-08-10 03:01:29 +08004867 PCI_VENDOR_ID_SUNIX, 0x0002, 0, 0,
4868 pbn_sunix_pci_2s },
4869 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4870 PCI_VENDOR_ID_SUNIX, 0x0004, 0, 0,
4871 pbn_sunix_pci_4s },
4872 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4873 PCI_VENDOR_ID_SUNIX, 0x0084, 0, 0,
4874 pbn_sunix_pci_4s },
4875 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4876 PCI_VENDOR_ID_SUNIX, 0x0008, 0, 0,
4877 pbn_sunix_pci_8s },
4878 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4879 PCI_VENDOR_ID_SUNIX, 0x0088, 0, 0,
4880 pbn_sunix_pci_8s },
4881 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4882 PCI_VENDOR_ID_SUNIX, 0x0010, 0, 0,
4883 pbn_sunix_pci_16s },
Stephen Chiversabd7bac2013-01-28 19:49:20 +11004884
4885 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004886 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
4887 */
4888 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
4889 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4890 pbn_b0_bt_8_115200 },
4891 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
4892 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4893 pbn_b0_bt_8_115200 },
4894
4895 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
4896 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4897 pbn_b0_bt_2_115200 },
4898 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
4899 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4900 pbn_b0_bt_2_115200 },
4901 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
4902 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4903 pbn_b0_bt_2_115200 },
Lennert Buytenhekb87e5e22009-11-11 14:26:42 -08004904 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
4905 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4906 pbn_b0_bt_2_115200 },
4907 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
4908 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4909 pbn_b0_bt_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07004910 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
4911 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4912 pbn_b0_bt_4_460800 },
4913 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
4914 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4915 pbn_b0_bt_4_460800 },
4916 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
4917 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4918 pbn_b0_bt_2_460800 },
4919 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
4920 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4921 pbn_b0_bt_2_460800 },
4922 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
4923 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4924 pbn_b0_bt_2_460800 },
4925 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
4926 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4927 pbn_b0_bt_1_115200 },
4928 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
4929 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4930 pbn_b0_bt_1_460800 },
4931
4932 /*
Russell King1fb8cac2006-12-13 14:45:46 +00004933 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
4934 * Cards are identified by their subsystem vendor IDs, which
4935 * (in hex) match the model number.
4936 *
4937 * Note that JC140x are RS422/485 cards which require ox950
4938 * ACR = 0x10, and as such are not currently fully supported.
4939 */
4940 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4941 0x1204, 0x0004, 0, 0,
4942 pbn_b0_4_921600 },
4943 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4944 0x1208, 0x0004, 0, 0,
4945 pbn_b0_4_921600 },
4946/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4947 0x1402, 0x0002, 0, 0,
4948 pbn_b0_2_921600 }, */
4949/* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4950 0x1404, 0x0004, 0, 0,
4951 pbn_b0_4_921600 }, */
4952 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
4953 0x1208, 0x0004, 0, 0,
4954 pbn_b0_4_921600 },
4955
Kiros Yeh2a52fcb2009-12-21 16:26:48 -08004956 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4957 0x1204, 0x0004, 0, 0,
4958 pbn_b0_4_921600 },
4959 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4960 0x1208, 0x0004, 0, 0,
4961 pbn_b0_4_921600 },
4962 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF3,
4963 0x1208, 0x0004, 0, 0,
4964 pbn_b0_4_921600 },
Russell King1fb8cac2006-12-13 14:45:46 +00004965 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07004966 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
4967 */
4968 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
4969 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4970 pbn_b1_1_1382400 },
4971
4972 /*
4973 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
4974 */
4975 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
4976 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4977 pbn_b1_1_1382400 },
4978
4979 /*
4980 * RAStel 2 port modem, gerg@moreton.com.au
4981 */
4982 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
4983 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4984 pbn_b2_bt_2_115200 },
4985
4986 /*
4987 * EKF addition for i960 Boards form EKF with serial port
4988 */
4989 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
4990 0xE4BF, PCI_ANY_ID, 0, 0,
4991 pbn_intel_i960 },
4992
4993 /*
4994 * Xircom Cardbus/Ethernet combos
4995 */
4996 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
4997 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4998 pbn_b0_1_115200 },
4999 /*
5000 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
5001 */
5002 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
5003 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5004 pbn_b0_1_115200 },
5005
5006 /*
5007 * Untested PCI modems, sent in from various folks...
5008 */
5009
5010 /*
5011 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
5012 */
5013 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
5014 0x1048, 0x1500, 0, 0,
5015 pbn_b1_1_115200 },
5016
5017 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
5018 0xFF00, 0, 0, 0,
5019 pbn_sgi_ioc3 },
5020
5021 /*
5022 * HP Diva card
5023 */
5024 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
5025 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
5026 pbn_b1_1_115200 },
5027 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
5028 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5029 pbn_b0_5_115200 },
5030 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
5031 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5032 pbn_b2_1_115200 },
Randy Wrighte0e24202021-05-14 10:26:54 -06005033 /* HPE PCI serial device */
5034 { PCI_VENDOR_ID_HP_3PAR, PCI_DEVICE_ID_HPE_PCI_SERIAL,
5035 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5036 pbn_b1_1_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07005037
Alon Bar-Levd9004eb2006-01-18 11:47:33 +00005038 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
5039 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5040 pbn_b3_2_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07005041 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
5042 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5043 pbn_b3_4_115200 },
5044 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
5045 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5046 pbn_b3_8_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07005047 /*
Adam Lee89c043a2015-08-03 13:28:13 +08005048 * Pericom PI7C9X795[1248] Uno/Dual/Quad/Octal UART
5049 */
5050 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7951,
5051 PCI_ANY_ID, PCI_ANY_ID,
5052 0,
5053 0, pbn_pericom_PI7C9X7951 },
5054 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7952,
5055 PCI_ANY_ID, PCI_ANY_ID,
5056 0,
5057 0, pbn_pericom_PI7C9X7952 },
5058 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7954,
5059 PCI_ANY_ID, PCI_ANY_ID,
5060 0,
5061 0, pbn_pericom_PI7C9X7954 },
5062 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7958,
5063 PCI_ANY_ID, PCI_ANY_ID,
5064 0,
5065 0, pbn_pericom_PI7C9X7958 },
5066 /*
Jimi Damonc8d19242016-07-20 17:00:40 -07005067 * ACCES I/O Products quad
5068 */
5069 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB,
5070 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005071 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005072 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S,
5073 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005074 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005075 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB,
5076 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5077 pbn_pericom_PI7C9X7954 },
5078 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S,
5079 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5080 pbn_pericom_PI7C9X7954 },
5081 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB,
5082 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005083 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005084 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2,
5085 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005086 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005087 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB,
5088 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5089 pbn_pericom_PI7C9X7954 },
5090 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4,
5091 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5092 pbn_pericom_PI7C9X7954 },
5093 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB,
5094 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005095 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005096 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM,
5097 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005098 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005099 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB,
5100 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5101 pbn_pericom_PI7C9X7954 },
5102 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM,
5103 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5104 pbn_pericom_PI7C9X7954 },
5105 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1,
5106 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005107 pbn_pericom_PI7C9X7951 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005108 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2,
5109 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005110 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005111 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2,
5112 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005113 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005114 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4,
5115 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5116 pbn_pericom_PI7C9X7954 },
5117 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4,
5118 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5119 pbn_pericom_PI7C9X7954 },
5120 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S,
5121 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005122 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005123 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S,
5124 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5125 pbn_pericom_PI7C9X7954 },
5126 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2,
5127 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005128 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005129 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2,
5130 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005131 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005132 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4,
5133 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5134 pbn_pericom_PI7C9X7954 },
5135 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4,
5136 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5137 pbn_pericom_PI7C9X7954 },
5138 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM,
5139 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005140 pbn_pericom_PI7C9X7952 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005141 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4,
5142 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005143 pbn_pericom_PI7C9X7954 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005144 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4,
5145 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005146 pbn_pericom_PI7C9X7954 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005147 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8,
5148 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5149 pbn_pericom_PI7C9X7958 },
5150 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8,
5151 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5152 pbn_pericom_PI7C9X7958 },
5153 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4,
5154 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005155 pbn_pericom_PI7C9X7954 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005156 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8,
5157 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5158 pbn_pericom_PI7C9X7958 },
5159 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM,
5160 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005161 pbn_pericom_PI7C9X7954 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005162 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM,
5163 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5164 pbn_pericom_PI7C9X7958 },
5165 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM,
5166 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
Jay Dolanb896b032019-02-12 21:43:11 -08005167 pbn_pericom_PI7C9X7954 },
Jimi Damonc8d19242016-07-20 17:00:40 -07005168 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07005169 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
5170 */
5171 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
5172 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5173 pbn_b0_1_115200 },
Niels de Vos84f8c6f2007-08-22 14:01:14 -07005174 /*
5175 * ITE
5176 */
5177 { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
5178 PCI_ANY_ID, PCI_ANY_ID,
5179 0, 0,
5180 pbn_b1_bt_1_115200 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07005181
5182 /*
Peter Horton737c1752006-08-26 09:07:36 +01005183 * IntaShield IS-200
5184 */
5185 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
5186 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
5187 pbn_b2_2_115200 },
Ignacio García Pérez4b6f6ce2008-05-23 13:04:28 -07005188 /*
5189 * IntaShield IS-400
5190 */
5191 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
5192 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
5193 pbn_b2_4_115200 },
Peter Horton737c1752006-08-26 09:07:36 +01005194 /*
Nikola Ciprich9f2068f2018-02-13 15:04:46 +01005195 * BrainBoxes UC-260
5196 */
5197 { PCI_VENDOR_ID_INTASHIELD, 0x0D21,
5198 PCI_ANY_ID, PCI_ANY_ID,
5199 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
5200 pbn_b2_4_115200 },
5201 { PCI_VENDOR_ID_INTASHIELD, 0x0E34,
5202 PCI_ANY_ID, PCI_ANY_ID,
5203 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
5204 pbn_b2_4_115200 },
5205 /*
Thomas Hoehn48212002007-02-10 01:46:05 -08005206 * Perle PCI-RAS cards
5207 */
5208 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
5209 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
5210 0, 0, pbn_b2_4_921600 },
5211 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
5212 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
5213 0, 0, pbn_b2_8_921600 },
Alan Coxbf0df632007-10-16 01:24:00 -07005214
5215 /*
5216 * Mainpine series cards: Fairly standard layout but fools
5217 * parts of the autodetect in some cases and uses otherwise
5218 * unmatched communications subclasses in the PCI Express case
5219 */
5220
5221 { /* RockForceDUO */
5222 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5223 PCI_VENDOR_ID_MAINPINE, 0x0200,
5224 0, 0, pbn_b0_2_115200 },
5225 { /* RockForceQUATRO */
5226 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5227 PCI_VENDOR_ID_MAINPINE, 0x0300,
5228 0, 0, pbn_b0_4_115200 },
5229 { /* RockForceDUO+ */
5230 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5231 PCI_VENDOR_ID_MAINPINE, 0x0400,
5232 0, 0, pbn_b0_2_115200 },
5233 { /* RockForceQUATRO+ */
5234 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5235 PCI_VENDOR_ID_MAINPINE, 0x0500,
5236 0, 0, pbn_b0_4_115200 },
5237 { /* RockForce+ */
5238 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5239 PCI_VENDOR_ID_MAINPINE, 0x0600,
5240 0, 0, pbn_b0_2_115200 },
5241 { /* RockForce+ */
5242 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5243 PCI_VENDOR_ID_MAINPINE, 0x0700,
5244 0, 0, pbn_b0_4_115200 },
5245 { /* RockForceOCTO+ */
5246 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5247 PCI_VENDOR_ID_MAINPINE, 0x0800,
5248 0, 0, pbn_b0_8_115200 },
5249 { /* RockForceDUO+ */
5250 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5251 PCI_VENDOR_ID_MAINPINE, 0x0C00,
5252 0, 0, pbn_b0_2_115200 },
5253 { /* RockForceQUARTRO+ */
5254 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5255 PCI_VENDOR_ID_MAINPINE, 0x0D00,
5256 0, 0, pbn_b0_4_115200 },
5257 { /* RockForceOCTO+ */
5258 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5259 PCI_VENDOR_ID_MAINPINE, 0x1D00,
5260 0, 0, pbn_b0_8_115200 },
5261 { /* RockForceD1 */
5262 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5263 PCI_VENDOR_ID_MAINPINE, 0x2000,
5264 0, 0, pbn_b0_1_115200 },
5265 { /* RockForceF1 */
5266 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5267 PCI_VENDOR_ID_MAINPINE, 0x2100,
5268 0, 0, pbn_b0_1_115200 },
5269 { /* RockForceD2 */
5270 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5271 PCI_VENDOR_ID_MAINPINE, 0x2200,
5272 0, 0, pbn_b0_2_115200 },
5273 { /* RockForceF2 */
5274 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5275 PCI_VENDOR_ID_MAINPINE, 0x2300,
5276 0, 0, pbn_b0_2_115200 },
5277 { /* RockForceD4 */
5278 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5279 PCI_VENDOR_ID_MAINPINE, 0x2400,
5280 0, 0, pbn_b0_4_115200 },
5281 { /* RockForceF4 */
5282 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5283 PCI_VENDOR_ID_MAINPINE, 0x2500,
5284 0, 0, pbn_b0_4_115200 },
5285 { /* RockForceD8 */
5286 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5287 PCI_VENDOR_ID_MAINPINE, 0x2600,
5288 0, 0, pbn_b0_8_115200 },
5289 { /* RockForceF8 */
5290 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5291 PCI_VENDOR_ID_MAINPINE, 0x2700,
5292 0, 0, pbn_b0_8_115200 },
5293 { /* IQ Express D1 */
5294 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5295 PCI_VENDOR_ID_MAINPINE, 0x3000,
5296 0, 0, pbn_b0_1_115200 },
5297 { /* IQ Express F1 */
5298 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5299 PCI_VENDOR_ID_MAINPINE, 0x3100,
5300 0, 0, pbn_b0_1_115200 },
5301 { /* IQ Express D2 */
5302 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5303 PCI_VENDOR_ID_MAINPINE, 0x3200,
5304 0, 0, pbn_b0_2_115200 },
5305 { /* IQ Express F2 */
5306 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5307 PCI_VENDOR_ID_MAINPINE, 0x3300,
5308 0, 0, pbn_b0_2_115200 },
5309 { /* IQ Express D4 */
5310 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5311 PCI_VENDOR_ID_MAINPINE, 0x3400,
5312 0, 0, pbn_b0_4_115200 },
5313 { /* IQ Express F4 */
5314 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5315 PCI_VENDOR_ID_MAINPINE, 0x3500,
5316 0, 0, pbn_b0_4_115200 },
5317 { /* IQ Express D8 */
5318 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5319 PCI_VENDOR_ID_MAINPINE, 0x3C00,
5320 0, 0, pbn_b0_8_115200 },
5321 { /* IQ Express F8 */
5322 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
5323 PCI_VENDOR_ID_MAINPINE, 0x3D00,
5324 0, 0, pbn_b0_8_115200 },
5325
5326
Thomas Hoehn48212002007-02-10 01:46:05 -08005327 /*
Olof Johanssonaa798502007-08-22 14:01:55 -07005328 * PA Semi PA6T-1682M on-chip UART
5329 */
5330 { PCI_VENDOR_ID_PASEMI, 0xa004,
5331 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5332 pbn_pasemi_1682M },
5333
5334 /*
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01005335 * National Instruments
5336 */
Will Page04bf7e72009-04-06 17:32:15 +01005337 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
5338 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5339 pbn_b1_16_115200 },
5340 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
5341 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5342 pbn_b1_8_115200 },
5343 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
5344 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5345 pbn_b1_bt_4_115200 },
5346 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
5347 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5348 pbn_b1_bt_2_115200 },
5349 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
5350 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5351 pbn_b1_bt_4_115200 },
5352 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
5353 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5354 pbn_b1_bt_2_115200 },
5355 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
5356 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5357 pbn_b1_16_115200 },
5358 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
5359 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5360 pbn_b1_8_115200 },
5361 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
5362 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5363 pbn_b1_bt_4_115200 },
5364 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
5365 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5366 pbn_b1_bt_2_115200 },
5367 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
5368 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5369 pbn_b1_bt_4_115200 },
5370 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
5371 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5372 pbn_b1_bt_2_115200 },
Shawn Bohrer46a0fac2009-04-06 17:32:07 +01005373 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
5374 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5375 pbn_ni8430_2 },
5376 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
5377 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5378 pbn_ni8430_2 },
5379 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
5380 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5381 pbn_ni8430_4 },
5382 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
5383 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5384 pbn_ni8430_4 },
5385 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
5386 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5387 pbn_ni8430_8 },
5388 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
5389 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5390 pbn_ni8430_8 },
5391 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
5392 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5393 pbn_ni8430_16 },
5394 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
5395 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5396 pbn_ni8430_16 },
5397 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
5398 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5399 pbn_ni8430_2 },
5400 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
5401 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5402 pbn_ni8430_2 },
5403 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
5404 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5405 pbn_ni8430_4 },
5406 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
5407 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5408 pbn_ni8430_4 },
5409
5410 /*
Kai-Heng Fengd193db72019-08-17 00:51:24 +08005411 * MOXA
5412 */
5413 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP102E,
5414 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5415 pbn_moxa8250_2p },
5416 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP102EL,
5417 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5418 pbn_moxa8250_2p },
5419 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP104EL_A,
5420 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5421 pbn_moxa8250_4p },
5422 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP114EL,
5423 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5424 pbn_moxa8250_4p },
5425 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP116E_A_A,
5426 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5427 pbn_moxa8250_8p },
5428 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP116E_A_B,
5429 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5430 pbn_moxa8250_8p },
5431 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP118EL_A,
5432 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5433 pbn_moxa8250_8p },
5434 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP118E_A_I,
5435 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5436 pbn_moxa8250_8p },
5437 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP132EL,
5438 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5439 pbn_moxa8250_2p },
5440 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP134EL_A,
5441 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5442 pbn_moxa8250_4p },
5443 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP138E_A,
5444 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5445 pbn_moxa8250_8p },
5446 { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP168EL_A,
5447 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5448 pbn_moxa8250_8p },
5449
5450 /*
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08005451 * ADDI-DATA GmbH communication cards <info@addi-data.com>
5452 */
5453 { PCI_VENDOR_ID_ADDIDATA,
5454 PCI_DEVICE_ID_ADDIDATA_APCI7500,
5455 PCI_ANY_ID,
5456 PCI_ANY_ID,
5457 0,
5458 0,
5459 pbn_b0_4_115200 },
5460
5461 { PCI_VENDOR_ID_ADDIDATA,
5462 PCI_DEVICE_ID_ADDIDATA_APCI7420,
5463 PCI_ANY_ID,
5464 PCI_ANY_ID,
5465 0,
5466 0,
5467 pbn_b0_2_115200 },
5468
5469 { PCI_VENDOR_ID_ADDIDATA,
5470 PCI_DEVICE_ID_ADDIDATA_APCI7300,
5471 PCI_ANY_ID,
5472 PCI_ANY_ID,
5473 0,
5474 0,
5475 pbn_b0_1_115200 },
5476
Ian Abbott086231f2013-07-16 16:14:39 +01005477 { PCI_VENDOR_ID_AMCC,
Ian Abbott57c1f0e2013-07-16 16:14:40 +01005478 PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08005479 PCI_ANY_ID,
5480 PCI_ANY_ID,
5481 0,
5482 0,
5483 pbn_b1_8_115200 },
5484
5485 { PCI_VENDOR_ID_ADDIDATA,
5486 PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
5487 PCI_ANY_ID,
5488 PCI_ANY_ID,
5489 0,
5490 0,
5491 pbn_b0_4_115200 },
5492
5493 { PCI_VENDOR_ID_ADDIDATA,
5494 PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
5495 PCI_ANY_ID,
5496 PCI_ANY_ID,
5497 0,
5498 0,
5499 pbn_b0_2_115200 },
5500
5501 { PCI_VENDOR_ID_ADDIDATA,
5502 PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
5503 PCI_ANY_ID,
5504 PCI_ANY_ID,
5505 0,
5506 0,
5507 pbn_b0_1_115200 },
5508
5509 { PCI_VENDOR_ID_ADDIDATA,
5510 PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
5511 PCI_ANY_ID,
5512 PCI_ANY_ID,
5513 0,
5514 0,
5515 pbn_b0_4_115200 },
5516
5517 { PCI_VENDOR_ID_ADDIDATA,
5518 PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
5519 PCI_ANY_ID,
5520 PCI_ANY_ID,
5521 0,
5522 0,
5523 pbn_b0_2_115200 },
5524
5525 { PCI_VENDOR_ID_ADDIDATA,
5526 PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
5527 PCI_ANY_ID,
5528 PCI_ANY_ID,
5529 0,
5530 0,
5531 pbn_b0_1_115200 },
5532
5533 { PCI_VENDOR_ID_ADDIDATA,
5534 PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
5535 PCI_ANY_ID,
5536 PCI_ANY_ID,
5537 0,
5538 0,
5539 pbn_b0_8_115200 },
5540
Krauth.Julien1b62cbf2009-10-26 16:50:04 -07005541 { PCI_VENDOR_ID_ADDIDATA,
5542 PCI_DEVICE_ID_ADDIDATA_APCIe7500,
5543 PCI_ANY_ID,
5544 PCI_ANY_ID,
5545 0,
5546 0,
5547 pbn_ADDIDATA_PCIe_4_3906250 },
5548
5549 { PCI_VENDOR_ID_ADDIDATA,
5550 PCI_DEVICE_ID_ADDIDATA_APCIe7420,
5551 PCI_ANY_ID,
5552 PCI_ANY_ID,
5553 0,
5554 0,
5555 pbn_ADDIDATA_PCIe_2_3906250 },
5556
5557 { PCI_VENDOR_ID_ADDIDATA,
5558 PCI_DEVICE_ID_ADDIDATA_APCIe7300,
5559 PCI_ANY_ID,
5560 PCI_ANY_ID,
5561 0,
5562 0,
5563 pbn_ADDIDATA_PCIe_1_3906250 },
5564
5565 { PCI_VENDOR_ID_ADDIDATA,
5566 PCI_DEVICE_ID_ADDIDATA_APCIe7800,
5567 PCI_ANY_ID,
5568 PCI_ANY_ID,
5569 0,
5570 0,
5571 pbn_ADDIDATA_PCIe_8_3906250 },
5572
Jiri Slaby25cf9bc2009-01-15 13:30:34 +00005573 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
5574 PCI_VENDOR_ID_IBM, 0x0299,
5575 0, 0, pbn_b0_bt_2_115200 },
5576
Stefan Seyfried972ce082013-07-01 09:14:21 +02005577 /*
5578 * other NetMos 9835 devices are most likely handled by the
5579 * parport_serial driver, check drivers/parport/parport_serial.c
5580 * before adding them here.
5581 */
5582
Michael Bueschc4285b42009-06-30 11:41:21 -07005583 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
5584 0xA000, 0x1000,
5585 0, 0, pbn_b0_1_115200 },
5586
Nicos Gollan7808edc2011-05-05 21:00:37 +02005587 /* the 9901 is a rebranded 9912 */
5588 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
5589 0xA000, 0x1000,
5590 0, 0, pbn_b0_1_115200 },
5591
5592 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
5593 0xA000, 0x1000,
5594 0, 0, pbn_b0_1_115200 },
5595
5596 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
5597 0xA000, 0x1000,
5598 0, 0, pbn_b0_1_115200 },
5599
5600 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5601 0xA000, 0x1000,
5602 0, 0, pbn_b0_1_115200 },
5603
5604 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5605 0xA000, 0x3002,
5606 0, 0, pbn_NETMOS9900_2s_115200 },
5607
Krauth.Julien02c9b5c2008-02-04 22:27:49 -08005608 /*
Eric Smith44178172011-07-11 22:53:13 -06005609 * Best Connectivity and Rosewill PCI Multi I/O cards
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005610 */
5611
5612 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
5613 0xA000, 0x1000,
5614 0, 0, pbn_b0_1_115200 },
5615
5616 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Eric Smith44178172011-07-11 22:53:13 -06005617 0xA000, 0x3002,
5618 0, 0, pbn_b0_bt_2_115200 },
5619
5620 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005621 0xA000, 0x3004,
5622 0, 0, pbn_b0_bt_4_115200 },
Dirk Brandewie095e24b2010-11-17 07:35:20 -08005623 /* Intel CE4100 */
5624 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
5625 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5626 pbn_ce4100_1_115200 },
Mika Westerberg6c55d9b2016-01-29 16:49:47 +02005627
Antony Pavlovd9a0fbf2011-05-18 22:38:30 +04005628 /*
5629 * Cronyx Omega PCI
5630 */
5631 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
5632 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5633 pbn_omegapci },
Ira W. Snyderac6ec5b2009-12-21 16:26:45 -08005634
5635 /*
Stephen Hurdebebd492013-01-17 14:14:53 -08005636 * Broadcom TruManage
5637 */
5638 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
5639 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5640 pbn_brcm_trumanage },
5641
5642 /*
Alan Cox66835492012-08-16 12:01:33 +01005643 * AgeStar as-prs2-009
5644 */
5645 { PCI_VENDOR_ID_AGESTAR, PCI_DEVICE_ID_AGESTAR_9375,
5646 PCI_ANY_ID, PCI_ANY_ID,
5647 0, 0, pbn_b0_bt_2_115200 },
Alan Cox27788c52012-09-04 16:21:06 +01005648
5649 /*
5650 * WCH CH353 series devices: The 2S1P is handled by parport_serial
5651 * so not listed here.
5652 */
5653 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_4S,
5654 PCI_ANY_ID, PCI_ANY_ID,
5655 0, 0, pbn_b0_bt_4_115200 },
5656
5657 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_2S1PF,
5658 PCI_ANY_ID, PCI_ANY_ID,
5659 0, 0, pbn_b0_bt_2_115200 },
5660
Alexandr Petrenko55c368c2016-05-23 10:04:54 +03005661 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH355_4S,
5662 PCI_ANY_ID, PCI_ANY_ID,
5663 0, 0, pbn_b0_bt_4_115200 },
5664
Jeremy McNicoll7dde5572016-02-02 13:00:45 -08005665 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH382_2S,
5666 PCI_ANY_ID, PCI_ANY_ID,
5667 0, 0, pbn_wch382_2 },
5668
Sergej Pupykin72a3c0e2014-12-30 16:16:50 +03005669 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_4S,
5670 PCI_ANY_ID, PCI_ANY_ID,
5671 0, 0, pbn_wch384_4 },
5672
Du Huanpeng04b6ff52020-08-22 09:47:28 +08005673 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_8S,
5674 PCI_ANY_ID, PCI_ANY_ID,
5675 0, 0, pbn_wch384_8 },
Tobias Diedrich3c5a87b2020-09-14 19:36:28 +02005676 /*
5677 * Realtek RealManage
5678 */
5679 { PCI_VENDOR_ID_REALTEK, 0x816a,
5680 PCI_ANY_ID, PCI_ANY_ID,
5681 0, 0, pbn_b0_1_115200 },
5682
5683 { PCI_VENDOR_ID_REALTEK, 0x816b,
5684 PCI_ANY_ID, PCI_ANY_ID,
5685 0, 0, pbn_b0_1_115200 },
Du Huanpeng04b6ff52020-08-22 09:47:28 +08005686
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07005687 /* Fintek PCI serial cards */
5688 { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 },
5689 { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 },
5690 { PCI_DEVICE(0x1c29, 0x1112), .driver_data = pbn_fintek_12 },
Ji-Ze Hong (Peter Hong)68e26a82019-08-16 13:27:29 +08005691 { PCI_DEVICE(0x1c29, 0x1204), .driver_data = pbn_fintek_F81504A },
5692 { PCI_DEVICE(0x1c29, 0x1208), .driver_data = pbn_fintek_F81508A },
5693 { PCI_DEVICE(0x1c29, 0x1212), .driver_data = pbn_fintek_F81512A },
Greg Kroah-Hartman2c62a3c2013-10-17 10:44:26 -07005694
Ian Abbott1c9c8582017-02-03 20:25:00 +00005695 /* MKS Tenta SCOM-080x serial cards */
5696 { PCI_DEVICE(0x1601, 0x0800), .driver_data = pbn_b0_4_1250000 },
5697 { PCI_DEVICE(0x1601, 0xa801), .driver_data = pbn_b0_4_1250000 },
5698
Matt Wilson3bfd1302017-11-13 11:31:31 -08005699 /* Amazon PCI serial device */
5700 { PCI_DEVICE(0x1d0f, 0x8250), .driver_data = pbn_b0_1_115200 },
5701
Matt Schulte14faa8c2012-11-21 10:35:15 -06005702 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -07005703 * These entries match devices with class COMMUNICATION_SERIAL,
5704 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
5705 */
5706 { PCI_ANY_ID, PCI_ANY_ID,
5707 PCI_ANY_ID, PCI_ANY_ID,
5708 PCI_CLASS_COMMUNICATION_SERIAL << 8,
5709 0xffff00, pbn_default },
5710 { PCI_ANY_ID, PCI_ANY_ID,
5711 PCI_ANY_ID, PCI_ANY_ID,
5712 PCI_CLASS_COMMUNICATION_MODEM << 8,
5713 0xffff00, pbn_default },
5714 { PCI_ANY_ID, PCI_ANY_ID,
5715 PCI_ANY_ID, PCI_ANY_ID,
5716 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
5717 0xffff00, pbn_default },
5718 { 0, }
5719};
5720
Michael Reed28071902011-05-31 12:06:28 -05005721static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
5722 pci_channel_state_t state)
5723{
5724 struct serial_private *priv = pci_get_drvdata(dev);
5725
5726 if (state == pci_channel_io_perm_failure)
5727 return PCI_ERS_RESULT_DISCONNECT;
5728
5729 if (priv)
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02005730 pciserial_detach_ports(priv);
Michael Reed28071902011-05-31 12:06:28 -05005731
5732 pci_disable_device(dev);
5733
5734 return PCI_ERS_RESULT_NEED_RESET;
5735}
5736
5737static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
5738{
5739 int rc;
5740
5741 rc = pci_enable_device(dev);
5742
5743 if (rc)
5744 return PCI_ERS_RESULT_DISCONNECT;
5745
5746 pci_restore_state(dev);
5747 pci_save_state(dev);
5748
5749 return PCI_ERS_RESULT_RECOVERED;
5750}
5751
5752static void serial8250_io_resume(struct pci_dev *dev)
5753{
5754 struct serial_private *priv = pci_get_drvdata(dev);
Gabriel Krisman Bertazic130b662016-12-28 16:42:00 -02005755 struct serial_private *new;
Michael Reed28071902011-05-31 12:06:28 -05005756
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02005757 if (!priv)
5758 return;
5759
Gabriel Krisman Bertazic130b662016-12-28 16:42:00 -02005760 new = pciserial_init_ports(dev, priv->board);
5761 if (!IS_ERR(new)) {
5762 pci_set_drvdata(dev, new);
5763 kfree(priv);
Gabriel Krisman Bertazif209fa02016-11-28 19:34:42 -02005764 }
Michael Reed28071902011-05-31 12:06:28 -05005765}
5766
Stephen Hemminger1d352032012-09-07 09:33:17 -07005767static const struct pci_error_handlers serial8250_err_handler = {
Michael Reed28071902011-05-31 12:06:28 -05005768 .error_detected = serial8250_io_error_detected,
5769 .slot_reset = serial8250_io_slot_reset,
5770 .resume = serial8250_io_resume,
5771};
5772
Linus Torvalds1da177e2005-04-16 15:20:36 -07005773static struct pci_driver serial_pci_driver = {
5774 .name = "serial",
5775 .probe = pciserial_init_one,
Bill Pemberton2d47b712012-11-19 13:21:34 -05005776 .remove = pciserial_remove_one,
Andy Shevchenko61702c32015-02-02 14:53:26 +02005777 .driver = {
5778 .pm = &pciserial_pm_ops,
5779 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07005780 .id_table = serial_pci_tbl,
Michael Reed28071902011-05-31 12:06:28 -05005781 .err_handler = &serial8250_err_handler,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005782};
5783
Wei Yongjun15a12e82012-10-26 23:04:22 +08005784module_pci_driver(serial_pci_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005785
5786MODULE_LICENSE("GPL");
5787MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
5788MODULE_DEVICE_TABLE(pci, serial_pci_tbl);