2 * Copyright (c) 2006 Marcel Moolenaar
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include <sys/cdefs.h>
28 __FBSDID("$FreeBSD$");
31 * PCI "universal" communications card driver configuration data (used to
32 * match/attach the cards).
35 #include <sys/param.h>
36 #include <sys/systm.h>
37 #include <sys/kernel.h>
40 #include <machine/resource.h>
41 #include <machine/bus.h>
44 #include <dev/pci/pcivar.h>
46 #include <dev/puc/puc_bus.h>
47 #include <dev/puc/puc_cfg.h>
48 #include <dev/puc/puc_bfe.h>
50 static puc_config_f puc_config_amc;
51 static puc_config_f puc_config_diva;
52 static puc_config_f puc_config_exar;
53 static puc_config_f puc_config_exar_pcie;
54 static puc_config_f puc_config_icbook;
55 static puc_config_f puc_config_moxa;
56 static puc_config_f puc_config_oxford_pcie;
57 static puc_config_f puc_config_quatech;
58 static puc_config_f puc_config_syba;
59 static puc_config_f puc_config_siig;
60 static puc_config_f puc_config_timedia;
61 static puc_config_f puc_config_titan;
63 const struct puc_cfg puc_pci_devices[] = {
65 { 0x0009, 0x7168, 0xffff, 0,
68 PUC_PORT_2S, 0x10, 0, 8,
71 { 0x103c, 0x1048, 0x103c, 0x1049,
72 "HP Diva Serial [GSP] Multiport UART - Tosca Console",
74 PUC_PORT_3S, 0x10, 0, -1,
75 .config_function = puc_config_diva
78 { 0x103c, 0x1048, 0x103c, 0x104a,
79 "HP Diva Serial [GSP] Multiport UART - Tosca Secondary",
81 PUC_PORT_2S, 0x10, 0, -1,
82 .config_function = puc_config_diva
85 { 0x103c, 0x1048, 0x103c, 0x104b,
86 "HP Diva Serial [GSP] Multiport UART - Maestro SP2",
88 PUC_PORT_4S, 0x10, 0, -1,
89 .config_function = puc_config_diva
92 { 0x103c, 0x1048, 0x103c, 0x1223,
93 "HP Diva Serial [GSP] Multiport UART - Superdome Console",
95 PUC_PORT_3S, 0x10, 0, -1,
96 .config_function = puc_config_diva
99 { 0x103c, 0x1048, 0x103c, 0x1226,
100 "HP Diva Serial [GSP] Multiport UART - Keystone SP2",
102 PUC_PORT_3S, 0x10, 0, -1,
103 .config_function = puc_config_diva
106 { 0x103c, 0x1048, 0x103c, 0x1282,
107 "HP Diva Serial [GSP] Multiport UART - Everest SP2",
109 PUC_PORT_3S, 0x10, 0, -1,
110 .config_function = puc_config_diva
113 { 0x10b5, 0x1076, 0x10b5, 0x1076,
116 PUC_PORT_8S, 0x18, 0, 8,
119 { 0x10b5, 0x1077, 0x10b5, 0x1077,
122 PUC_PORT_4S, 0x18, 0, 8,
125 { 0x10b5, 0x1103, 0x10b5, 0x1103,
128 PUC_PORT_2S, 0x18, 4, 0,
132 * Boca Research Turbo Serial 658 (8 serial port) card.
133 * Appears to be the same as Chase Research PLC PCI-FAST8
134 * and Perle PCI-FAST8 Multi-Port serial cards.
136 { 0x10b5, 0x9050, 0x12e0, 0x0021,
137 "Boca Research Turbo Serial 658",
139 PUC_PORT_8S, 0x18, 0, 8,
142 { 0x10b5, 0x9050, 0x12e0, 0x0031,
143 "Boca Research Turbo Serial 654",
145 PUC_PORT_4S, 0x18, 0, 8,
149 * Dolphin Peripherals 4035 (dual serial port) card. PLX 9050, with
150 * a seemingly-lame EEPROM setup that puts the Dolphin IDs
151 * into the subsystem fields, and claims that it's a
152 * network/misc (0x02/0x80) device.
154 { 0x10b5, 0x9050, 0xd84d, 0x6808,
155 "Dolphin Peripherals 4035",
157 PUC_PORT_2S, 0x18, 4, 0,
161 * Dolphin Peripherals 4014 (dual parallel port) card. PLX 9050, with
162 * a seemingly-lame EEPROM setup that puts the Dolphin IDs
163 * into the subsystem fields, and claims that it's a
164 * network/misc (0x02/0x80) device.
166 { 0x10b5, 0x9050, 0xd84d, 0x6810,
167 "Dolphin Peripherals 4014",
169 PUC_PORT_2P, 0x20, 4, 0,
172 { 0x10e8, 0x818e, 0xffff, 0,
173 "Applied Micro Circuits 8 Port UART",
175 PUC_PORT_8S, 0x14, -1, -1,
176 .config_function = puc_config_amc
179 { 0x11fe, 0x8010, 0xffff, 0,
180 "Comtrol RocketPort 550/8 RJ11 part A",
182 PUC_PORT_4S, 0x10, 0, 8,
185 { 0x11fe, 0x8011, 0xffff, 0,
186 "Comtrol RocketPort 550/8 RJ11 part B",
188 PUC_PORT_4S, 0x10, 0, 8,
191 { 0x11fe, 0x8012, 0xffff, 0,
192 "Comtrol RocketPort 550/8 Octa part A",
194 PUC_PORT_4S, 0x10, 0, 8,
197 { 0x11fe, 0x8013, 0xffff, 0,
198 "Comtrol RocketPort 550/8 Octa part B",
200 PUC_PORT_4S, 0x10, 0, 8,
203 { 0x11fe, 0x8014, 0xffff, 0,
204 "Comtrol RocketPort 550/4 RJ45",
206 PUC_PORT_4S, 0x10, 0, 8,
209 { 0x11fe, 0x8015, 0xffff, 0,
210 "Comtrol RocketPort 550/Quad",
212 PUC_PORT_4S, 0x10, 0, 8,
215 { 0x11fe, 0x8016, 0xffff, 0,
216 "Comtrol RocketPort 550/16 part A",
218 PUC_PORT_4S, 0x10, 0, 8,
221 { 0x11fe, 0x8017, 0xffff, 0,
222 "Comtrol RocketPort 550/16 part B",
224 PUC_PORT_12S, 0x10, 0, 8,
227 { 0x11fe, 0x8018, 0xffff, 0,
228 "Comtrol RocketPort 550/8 part A",
230 PUC_PORT_4S, 0x10, 0, 8,
233 { 0x11fe, 0x8019, 0xffff, 0,
234 "Comtrol RocketPort 550/8 part B",
236 PUC_PORT_4S, 0x10, 0, 8,
240 * IBM SurePOS 300 Series (481033H) serial ports
241 * Details can be found on the IBM RSS websites
244 { 0x1014, 0x0297, 0xffff, 0,
245 "IBM SurePOS 300 Series (481033H) serial ports",
247 PUC_PORT_4S, 0x10, 4, 0
253 * SIIG provides documentation for their boards at:
254 * <URL:http://www.siig.com/downloads.asp>
257 { 0x131f, 0x1010, 0xffff, 0,
258 "SIIG Cyber I/O PCI 16C550 (10x family)",
260 PUC_PORT_1S1P, 0x18, 4, 0,
263 { 0x131f, 0x1011, 0xffff, 0,
264 "SIIG Cyber I/O PCI 16C650 (10x family)",
266 PUC_PORT_1S1P, 0x18, 4, 0,
269 { 0x131f, 0x1012, 0xffff, 0,
270 "SIIG Cyber I/O PCI 16C850 (10x family)",
272 PUC_PORT_1S1P, 0x18, 4, 0,
275 { 0x131f, 0x1021, 0xffff, 0,
276 "SIIG Cyber Parallel Dual PCI (10x family)",
278 PUC_PORT_2P, 0x18, 8, 0,
281 { 0x131f, 0x1030, 0xffff, 0,
282 "SIIG Cyber Serial Dual PCI 16C550 (10x family)",
284 PUC_PORT_2S, 0x18, 4, 0,
287 { 0x131f, 0x1031, 0xffff, 0,
288 "SIIG Cyber Serial Dual PCI 16C650 (10x family)",
290 PUC_PORT_2S, 0x18, 4, 0,
293 { 0x131f, 0x1032, 0xffff, 0,
294 "SIIG Cyber Serial Dual PCI 16C850 (10x family)",
296 PUC_PORT_2S, 0x18, 4, 0,
299 { 0x131f, 0x1034, 0xffff, 0, /* XXX really? */
300 "SIIG Cyber 2S1P PCI 16C550 (10x family)",
302 PUC_PORT_2S1P, 0x18, 4, 0,
305 { 0x131f, 0x1035, 0xffff, 0, /* XXX really? */
306 "SIIG Cyber 2S1P PCI 16C650 (10x family)",
308 PUC_PORT_2S1P, 0x18, 4, 0,
311 { 0x131f, 0x1036, 0xffff, 0, /* XXX really? */
312 "SIIG Cyber 2S1P PCI 16C850 (10x family)",
314 PUC_PORT_2S1P, 0x18, 4, 0,
317 { 0x131f, 0x1050, 0xffff, 0,
318 "SIIG Cyber 4S PCI 16C550 (10x family)",
320 PUC_PORT_4S, 0x18, 4, 0,
323 { 0x131f, 0x1051, 0xffff, 0,
324 "SIIG Cyber 4S PCI 16C650 (10x family)",
326 PUC_PORT_4S, 0x18, 4, 0,
329 { 0x131f, 0x1052, 0xffff, 0,
330 "SIIG Cyber 4S PCI 16C850 (10x family)",
332 PUC_PORT_4S, 0x18, 4, 0,
335 { 0x131f, 0x2010, 0xffff, 0,
336 "SIIG Cyber I/O PCI 16C550 (20x family)",
338 PUC_PORT_1S1P, 0x10, 4, 0,
341 { 0x131f, 0x2011, 0xffff, 0,
342 "SIIG Cyber I/O PCI 16C650 (20x family)",
344 PUC_PORT_1S1P, 0x10, 4, 0,
347 { 0x131f, 0x2012, 0xffff, 0,
348 "SIIG Cyber I/O PCI 16C850 (20x family)",
350 PUC_PORT_1S1P, 0x10, 4, 0,
353 { 0x131f, 0x2021, 0xffff, 0,
354 "SIIG Cyber Parallel Dual PCI (20x family)",
356 PUC_PORT_2P, 0x10, 8, 0,
359 { 0x131f, 0x2030, 0xffff, 0,
360 "SIIG Cyber Serial Dual PCI 16C550 (20x family)",
362 PUC_PORT_2S, 0x10, 4, 0,
365 { 0x131f, 0x2031, 0xffff, 0,
366 "SIIG Cyber Serial Dual PCI 16C650 (20x family)",
368 PUC_PORT_2S, 0x10, 4, 0,
371 { 0x131f, 0x2032, 0xffff, 0,
372 "SIIG Cyber Serial Dual PCI 16C850 (20x family)",
374 PUC_PORT_2S, 0x10, 4, 0,
377 { 0x131f, 0x2040, 0xffff, 0,
378 "SIIG Cyber 2P1S PCI 16C550 (20x family)",
380 PUC_PORT_1S2P, 0x10, -1, 0,
381 .config_function = puc_config_siig
384 { 0x131f, 0x2041, 0xffff, 0,
385 "SIIG Cyber 2P1S PCI 16C650 (20x family)",
387 PUC_PORT_1S2P, 0x10, -1, 0,
388 .config_function = puc_config_siig
391 { 0x131f, 0x2042, 0xffff, 0,
392 "SIIG Cyber 2P1S PCI 16C850 (20x family)",
394 PUC_PORT_1S2P, 0x10, -1, 0,
395 .config_function = puc_config_siig
398 { 0x131f, 0x2050, 0xffff, 0,
399 "SIIG Cyber 4S PCI 16C550 (20x family)",
401 PUC_PORT_4S, 0x10, 4, 0,
404 { 0x131f, 0x2051, 0xffff, 0,
405 "SIIG Cyber 4S PCI 16C650 (20x family)",
407 PUC_PORT_4S, 0x10, 4, 0,
410 { 0x131f, 0x2052, 0xffff, 0,
411 "SIIG Cyber 4S PCI 16C850 (20x family)",
413 PUC_PORT_4S, 0x10, 4, 0,
416 { 0x131f, 0x2060, 0xffff, 0,
417 "SIIG Cyber 2S1P PCI 16C550 (20x family)",
419 PUC_PORT_2S1P, 0x10, 4, 0,
422 { 0x131f, 0x2061, 0xffff, 0,
423 "SIIG Cyber 2S1P PCI 16C650 (20x family)",
425 PUC_PORT_2S1P, 0x10, 4, 0,
428 { 0x131f, 0x2062, 0xffff, 0,
429 "SIIG Cyber 2S1P PCI 16C850 (20x family)",
431 PUC_PORT_2S1P, 0x10, 4, 0,
434 { 0x131f, 0x2081, 0xffff, 0,
435 "SIIG PS8000 8S PCI 16C650 (20x family)",
437 PUC_PORT_8S, 0x10, -1, -1,
438 .config_function = puc_config_siig
441 { 0x135c, 0x0010, 0xffff, 0,
443 -3, /* max 8x clock rate */
444 PUC_PORT_4S, 0x14, 0, 8,
445 .config_function = puc_config_quatech
448 { 0x135c, 0x0020, 0xffff, 0,
450 -1, /* max 2x clock rate */
451 PUC_PORT_2S, 0x14, 0, 8,
452 .config_function = puc_config_quatech
455 { 0x135c, 0x0030, 0xffff, 0,
456 "Quatech DSC-200/300",
457 -1, /* max 2x clock rate */
458 PUC_PORT_2S, 0x14, 0, 8,
459 .config_function = puc_config_quatech
462 { 0x135c, 0x0040, 0xffff, 0,
463 "Quatech QSC-200/300",
464 -3, /* max 8x clock rate */
465 PUC_PORT_4S, 0x14, 0, 8,
466 .config_function = puc_config_quatech
469 { 0x135c, 0x0050, 0xffff, 0,
471 -3, /* max 8x clock rate */
472 PUC_PORT_8S, 0x14, 0, 8,
473 .config_function = puc_config_quatech
476 { 0x135c, 0x0060, 0xffff, 0,
478 -3, /* max 8x clock rate */
479 PUC_PORT_8S, 0x14, 0, 8,
480 .config_function = puc_config_quatech
483 { 0x135c, 0x0170, 0xffff, 0,
485 -1, /* max 2x clock rate */
486 PUC_PORT_4S, 0x18, 0, 8,
487 .config_function = puc_config_quatech
490 { 0x135c, 0x0180, 0xffff, 0,
492 -1, /* max 3x clock rate */
493 PUC_PORT_2S, 0x18, 0, 8,
494 .config_function = puc_config_quatech
497 { 0x135c, 0x01b0, 0xffff, 0,
498 "Quatech DSCLP-200/300",
499 -1, /* max 2x clock rate */
500 PUC_PORT_2S, 0x18, 0, 8,
501 .config_function = puc_config_quatech
504 { 0x135c, 0x01e0, 0xffff, 0,
506 -3, /* max 8x clock rate */
507 PUC_PORT_8S, 0x10, 0, 8,
508 .config_function = puc_config_quatech
511 { 0x1393, 0x1024, 0xffff, 0,
512 "Moxa Technologies, Smartio CP-102E/PCIe",
514 PUC_PORT_2S, 0x14, 0, -1,
515 .config_function = puc_config_moxa
518 { 0x1393, 0x1025, 0xffff, 0,
519 "Moxa Technologies, Smartio CP-102EL/PCIe",
521 PUC_PORT_2S, 0x14, 0, -1,
522 .config_function = puc_config_moxa
525 { 0x1393, 0x1040, 0xffff, 0,
526 "Moxa Technologies, Smartio C104H/PCI",
528 PUC_PORT_4S, 0x18, 0, 8,
531 { 0x1393, 0x1041, 0xffff, 0,
532 "Moxa Technologies, Smartio CP-104UL/PCI",
534 PUC_PORT_4S, 0x18, 0, 8,
537 { 0x1393, 0x1042, 0xffff, 0,
538 "Moxa Technologies, Smartio CP-104JU/PCI",
540 PUC_PORT_4S, 0x18, 0, 8,
543 { 0x1393, 0x1043, 0xffff, 0,
544 "Moxa Technologies, Smartio CP-104EL/PCIe",
546 PUC_PORT_4S, 0x18, 0, 8,
549 { 0x1393, 0x1045, 0xffff, 0,
550 "Moxa Technologies, Smartio CP-104EL-A/PCIe",
552 PUC_PORT_4S, 0x14, 0, -1,
553 .config_function = puc_config_moxa
556 { 0x1393, 0x1120, 0xffff, 0,
557 "Moxa Technologies, CP-112UL",
559 PUC_PORT_2S, 0x18, 0, 8,
562 { 0x1393, 0x1141, 0xffff, 0,
563 "Moxa Technologies, Industio CP-114",
565 PUC_PORT_4S, 0x18, 0, 8,
568 { 0x1393, 0x1144, 0xffff, 0,
569 "Moxa Technologies, Smartio CP-114EL/PCIe",
571 PUC_PORT_4S, 0x14, 0, -1,
572 .config_function = puc_config_moxa
575 { 0x1393, 0x1182, 0xffff, 0,
576 "Moxa Technologies, Smartio CP-118EL-A/PCIe",
578 PUC_PORT_8S, 0x14, 0, -1,
579 .config_function = puc_config_moxa
582 { 0x1393, 0x1680, 0xffff, 0,
583 "Moxa Technologies, C168H/PCI",
585 PUC_PORT_8S, 0x18, 0, 8,
588 { 0x1393, 0x1681, 0xffff, 0,
589 "Moxa Technologies, C168U/PCI",
591 PUC_PORT_8S, 0x18, 0, 8,
594 { 0x1393, 0x1682, 0xffff, 0,
595 "Moxa Technologies, CP-168EL/PCIe",
597 PUC_PORT_8S, 0x18, 0, 8,
600 { 0x1393, 0x1683, 0xffff, 0,
601 "Moxa Technologies, Smartio CP-168EL-A/PCIe",
603 PUC_PORT_8S, 0x14, 0, -1,
604 .config_function = puc_config_moxa
607 { 0x13a8, 0x0152, 0xffff, 0,
610 PUC_PORT_2S, 0x10, 0, -1,
611 .config_function = puc_config_exar
614 { 0x13a8, 0x0154, 0xffff, 0,
617 PUC_PORT_4S, 0x10, 0, -1,
618 .config_function = puc_config_exar
621 { 0x13a8, 0x0158, 0xffff, 0,
624 PUC_PORT_8S, 0x10, 0, -1,
625 .config_function = puc_config_exar
628 { 0x13a8, 0x0258, 0xffff, 0,
631 PUC_PORT_8S, 0x10, 0, -1,
632 .config_function = puc_config_exar
635 /* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */
636 { 0x13a8, 0x0358, 0xffff, 0,
639 PUC_PORT_8S, 0x10, 0, -1,
640 .config_function = puc_config_exar_pcie
643 { 0x13fe, 0x1600, 0x1602, 0x0002,
644 "Advantech PCI-1602",
646 PUC_PORT_2S, 0x10, 0, 8,
649 { 0x1407, 0x0100, 0xffff, 0,
650 "Lava Computers Dual Serial",
652 PUC_PORT_2S, 0x10, 4, 0,
655 { 0x1407, 0x0101, 0xffff, 0,
656 "Lava Computers Quatro A",
658 PUC_PORT_2S, 0x10, 4, 0,
661 { 0x1407, 0x0102, 0xffff, 0,
662 "Lava Computers Quatro B",
664 PUC_PORT_2S, 0x10, 4, 0,
667 { 0x1407, 0x0120, 0xffff, 0,
668 "Lava Computers Quattro-PCI A",
670 PUC_PORT_2S, 0x10, 4, 0,
673 { 0x1407, 0x0121, 0xffff, 0,
674 "Lava Computers Quattro-PCI B",
676 PUC_PORT_2S, 0x10, 4, 0,
679 { 0x1407, 0x0180, 0xffff, 0,
680 "Lava Computers Octo A",
682 PUC_PORT_4S, 0x10, 4, 0,
685 { 0x1407, 0x0181, 0xffff, 0,
686 "Lava Computers Octo B",
688 PUC_PORT_4S, 0x10, 4, 0,
691 { 0x1409, 0x7268, 0xffff, 0,
694 PUC_PORT_2P, 0x10, 0, 8,
697 { 0x1409, 0x7168, 0xffff, 0,
700 PUC_PORT_NONSTANDARD, 0x10, -1, -1,
701 .config_function = puc_config_timedia
705 * Boards with an Oxford Semiconductor chip.
707 * Oxford Semiconductor provides documentation for their chip at:
708 * <URL:http://www.plxtech.com/products/uart/>
710 * As sold by Kouwell <URL:http://www.kouwell.com/>.
711 * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports.
714 0x1415, 0x9501, 0x10fc ,0xc070,
715 "I-O DATA RSA-PCI2/R",
717 PUC_PORT_2S, 0x10, 0, 8,
720 { 0x1415, 0x9501, 0x131f, 0x2050,
721 "SIIG Cyber 4 PCI 16550",
723 PUC_PORT_4S, 0x10, 0, 8,
726 { 0x1415, 0x9501, 0x131f, 0x2051,
727 "SIIG Cyber 4S PCI 16C650 (20x family)",
729 PUC_PORT_4S, 0x10, 0, 8,
732 { 0x1415, 0x9501, 0x131f, 0x2052,
733 "SIIG Quartet Serial 850",
735 PUC_PORT_4S, 0x10, 0, 8,
738 { 0x1415, 0x9501, 0x14db, 0x2150,
739 "Kuroutoshikou SERIAL4P-LPPCI2",
741 PUC_PORT_4S, 0x10, 0, 8,
744 { 0x1415, 0x9501, 0xffff, 0,
745 "Oxford Semiconductor OX16PCI954 UARTs",
747 PUC_PORT_4S, 0x10, 0, 8,
750 { 0x1415, 0x950a, 0x131f, 0x2030,
751 "SIIG Cyber 2S PCIe",
753 PUC_PORT_2S, 0x10, 0, 8,
756 { 0x1415, 0x950a, 0x131f, 0x2032,
757 "SIIG Cyber Serial Dual PCI 16C850",
759 PUC_PORT_4S, 0x10, 0, 8,
762 { 0x1415, 0x950a, 0xffff, 0,
763 "Oxford Semiconductor OX16PCI954 UARTs",
765 PUC_PORT_4S, 0x10, 0, 8,
768 { 0x1415, 0x9511, 0xffff, 0,
769 "Oxford Semiconductor OX9160/OX16PCI954 UARTs (function 1)",
771 PUC_PORT_4S, 0x10, 0, 8,
774 { 0x1415, 0x9521, 0xffff, 0,
775 "Oxford Semiconductor OX16PCI952 UARTs",
777 PUC_PORT_2S, 0x10, 4, 0,
780 { 0x1415, 0x9538, 0xffff, 0,
781 "Oxford Semiconductor OX16PCI958 UARTs",
783 PUC_PORT_8S, 0x18, 0, 8,
787 * Perle boards use Oxford Semiconductor chips, but they store the
788 * Oxford Semiconductor device ID as a subvendor device ID and use
789 * their own device IDs.
792 { 0x155f, 0x0331, 0xffff, 0,
793 "Perle Ultraport4 Express",
795 PUC_PORT_4S, 0x10, 0, 8,
798 { 0x155f, 0xB012, 0xffff, 0,
801 PUC_PORT_2S, 0x10, 0, 8,
804 { 0x155f, 0xB022, 0xffff, 0,
807 PUC_PORT_2S, 0x10, 0, 8,
810 { 0x155f, 0xB004, 0xffff, 0,
813 PUC_PORT_4S, 0x10, 0, 8,
816 { 0x155f, 0xB008, 0xffff, 0,
819 PUC_PORT_8S, 0x10, 0, 8,
824 * Oxford Semiconductor PCI Express Expresso family
826 * Found in many 'native' PCI Express serial boards such as:
828 * eMegatech MP954ER4 (4 port) and MP958ER8 (8 port)
829 * <URL:http://www.emegatech.com.tw/pdrs232pcie.html>
831 * Lindy 51189 (4 port)
832 * <URL:http://www.lindy.com> <URL:http://tinyurl.com/lindy-51189>
834 * StarTech.com PEX4S952 (4 port) and PEX8S952 (8 port)
835 * <URL:http://www.startech.com>
838 { 0x1415, 0xc138, 0xffff, 0,
839 "Oxford Semiconductor OXPCIe952 UARTs",
841 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
842 .config_function = puc_config_oxford_pcie
845 { 0x1415, 0xc158, 0xffff, 0,
846 "Oxford Semiconductor OXPCIe952 UARTs",
848 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
849 .config_function = puc_config_oxford_pcie
852 { 0x1415, 0xc15d, 0xffff, 0,
853 "Oxford Semiconductor OXPCIe952 UARTs (function 1)",
855 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
856 .config_function = puc_config_oxford_pcie
859 { 0x1415, 0xc208, 0xffff, 0,
860 "Oxford Semiconductor OXPCIe954 UARTs",
862 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
863 .config_function = puc_config_oxford_pcie
866 { 0x1415, 0xc20d, 0xffff, 0,
867 "Oxford Semiconductor OXPCIe954 UARTs (function 1)",
869 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
870 .config_function = puc_config_oxford_pcie
873 { 0x1415, 0xc308, 0xffff, 0,
874 "Oxford Semiconductor OXPCIe958 UARTs",
876 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
877 .config_function = puc_config_oxford_pcie
880 { 0x1415, 0xc30d, 0xffff, 0,
881 "Oxford Semiconductor OXPCIe958 UARTs (function 1)",
883 PUC_PORT_NONSTANDARD, 0x10, 0, -1,
884 .config_function = puc_config_oxford_pcie
887 { 0x14d2, 0x8010, 0xffff, 0,
890 PUC_PORT_1S, 0x14, 0, 0,
893 { 0x14d2, 0x8020, 0xffff, 0,
896 PUC_PORT_2S, 0x14, 4, 0,
899 { 0x14d2, 0x8028, 0xffff, 0,
902 PUC_PORT_2S, 0x20, 0, 8,
906 * VScom (Titan?) PCI-800L. More modern variant of the
907 * PCI-800. Uses 6 discrete 16550 UARTs, plus another
908 * two of them obviously implemented as macro cells in
909 * the ASIC. This causes the weird port access pattern
910 * below, where two of the IO port ranges each access
911 * one of the ASIC UARTs, and a block of IO addresses
912 * access the external UARTs.
914 { 0x14d2, 0x8080, 0xffff, 0,
915 "Titan VScom PCI-800L",
917 PUC_PORT_8S, 0x14, -1, -1,
918 .config_function = puc_config_titan
922 * VScom PCI-800H. Uses 8 16950 UART, behind a PCI chips that offers
923 * 4 com port on PCI device 0 and 4 on PCI device 1. PCI device 0 has
924 * device ID 3 and PCI device 1 device ID 4.
926 { 0x14d2, 0xa003, 0xffff, 0,
929 PUC_PORT_4S, 0x10, 0, 8,
932 { 0x14d2, 0xa004, 0xffff, 0,
935 PUC_PORT_4S, 0x10, 0, 8,
938 { 0x14d2, 0xa005, 0xffff, 0,
941 PUC_PORT_2S, 0x10, 0, 8,
944 { 0x14d2, 0xe020, 0xffff, 0,
945 "Titan VScom PCI-200HV2",
947 PUC_PORT_2S, 0x10, 4, 0,
950 { 0x14d2, 0xa007, 0xffff, 0,
951 "Titan VScom PCIex-800H",
953 PUC_PORT_4S, 0x10, 0, 8,
956 { 0x14d2, 0xa008, 0xffff, 0,
957 "Titan VScom PCIex-800H",
959 PUC_PORT_4S, 0x10, 0, 8,
962 { 0x14db, 0x2130, 0xffff, 0,
963 "Avlab Technology, PCI IO 2S",
965 PUC_PORT_2S, 0x10, 4, 0,
968 { 0x14db, 0x2150, 0xffff, 0,
969 "Avlab Low Profile PCI 4 Serial",
971 PUC_PORT_4S, 0x10, 4, 0,
974 { 0x14db, 0x2152, 0xffff, 0,
975 "Avlab Low Profile PCI 4 Serial",
977 PUC_PORT_4S, 0x10, 4, 0,
980 { 0x1592, 0x0781, 0xffff, 0,
981 "Syba Tech Ltd. PCI-4S2P-550-ECP",
983 PUC_PORT_4S1P, 0x10, 0, -1,
984 .config_function = puc_config_syba
987 { 0x1fd4, 0x1999, 0xffff, 0,
990 PUC_PORT_2S, 0x10, 0, 8,
993 { 0x5372, 0x6873, 0xffff, 0,
994 "Sun 1040 PCI Quad Serial",
996 PUC_PORT_4S, 0x10, 4, 0,
999 { 0x6666, 0x0001, 0xffff, 0,
1000 "Decision Computer Inc, PCCOM 4-port serial",
1002 PUC_PORT_4S, 0x1c, 0, 8,
1005 { 0x6666, 0x0002, 0xffff, 0,
1006 "Decision Computer Inc, PCCOM 8-port serial",
1008 PUC_PORT_8S, 0x1c, 0, 8,
1011 { 0x6666, 0x0004, 0xffff, 0,
1012 "PCCOM dual port RS232/422/485",
1014 PUC_PORT_2S, 0x1c, 0, 8,
1017 { 0x9710, 0x9815, 0xffff, 0,
1018 "NetMos NM9815 Dual 1284 Printer port",
1020 PUC_PORT_2P, 0x10, 8, 0,
1024 * This is more specific than the generic NM9835 entry that follows, and
1025 * is placed here to _prevent_ puc from claiming this single port card.
1027 * uart(4) will claim this device.
1029 { 0x9710, 0x9835, 0x1000, 1,
1030 "NetMos NM9835 based 1-port serial",
1032 PUC_PORT_1S, 0x10, 4, 0,
1035 { 0x9710, 0x9835, 0x1000, 2,
1036 "NetMos NM9835 based 2-port serial",
1038 PUC_PORT_2S, 0x10, 4, 0,
1041 { 0x9710, 0x9835, 0xffff, 0,
1042 "NetMos NM9835 Dual UART and 1284 Printer port",
1044 PUC_PORT_2S1P, 0x10, 4, 0,
1047 { 0x9710, 0x9845, 0x1000, 0x0006,
1048 "NetMos NM9845 6 Port UART",
1050 PUC_PORT_6S, 0x10, 4, 0,
1053 { 0x9710, 0x9845, 0xffff, 0,
1054 "NetMos NM9845 Quad UART and 1284 Printer port",
1056 PUC_PORT_4S1P, 0x10, 4, 0,
1059 { 0x9710, 0x9865, 0xa000, 0x3002,
1060 "NetMos NM9865 Dual UART",
1062 PUC_PORT_2S, 0x10, 4, 0,
1065 { 0x9710, 0x9865, 0xa000, 0x3003,
1066 "NetMos NM9865 Triple UART",
1068 PUC_PORT_3S, 0x10, 4, 0,
1071 { 0x9710, 0x9865, 0xa000, 0x3004,
1072 "NetMos NM9865 Quad UART",
1074 PUC_PORT_4S, 0x10, 4, 0,
1077 { 0x9710, 0x9865, 0xa000, 0x3011,
1078 "NetMos NM9865 Single UART and 1284 Printer port",
1080 PUC_PORT_1S1P, 0x10, 4, 0,
1083 { 0x9710, 0x9865, 0xa000, 0x3012,
1084 "NetMos NM9865 Dual UART and 1284 Printer port",
1086 PUC_PORT_2S1P, 0x10, 4, 0,
1089 { 0x9710, 0x9865, 0xa000, 0x3020,
1090 "NetMos NM9865 Dual 1284 Printer port",
1092 PUC_PORT_2P, 0x10, 4, 0,
1095 { 0xb00c, 0x021c, 0xffff, 0,
1096 "IC Book Labs Gunboat x4 Lite",
1098 PUC_PORT_4S, 0x10, 0, 8,
1099 .config_function = puc_config_icbook
1102 { 0xb00c, 0x031c, 0xffff, 0,
1103 "IC Book Labs Gunboat x4 Pro",
1105 PUC_PORT_4S, 0x10, 0, 8,
1106 .config_function = puc_config_icbook
1109 { 0xb00c, 0x041c, 0xffff, 0,
1110 "IC Book Labs Ironclad x8 Lite",
1112 PUC_PORT_8S, 0x10, 0, 8,
1113 .config_function = puc_config_icbook
1116 { 0xb00c, 0x051c, 0xffff, 0,
1117 "IC Book Labs Ironclad x8 Pro",
1119 PUC_PORT_8S, 0x10, 0, 8,
1120 .config_function = puc_config_icbook
1123 { 0xb00c, 0x081c, 0xffff, 0,
1124 "IC Book Labs Dreadnought x16 Pro",
1126 PUC_PORT_16S, 0x10, 0, 8,
1127 .config_function = puc_config_icbook
1130 { 0xb00c, 0x091c, 0xffff, 0,
1131 "IC Book Labs Dreadnought x16 Lite",
1133 PUC_PORT_16S, 0x10, 0, 8,
1134 .config_function = puc_config_icbook
1137 { 0xb00c, 0x0a1c, 0xffff, 0,
1138 "IC Book Labs Gunboat x2 Low Profile",
1140 PUC_PORT_2S, 0x10, 0, 8,
1143 { 0xb00c, 0x0b1c, 0xffff, 0,
1144 "IC Book Labs Gunboat x4 Low Profile",
1146 PUC_PORT_4S, 0x10, 0, 8,
1147 .config_function = puc_config_icbook
1150 { 0xffff, 0, 0xffff, 0, NULL, 0 }
1154 puc_config_amc(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1158 case PUC_CFG_GET_OFS:
1159 *res = 8 * (port & 1);
1161 case PUC_CFG_GET_RID:
1162 *res = 0x14 + (port >> 1) * 4;
1171 puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1174 const struct puc_cfg *cfg = sc->sc_cfg;
1176 if (cmd == PUC_CFG_GET_OFS) {
1177 if (cfg->subdevice == 0x1282) /* Everest SP */
1179 else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
1180 port = (port == 3) ? 4 : port;
1181 *res = port * 8 + ((port > 2) ? 0x18 : 0);
1188 puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1191 if (cmd == PUC_CFG_GET_OFS) {
1192 *res = port * 0x200;
1199 puc_config_exar_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1202 if (cmd == PUC_CFG_GET_OFS) {
1203 *res = port * 0x400;
1210 puc_config_icbook(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1213 if (cmd == PUC_CFG_GET_ILR) {
1214 *res = PUC_ILR_DIGI;
1221 puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1224 if (cmd == PUC_CFG_GET_OFS) {
1225 const struct puc_cfg *cfg = sc->sc_cfg;
1227 if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144))
1229 *res = port * 0x200;
1237 puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1240 const struct puc_cfg *cfg = sc->sc_cfg;
1241 struct puc_bar *bar;
1247 * Check if the scratchpad register is enabled or if the
1248 * interrupt status and options registers are active.
1250 bar = puc_get_bar(sc, cfg->rid);
1253 /* Set DLAB in the LCR register of UART 0. */
1254 bus_write_1(bar->b_res, 3, 0x80);
1255 /* Write 0 to the SPR register of UART 0. */
1256 bus_write_1(bar->b_res, 7, 0);
1257 /* Read back the contents of the SPR register of UART 0. */
1258 v0 = bus_read_1(bar->b_res, 7);
1259 /* Write a specific value to the SPR register of UART 0. */
1260 bus_write_1(bar->b_res, 7, 0x80 + -cfg->clock);
1261 /* Read back the contents of the SPR register of UART 0. */
1262 v1 = bus_read_1(bar->b_res, 7);
1263 /* Clear DLAB in the LCR register of UART 0. */
1264 bus_write_1(bar->b_res, 3, 0);
1265 /* Save the two values read-back from the SPR register. */
1266 sc->sc_cfg_data = (v0 << 8) | v1;
1267 if (v0 == 0 && v1 == 0x80 + -cfg->clock) {
1269 * The SPR register echoed the two values written
1270 * by us. This means that the SPAD jumper is set.
1272 device_printf(sc->sc_dev, "warning: extra features "
1273 "not usable -- SPAD compatibility enabled\n");
1278 * The first value doesn't match. This can only mean
1279 * that the SPAD jumper is not set and that a non-
1280 * standard fixed clock multiplier jumper is set.
1283 device_printf(sc->sc_dev, "fixed clock rate "
1284 "multiplier of %d\n", 1 << v0);
1285 if (v0 < -cfg->clock)
1286 device_printf(sc->sc_dev, "warning: "
1287 "suboptimal fixed clock rate multiplier "
1292 * The first value matched, but the second didn't. We know
1293 * that the SPAD jumper is not set. We also know that the
1294 * clock rate multiplier is software controlled *and* that
1295 * we just programmed it to the maximum allowed.
1298 device_printf(sc->sc_dev, "clock rate multiplier of "
1299 "%d selected\n", 1 << -cfg->clock);
1301 case PUC_CFG_GET_CLOCK:
1302 v0 = (sc->sc_cfg_data >> 8) & 0xff;
1303 v1 = sc->sc_cfg_data & 0xff;
1304 if (v0 == 0 && v1 == 0x80 + -cfg->clock) {
1306 * XXX With the SPAD jumper applied, there's no
1307 * easy way of knowing if there's also a clock
1308 * rate multiplier jumper installed. Let's hope
1311 *res = DEFAULT_RCLK;
1312 } else if (v0 == 0) {
1314 * No clock rate multiplier jumper installed,
1315 * so we programmed the board with the maximum
1316 * multiplier allowed as given to us in the
1317 * clock field of the config record (negated).
1319 *res = DEFAULT_RCLK << -cfg->clock;
1321 *res = DEFAULT_RCLK << v0;
1323 case PUC_CFG_GET_ILR:
1324 v0 = (sc->sc_cfg_data >> 8) & 0xff;
1325 v1 = sc->sc_cfg_data & 0xff;
1326 *res = (v0 == 0 && v1 == 0x80 + -cfg->clock)
1327 ? PUC_ILR_NONE : PUC_ILR_QUATECH;
1336 puc_config_syba(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1339 static int base[] = { 0x251, 0x3f0, 0 };
1340 const struct puc_cfg *cfg = sc->sc_cfg;
1341 struct puc_bar *bar;
1347 bar = puc_get_bar(sc, cfg->rid);
1351 /* configure both W83877TFs */
1352 bus_write_1(bar->b_res, 0x250, 0x89);
1353 bus_write_1(bar->b_res, 0x3f0, 0x87);
1354 bus_write_1(bar->b_res, 0x3f0, 0x87);
1356 while (base[idx] != 0) {
1358 bus_write_1(bar->b_res, efir, 0x09);
1359 v = bus_read_1(bar->b_res, efir + 1);
1360 if ((v & 0x0f) != 0x0c)
1362 bus_write_1(bar->b_res, efir, 0x16);
1363 v = bus_read_1(bar->b_res, efir + 1);
1364 bus_write_1(bar->b_res, efir, 0x16);
1365 bus_write_1(bar->b_res, efir + 1, v | 0x04);
1366 bus_write_1(bar->b_res, efir, 0x16);
1367 bus_write_1(bar->b_res, efir + 1, v & ~0x04);
1368 ofs = base[idx] & 0x300;
1369 bus_write_1(bar->b_res, efir, 0x23);
1370 bus_write_1(bar->b_res, efir + 1, (ofs + 0x78) >> 2);
1371 bus_write_1(bar->b_res, efir, 0x24);
1372 bus_write_1(bar->b_res, efir + 1, (ofs + 0xf8) >> 2);
1373 bus_write_1(bar->b_res, efir, 0x25);
1374 bus_write_1(bar->b_res, efir + 1, (ofs + 0xe8) >> 2);
1375 bus_write_1(bar->b_res, efir, 0x17);
1376 bus_write_1(bar->b_res, efir + 1, 0x03);
1377 bus_write_1(bar->b_res, efir, 0x28);
1378 bus_write_1(bar->b_res, efir + 1, 0x43);
1381 bus_write_1(bar->b_res, 0x250, 0xaa);
1382 bus_write_1(bar->b_res, 0x3f0, 0xaa);
1384 case PUC_CFG_GET_OFS:
1410 puc_config_siig(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1413 const struct puc_cfg *cfg = sc->sc_cfg;
1416 case PUC_CFG_GET_OFS:
1417 if (cfg->ports == PUC_PORT_8S) {
1418 *res = (port > 4) ? 8 * (port - 4) : 0;
1422 case PUC_CFG_GET_RID:
1423 if (cfg->ports == PUC_PORT_8S) {
1424 *res = 0x10 + ((port > 4) ? 0x10 : 4 * port);
1427 if (cfg->ports == PUC_PORT_2S1P) {
1429 case 0: *res = 0x10; return (0);
1430 case 1: *res = 0x14; return (0);
1431 case 2: *res = 0x1c; return (0);
1442 puc_config_timedia(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1445 static const uint16_t dual[] = {
1446 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
1447 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
1448 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
1449 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
1452 static const uint16_t quad[] = {
1453 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
1454 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
1455 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
1458 static const uint16_t octa[] = {
1459 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
1460 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
1462 static const struct {
1464 const uint16_t *ids;
1471 static char desc[64];
1476 case PUC_CFG_GET_CLOCK:
1478 *res = DEFAULT_RCLK * 8;
1480 *res = DEFAULT_RCLK;
1482 case PUC_CFG_GET_DESC:
1483 snprintf(desc, sizeof(desc),
1484 "Timedia technology %d Port Serial", (int)sc->sc_cfg_data);
1485 *res = (intptr_t)desc;
1487 case PUC_CFG_GET_NPORTS:
1488 subdev = pci_get_subdevice(sc->sc_dev);
1490 while (subdevs[dev].ports != 0) {
1492 while (subdevs[dev].ids[id] != 0) {
1493 if (subdev == subdevs[dev].ids[id]) {
1494 sc->sc_cfg_data = subdevs[dev].ports;
1495 *res = sc->sc_cfg_data;
1503 case PUC_CFG_GET_OFS:
1504 *res = (port == 1 || port == 3) ? 8 : 0;
1506 case PUC_CFG_GET_RID:
1507 *res = 0x10 + ((port > 3) ? port - 2 : port >> 1) * 4;
1509 case PUC_CFG_GET_TYPE:
1510 *res = PUC_TYPE_SERIAL;
1519 puc_config_oxford_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1522 const struct puc_cfg *cfg = sc->sc_cfg;
1524 struct puc_bar *bar;
1529 device_printf(sc->sc_dev, "%d UARTs detected\n",
1532 /* Set UARTs to enhanced mode */
1533 bar = puc_get_bar(sc, cfg->rid);
1536 for (idx = 0; idx < sc->sc_nports; idx++) {
1537 value = bus_read_1(bar->b_res, 0x1000 + (idx << 9) +
1539 bus_write_1(bar->b_res, 0x1000 + (idx << 9) + 0x92,
1543 case PUC_CFG_GET_LEN:
1546 case PUC_CFG_GET_NPORTS:
1548 * Check if we are being called from puc_bfe_attach()
1549 * or puc_bfe_probe(). If puc_bfe_probe(), we cannot
1550 * puc_get_bar(), so we return a value of 16. This has cosmetic
1551 * side-effects at worst; in PUC_CFG_GET_DESC,
1552 * (int)sc->sc_cfg_data will not contain the true number of
1553 * ports in PUC_CFG_GET_DESC, but we are not implementing that
1554 * call for this device family anyway.
1556 * The check is for initialisation of sc->sc_bar[idx], which is
1557 * only done in puc_bfe_attach().
1561 if (sc->sc_bar[idx++].b_rid != -1) {
1562 sc->sc_cfg_data = 16;
1563 *res = sc->sc_cfg_data;
1566 } while (idx < PUC_PCI_BARS);
1568 bar = puc_get_bar(sc, cfg->rid);
1572 value = bus_read_1(bar->b_res, 0x04);
1576 sc->sc_cfg_data = value;
1577 *res = sc->sc_cfg_data;
1579 case PUC_CFG_GET_OFS:
1580 *res = 0x1000 + (port << 9);
1582 case PUC_CFG_GET_TYPE:
1583 *res = PUC_TYPE_SERIAL;
1592 puc_config_titan(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
1596 case PUC_CFG_GET_OFS:
1597 *res = (port < 3) ? 0 : (port - 2) << 3;
1599 case PUC_CFG_GET_RID:
1600 *res = 0x14 + ((port >= 2) ? 0x0c : port << 2);