8250_pci.c 86 KB

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