8250_pci.c 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194
  1. /*
  2. * linux/drivers/char/8250_pci.c
  3. *
  4. * Probe module for 8250/16550-type PCI serial ports.
  5. *
  6. * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
  7. *
  8. * Copyright (C) 2001 Russell King, All Rights Reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/pci.h>
  17. #include <linux/string.h>
  18. #include <linux/kernel.h>
  19. #include <linux/slab.h>
  20. #include <linux/delay.h>
  21. #include <linux/tty.h>
  22. #include <linux/serial_core.h>
  23. #include <linux/8250_pci.h>
  24. #include <linux/bitops.h>
  25. #include <asm/byteorder.h>
  26. #include <asm/io.h>
  27. #include "8250.h"
  28. #undef SERIAL_DEBUG_PCI
  29. /*
  30. * init function returns:
  31. * > 0 - number of ports
  32. * = 0 - use board->num_ports
  33. * < 0 - error
  34. */
  35. struct pci_serial_quirk {
  36. u32 vendor;
  37. u32 device;
  38. u32 subvendor;
  39. u32 subdevice;
  40. int (*init)(struct pci_dev *dev);
  41. int (*setup)(struct serial_private *,
  42. const struct pciserial_board *,
  43. struct uart_port *, int);
  44. void (*exit)(struct pci_dev *dev);
  45. };
  46. #define PCI_NUM_BAR_RESOURCES 6
  47. struct serial_private {
  48. struct pci_dev *dev;
  49. unsigned int nr;
  50. void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
  51. struct pci_serial_quirk *quirk;
  52. int line[0];
  53. };
  54. static void moan_device(const char *str, struct pci_dev *dev)
  55. {
  56. printk(KERN_WARNING "%s: %s\n"
  57. KERN_WARNING "Please send the output of lspci -vv, this\n"
  58. KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
  59. KERN_WARNING "manufacturer and name of serial board or\n"
  60. KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
  61. pci_name(dev), str, dev->vendor, dev->device,
  62. dev->subsystem_vendor, dev->subsystem_device);
  63. }
  64. static int
  65. setup_port(struct serial_private *priv, struct uart_port *port,
  66. int bar, int offset, int regshift)
  67. {
  68. struct pci_dev *dev = priv->dev;
  69. unsigned long base, len;
  70. if (bar >= PCI_NUM_BAR_RESOURCES)
  71. return -EINVAL;
  72. base = pci_resource_start(dev, bar);
  73. if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
  74. len = pci_resource_len(dev, bar);
  75. if (!priv->remapped_bar[bar])
  76. priv->remapped_bar[bar] = ioremap_nocache(base, len);
  77. if (!priv->remapped_bar[bar])
  78. return -ENOMEM;
  79. port->iotype = UPIO_MEM;
  80. port->iobase = 0;
  81. port->mapbase = base + offset;
  82. port->membase = priv->remapped_bar[bar] + offset;
  83. port->regshift = regshift;
  84. } else {
  85. port->iotype = UPIO_PORT;
  86. port->iobase = base + offset;
  87. port->mapbase = 0;
  88. port->membase = NULL;
  89. port->regshift = 0;
  90. }
  91. return 0;
  92. }
  93. /*
  94. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  95. */
  96. static int addidata_apci7800_setup(struct serial_private *priv,
  97. const struct pciserial_board *board,
  98. struct uart_port *port, int idx)
  99. {
  100. unsigned int bar = 0, offset = board->first_offset;
  101. bar = FL_GET_BASE(board->flags);
  102. if (idx < 2) {
  103. offset += idx * board->uart_offset;
  104. } else if ((idx >= 2) && (idx < 4)) {
  105. bar += 1;
  106. offset += ((idx - 2) * board->uart_offset);
  107. } else if ((idx >= 4) && (idx < 6)) {
  108. bar += 2;
  109. offset += ((idx - 4) * board->uart_offset);
  110. } else if (idx >= 6) {
  111. bar += 3;
  112. offset += ((idx - 6) * board->uart_offset);
  113. }
  114. return setup_port(priv, port, bar, offset, board->reg_shift);
  115. }
  116. /*
  117. * AFAVLAB uses a different mixture of BARs and offsets
  118. * Not that ugly ;) -- HW
  119. */
  120. static int
  121. afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
  122. struct uart_port *port, int idx)
  123. {
  124. unsigned int bar, offset = board->first_offset;
  125. bar = FL_GET_BASE(board->flags);
  126. if (idx < 4)
  127. bar += idx;
  128. else {
  129. bar = 4;
  130. offset += (idx - 4) * board->uart_offset;
  131. }
  132. return setup_port(priv, port, bar, offset, board->reg_shift);
  133. }
  134. /*
  135. * HP's Remote Management Console. The Diva chip came in several
  136. * different versions. N-class, L2000 and A500 have two Diva chips, each
  137. * with 3 UARTs (the third UART on the second chip is unused). Superdome
  138. * and Keystone have one Diva chip with 3 UARTs. Some later machines have
  139. * one Diva chip, but it has been expanded to 5 UARTs.
  140. */
  141. static int pci_hp_diva_init(struct pci_dev *dev)
  142. {
  143. int rc = 0;
  144. switch (dev->subsystem_device) {
  145. case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
  146. case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
  147. case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
  148. case PCI_DEVICE_ID_HP_DIVA_EVEREST:
  149. rc = 3;
  150. break;
  151. case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
  152. rc = 2;
  153. break;
  154. case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
  155. rc = 4;
  156. break;
  157. case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
  158. case PCI_DEVICE_ID_HP_DIVA_HURRICANE:
  159. rc = 1;
  160. break;
  161. }
  162. return rc;
  163. }
  164. /*
  165. * HP's Diva chip puts the 4th/5th serial port further out, and
  166. * some serial ports are supposed to be hidden on certain models.
  167. */
  168. static int
  169. pci_hp_diva_setup(struct serial_private *priv,
  170. const struct pciserial_board *board,
  171. struct uart_port *port, int idx)
  172. {
  173. unsigned int offset = board->first_offset;
  174. unsigned int bar = FL_GET_BASE(board->flags);
  175. switch (priv->dev->subsystem_device) {
  176. case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
  177. if (idx == 3)
  178. idx++;
  179. break;
  180. case PCI_DEVICE_ID_HP_DIVA_EVEREST:
  181. if (idx > 0)
  182. idx++;
  183. if (idx > 2)
  184. idx++;
  185. break;
  186. }
  187. if (idx > 2)
  188. offset = 0x18;
  189. offset += idx * board->uart_offset;
  190. return setup_port(priv, port, bar, offset, board->reg_shift);
  191. }
  192. /*
  193. * Added for EKF Intel i960 serial boards
  194. */
  195. static int pci_inteli960ni_init(struct pci_dev *dev)
  196. {
  197. unsigned long oldval;
  198. if (!(dev->subsystem_device & 0x1000))
  199. return -ENODEV;
  200. /* is firmware started? */
  201. pci_read_config_dword(dev, 0x44, (void *)&oldval);
  202. if (oldval == 0x00001000L) { /* RESET value */
  203. printk(KERN_DEBUG "Local i960 firmware missing");
  204. return -ENODEV;
  205. }
  206. return 0;
  207. }
  208. /*
  209. * Some PCI serial cards using the PLX 9050 PCI interface chip require
  210. * that the card interrupt be explicitly enabled or disabled. This
  211. * seems to be mainly needed on card using the PLX which also use I/O
  212. * mapped memory.
  213. */
  214. static int pci_plx9050_init(struct pci_dev *dev)
  215. {
  216. u8 irq_config;
  217. void __iomem *p;
  218. if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
  219. moan_device("no memory in bar 0", dev);
  220. return 0;
  221. }
  222. irq_config = 0x41;
  223. if (dev->vendor == PCI_VENDOR_ID_PANACOM ||
  224. dev->subsystem_vendor == PCI_SUBVENDOR_ID_EXSYS)
  225. irq_config = 0x43;
  226. if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
  227. (dev->device == PCI_DEVICE_ID_PLX_ROMULUS))
  228. /*
  229. * As the megawolf cards have the int pins active
  230. * high, and have 2 UART chips, both ints must be
  231. * enabled on the 9050. Also, the UARTS are set in
  232. * 16450 mode by default, so we have to enable the
  233. * 16C950 'enhanced' mode so that we can use the
  234. * deep FIFOs
  235. */
  236. irq_config = 0x5b;
  237. /*
  238. * enable/disable interrupts
  239. */
  240. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  241. if (p == NULL)
  242. return -ENOMEM;
  243. writel(irq_config, p + 0x4c);
  244. /*
  245. * Read the register back to ensure that it took effect.
  246. */
  247. readl(p + 0x4c);
  248. iounmap(p);
  249. return 0;
  250. }
  251. static void __devexit pci_plx9050_exit(struct pci_dev *dev)
  252. {
  253. u8 __iomem *p;
  254. if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
  255. return;
  256. /*
  257. * disable interrupts
  258. */
  259. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  260. if (p != NULL) {
  261. writel(0, p + 0x4c);
  262. /*
  263. * Read the register back to ensure that it took effect.
  264. */
  265. readl(p + 0x4c);
  266. iounmap(p);
  267. }
  268. }
  269. /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
  270. static int
  271. sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
  272. struct uart_port *port, int idx)
  273. {
  274. unsigned int bar, offset = board->first_offset;
  275. bar = 0;
  276. if (idx < 4) {
  277. /* first four channels map to 0, 0x100, 0x200, 0x300 */
  278. offset += idx * board->uart_offset;
  279. } else if (idx < 8) {
  280. /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
  281. offset += idx * board->uart_offset + 0xC00;
  282. } else /* we have only 8 ports on PMC-OCTALPRO */
  283. return 1;
  284. return setup_port(priv, port, bar, offset, board->reg_shift);
  285. }
  286. /*
  287. * This does initialization for PMC OCTALPRO cards:
  288. * maps the device memory, resets the UARTs (needed, bc
  289. * if the module is removed and inserted again, the card
  290. * is in the sleep mode) and enables global interrupt.
  291. */
  292. /* global control register offset for SBS PMC-OctalPro */
  293. #define OCT_REG_CR_OFF 0x500
  294. static int sbs_init(struct pci_dev *dev)
  295. {
  296. u8 __iomem *p;
  297. p = ioremap_nocache(pci_resource_start(dev, 0),
  298. pci_resource_len(dev, 0));
  299. if (p == NULL)
  300. return -ENOMEM;
  301. /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
  302. writeb(0x10, p + OCT_REG_CR_OFF);
  303. udelay(50);
  304. writeb(0x0, p + OCT_REG_CR_OFF);
  305. /* Set bit-2 (INTENABLE) of Control Register */
  306. writeb(0x4, p + OCT_REG_CR_OFF);
  307. iounmap(p);
  308. return 0;
  309. }
  310. /*
  311. * Disables the global interrupt of PMC-OctalPro
  312. */
  313. static void __devexit sbs_exit(struct pci_dev *dev)
  314. {
  315. u8 __iomem *p;
  316. p = ioremap_nocache(pci_resource_start(dev, 0),
  317. pci_resource_len(dev, 0));
  318. /* FIXME: What if resource_len < OCT_REG_CR_OFF */
  319. if (p != NULL)
  320. writeb(0, p + OCT_REG_CR_OFF);
  321. iounmap(p);
  322. }
  323. /*
  324. * SIIG serial cards have an PCI interface chip which also controls
  325. * the UART clocking frequency. Each UART can be clocked independently
  326. * (except cards equiped with 4 UARTs) and initial clocking settings
  327. * are stored in the EEPROM chip. It can cause problems because this
  328. * version of serial driver doesn't support differently clocked UART's
  329. * on single PCI card. To prevent this, initialization functions set
  330. * high frequency clocking for all UART's on given card. It is safe (I
  331. * hope) because it doesn't touch EEPROM settings to prevent conflicts
  332. * with other OSes (like M$ DOS).
  333. *
  334. * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
  335. *
  336. * There is two family of SIIG serial cards with different PCI
  337. * interface chip and different configuration methods:
  338. * - 10x cards have control registers in IO and/or memory space;
  339. * - 20x cards have control registers in standard PCI configuration space.
  340. *
  341. * Note: all 10x cards have PCI device ids 0x10..
  342. * all 20x cards have PCI device ids 0x20..
  343. *
  344. * There are also Quartet Serial cards which use Oxford Semiconductor
  345. * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
  346. *
  347. * Note: some SIIG cards are probed by the parport_serial object.
  348. */
  349. #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
  350. #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
  351. static int pci_siig10x_init(struct pci_dev *dev)
  352. {
  353. u16 data;
  354. void __iomem *p;
  355. switch (dev->device & 0xfff8) {
  356. case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
  357. data = 0xffdf;
  358. break;
  359. case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
  360. data = 0xf7ff;
  361. break;
  362. default: /* 1S1P, 4S */
  363. data = 0xfffb;
  364. break;
  365. }
  366. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  367. if (p == NULL)
  368. return -ENOMEM;
  369. writew(readw(p + 0x28) & data, p + 0x28);
  370. readw(p + 0x28);
  371. iounmap(p);
  372. return 0;
  373. }
  374. #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
  375. #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
  376. static int pci_siig20x_init(struct pci_dev *dev)
  377. {
  378. u8 data;
  379. /* Change clock frequency for the first UART. */
  380. pci_read_config_byte(dev, 0x6f, &data);
  381. pci_write_config_byte(dev, 0x6f, data & 0xef);
  382. /* If this card has 2 UART, we have to do the same with second UART. */
  383. if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
  384. ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
  385. pci_read_config_byte(dev, 0x73, &data);
  386. pci_write_config_byte(dev, 0x73, data & 0xef);
  387. }
  388. return 0;
  389. }
  390. static int pci_siig_init(struct pci_dev *dev)
  391. {
  392. unsigned int type = dev->device & 0xff00;
  393. if (type == 0x1000)
  394. return pci_siig10x_init(dev);
  395. else if (type == 0x2000)
  396. return pci_siig20x_init(dev);
  397. moan_device("Unknown SIIG card", dev);
  398. return -ENODEV;
  399. }
  400. static int pci_siig_setup(struct serial_private *priv,
  401. const struct pciserial_board *board,
  402. struct uart_port *port, int idx)
  403. {
  404. unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
  405. if (idx > 3) {
  406. bar = 4;
  407. offset = (idx - 4) * 8;
  408. }
  409. return setup_port(priv, port, bar, offset, 0);
  410. }
  411. /*
  412. * Timedia has an explosion of boards, and to avoid the PCI table from
  413. * growing *huge*, we use this function to collapse some 70 entries
  414. * in the PCI table into one, for sanity's and compactness's sake.
  415. */
  416. static const unsigned short timedia_single_port[] = {
  417. 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
  418. };
  419. static const unsigned short timedia_dual_port[] = {
  420. 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
  421. 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
  422. 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
  423. 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
  424. 0xD079, 0
  425. };
  426. static const unsigned short timedia_quad_port[] = {
  427. 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
  428. 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
  429. 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
  430. 0xB157, 0
  431. };
  432. static const unsigned short timedia_eight_port[] = {
  433. 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
  434. 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
  435. };
  436. static const struct timedia_struct {
  437. int num;
  438. const unsigned short *ids;
  439. } timedia_data[] = {
  440. { 1, timedia_single_port },
  441. { 2, timedia_dual_port },
  442. { 4, timedia_quad_port },
  443. { 8, timedia_eight_port }
  444. };
  445. static int pci_timedia_init(struct pci_dev *dev)
  446. {
  447. const unsigned short *ids;
  448. int i, j;
  449. for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
  450. ids = timedia_data[i].ids;
  451. for (j = 0; ids[j]; j++)
  452. if (dev->subsystem_device == ids[j])
  453. return timedia_data[i].num;
  454. }
  455. return 0;
  456. }
  457. /*
  458. * Timedia/SUNIX uses a mixture of BARs and offsets
  459. * Ugh, this is ugly as all hell --- TYT
  460. */
  461. static int
  462. pci_timedia_setup(struct serial_private *priv,
  463. const struct pciserial_board *board,
  464. struct uart_port *port, int idx)
  465. {
  466. unsigned int bar = 0, offset = board->first_offset;
  467. switch (idx) {
  468. case 0:
  469. bar = 0;
  470. break;
  471. case 1:
  472. offset = board->uart_offset;
  473. bar = 0;
  474. break;
  475. case 2:
  476. bar = 1;
  477. break;
  478. case 3:
  479. offset = board->uart_offset;
  480. /* FALLTHROUGH */
  481. case 4: /* BAR 2 */
  482. case 5: /* BAR 3 */
  483. case 6: /* BAR 4 */
  484. case 7: /* BAR 5 */
  485. bar = idx - 2;
  486. }
  487. return setup_port(priv, port, bar, offset, board->reg_shift);
  488. }
  489. /*
  490. * Some Titan cards are also a little weird
  491. */
  492. static int
  493. titan_400l_800l_setup(struct serial_private *priv,
  494. const struct pciserial_board *board,
  495. struct uart_port *port, int idx)
  496. {
  497. unsigned int bar, offset = board->first_offset;
  498. switch (idx) {
  499. case 0:
  500. bar = 1;
  501. break;
  502. case 1:
  503. bar = 2;
  504. break;
  505. default:
  506. bar = 4;
  507. offset = (idx - 2) * board->uart_offset;
  508. }
  509. return setup_port(priv, port, bar, offset, board->reg_shift);
  510. }
  511. static int pci_xircom_init(struct pci_dev *dev)
  512. {
  513. msleep(100);
  514. return 0;
  515. }
  516. static int pci_netmos_init(struct pci_dev *dev)
  517. {
  518. /* subdevice 0x00PS means <P> parallel, <S> serial */
  519. unsigned int num_serial = dev->subsystem_device & 0xf;
  520. if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
  521. dev->subsystem_device == 0x0299)
  522. return 0;
  523. if (num_serial == 0)
  524. return -ENODEV;
  525. return num_serial;
  526. }
  527. /*
  528. * ITE support by Niels de Vos <niels.devos@wincor-nixdorf.com>
  529. *
  530. * These chips are available with optionally one parallel port and up to
  531. * two serial ports. Unfortunately they all have the same product id.
  532. *
  533. * Basic configuration is done over a region of 32 I/O ports. The base
  534. * ioport is called INTA or INTC, depending on docs/other drivers.
  535. *
  536. * The region of the 32 I/O ports is configured in POSIO0R...
  537. */
  538. /* registers */
  539. #define ITE_887x_MISCR 0x9c
  540. #define ITE_887x_INTCBAR 0x78
  541. #define ITE_887x_UARTBAR 0x7c
  542. #define ITE_887x_PS0BAR 0x10
  543. #define ITE_887x_POSIO0 0x60
  544. /* I/O space size */
  545. #define ITE_887x_IOSIZE 32
  546. /* I/O space size (bits 26-24; 8 bytes = 011b) */
  547. #define ITE_887x_POSIO_IOSIZE_8 (3 << 24)
  548. /* I/O space size (bits 26-24; 32 bytes = 101b) */
  549. #define ITE_887x_POSIO_IOSIZE_32 (5 << 24)
  550. /* Decoding speed (1 = slow, 2 = medium, 3 = fast) */
  551. #define ITE_887x_POSIO_SPEED (3 << 29)
  552. /* enable IO_Space bit */
  553. #define ITE_887x_POSIO_ENABLE (1 << 31)
  554. static int pci_ite887x_init(struct pci_dev *dev)
  555. {
  556. /* inta_addr are the configuration addresses of the ITE */
  557. static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
  558. 0x200, 0x280, 0 };
  559. int ret, i, type;
  560. struct resource *iobase = NULL;
  561. u32 miscr, uartbar, ioport;
  562. /* search for the base-ioport */
  563. i = 0;
  564. while (inta_addr[i] && iobase == NULL) {
  565. iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
  566. "ite887x");
  567. if (iobase != NULL) {
  568. /* write POSIO0R - speed | size | ioport */
  569. pci_write_config_dword(dev, ITE_887x_POSIO0,
  570. ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
  571. ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
  572. /* write INTCBAR - ioport */
  573. pci_write_config_dword(dev, ITE_887x_INTCBAR,
  574. inta_addr[i]);
  575. ret = inb(inta_addr[i]);
  576. if (ret != 0xff) {
  577. /* ioport connected */
  578. break;
  579. }
  580. release_region(iobase->start, ITE_887x_IOSIZE);
  581. iobase = NULL;
  582. }
  583. i++;
  584. }
  585. if (!inta_addr[i]) {
  586. printk(KERN_ERR "ite887x: could not find iobase\n");
  587. return -ENODEV;
  588. }
  589. /* start of undocumented type checking (see parport_pc.c) */
  590. type = inb(iobase->start + 0x18) & 0x0f;
  591. switch (type) {
  592. case 0x2: /* ITE8871 (1P) */
  593. case 0xa: /* ITE8875 (1P) */
  594. ret = 0;
  595. break;
  596. case 0xe: /* ITE8872 (2S1P) */
  597. ret = 2;
  598. break;
  599. case 0x6: /* ITE8873 (1S) */
  600. ret = 1;
  601. break;
  602. case 0x8: /* ITE8874 (2S) */
  603. ret = 2;
  604. break;
  605. default:
  606. moan_device("Unknown ITE887x", dev);
  607. ret = -ENODEV;
  608. }
  609. /* configure all serial ports */
  610. for (i = 0; i < ret; i++) {
  611. /* read the I/O port from the device */
  612. pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)),
  613. &ioport);
  614. ioport &= 0x0000FF00; /* the actual base address */
  615. pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)),
  616. ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
  617. ITE_887x_POSIO_IOSIZE_8 | ioport);
  618. /* write the ioport to the UARTBAR */
  619. pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar);
  620. uartbar &= ~(0xffff << (16 * i)); /* clear half the reg */
  621. uartbar |= (ioport << (16 * i)); /* set the ioport */
  622. pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar);
  623. /* get current config */
  624. pci_read_config_dword(dev, ITE_887x_MISCR, &miscr);
  625. /* disable interrupts (UARTx_Routing[3:0]) */
  626. miscr &= ~(0xf << (12 - 4 * i));
  627. /* activate the UART (UARTx_En) */
  628. miscr |= 1 << (23 - i);
  629. /* write new config with activated UART */
  630. pci_write_config_dword(dev, ITE_887x_MISCR, miscr);
  631. }
  632. if (ret <= 0) {
  633. /* the device has no UARTs if we get here */
  634. release_region(iobase->start, ITE_887x_IOSIZE);
  635. }
  636. return ret;
  637. }
  638. static void __devexit pci_ite887x_exit(struct pci_dev *dev)
  639. {
  640. u32 ioport;
  641. /* the ioport is bit 0-15 in POSIO0R */
  642. pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport);
  643. ioport &= 0xffff;
  644. release_region(ioport, ITE_887x_IOSIZE);
  645. }
  646. /*
  647. * Oxford Semiconductor Inc.
  648. * Check that device is part of the Tornado range of devices, then determine
  649. * the number of ports available on the device.
  650. */
  651. static int pci_oxsemi_tornado_init(struct pci_dev *dev)
  652. {
  653. u8 __iomem *p;
  654. unsigned long deviceID;
  655. unsigned int number_uarts = 0;
  656. /* OxSemi Tornado devices are all 0xCxxx */
  657. if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
  658. (dev->device & 0xF000) != 0xC000)
  659. return 0;
  660. p = pci_iomap(dev, 0, 5);
  661. if (p == NULL)
  662. return -ENOMEM;
  663. deviceID = ioread32(p);
  664. /* Tornado device */
  665. if (deviceID == 0x07000200) {
  666. number_uarts = ioread8(p + 4);
  667. printk(KERN_DEBUG
  668. "%d ports detected on Oxford PCI Express device\n",
  669. number_uarts);
  670. }
  671. pci_iounmap(dev, p);
  672. return number_uarts;
  673. }
  674. static int
  675. pci_default_setup(struct serial_private *priv,
  676. const struct pciserial_board *board,
  677. struct uart_port *port, int idx)
  678. {
  679. unsigned int bar, offset = board->first_offset, maxnr;
  680. bar = FL_GET_BASE(board->flags);
  681. if (board->flags & FL_BASE_BARS)
  682. bar += idx;
  683. else
  684. offset += idx * board->uart_offset;
  685. maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
  686. (board->reg_shift + 3);
  687. if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
  688. return 1;
  689. return setup_port(priv, port, bar, offset, board->reg_shift);
  690. }
  691. static int skip_tx_en_setup(struct serial_private *priv,
  692. const struct pciserial_board *board,
  693. struct uart_port *port, int idx)
  694. {
  695. port->flags |= UPF_NO_TXEN_TEST;
  696. printk(KERN_DEBUG "serial8250: skipping TxEn test for device "
  697. "[%04x:%04x] subsystem [%04x:%04x]\n",
  698. priv->dev->vendor,
  699. priv->dev->device,
  700. priv->dev->subsystem_vendor,
  701. priv->dev->subsystem_device);
  702. return pci_default_setup(priv, board, port, idx);
  703. }
  704. /* This should be in linux/pci_ids.h */
  705. #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
  706. #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
  707. #define PCI_DEVICE_ID_OCTPRO 0x0001
  708. #define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
  709. #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
  710. #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
  711. #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
  712. #define PCI_VENDOR_ID_ADVANTECH 0x13fe
  713. #define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
  714. /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
  715. #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
  716. /*
  717. * Master list of serial port init/setup/exit quirks.
  718. * This does not describe the general nature of the port.
  719. * (ie, baud base, number and location of ports, etc)
  720. *
  721. * This list is ordered alphabetically by vendor then device.
  722. * Specific entries must come before more generic entries.
  723. */
  724. static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
  725. /*
  726. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  727. */
  728. {
  729. .vendor = PCI_VENDOR_ID_ADDIDATA_OLD,
  730. .device = PCI_DEVICE_ID_ADDIDATA_APCI7800,
  731. .subvendor = PCI_ANY_ID,
  732. .subdevice = PCI_ANY_ID,
  733. .setup = addidata_apci7800_setup,
  734. },
  735. /*
  736. * AFAVLAB cards - these may be called via parport_serial
  737. * It is not clear whether this applies to all products.
  738. */
  739. {
  740. .vendor = PCI_VENDOR_ID_AFAVLAB,
  741. .device = PCI_ANY_ID,
  742. .subvendor = PCI_ANY_ID,
  743. .subdevice = PCI_ANY_ID,
  744. .setup = afavlab_setup,
  745. },
  746. /*
  747. * HP Diva
  748. */
  749. {
  750. .vendor = PCI_VENDOR_ID_HP,
  751. .device = PCI_DEVICE_ID_HP_DIVA,
  752. .subvendor = PCI_ANY_ID,
  753. .subdevice = PCI_ANY_ID,
  754. .init = pci_hp_diva_init,
  755. .setup = pci_hp_diva_setup,
  756. },
  757. /*
  758. * Intel
  759. */
  760. {
  761. .vendor = PCI_VENDOR_ID_INTEL,
  762. .device = PCI_DEVICE_ID_INTEL_80960_RP,
  763. .subvendor = 0xe4bf,
  764. .subdevice = PCI_ANY_ID,
  765. .init = pci_inteli960ni_init,
  766. .setup = pci_default_setup,
  767. },
  768. {
  769. .vendor = PCI_VENDOR_ID_INTEL,
  770. .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
  771. .subvendor = PCI_ANY_ID,
  772. .subdevice = PCI_ANY_ID,
  773. .setup = skip_tx_en_setup,
  774. },
  775. {
  776. .vendor = PCI_VENDOR_ID_INTEL,
  777. .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
  778. .subvendor = PCI_ANY_ID,
  779. .subdevice = PCI_ANY_ID,
  780. .setup = skip_tx_en_setup,
  781. },
  782. {
  783. .vendor = PCI_VENDOR_ID_INTEL,
  784. .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
  785. .subvendor = PCI_ANY_ID,
  786. .subdevice = PCI_ANY_ID,
  787. .setup = skip_tx_en_setup,
  788. },
  789. /*
  790. * ITE
  791. */
  792. {
  793. .vendor = PCI_VENDOR_ID_ITE,
  794. .device = PCI_DEVICE_ID_ITE_8872,
  795. .subvendor = PCI_ANY_ID,
  796. .subdevice = PCI_ANY_ID,
  797. .init = pci_ite887x_init,
  798. .setup = pci_default_setup,
  799. .exit = __devexit_p(pci_ite887x_exit),
  800. },
  801. /*
  802. * Panacom
  803. */
  804. {
  805. .vendor = PCI_VENDOR_ID_PANACOM,
  806. .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
  807. .subvendor = PCI_ANY_ID,
  808. .subdevice = PCI_ANY_ID,
  809. .init = pci_plx9050_init,
  810. .setup = pci_default_setup,
  811. .exit = __devexit_p(pci_plx9050_exit),
  812. },
  813. {
  814. .vendor = PCI_VENDOR_ID_PANACOM,
  815. .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
  816. .subvendor = PCI_ANY_ID,
  817. .subdevice = PCI_ANY_ID,
  818. .init = pci_plx9050_init,
  819. .setup = pci_default_setup,
  820. .exit = __devexit_p(pci_plx9050_exit),
  821. },
  822. /*
  823. * PLX
  824. */
  825. {
  826. .vendor = PCI_VENDOR_ID_PLX,
  827. .device = PCI_DEVICE_ID_PLX_9030,
  828. .subvendor = PCI_SUBVENDOR_ID_PERLE,
  829. .subdevice = PCI_ANY_ID,
  830. .setup = pci_default_setup,
  831. },
  832. {
  833. .vendor = PCI_VENDOR_ID_PLX,
  834. .device = PCI_DEVICE_ID_PLX_9050,
  835. .subvendor = PCI_SUBVENDOR_ID_EXSYS,
  836. .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
  837. .init = pci_plx9050_init,
  838. .setup = pci_default_setup,
  839. .exit = __devexit_p(pci_plx9050_exit),
  840. },
  841. {
  842. .vendor = PCI_VENDOR_ID_PLX,
  843. .device = PCI_DEVICE_ID_PLX_9050,
  844. .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
  845. .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
  846. .init = pci_plx9050_init,
  847. .setup = pci_default_setup,
  848. .exit = __devexit_p(pci_plx9050_exit),
  849. },
  850. {
  851. .vendor = PCI_VENDOR_ID_PLX,
  852. .device = PCI_DEVICE_ID_PLX_9050,
  853. .subvendor = PCI_VENDOR_ID_PLX,
  854. .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
  855. .init = pci_plx9050_init,
  856. .setup = pci_default_setup,
  857. .exit = __devexit_p(pci_plx9050_exit),
  858. },
  859. {
  860. .vendor = PCI_VENDOR_ID_PLX,
  861. .device = PCI_DEVICE_ID_PLX_ROMULUS,
  862. .subvendor = PCI_VENDOR_ID_PLX,
  863. .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
  864. .init = pci_plx9050_init,
  865. .setup = pci_default_setup,
  866. .exit = __devexit_p(pci_plx9050_exit),
  867. },
  868. /*
  869. * SBS Technologies, Inc., PMC-OCTALPRO 232
  870. */
  871. {
  872. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  873. .device = PCI_DEVICE_ID_OCTPRO,
  874. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  875. .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
  876. .init = sbs_init,
  877. .setup = sbs_setup,
  878. .exit = __devexit_p(sbs_exit),
  879. },
  880. /*
  881. * SBS Technologies, Inc., PMC-OCTALPRO 422
  882. */
  883. {
  884. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  885. .device = PCI_DEVICE_ID_OCTPRO,
  886. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  887. .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
  888. .init = sbs_init,
  889. .setup = sbs_setup,
  890. .exit = __devexit_p(sbs_exit),
  891. },
  892. /*
  893. * SBS Technologies, Inc., P-Octal 232
  894. */
  895. {
  896. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  897. .device = PCI_DEVICE_ID_OCTPRO,
  898. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  899. .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
  900. .init = sbs_init,
  901. .setup = sbs_setup,
  902. .exit = __devexit_p(sbs_exit),
  903. },
  904. /*
  905. * SBS Technologies, Inc., P-Octal 422
  906. */
  907. {
  908. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  909. .device = PCI_DEVICE_ID_OCTPRO,
  910. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  911. .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
  912. .init = sbs_init,
  913. .setup = sbs_setup,
  914. .exit = __devexit_p(sbs_exit),
  915. },
  916. /*
  917. * SIIG cards - these may be called via parport_serial
  918. */
  919. {
  920. .vendor = PCI_VENDOR_ID_SIIG,
  921. .device = PCI_ANY_ID,
  922. .subvendor = PCI_ANY_ID,
  923. .subdevice = PCI_ANY_ID,
  924. .init = pci_siig_init,
  925. .setup = pci_siig_setup,
  926. },
  927. /*
  928. * Titan cards
  929. */
  930. {
  931. .vendor = PCI_VENDOR_ID_TITAN,
  932. .device = PCI_DEVICE_ID_TITAN_400L,
  933. .subvendor = PCI_ANY_ID,
  934. .subdevice = PCI_ANY_ID,
  935. .setup = titan_400l_800l_setup,
  936. },
  937. {
  938. .vendor = PCI_VENDOR_ID_TITAN,
  939. .device = PCI_DEVICE_ID_TITAN_800L,
  940. .subvendor = PCI_ANY_ID,
  941. .subdevice = PCI_ANY_ID,
  942. .setup = titan_400l_800l_setup,
  943. },
  944. /*
  945. * Timedia cards
  946. */
  947. {
  948. .vendor = PCI_VENDOR_ID_TIMEDIA,
  949. .device = PCI_DEVICE_ID_TIMEDIA_1889,
  950. .subvendor = PCI_VENDOR_ID_TIMEDIA,
  951. .subdevice = PCI_ANY_ID,
  952. .init = pci_timedia_init,
  953. .setup = pci_timedia_setup,
  954. },
  955. {
  956. .vendor = PCI_VENDOR_ID_TIMEDIA,
  957. .device = PCI_ANY_ID,
  958. .subvendor = PCI_ANY_ID,
  959. .subdevice = PCI_ANY_ID,
  960. .setup = pci_timedia_setup,
  961. },
  962. /*
  963. * Xircom cards
  964. */
  965. {
  966. .vendor = PCI_VENDOR_ID_XIRCOM,
  967. .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
  968. .subvendor = PCI_ANY_ID,
  969. .subdevice = PCI_ANY_ID,
  970. .init = pci_xircom_init,
  971. .setup = pci_default_setup,
  972. },
  973. /*
  974. * Netmos cards - these may be called via parport_serial
  975. */
  976. {
  977. .vendor = PCI_VENDOR_ID_NETMOS,
  978. .device = PCI_ANY_ID,
  979. .subvendor = PCI_ANY_ID,
  980. .subdevice = PCI_ANY_ID,
  981. .init = pci_netmos_init,
  982. .setup = pci_default_setup,
  983. },
  984. /*
  985. * For Oxford Semiconductor and Mainpine
  986. */
  987. {
  988. .vendor = PCI_VENDOR_ID_OXSEMI,
  989. .device = PCI_ANY_ID,
  990. .subvendor = PCI_ANY_ID,
  991. .subdevice = PCI_ANY_ID,
  992. .init = pci_oxsemi_tornado_init,
  993. .setup = pci_default_setup,
  994. },
  995. {
  996. .vendor = PCI_VENDOR_ID_MAINPINE,
  997. .device = PCI_ANY_ID,
  998. .subvendor = PCI_ANY_ID,
  999. .subdevice = PCI_ANY_ID,
  1000. .init = pci_oxsemi_tornado_init,
  1001. .setup = pci_default_setup,
  1002. },
  1003. /*
  1004. * Default "match everything" terminator entry
  1005. */
  1006. {
  1007. .vendor = PCI_ANY_ID,
  1008. .device = PCI_ANY_ID,
  1009. .subvendor = PCI_ANY_ID,
  1010. .subdevice = PCI_ANY_ID,
  1011. .setup = pci_default_setup,
  1012. }
  1013. };
  1014. static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
  1015. {
  1016. return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
  1017. }
  1018. static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
  1019. {
  1020. struct pci_serial_quirk *quirk;
  1021. for (quirk = pci_serial_quirks; ; quirk++)
  1022. if (quirk_id_matches(quirk->vendor, dev->vendor) &&
  1023. quirk_id_matches(quirk->device, dev->device) &&
  1024. quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
  1025. quirk_id_matches(quirk->subdevice, dev->subsystem_device))
  1026. break;
  1027. return quirk;
  1028. }
  1029. static inline int get_pci_irq(struct pci_dev *dev,
  1030. const struct pciserial_board *board)
  1031. {
  1032. if (board->flags & FL_NOIRQ)
  1033. return 0;
  1034. else
  1035. return dev->irq;
  1036. }
  1037. /*
  1038. * This is the configuration table for all of the PCI serial boards
  1039. * which we support. It is directly indexed by the pci_board_num_t enum
  1040. * value, which is encoded in the pci_device_id PCI probe table's
  1041. * driver_data member.
  1042. *
  1043. * The makeup of these names are:
  1044. * pbn_bn{_bt}_n_baud{_offsetinhex}
  1045. *
  1046. * bn = PCI BAR number
  1047. * bt = Index using PCI BARs
  1048. * n = number of serial ports
  1049. * baud = baud rate
  1050. * offsetinhex = offset for each sequential port (in hex)
  1051. *
  1052. * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
  1053. *
  1054. * Please note: in theory if n = 1, _bt infix should make no difference.
  1055. * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
  1056. */
  1057. enum pci_board_num_t {
  1058. pbn_default = 0,
  1059. pbn_b0_1_115200,
  1060. pbn_b0_2_115200,
  1061. pbn_b0_4_115200,
  1062. pbn_b0_5_115200,
  1063. pbn_b0_8_115200,
  1064. pbn_b0_1_921600,
  1065. pbn_b0_2_921600,
  1066. pbn_b0_4_921600,
  1067. pbn_b0_2_1130000,
  1068. pbn_b0_4_1152000,
  1069. pbn_b0_2_1843200,
  1070. pbn_b0_4_1843200,
  1071. pbn_b0_2_1843200_200,
  1072. pbn_b0_4_1843200_200,
  1073. pbn_b0_8_1843200_200,
  1074. pbn_b0_1_4000000,
  1075. pbn_b0_bt_1_115200,
  1076. pbn_b0_bt_2_115200,
  1077. pbn_b0_bt_8_115200,
  1078. pbn_b0_bt_1_460800,
  1079. pbn_b0_bt_2_460800,
  1080. pbn_b0_bt_4_460800,
  1081. pbn_b0_bt_1_921600,
  1082. pbn_b0_bt_2_921600,
  1083. pbn_b0_bt_4_921600,
  1084. pbn_b0_bt_8_921600,
  1085. pbn_b1_1_115200,
  1086. pbn_b1_2_115200,
  1087. pbn_b1_4_115200,
  1088. pbn_b1_8_115200,
  1089. pbn_b1_1_921600,
  1090. pbn_b1_2_921600,
  1091. pbn_b1_4_921600,
  1092. pbn_b1_8_921600,
  1093. pbn_b1_2_1250000,
  1094. pbn_b1_bt_1_115200,
  1095. pbn_b1_bt_2_921600,
  1096. pbn_b1_1_1382400,
  1097. pbn_b1_2_1382400,
  1098. pbn_b1_4_1382400,
  1099. pbn_b1_8_1382400,
  1100. pbn_b2_1_115200,
  1101. pbn_b2_2_115200,
  1102. pbn_b2_4_115200,
  1103. pbn_b2_8_115200,
  1104. pbn_b2_1_460800,
  1105. pbn_b2_4_460800,
  1106. pbn_b2_8_460800,
  1107. pbn_b2_16_460800,
  1108. pbn_b2_1_921600,
  1109. pbn_b2_4_921600,
  1110. pbn_b2_8_921600,
  1111. pbn_b2_bt_1_115200,
  1112. pbn_b2_bt_2_115200,
  1113. pbn_b2_bt_4_115200,
  1114. pbn_b2_bt_2_921600,
  1115. pbn_b2_bt_4_921600,
  1116. pbn_b3_2_115200,
  1117. pbn_b3_4_115200,
  1118. pbn_b3_8_115200,
  1119. /*
  1120. * Board-specific versions.
  1121. */
  1122. pbn_panacom,
  1123. pbn_panacom2,
  1124. pbn_panacom4,
  1125. pbn_exsys_4055,
  1126. pbn_plx_romulus,
  1127. pbn_oxsemi,
  1128. pbn_oxsemi_1_4000000,
  1129. pbn_oxsemi_2_4000000,
  1130. pbn_oxsemi_4_4000000,
  1131. pbn_oxsemi_8_4000000,
  1132. pbn_intel_i960,
  1133. pbn_sgi_ioc3,
  1134. pbn_computone_4,
  1135. pbn_computone_6,
  1136. pbn_computone_8,
  1137. pbn_sbsxrsio,
  1138. pbn_exar_XR17C152,
  1139. pbn_exar_XR17C154,
  1140. pbn_exar_XR17C158,
  1141. pbn_pasemi_1682M,
  1142. };
  1143. /*
  1144. * uart_offset - the space between channels
  1145. * reg_shift - describes how the UART registers are mapped
  1146. * to PCI memory by the card.
  1147. * For example IER register on SBS, Inc. PMC-OctPro is located at
  1148. * offset 0x10 from the UART base, while UART_IER is defined as 1
  1149. * in include/linux/serial_reg.h,
  1150. * see first lines of serial_in() and serial_out() in 8250.c
  1151. */
  1152. static struct pciserial_board pci_boards[] __devinitdata = {
  1153. [pbn_default] = {
  1154. .flags = FL_BASE0,
  1155. .num_ports = 1,
  1156. .base_baud = 115200,
  1157. .uart_offset = 8,
  1158. },
  1159. [pbn_b0_1_115200] = {
  1160. .flags = FL_BASE0,
  1161. .num_ports = 1,
  1162. .base_baud = 115200,
  1163. .uart_offset = 8,
  1164. },
  1165. [pbn_b0_2_115200] = {
  1166. .flags = FL_BASE0,
  1167. .num_ports = 2,
  1168. .base_baud = 115200,
  1169. .uart_offset = 8,
  1170. },
  1171. [pbn_b0_4_115200] = {
  1172. .flags = FL_BASE0,
  1173. .num_ports = 4,
  1174. .base_baud = 115200,
  1175. .uart_offset = 8,
  1176. },
  1177. [pbn_b0_5_115200] = {
  1178. .flags = FL_BASE0,
  1179. .num_ports = 5,
  1180. .base_baud = 115200,
  1181. .uart_offset = 8,
  1182. },
  1183. [pbn_b0_8_115200] = {
  1184. .flags = FL_BASE0,
  1185. .num_ports = 8,
  1186. .base_baud = 115200,
  1187. .uart_offset = 8,
  1188. },
  1189. [pbn_b0_1_921600] = {
  1190. .flags = FL_BASE0,
  1191. .num_ports = 1,
  1192. .base_baud = 921600,
  1193. .uart_offset = 8,
  1194. },
  1195. [pbn_b0_2_921600] = {
  1196. .flags = FL_BASE0,
  1197. .num_ports = 2,
  1198. .base_baud = 921600,
  1199. .uart_offset = 8,
  1200. },
  1201. [pbn_b0_4_921600] = {
  1202. .flags = FL_BASE0,
  1203. .num_ports = 4,
  1204. .base_baud = 921600,
  1205. .uart_offset = 8,
  1206. },
  1207. [pbn_b0_2_1130000] = {
  1208. .flags = FL_BASE0,
  1209. .num_ports = 2,
  1210. .base_baud = 1130000,
  1211. .uart_offset = 8,
  1212. },
  1213. [pbn_b0_4_1152000] = {
  1214. .flags = FL_BASE0,
  1215. .num_ports = 4,
  1216. .base_baud = 1152000,
  1217. .uart_offset = 8,
  1218. },
  1219. [pbn_b0_2_1843200] = {
  1220. .flags = FL_BASE0,
  1221. .num_ports = 2,
  1222. .base_baud = 1843200,
  1223. .uart_offset = 8,
  1224. },
  1225. [pbn_b0_4_1843200] = {
  1226. .flags = FL_BASE0,
  1227. .num_ports = 4,
  1228. .base_baud = 1843200,
  1229. .uart_offset = 8,
  1230. },
  1231. [pbn_b0_2_1843200_200] = {
  1232. .flags = FL_BASE0,
  1233. .num_ports = 2,
  1234. .base_baud = 1843200,
  1235. .uart_offset = 0x200,
  1236. },
  1237. [pbn_b0_4_1843200_200] = {
  1238. .flags = FL_BASE0,
  1239. .num_ports = 4,
  1240. .base_baud = 1843200,
  1241. .uart_offset = 0x200,
  1242. },
  1243. [pbn_b0_8_1843200_200] = {
  1244. .flags = FL_BASE0,
  1245. .num_ports = 8,
  1246. .base_baud = 1843200,
  1247. .uart_offset = 0x200,
  1248. },
  1249. [pbn_b0_1_4000000] = {
  1250. .flags = FL_BASE0,
  1251. .num_ports = 1,
  1252. .base_baud = 4000000,
  1253. .uart_offset = 8,
  1254. },
  1255. [pbn_b0_bt_1_115200] = {
  1256. .flags = FL_BASE0|FL_BASE_BARS,
  1257. .num_ports = 1,
  1258. .base_baud = 115200,
  1259. .uart_offset = 8,
  1260. },
  1261. [pbn_b0_bt_2_115200] = {
  1262. .flags = FL_BASE0|FL_BASE_BARS,
  1263. .num_ports = 2,
  1264. .base_baud = 115200,
  1265. .uart_offset = 8,
  1266. },
  1267. [pbn_b0_bt_8_115200] = {
  1268. .flags = FL_BASE0|FL_BASE_BARS,
  1269. .num_ports = 8,
  1270. .base_baud = 115200,
  1271. .uart_offset = 8,
  1272. },
  1273. [pbn_b0_bt_1_460800] = {
  1274. .flags = FL_BASE0|FL_BASE_BARS,
  1275. .num_ports = 1,
  1276. .base_baud = 460800,
  1277. .uart_offset = 8,
  1278. },
  1279. [pbn_b0_bt_2_460800] = {
  1280. .flags = FL_BASE0|FL_BASE_BARS,
  1281. .num_ports = 2,
  1282. .base_baud = 460800,
  1283. .uart_offset = 8,
  1284. },
  1285. [pbn_b0_bt_4_460800] = {
  1286. .flags = FL_BASE0|FL_BASE_BARS,
  1287. .num_ports = 4,
  1288. .base_baud = 460800,
  1289. .uart_offset = 8,
  1290. },
  1291. [pbn_b0_bt_1_921600] = {
  1292. .flags = FL_BASE0|FL_BASE_BARS,
  1293. .num_ports = 1,
  1294. .base_baud = 921600,
  1295. .uart_offset = 8,
  1296. },
  1297. [pbn_b0_bt_2_921600] = {
  1298. .flags = FL_BASE0|FL_BASE_BARS,
  1299. .num_ports = 2,
  1300. .base_baud = 921600,
  1301. .uart_offset = 8,
  1302. },
  1303. [pbn_b0_bt_4_921600] = {
  1304. .flags = FL_BASE0|FL_BASE_BARS,
  1305. .num_ports = 4,
  1306. .base_baud = 921600,
  1307. .uart_offset = 8,
  1308. },
  1309. [pbn_b0_bt_8_921600] = {
  1310. .flags = FL_BASE0|FL_BASE_BARS,
  1311. .num_ports = 8,
  1312. .base_baud = 921600,
  1313. .uart_offset = 8,
  1314. },
  1315. [pbn_b1_1_115200] = {
  1316. .flags = FL_BASE1,
  1317. .num_ports = 1,
  1318. .base_baud = 115200,
  1319. .uart_offset = 8,
  1320. },
  1321. [pbn_b1_2_115200] = {
  1322. .flags = FL_BASE1,
  1323. .num_ports = 2,
  1324. .base_baud = 115200,
  1325. .uart_offset = 8,
  1326. },
  1327. [pbn_b1_4_115200] = {
  1328. .flags = FL_BASE1,
  1329. .num_ports = 4,
  1330. .base_baud = 115200,
  1331. .uart_offset = 8,
  1332. },
  1333. [pbn_b1_8_115200] = {
  1334. .flags = FL_BASE1,
  1335. .num_ports = 8,
  1336. .base_baud = 115200,
  1337. .uart_offset = 8,
  1338. },
  1339. [pbn_b1_1_921600] = {
  1340. .flags = FL_BASE1,
  1341. .num_ports = 1,
  1342. .base_baud = 921600,
  1343. .uart_offset = 8,
  1344. },
  1345. [pbn_b1_2_921600] = {
  1346. .flags = FL_BASE1,
  1347. .num_ports = 2,
  1348. .base_baud = 921600,
  1349. .uart_offset = 8,
  1350. },
  1351. [pbn_b1_4_921600] = {
  1352. .flags = FL_BASE1,
  1353. .num_ports = 4,
  1354. .base_baud = 921600,
  1355. .uart_offset = 8,
  1356. },
  1357. [pbn_b1_8_921600] = {
  1358. .flags = FL_BASE1,
  1359. .num_ports = 8,
  1360. .base_baud = 921600,
  1361. .uart_offset = 8,
  1362. },
  1363. [pbn_b1_2_1250000] = {
  1364. .flags = FL_BASE1,
  1365. .num_ports = 2,
  1366. .base_baud = 1250000,
  1367. .uart_offset = 8,
  1368. },
  1369. [pbn_b1_bt_1_115200] = {
  1370. .flags = FL_BASE1|FL_BASE_BARS,
  1371. .num_ports = 1,
  1372. .base_baud = 115200,
  1373. .uart_offset = 8,
  1374. },
  1375. [pbn_b1_bt_2_921600] = {
  1376. .flags = FL_BASE1|FL_BASE_BARS,
  1377. .num_ports = 2,
  1378. .base_baud = 921600,
  1379. .uart_offset = 8,
  1380. },
  1381. [pbn_b1_1_1382400] = {
  1382. .flags = FL_BASE1,
  1383. .num_ports = 1,
  1384. .base_baud = 1382400,
  1385. .uart_offset = 8,
  1386. },
  1387. [pbn_b1_2_1382400] = {
  1388. .flags = FL_BASE1,
  1389. .num_ports = 2,
  1390. .base_baud = 1382400,
  1391. .uart_offset = 8,
  1392. },
  1393. [pbn_b1_4_1382400] = {
  1394. .flags = FL_BASE1,
  1395. .num_ports = 4,
  1396. .base_baud = 1382400,
  1397. .uart_offset = 8,
  1398. },
  1399. [pbn_b1_8_1382400] = {
  1400. .flags = FL_BASE1,
  1401. .num_ports = 8,
  1402. .base_baud = 1382400,
  1403. .uart_offset = 8,
  1404. },
  1405. [pbn_b2_1_115200] = {
  1406. .flags = FL_BASE2,
  1407. .num_ports = 1,
  1408. .base_baud = 115200,
  1409. .uart_offset = 8,
  1410. },
  1411. [pbn_b2_2_115200] = {
  1412. .flags = FL_BASE2,
  1413. .num_ports = 2,
  1414. .base_baud = 115200,
  1415. .uart_offset = 8,
  1416. },
  1417. [pbn_b2_4_115200] = {
  1418. .flags = FL_BASE2,
  1419. .num_ports = 4,
  1420. .base_baud = 115200,
  1421. .uart_offset = 8,
  1422. },
  1423. [pbn_b2_8_115200] = {
  1424. .flags = FL_BASE2,
  1425. .num_ports = 8,
  1426. .base_baud = 115200,
  1427. .uart_offset = 8,
  1428. },
  1429. [pbn_b2_1_460800] = {
  1430. .flags = FL_BASE2,
  1431. .num_ports = 1,
  1432. .base_baud = 460800,
  1433. .uart_offset = 8,
  1434. },
  1435. [pbn_b2_4_460800] = {
  1436. .flags = FL_BASE2,
  1437. .num_ports = 4,
  1438. .base_baud = 460800,
  1439. .uart_offset = 8,
  1440. },
  1441. [pbn_b2_8_460800] = {
  1442. .flags = FL_BASE2,
  1443. .num_ports = 8,
  1444. .base_baud = 460800,
  1445. .uart_offset = 8,
  1446. },
  1447. [pbn_b2_16_460800] = {
  1448. .flags = FL_BASE2,
  1449. .num_ports = 16,
  1450. .base_baud = 460800,
  1451. .uart_offset = 8,
  1452. },
  1453. [pbn_b2_1_921600] = {
  1454. .flags = FL_BASE2,
  1455. .num_ports = 1,
  1456. .base_baud = 921600,
  1457. .uart_offset = 8,
  1458. },
  1459. [pbn_b2_4_921600] = {
  1460. .flags = FL_BASE2,
  1461. .num_ports = 4,
  1462. .base_baud = 921600,
  1463. .uart_offset = 8,
  1464. },
  1465. [pbn_b2_8_921600] = {
  1466. .flags = FL_BASE2,
  1467. .num_ports = 8,
  1468. .base_baud = 921600,
  1469. .uart_offset = 8,
  1470. },
  1471. [pbn_b2_bt_1_115200] = {
  1472. .flags = FL_BASE2|FL_BASE_BARS,
  1473. .num_ports = 1,
  1474. .base_baud = 115200,
  1475. .uart_offset = 8,
  1476. },
  1477. [pbn_b2_bt_2_115200] = {
  1478. .flags = FL_BASE2|FL_BASE_BARS,
  1479. .num_ports = 2,
  1480. .base_baud = 115200,
  1481. .uart_offset = 8,
  1482. },
  1483. [pbn_b2_bt_4_115200] = {
  1484. .flags = FL_BASE2|FL_BASE_BARS,
  1485. .num_ports = 4,
  1486. .base_baud = 115200,
  1487. .uart_offset = 8,
  1488. },
  1489. [pbn_b2_bt_2_921600] = {
  1490. .flags = FL_BASE2|FL_BASE_BARS,
  1491. .num_ports = 2,
  1492. .base_baud = 921600,
  1493. .uart_offset = 8,
  1494. },
  1495. [pbn_b2_bt_4_921600] = {
  1496. .flags = FL_BASE2|FL_BASE_BARS,
  1497. .num_ports = 4,
  1498. .base_baud = 921600,
  1499. .uart_offset = 8,
  1500. },
  1501. [pbn_b3_2_115200] = {
  1502. .flags = FL_BASE3,
  1503. .num_ports = 2,
  1504. .base_baud = 115200,
  1505. .uart_offset = 8,
  1506. },
  1507. [pbn_b3_4_115200] = {
  1508. .flags = FL_BASE3,
  1509. .num_ports = 4,
  1510. .base_baud = 115200,
  1511. .uart_offset = 8,
  1512. },
  1513. [pbn_b3_8_115200] = {
  1514. .flags = FL_BASE3,
  1515. .num_ports = 8,
  1516. .base_baud = 115200,
  1517. .uart_offset = 8,
  1518. },
  1519. /*
  1520. * Entries following this are board-specific.
  1521. */
  1522. /*
  1523. * Panacom - IOMEM
  1524. */
  1525. [pbn_panacom] = {
  1526. .flags = FL_BASE2,
  1527. .num_ports = 2,
  1528. .base_baud = 921600,
  1529. .uart_offset = 0x400,
  1530. .reg_shift = 7,
  1531. },
  1532. [pbn_panacom2] = {
  1533. .flags = FL_BASE2|FL_BASE_BARS,
  1534. .num_ports = 2,
  1535. .base_baud = 921600,
  1536. .uart_offset = 0x400,
  1537. .reg_shift = 7,
  1538. },
  1539. [pbn_panacom4] = {
  1540. .flags = FL_BASE2|FL_BASE_BARS,
  1541. .num_ports = 4,
  1542. .base_baud = 921600,
  1543. .uart_offset = 0x400,
  1544. .reg_shift = 7,
  1545. },
  1546. [pbn_exsys_4055] = {
  1547. .flags = FL_BASE2,
  1548. .num_ports = 4,
  1549. .base_baud = 115200,
  1550. .uart_offset = 8,
  1551. },
  1552. /* I think this entry is broken - the first_offset looks wrong --rmk */
  1553. [pbn_plx_romulus] = {
  1554. .flags = FL_BASE2,
  1555. .num_ports = 4,
  1556. .base_baud = 921600,
  1557. .uart_offset = 8 << 2,
  1558. .reg_shift = 2,
  1559. .first_offset = 0x03,
  1560. },
  1561. /*
  1562. * This board uses the size of PCI Base region 0 to
  1563. * signal now many ports are available
  1564. */
  1565. [pbn_oxsemi] = {
  1566. .flags = FL_BASE0|FL_REGION_SZ_CAP,
  1567. .num_ports = 32,
  1568. .base_baud = 115200,
  1569. .uart_offset = 8,
  1570. },
  1571. [pbn_oxsemi_1_4000000] = {
  1572. .flags = FL_BASE0,
  1573. .num_ports = 1,
  1574. .base_baud = 4000000,
  1575. .uart_offset = 0x200,
  1576. .first_offset = 0x1000,
  1577. },
  1578. [pbn_oxsemi_2_4000000] = {
  1579. .flags = FL_BASE0,
  1580. .num_ports = 2,
  1581. .base_baud = 4000000,
  1582. .uart_offset = 0x200,
  1583. .first_offset = 0x1000,
  1584. },
  1585. [pbn_oxsemi_4_4000000] = {
  1586. .flags = FL_BASE0,
  1587. .num_ports = 4,
  1588. .base_baud = 4000000,
  1589. .uart_offset = 0x200,
  1590. .first_offset = 0x1000,
  1591. },
  1592. [pbn_oxsemi_8_4000000] = {
  1593. .flags = FL_BASE0,
  1594. .num_ports = 8,
  1595. .base_baud = 4000000,
  1596. .uart_offset = 0x200,
  1597. .first_offset = 0x1000,
  1598. },
  1599. /*
  1600. * EKF addition for i960 Boards form EKF with serial port.
  1601. * Max 256 ports.
  1602. */
  1603. [pbn_intel_i960] = {
  1604. .flags = FL_BASE0,
  1605. .num_ports = 32,
  1606. .base_baud = 921600,
  1607. .uart_offset = 8 << 2,
  1608. .reg_shift = 2,
  1609. .first_offset = 0x10000,
  1610. },
  1611. [pbn_sgi_ioc3] = {
  1612. .flags = FL_BASE0|FL_NOIRQ,
  1613. .num_ports = 1,
  1614. .base_baud = 458333,
  1615. .uart_offset = 8,
  1616. .reg_shift = 0,
  1617. .first_offset = 0x20178,
  1618. },
  1619. /*
  1620. * Computone - uses IOMEM.
  1621. */
  1622. [pbn_computone_4] = {
  1623. .flags = FL_BASE0,
  1624. .num_ports = 4,
  1625. .base_baud = 921600,
  1626. .uart_offset = 0x40,
  1627. .reg_shift = 2,
  1628. .first_offset = 0x200,
  1629. },
  1630. [pbn_computone_6] = {
  1631. .flags = FL_BASE0,
  1632. .num_ports = 6,
  1633. .base_baud = 921600,
  1634. .uart_offset = 0x40,
  1635. .reg_shift = 2,
  1636. .first_offset = 0x200,
  1637. },
  1638. [pbn_computone_8] = {
  1639. .flags = FL_BASE0,
  1640. .num_ports = 8,
  1641. .base_baud = 921600,
  1642. .uart_offset = 0x40,
  1643. .reg_shift = 2,
  1644. .first_offset = 0x200,
  1645. },
  1646. [pbn_sbsxrsio] = {
  1647. .flags = FL_BASE0,
  1648. .num_ports = 8,
  1649. .base_baud = 460800,
  1650. .uart_offset = 256,
  1651. .reg_shift = 4,
  1652. },
  1653. /*
  1654. * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
  1655. * Only basic 16550A support.
  1656. * XR17C15[24] are not tested, but they should work.
  1657. */
  1658. [pbn_exar_XR17C152] = {
  1659. .flags = FL_BASE0,
  1660. .num_ports = 2,
  1661. .base_baud = 921600,
  1662. .uart_offset = 0x200,
  1663. },
  1664. [pbn_exar_XR17C154] = {
  1665. .flags = FL_BASE0,
  1666. .num_ports = 4,
  1667. .base_baud = 921600,
  1668. .uart_offset = 0x200,
  1669. },
  1670. [pbn_exar_XR17C158] = {
  1671. .flags = FL_BASE0,
  1672. .num_ports = 8,
  1673. .base_baud = 921600,
  1674. .uart_offset = 0x200,
  1675. },
  1676. /*
  1677. * PA Semi PWRficient PA6T-1682M on-chip UART
  1678. */
  1679. [pbn_pasemi_1682M] = {
  1680. .flags = FL_BASE0,
  1681. .num_ports = 1,
  1682. .base_baud = 8333333,
  1683. },
  1684. };
  1685. static const struct pci_device_id softmodem_blacklist[] = {
  1686. { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
  1687. };
  1688. /*
  1689. * Given a complete unknown PCI device, try to use some heuristics to
  1690. * guess what the configuration might be, based on the pitiful PCI
  1691. * serial specs. Returns 0 on success, 1 on failure.
  1692. */
  1693. static int __devinit
  1694. serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
  1695. {
  1696. const struct pci_device_id *blacklist;
  1697. int num_iomem, num_port, first_port = -1, i;
  1698. /*
  1699. * If it is not a communications device or the programming
  1700. * interface is greater than 6, give up.
  1701. *
  1702. * (Should we try to make guesses for multiport serial devices
  1703. * later?)
  1704. */
  1705. if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
  1706. ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
  1707. (dev->class & 0xff) > 6)
  1708. return -ENODEV;
  1709. /*
  1710. * Do not access blacklisted devices that are known not to
  1711. * feature serial ports.
  1712. */
  1713. for (blacklist = softmodem_blacklist;
  1714. blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist);
  1715. blacklist++) {
  1716. if (dev->vendor == blacklist->vendor &&
  1717. dev->device == blacklist->device)
  1718. return -ENODEV;
  1719. }
  1720. num_iomem = num_port = 0;
  1721. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1722. if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
  1723. num_port++;
  1724. if (first_port == -1)
  1725. first_port = i;
  1726. }
  1727. if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
  1728. num_iomem++;
  1729. }
  1730. /*
  1731. * If there is 1 or 0 iomem regions, and exactly one port,
  1732. * use it. We guess the number of ports based on the IO
  1733. * region size.
  1734. */
  1735. if (num_iomem <= 1 && num_port == 1) {
  1736. board->flags = first_port;
  1737. board->num_ports = pci_resource_len(dev, first_port) / 8;
  1738. return 0;
  1739. }
  1740. /*
  1741. * Now guess if we've got a board which indexes by BARs.
  1742. * Each IO BAR should be 8 bytes, and they should follow
  1743. * consecutively.
  1744. */
  1745. first_port = -1;
  1746. num_port = 0;
  1747. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1748. if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
  1749. pci_resource_len(dev, i) == 8 &&
  1750. (first_port == -1 || (first_port + num_port) == i)) {
  1751. num_port++;
  1752. if (first_port == -1)
  1753. first_port = i;
  1754. }
  1755. }
  1756. if (num_port > 1) {
  1757. board->flags = first_port | FL_BASE_BARS;
  1758. board->num_ports = num_port;
  1759. return 0;
  1760. }
  1761. return -ENODEV;
  1762. }
  1763. static inline int
  1764. serial_pci_matches(const struct pciserial_board *board,
  1765. const struct pciserial_board *guessed)
  1766. {
  1767. return
  1768. board->num_ports == guessed->num_ports &&
  1769. board->base_baud == guessed->base_baud &&
  1770. board->uart_offset == guessed->uart_offset &&
  1771. board->reg_shift == guessed->reg_shift &&
  1772. board->first_offset == guessed->first_offset;
  1773. }
  1774. struct serial_private *
  1775. pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
  1776. {
  1777. struct uart_port serial_port;
  1778. struct serial_private *priv;
  1779. struct pci_serial_quirk *quirk;
  1780. int rc, nr_ports, i;
  1781. nr_ports = board->num_ports;
  1782. /*
  1783. * Find an init and setup quirks.
  1784. */
  1785. quirk = find_quirk(dev);
  1786. /*
  1787. * Run the new-style initialization function.
  1788. * The initialization function returns:
  1789. * <0 - error
  1790. * 0 - use board->num_ports
  1791. * >0 - number of ports
  1792. */
  1793. if (quirk->init) {
  1794. rc = quirk->init(dev);
  1795. if (rc < 0) {
  1796. priv = ERR_PTR(rc);
  1797. goto err_out;
  1798. }
  1799. if (rc)
  1800. nr_ports = rc;
  1801. }
  1802. priv = kzalloc(sizeof(struct serial_private) +
  1803. sizeof(unsigned int) * nr_ports,
  1804. GFP_KERNEL);
  1805. if (!priv) {
  1806. priv = ERR_PTR(-ENOMEM);
  1807. goto err_deinit;
  1808. }
  1809. priv->dev = dev;
  1810. priv->quirk = quirk;
  1811. memset(&serial_port, 0, sizeof(struct uart_port));
  1812. serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
  1813. serial_port.uartclk = board->base_baud * 16;
  1814. serial_port.irq = get_pci_irq(dev, board);
  1815. serial_port.dev = &dev->dev;
  1816. for (i = 0; i < nr_ports; i++) {
  1817. if (quirk->setup(priv, board, &serial_port, i))
  1818. break;
  1819. #ifdef SERIAL_DEBUG_PCI
  1820. printk(KERN_DEBUG "Setup PCI port: port %x, irq %d, type %d\n",
  1821. serial_port.iobase, serial_port.irq, serial_port.iotype);
  1822. #endif
  1823. priv->line[i] = serial8250_register_port(&serial_port);
  1824. if (priv->line[i] < 0) {
  1825. printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
  1826. break;
  1827. }
  1828. }
  1829. priv->nr = i;
  1830. return priv;
  1831. err_deinit:
  1832. if (quirk->exit)
  1833. quirk->exit(dev);
  1834. err_out:
  1835. return priv;
  1836. }
  1837. EXPORT_SYMBOL_GPL(pciserial_init_ports);
  1838. void pciserial_remove_ports(struct serial_private *priv)
  1839. {
  1840. struct pci_serial_quirk *quirk;
  1841. int i;
  1842. for (i = 0; i < priv->nr; i++)
  1843. serial8250_unregister_port(priv->line[i]);
  1844. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1845. if (priv->remapped_bar[i])
  1846. iounmap(priv->remapped_bar[i]);
  1847. priv->remapped_bar[i] = NULL;
  1848. }
  1849. /*
  1850. * Find the exit quirks.
  1851. */
  1852. quirk = find_quirk(priv->dev);
  1853. if (quirk->exit)
  1854. quirk->exit(priv->dev);
  1855. kfree(priv);
  1856. }
  1857. EXPORT_SYMBOL_GPL(pciserial_remove_ports);
  1858. void pciserial_suspend_ports(struct serial_private *priv)
  1859. {
  1860. int i;
  1861. for (i = 0; i < priv->nr; i++)
  1862. if (priv->line[i] >= 0)
  1863. serial8250_suspend_port(priv->line[i]);
  1864. }
  1865. EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
  1866. void pciserial_resume_ports(struct serial_private *priv)
  1867. {
  1868. int i;
  1869. /*
  1870. * Ensure that the board is correctly configured.
  1871. */
  1872. if (priv->quirk->init)
  1873. priv->quirk->init(priv->dev);
  1874. for (i = 0; i < priv->nr; i++)
  1875. if (priv->line[i] >= 0)
  1876. serial8250_resume_port(priv->line[i]);
  1877. }
  1878. EXPORT_SYMBOL_GPL(pciserial_resume_ports);
  1879. /*
  1880. * Probe one serial board. Unfortunately, there is no rhyme nor reason
  1881. * to the arrangement of serial ports on a PCI card.
  1882. */
  1883. static int __devinit
  1884. pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
  1885. {
  1886. struct serial_private *priv;
  1887. const struct pciserial_board *board;
  1888. struct pciserial_board tmp;
  1889. int rc;
  1890. if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
  1891. printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
  1892. ent->driver_data);
  1893. return -EINVAL;
  1894. }
  1895. board = &pci_boards[ent->driver_data];
  1896. rc = pci_enable_device(dev);
  1897. if (rc)
  1898. return rc;
  1899. if (ent->driver_data == pbn_default) {
  1900. /*
  1901. * Use a copy of the pci_board entry for this;
  1902. * avoid changing entries in the table.
  1903. */
  1904. memcpy(&tmp, board, sizeof(struct pciserial_board));
  1905. board = &tmp;
  1906. /*
  1907. * We matched one of our class entries. Try to
  1908. * determine the parameters of this board.
  1909. */
  1910. rc = serial_pci_guess_board(dev, &tmp);
  1911. if (rc)
  1912. goto disable;
  1913. } else {
  1914. /*
  1915. * We matched an explicit entry. If we are able to
  1916. * detect this boards settings with our heuristic,
  1917. * then we no longer need this entry.
  1918. */
  1919. memcpy(&tmp, &pci_boards[pbn_default],
  1920. sizeof(struct pciserial_board));
  1921. rc = serial_pci_guess_board(dev, &tmp);
  1922. if (rc == 0 && serial_pci_matches(board, &tmp))
  1923. moan_device("Redundant entry in serial pci_table.",
  1924. dev);
  1925. }
  1926. priv = pciserial_init_ports(dev, board);
  1927. if (!IS_ERR(priv)) {
  1928. pci_set_drvdata(dev, priv);
  1929. return 0;
  1930. }
  1931. rc = PTR_ERR(priv);
  1932. disable:
  1933. pci_disable_device(dev);
  1934. return rc;
  1935. }
  1936. static void __devexit pciserial_remove_one(struct pci_dev *dev)
  1937. {
  1938. struct serial_private *priv = pci_get_drvdata(dev);
  1939. pci_set_drvdata(dev, NULL);
  1940. pciserial_remove_ports(priv);
  1941. pci_disable_device(dev);
  1942. }
  1943. #ifdef CONFIG_PM
  1944. static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
  1945. {
  1946. struct serial_private *priv = pci_get_drvdata(dev);
  1947. if (priv)
  1948. pciserial_suspend_ports(priv);
  1949. pci_save_state(dev);
  1950. pci_set_power_state(dev, pci_choose_state(dev, state));
  1951. return 0;
  1952. }
  1953. static int pciserial_resume_one(struct pci_dev *dev)
  1954. {
  1955. int err;
  1956. struct serial_private *priv = pci_get_drvdata(dev);
  1957. pci_set_power_state(dev, PCI_D0);
  1958. pci_restore_state(dev);
  1959. if (priv) {
  1960. /*
  1961. * The device may have been disabled. Re-enable it.
  1962. */
  1963. err = pci_enable_device(dev);
  1964. /* FIXME: We cannot simply error out here */
  1965. if (err)
  1966. printk(KERN_ERR "pciserial: Unable to re-enable ports, trying to continue.\n");
  1967. pciserial_resume_ports(priv);
  1968. }
  1969. return 0;
  1970. }
  1971. #endif
  1972. static struct pci_device_id serial_pci_tbl[] = {
  1973. /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
  1974. { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
  1975. PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
  1976. pbn_b2_8_921600 },
  1977. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1978. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1979. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
  1980. pbn_b1_8_1382400 },
  1981. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1982. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1983. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
  1984. pbn_b1_4_1382400 },
  1985. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1986. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1987. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
  1988. pbn_b1_2_1382400 },
  1989. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1990. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1991. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
  1992. pbn_b1_8_1382400 },
  1993. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1994. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1995. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
  1996. pbn_b1_4_1382400 },
  1997. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1998. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1999. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
  2000. pbn_b1_2_1382400 },
  2001. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2002. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2003. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
  2004. pbn_b1_8_921600 },
  2005. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2006. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2007. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
  2008. pbn_b1_8_921600 },
  2009. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2010. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2011. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
  2012. pbn_b1_4_921600 },
  2013. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2014. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2015. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
  2016. pbn_b1_4_921600 },
  2017. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2018. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2019. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
  2020. pbn_b1_2_921600 },
  2021. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2022. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2023. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
  2024. pbn_b1_8_921600 },
  2025. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2026. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2027. PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
  2028. pbn_b1_8_921600 },
  2029. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2030. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2031. PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
  2032. pbn_b1_4_921600 },
  2033. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  2034. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2035. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
  2036. pbn_b1_2_1250000 },
  2037. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2038. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2039. PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
  2040. pbn_b0_2_1843200 },
  2041. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2042. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2043. PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
  2044. pbn_b0_4_1843200 },
  2045. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2046. PCI_VENDOR_ID_AFAVLAB,
  2047. PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
  2048. pbn_b0_4_1152000 },
  2049. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2050. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2051. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232, 0, 0,
  2052. pbn_b0_2_1843200_200 },
  2053. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2054. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2055. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232, 0, 0,
  2056. pbn_b0_4_1843200_200 },
  2057. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2058. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2059. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232, 0, 0,
  2060. pbn_b0_8_1843200_200 },
  2061. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2062. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2063. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1, 0, 0,
  2064. pbn_b0_2_1843200_200 },
  2065. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2066. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2067. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2, 0, 0,
  2068. pbn_b0_4_1843200_200 },
  2069. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2070. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2071. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4, 0, 0,
  2072. pbn_b0_8_1843200_200 },
  2073. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2074. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2075. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2, 0, 0,
  2076. pbn_b0_2_1843200_200 },
  2077. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2078. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2079. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4, 0, 0,
  2080. pbn_b0_4_1843200_200 },
  2081. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2082. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2083. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8, 0, 0,
  2084. pbn_b0_8_1843200_200 },
  2085. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2086. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2087. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485, 0, 0,
  2088. pbn_b0_2_1843200_200 },
  2089. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2090. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2091. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485, 0, 0,
  2092. pbn_b0_4_1843200_200 },
  2093. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2094. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2095. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
  2096. pbn_b0_8_1843200_200 },
  2097. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
  2098. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2099. pbn_b2_bt_1_115200 },
  2100. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
  2101. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2102. pbn_b2_bt_2_115200 },
  2103. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
  2104. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2105. pbn_b2_bt_4_115200 },
  2106. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
  2107. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2108. pbn_b2_bt_2_115200 },
  2109. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
  2110. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2111. pbn_b2_bt_4_115200 },
  2112. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
  2113. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2114. pbn_b2_8_115200 },
  2115. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
  2116. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2117. pbn_b2_8_460800 },
  2118. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
  2119. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2120. pbn_b2_8_115200 },
  2121. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
  2122. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2123. pbn_b2_bt_2_115200 },
  2124. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
  2125. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2126. pbn_b2_bt_2_921600 },
  2127. /*
  2128. * VScom SPCOM800, from sl@s.pl
  2129. */
  2130. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
  2131. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2132. pbn_b2_8_921600 },
  2133. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
  2134. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2135. pbn_b2_4_921600 },
  2136. /* Unknown card - subdevice 0x1584 */
  2137. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2138. PCI_VENDOR_ID_PLX,
  2139. PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
  2140. pbn_b0_4_115200 },
  2141. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2142. PCI_SUBVENDOR_ID_KEYSPAN,
  2143. PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
  2144. pbn_panacom },
  2145. { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
  2146. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2147. pbn_panacom4 },
  2148. { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
  2149. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2150. pbn_panacom2 },
  2151. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2152. PCI_VENDOR_ID_ESDGMBH,
  2153. PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
  2154. pbn_b2_4_115200 },
  2155. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2156. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2157. PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
  2158. pbn_b2_4_460800 },
  2159. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2160. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2161. PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
  2162. pbn_b2_8_460800 },
  2163. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2164. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2165. PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
  2166. pbn_b2_16_460800 },
  2167. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2168. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2169. PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
  2170. pbn_b2_16_460800 },
  2171. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2172. PCI_SUBVENDOR_ID_CHASE_PCIRAS,
  2173. PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
  2174. pbn_b2_4_460800 },
  2175. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2176. PCI_SUBVENDOR_ID_CHASE_PCIRAS,
  2177. PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
  2178. pbn_b2_8_460800 },
  2179. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2180. PCI_SUBVENDOR_ID_EXSYS,
  2181. PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
  2182. pbn_exsys_4055 },
  2183. /*
  2184. * Megawolf Romulus PCI Serial Card, from Mike Hudson
  2185. * (Exoray@isys.ca)
  2186. */
  2187. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
  2188. 0x10b5, 0x106a, 0, 0,
  2189. pbn_plx_romulus },
  2190. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
  2191. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2192. pbn_b1_4_115200 },
  2193. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
  2194. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2195. pbn_b1_2_115200 },
  2196. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
  2197. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2198. pbn_b1_8_115200 },
  2199. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
  2200. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2201. pbn_b1_8_115200 },
  2202. { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2203. PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
  2204. 0, 0,
  2205. pbn_b0_4_921600 },
  2206. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2207. PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
  2208. 0, 0,
  2209. pbn_b0_4_1152000 },
  2210. /*
  2211. * The below card is a little controversial since it is the
  2212. * subject of a PCI vendor/device ID clash. (See
  2213. * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
  2214. * For now just used the hex ID 0x950a.
  2215. */
  2216. { PCI_VENDOR_ID_OXSEMI, 0x950a,
  2217. PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL, 0, 0,
  2218. pbn_b0_2_115200 },
  2219. { PCI_VENDOR_ID_OXSEMI, 0x950a,
  2220. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2221. pbn_b0_2_1130000 },
  2222. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2223. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2224. pbn_b0_4_115200 },
  2225. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
  2226. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2227. pbn_b0_bt_2_921600 },
  2228. /*
  2229. * Oxford Semiconductor Inc. Tornado PCI express device range.
  2230. */
  2231. { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
  2232. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2233. pbn_b0_1_4000000 },
  2234. { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
  2235. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2236. pbn_b0_1_4000000 },
  2237. { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
  2238. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2239. pbn_oxsemi_1_4000000 },
  2240. { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
  2241. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2242. pbn_oxsemi_1_4000000 },
  2243. { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
  2244. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2245. pbn_b0_1_4000000 },
  2246. { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
  2247. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2248. pbn_b0_1_4000000 },
  2249. { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
  2250. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2251. pbn_oxsemi_1_4000000 },
  2252. { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
  2253. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2254. pbn_oxsemi_1_4000000 },
  2255. { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
  2256. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2257. pbn_b0_1_4000000 },
  2258. { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
  2259. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2260. pbn_b0_1_4000000 },
  2261. { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
  2262. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2263. pbn_b0_1_4000000 },
  2264. { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
  2265. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2266. pbn_b0_1_4000000 },
  2267. { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
  2268. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2269. pbn_oxsemi_2_4000000 },
  2270. { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
  2271. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2272. pbn_oxsemi_2_4000000 },
  2273. { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
  2274. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2275. pbn_oxsemi_4_4000000 },
  2276. { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
  2277. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2278. pbn_oxsemi_4_4000000 },
  2279. { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
  2280. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2281. pbn_oxsemi_8_4000000 },
  2282. { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
  2283. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2284. pbn_oxsemi_8_4000000 },
  2285. { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
  2286. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2287. pbn_oxsemi_1_4000000 },
  2288. { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
  2289. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2290. pbn_oxsemi_1_4000000 },
  2291. { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
  2292. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2293. pbn_oxsemi_1_4000000 },
  2294. { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
  2295. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2296. pbn_oxsemi_1_4000000 },
  2297. { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
  2298. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2299. pbn_oxsemi_1_4000000 },
  2300. { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
  2301. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2302. pbn_oxsemi_1_4000000 },
  2303. { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
  2304. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2305. pbn_oxsemi_1_4000000 },
  2306. { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
  2307. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2308. pbn_oxsemi_1_4000000 },
  2309. { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
  2310. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2311. pbn_oxsemi_1_4000000 },
  2312. { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
  2313. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2314. pbn_oxsemi_1_4000000 },
  2315. { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
  2316. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2317. pbn_oxsemi_1_4000000 },
  2318. { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
  2319. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2320. pbn_oxsemi_1_4000000 },
  2321. { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
  2322. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2323. pbn_oxsemi_1_4000000 },
  2324. { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
  2325. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2326. pbn_oxsemi_1_4000000 },
  2327. { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
  2328. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2329. pbn_oxsemi_1_4000000 },
  2330. { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
  2331. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2332. pbn_oxsemi_1_4000000 },
  2333. { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
  2334. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2335. pbn_oxsemi_1_4000000 },
  2336. { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
  2337. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2338. pbn_oxsemi_1_4000000 },
  2339. { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
  2340. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2341. pbn_oxsemi_1_4000000 },
  2342. { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
  2343. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2344. pbn_oxsemi_1_4000000 },
  2345. { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
  2346. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2347. pbn_oxsemi_1_4000000 },
  2348. { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
  2349. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2350. pbn_oxsemi_1_4000000 },
  2351. { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
  2352. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2353. pbn_oxsemi_1_4000000 },
  2354. { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
  2355. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2356. pbn_oxsemi_1_4000000 },
  2357. { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
  2358. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2359. pbn_oxsemi_1_4000000 },
  2360. { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
  2361. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2362. pbn_oxsemi_1_4000000 },
  2363. /*
  2364. * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
  2365. */
  2366. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
  2367. PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
  2368. pbn_oxsemi_1_4000000 },
  2369. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
  2370. PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
  2371. pbn_oxsemi_2_4000000 },
  2372. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
  2373. PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
  2374. pbn_oxsemi_4_4000000 },
  2375. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
  2376. PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
  2377. pbn_oxsemi_8_4000000 },
  2378. /*
  2379. * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
  2380. * from skokodyn@yahoo.com
  2381. */
  2382. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2383. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
  2384. pbn_sbsxrsio },
  2385. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2386. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
  2387. pbn_sbsxrsio },
  2388. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2389. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
  2390. pbn_sbsxrsio },
  2391. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2392. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
  2393. pbn_sbsxrsio },
  2394. /*
  2395. * Digitan DS560-558, from jimd@esoft.com
  2396. */
  2397. { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
  2398. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2399. pbn_b1_1_115200 },
  2400. /*
  2401. * Titan Electronic cards
  2402. * The 400L and 800L have a custom setup quirk.
  2403. */
  2404. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
  2405. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2406. pbn_b0_1_921600 },
  2407. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
  2408. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2409. pbn_b0_2_921600 },
  2410. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
  2411. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2412. pbn_b0_4_921600 },
  2413. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
  2414. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2415. pbn_b0_4_921600 },
  2416. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
  2417. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2418. pbn_b1_1_921600 },
  2419. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
  2420. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2421. pbn_b1_bt_2_921600 },
  2422. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
  2423. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2424. pbn_b0_bt_4_921600 },
  2425. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
  2426. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2427. pbn_b0_bt_8_921600 },
  2428. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
  2429. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2430. pbn_b2_1_460800 },
  2431. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
  2432. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2433. pbn_b2_1_460800 },
  2434. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
  2435. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2436. pbn_b2_1_460800 },
  2437. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
  2438. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2439. pbn_b2_bt_2_921600 },
  2440. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
  2441. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2442. pbn_b2_bt_2_921600 },
  2443. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
  2444. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2445. pbn_b2_bt_2_921600 },
  2446. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
  2447. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2448. pbn_b2_bt_4_921600 },
  2449. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
  2450. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2451. pbn_b2_bt_4_921600 },
  2452. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
  2453. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2454. pbn_b2_bt_4_921600 },
  2455. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
  2456. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2457. pbn_b0_1_921600 },
  2458. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
  2459. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2460. pbn_b0_1_921600 },
  2461. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
  2462. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2463. pbn_b0_1_921600 },
  2464. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
  2465. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2466. pbn_b0_bt_2_921600 },
  2467. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
  2468. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2469. pbn_b0_bt_2_921600 },
  2470. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
  2471. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2472. pbn_b0_bt_2_921600 },
  2473. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
  2474. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2475. pbn_b0_bt_4_921600 },
  2476. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
  2477. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2478. pbn_b0_bt_4_921600 },
  2479. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
  2480. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2481. pbn_b0_bt_4_921600 },
  2482. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
  2483. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2484. pbn_b0_bt_8_921600 },
  2485. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
  2486. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2487. pbn_b0_bt_8_921600 },
  2488. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
  2489. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2490. pbn_b0_bt_8_921600 },
  2491. /*
  2492. * Computone devices submitted by Doug McNash dmcnash@computone.com
  2493. */
  2494. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2495. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
  2496. 0, 0, pbn_computone_4 },
  2497. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2498. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
  2499. 0, 0, pbn_computone_8 },
  2500. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2501. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
  2502. 0, 0, pbn_computone_6 },
  2503. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
  2504. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2505. pbn_oxsemi },
  2506. { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
  2507. PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
  2508. pbn_b0_bt_1_921600 },
  2509. /*
  2510. * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
  2511. */
  2512. { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
  2513. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2514. pbn_b0_bt_8_115200 },
  2515. { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
  2516. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2517. pbn_b0_bt_8_115200 },
  2518. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
  2519. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2520. pbn_b0_bt_2_115200 },
  2521. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
  2522. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2523. pbn_b0_bt_2_115200 },
  2524. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
  2525. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2526. pbn_b0_bt_2_115200 },
  2527. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
  2528. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2529. pbn_b0_bt_4_460800 },
  2530. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
  2531. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2532. pbn_b0_bt_4_460800 },
  2533. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
  2534. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2535. pbn_b0_bt_2_460800 },
  2536. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
  2537. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2538. pbn_b0_bt_2_460800 },
  2539. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
  2540. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2541. pbn_b0_bt_2_460800 },
  2542. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
  2543. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2544. pbn_b0_bt_1_115200 },
  2545. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
  2546. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2547. pbn_b0_bt_1_460800 },
  2548. /*
  2549. * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
  2550. * Cards are identified by their subsystem vendor IDs, which
  2551. * (in hex) match the model number.
  2552. *
  2553. * Note that JC140x are RS422/485 cards which require ox950
  2554. * ACR = 0x10, and as such are not currently fully supported.
  2555. */
  2556. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2557. 0x1204, 0x0004, 0, 0,
  2558. pbn_b0_4_921600 },
  2559. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2560. 0x1208, 0x0004, 0, 0,
  2561. pbn_b0_4_921600 },
  2562. /* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2563. 0x1402, 0x0002, 0, 0,
  2564. pbn_b0_2_921600 }, */
  2565. /* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2566. 0x1404, 0x0004, 0, 0,
  2567. pbn_b0_4_921600 }, */
  2568. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
  2569. 0x1208, 0x0004, 0, 0,
  2570. pbn_b0_4_921600 },
  2571. /*
  2572. * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
  2573. */
  2574. { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
  2575. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2576. pbn_b1_1_1382400 },
  2577. /*
  2578. * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
  2579. */
  2580. { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
  2581. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2582. pbn_b1_1_1382400 },
  2583. /*
  2584. * RAStel 2 port modem, gerg@moreton.com.au
  2585. */
  2586. { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
  2587. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2588. pbn_b2_bt_2_115200 },
  2589. /*
  2590. * EKF addition for i960 Boards form EKF with serial port
  2591. */
  2592. { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
  2593. 0xE4BF, PCI_ANY_ID, 0, 0,
  2594. pbn_intel_i960 },
  2595. /*
  2596. * Xircom Cardbus/Ethernet combos
  2597. */
  2598. { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
  2599. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2600. pbn_b0_1_115200 },
  2601. /*
  2602. * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
  2603. */
  2604. { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
  2605. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2606. pbn_b0_1_115200 },
  2607. /*
  2608. * Untested PCI modems, sent in from various folks...
  2609. */
  2610. /*
  2611. * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
  2612. */
  2613. { PCI_VENDOR_ID_ROCKWELL, 0x1004,
  2614. 0x1048, 0x1500, 0, 0,
  2615. pbn_b1_1_115200 },
  2616. { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
  2617. 0xFF00, 0, 0, 0,
  2618. pbn_sgi_ioc3 },
  2619. /*
  2620. * HP Diva card
  2621. */
  2622. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
  2623. PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
  2624. pbn_b1_1_115200 },
  2625. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
  2626. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2627. pbn_b0_5_115200 },
  2628. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
  2629. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2630. pbn_b2_1_115200 },
  2631. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
  2632. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2633. pbn_b3_2_115200 },
  2634. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
  2635. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2636. pbn_b3_4_115200 },
  2637. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
  2638. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2639. pbn_b3_8_115200 },
  2640. /*
  2641. * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
  2642. */
  2643. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2644. PCI_ANY_ID, PCI_ANY_ID,
  2645. 0,
  2646. 0, pbn_exar_XR17C152 },
  2647. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2648. PCI_ANY_ID, PCI_ANY_ID,
  2649. 0,
  2650. 0, pbn_exar_XR17C154 },
  2651. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2652. PCI_ANY_ID, PCI_ANY_ID,
  2653. 0,
  2654. 0, pbn_exar_XR17C158 },
  2655. /*
  2656. * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
  2657. */
  2658. { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
  2659. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2660. pbn_b0_1_115200 },
  2661. /*
  2662. * ITE
  2663. */
  2664. { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
  2665. PCI_ANY_ID, PCI_ANY_ID,
  2666. 0, 0,
  2667. pbn_b1_bt_1_115200 },
  2668. /*
  2669. * IntaShield IS-200
  2670. */
  2671. { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
  2672. PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
  2673. pbn_b2_2_115200 },
  2674. /*
  2675. * IntaShield IS-400
  2676. */
  2677. { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
  2678. PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
  2679. pbn_b2_4_115200 },
  2680. /*
  2681. * Perle PCI-RAS cards
  2682. */
  2683. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2684. PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
  2685. 0, 0, pbn_b2_4_921600 },
  2686. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2687. PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
  2688. 0, 0, pbn_b2_8_921600 },
  2689. /*
  2690. * Mainpine series cards: Fairly standard layout but fools
  2691. * parts of the autodetect in some cases and uses otherwise
  2692. * unmatched communications subclasses in the PCI Express case
  2693. */
  2694. { /* RockForceDUO */
  2695. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2696. PCI_VENDOR_ID_MAINPINE, 0x0200,
  2697. 0, 0, pbn_b0_2_115200 },
  2698. { /* RockForceQUATRO */
  2699. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2700. PCI_VENDOR_ID_MAINPINE, 0x0300,
  2701. 0, 0, pbn_b0_4_115200 },
  2702. { /* RockForceDUO+ */
  2703. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2704. PCI_VENDOR_ID_MAINPINE, 0x0400,
  2705. 0, 0, pbn_b0_2_115200 },
  2706. { /* RockForceQUATRO+ */
  2707. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2708. PCI_VENDOR_ID_MAINPINE, 0x0500,
  2709. 0, 0, pbn_b0_4_115200 },
  2710. { /* RockForce+ */
  2711. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2712. PCI_VENDOR_ID_MAINPINE, 0x0600,
  2713. 0, 0, pbn_b0_2_115200 },
  2714. { /* RockForce+ */
  2715. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2716. PCI_VENDOR_ID_MAINPINE, 0x0700,
  2717. 0, 0, pbn_b0_4_115200 },
  2718. { /* RockForceOCTO+ */
  2719. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2720. PCI_VENDOR_ID_MAINPINE, 0x0800,
  2721. 0, 0, pbn_b0_8_115200 },
  2722. { /* RockForceDUO+ */
  2723. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2724. PCI_VENDOR_ID_MAINPINE, 0x0C00,
  2725. 0, 0, pbn_b0_2_115200 },
  2726. { /* RockForceQUARTRO+ */
  2727. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2728. PCI_VENDOR_ID_MAINPINE, 0x0D00,
  2729. 0, 0, pbn_b0_4_115200 },
  2730. { /* RockForceOCTO+ */
  2731. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2732. PCI_VENDOR_ID_MAINPINE, 0x1D00,
  2733. 0, 0, pbn_b0_8_115200 },
  2734. { /* RockForceD1 */
  2735. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2736. PCI_VENDOR_ID_MAINPINE, 0x2000,
  2737. 0, 0, pbn_b0_1_115200 },
  2738. { /* RockForceF1 */
  2739. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2740. PCI_VENDOR_ID_MAINPINE, 0x2100,
  2741. 0, 0, pbn_b0_1_115200 },
  2742. { /* RockForceD2 */
  2743. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2744. PCI_VENDOR_ID_MAINPINE, 0x2200,
  2745. 0, 0, pbn_b0_2_115200 },
  2746. { /* RockForceF2 */
  2747. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2748. PCI_VENDOR_ID_MAINPINE, 0x2300,
  2749. 0, 0, pbn_b0_2_115200 },
  2750. { /* RockForceD4 */
  2751. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2752. PCI_VENDOR_ID_MAINPINE, 0x2400,
  2753. 0, 0, pbn_b0_4_115200 },
  2754. { /* RockForceF4 */
  2755. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2756. PCI_VENDOR_ID_MAINPINE, 0x2500,
  2757. 0, 0, pbn_b0_4_115200 },
  2758. { /* RockForceD8 */
  2759. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2760. PCI_VENDOR_ID_MAINPINE, 0x2600,
  2761. 0, 0, pbn_b0_8_115200 },
  2762. { /* RockForceF8 */
  2763. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2764. PCI_VENDOR_ID_MAINPINE, 0x2700,
  2765. 0, 0, pbn_b0_8_115200 },
  2766. { /* IQ Express D1 */
  2767. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2768. PCI_VENDOR_ID_MAINPINE, 0x3000,
  2769. 0, 0, pbn_b0_1_115200 },
  2770. { /* IQ Express F1 */
  2771. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2772. PCI_VENDOR_ID_MAINPINE, 0x3100,
  2773. 0, 0, pbn_b0_1_115200 },
  2774. { /* IQ Express D2 */
  2775. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2776. PCI_VENDOR_ID_MAINPINE, 0x3200,
  2777. 0, 0, pbn_b0_2_115200 },
  2778. { /* IQ Express F2 */
  2779. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2780. PCI_VENDOR_ID_MAINPINE, 0x3300,
  2781. 0, 0, pbn_b0_2_115200 },
  2782. { /* IQ Express D4 */
  2783. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2784. PCI_VENDOR_ID_MAINPINE, 0x3400,
  2785. 0, 0, pbn_b0_4_115200 },
  2786. { /* IQ Express F4 */
  2787. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2788. PCI_VENDOR_ID_MAINPINE, 0x3500,
  2789. 0, 0, pbn_b0_4_115200 },
  2790. { /* IQ Express D8 */
  2791. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2792. PCI_VENDOR_ID_MAINPINE, 0x3C00,
  2793. 0, 0, pbn_b0_8_115200 },
  2794. { /* IQ Express F8 */
  2795. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2796. PCI_VENDOR_ID_MAINPINE, 0x3D00,
  2797. 0, 0, pbn_b0_8_115200 },
  2798. /*
  2799. * PA Semi PA6T-1682M on-chip UART
  2800. */
  2801. { PCI_VENDOR_ID_PASEMI, 0xa004,
  2802. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2803. pbn_pasemi_1682M },
  2804. /*
  2805. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  2806. */
  2807. { PCI_VENDOR_ID_ADDIDATA,
  2808. PCI_DEVICE_ID_ADDIDATA_APCI7500,
  2809. PCI_ANY_ID,
  2810. PCI_ANY_ID,
  2811. 0,
  2812. 0,
  2813. pbn_b0_4_115200 },
  2814. { PCI_VENDOR_ID_ADDIDATA,
  2815. PCI_DEVICE_ID_ADDIDATA_APCI7420,
  2816. PCI_ANY_ID,
  2817. PCI_ANY_ID,
  2818. 0,
  2819. 0,
  2820. pbn_b0_2_115200 },
  2821. { PCI_VENDOR_ID_ADDIDATA,
  2822. PCI_DEVICE_ID_ADDIDATA_APCI7300,
  2823. PCI_ANY_ID,
  2824. PCI_ANY_ID,
  2825. 0,
  2826. 0,
  2827. pbn_b0_1_115200 },
  2828. { PCI_VENDOR_ID_ADDIDATA_OLD,
  2829. PCI_DEVICE_ID_ADDIDATA_APCI7800,
  2830. PCI_ANY_ID,
  2831. PCI_ANY_ID,
  2832. 0,
  2833. 0,
  2834. pbn_b1_8_115200 },
  2835. { PCI_VENDOR_ID_ADDIDATA,
  2836. PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
  2837. PCI_ANY_ID,
  2838. PCI_ANY_ID,
  2839. 0,
  2840. 0,
  2841. pbn_b0_4_115200 },
  2842. { PCI_VENDOR_ID_ADDIDATA,
  2843. PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
  2844. PCI_ANY_ID,
  2845. PCI_ANY_ID,
  2846. 0,
  2847. 0,
  2848. pbn_b0_2_115200 },
  2849. { PCI_VENDOR_ID_ADDIDATA,
  2850. PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
  2851. PCI_ANY_ID,
  2852. PCI_ANY_ID,
  2853. 0,
  2854. 0,
  2855. pbn_b0_1_115200 },
  2856. { PCI_VENDOR_ID_ADDIDATA,
  2857. PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
  2858. PCI_ANY_ID,
  2859. PCI_ANY_ID,
  2860. 0,
  2861. 0,
  2862. pbn_b0_4_115200 },
  2863. { PCI_VENDOR_ID_ADDIDATA,
  2864. PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
  2865. PCI_ANY_ID,
  2866. PCI_ANY_ID,
  2867. 0,
  2868. 0,
  2869. pbn_b0_2_115200 },
  2870. { PCI_VENDOR_ID_ADDIDATA,
  2871. PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
  2872. PCI_ANY_ID,
  2873. PCI_ANY_ID,
  2874. 0,
  2875. 0,
  2876. pbn_b0_1_115200 },
  2877. { PCI_VENDOR_ID_ADDIDATA,
  2878. PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
  2879. PCI_ANY_ID,
  2880. PCI_ANY_ID,
  2881. 0,
  2882. 0,
  2883. pbn_b0_8_115200 },
  2884. { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
  2885. PCI_VENDOR_ID_IBM, 0x0299,
  2886. 0, 0, pbn_b0_bt_2_115200 },
  2887. /*
  2888. * These entries match devices with class COMMUNICATION_SERIAL,
  2889. * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
  2890. */
  2891. { PCI_ANY_ID, PCI_ANY_ID,
  2892. PCI_ANY_ID, PCI_ANY_ID,
  2893. PCI_CLASS_COMMUNICATION_SERIAL << 8,
  2894. 0xffff00, pbn_default },
  2895. { PCI_ANY_ID, PCI_ANY_ID,
  2896. PCI_ANY_ID, PCI_ANY_ID,
  2897. PCI_CLASS_COMMUNICATION_MODEM << 8,
  2898. 0xffff00, pbn_default },
  2899. { PCI_ANY_ID, PCI_ANY_ID,
  2900. PCI_ANY_ID, PCI_ANY_ID,
  2901. PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
  2902. 0xffff00, pbn_default },
  2903. { 0, }
  2904. };
  2905. static struct pci_driver serial_pci_driver = {
  2906. .name = "serial",
  2907. .probe = pciserial_init_one,
  2908. .remove = __devexit_p(pciserial_remove_one),
  2909. #ifdef CONFIG_PM
  2910. .suspend = pciserial_suspend_one,
  2911. .resume = pciserial_resume_one,
  2912. #endif
  2913. .id_table = serial_pci_tbl,
  2914. };
  2915. static int __init serial8250_pci_init(void)
  2916. {
  2917. return pci_register_driver(&serial_pci_driver);
  2918. }
  2919. static void __exit serial8250_pci_exit(void)
  2920. {
  2921. pci_unregister_driver(&serial_pci_driver);
  2922. }
  2923. module_init(serial8250_pci_init);
  2924. module_exit(serial8250_pci_exit);
  2925. MODULE_LICENSE("GPL");
  2926. MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
  2927. MODULE_DEVICE_TABLE(pci, serial_pci_tbl);