8250_pci.c 80 KB

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