pata_hpt37x.c 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. /*
  2. * Libata driver for the highpoint 37x and 30x UDMA66 ATA controllers.
  3. *
  4. * This driver is heavily based upon:
  5. *
  6. * linux/drivers/ide/pci/hpt366.c Version 0.36 April 25, 2003
  7. *
  8. * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
  9. * Portions Copyright (C) 2001 Sun Microsystems, Inc.
  10. * Portions Copyright (C) 2003 Red Hat Inc
  11. * Portions Copyright (C) 2005-2006 MontaVista Software, Inc.
  12. *
  13. * TODO
  14. * PLL mode
  15. * Look into engine reset on timeout errors. Should not be
  16. * required.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/module.h>
  20. #include <linux/pci.h>
  21. #include <linux/init.h>
  22. #include <linux/blkdev.h>
  23. #include <linux/delay.h>
  24. #include <scsi/scsi_host.h>
  25. #include <linux/libata.h>
  26. #define DRV_NAME "pata_hpt37x"
  27. #define DRV_VERSION "0.6.5"
  28. struct hpt_clock {
  29. u8 xfer_speed;
  30. u32 timing;
  31. };
  32. struct hpt_chip {
  33. const char *name;
  34. unsigned int base;
  35. struct hpt_clock const *clocks[4];
  36. };
  37. /* key for bus clock timings
  38. * bit
  39. * 0:3 data_high_time. inactive time of DIOW_/DIOR_ for PIO and MW
  40. * DMA. cycles = value + 1
  41. * 4:8 data_low_time. active time of DIOW_/DIOR_ for PIO and MW
  42. * DMA. cycles = value + 1
  43. * 9:12 cmd_high_time. inactive time of DIOW_/DIOR_ during task file
  44. * register access.
  45. * 13:17 cmd_low_time. active time of DIOW_/DIOR_ during task file
  46. * register access.
  47. * 18:21 udma_cycle_time. clock freq and clock cycles for UDMA xfer.
  48. * during task file register access.
  49. * 22:24 pre_high_time. time to initialize 1st cycle for PIO and MW DMA
  50. * xfer.
  51. * 25:27 cmd_pre_high_time. time to initialize 1st PIO cycle for task
  52. * register access.
  53. * 28 UDMA enable
  54. * 29 DMA enable
  55. * 30 PIO_MST enable. if set, the chip is in bus master mode during
  56. * PIO.
  57. * 31 FIFO enable.
  58. */
  59. static struct hpt_clock hpt37x_timings_33[] = {
  60. { XFER_UDMA_6, 0x12446231 }, /* 0x12646231 ?? */
  61. { XFER_UDMA_5, 0x12446231 },
  62. { XFER_UDMA_4, 0x12446231 },
  63. { XFER_UDMA_3, 0x126c6231 },
  64. { XFER_UDMA_2, 0x12486231 },
  65. { XFER_UDMA_1, 0x124c6233 },
  66. { XFER_UDMA_0, 0x12506297 },
  67. { XFER_MW_DMA_2, 0x22406c31 },
  68. { XFER_MW_DMA_1, 0x22406c33 },
  69. { XFER_MW_DMA_0, 0x22406c97 },
  70. { XFER_PIO_4, 0x06414e31 },
  71. { XFER_PIO_3, 0x06414e42 },
  72. { XFER_PIO_2, 0x06414e53 },
  73. { XFER_PIO_1, 0x06814e93 },
  74. { XFER_PIO_0, 0x06814ea7 }
  75. };
  76. static struct hpt_clock hpt37x_timings_50[] = {
  77. { XFER_UDMA_6, 0x12848242 },
  78. { XFER_UDMA_5, 0x12848242 },
  79. { XFER_UDMA_4, 0x12ac8242 },
  80. { XFER_UDMA_3, 0x128c8242 },
  81. { XFER_UDMA_2, 0x120c8242 },
  82. { XFER_UDMA_1, 0x12148254 },
  83. { XFER_UDMA_0, 0x121882ea },
  84. { XFER_MW_DMA_2, 0x22808242 },
  85. { XFER_MW_DMA_1, 0x22808254 },
  86. { XFER_MW_DMA_0, 0x228082ea },
  87. { XFER_PIO_4, 0x0a81f442 },
  88. { XFER_PIO_3, 0x0a81f443 },
  89. { XFER_PIO_2, 0x0a81f454 },
  90. { XFER_PIO_1, 0x0ac1f465 },
  91. { XFER_PIO_0, 0x0ac1f48a }
  92. };
  93. static struct hpt_clock hpt37x_timings_66[] = {
  94. { XFER_UDMA_6, 0x1c869c62 },
  95. { XFER_UDMA_5, 0x1cae9c62 }, /* 0x1c8a9c62 */
  96. { XFER_UDMA_4, 0x1c8a9c62 },
  97. { XFER_UDMA_3, 0x1c8e9c62 },
  98. { XFER_UDMA_2, 0x1c929c62 },
  99. { XFER_UDMA_1, 0x1c9a9c62 },
  100. { XFER_UDMA_0, 0x1c829c62 },
  101. { XFER_MW_DMA_2, 0x2c829c62 },
  102. { XFER_MW_DMA_1, 0x2c829c66 },
  103. { XFER_MW_DMA_0, 0x2c829d2e },
  104. { XFER_PIO_4, 0x0c829c62 },
  105. { XFER_PIO_3, 0x0c829c84 },
  106. { XFER_PIO_2, 0x0c829ca6 },
  107. { XFER_PIO_1, 0x0d029d26 },
  108. { XFER_PIO_0, 0x0d029d5e }
  109. };
  110. static const struct hpt_chip hpt370 = {
  111. "HPT370",
  112. 48,
  113. {
  114. hpt37x_timings_33,
  115. NULL,
  116. NULL,
  117. NULL
  118. }
  119. };
  120. static const struct hpt_chip hpt370a = {
  121. "HPT370A",
  122. 48,
  123. {
  124. hpt37x_timings_33,
  125. NULL,
  126. hpt37x_timings_50,
  127. NULL
  128. }
  129. };
  130. static const struct hpt_chip hpt372 = {
  131. "HPT372",
  132. 55,
  133. {
  134. hpt37x_timings_33,
  135. NULL,
  136. hpt37x_timings_50,
  137. hpt37x_timings_66
  138. }
  139. };
  140. static const struct hpt_chip hpt302 = {
  141. "HPT302",
  142. 66,
  143. {
  144. hpt37x_timings_33,
  145. NULL,
  146. hpt37x_timings_50,
  147. hpt37x_timings_66
  148. }
  149. };
  150. static const struct hpt_chip hpt371 = {
  151. "HPT371",
  152. 66,
  153. {
  154. hpt37x_timings_33,
  155. NULL,
  156. hpt37x_timings_50,
  157. hpt37x_timings_66
  158. }
  159. };
  160. static const struct hpt_chip hpt372a = {
  161. "HPT372A",
  162. 66,
  163. {
  164. hpt37x_timings_33,
  165. NULL,
  166. hpt37x_timings_50,
  167. hpt37x_timings_66
  168. }
  169. };
  170. static const struct hpt_chip hpt374 = {
  171. "HPT374",
  172. 48,
  173. {
  174. hpt37x_timings_33,
  175. NULL,
  176. NULL,
  177. NULL
  178. }
  179. };
  180. /**
  181. * hpt37x_find_mode - reset the hpt37x bus
  182. * @ap: ATA port
  183. * @speed: transfer mode
  184. *
  185. * Return the 32bit register programming information for this channel
  186. * that matches the speed provided.
  187. */
  188. static u32 hpt37x_find_mode(struct ata_port *ap, int speed)
  189. {
  190. struct hpt_clock *clocks = ap->host->private_data;
  191. while(clocks->xfer_speed) {
  192. if (clocks->xfer_speed == speed)
  193. return clocks->timing;
  194. clocks++;
  195. }
  196. BUG();
  197. return 0xffffffffU; /* silence compiler warning */
  198. }
  199. static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[])
  200. {
  201. unsigned char model_num[ATA_ID_PROD_LEN + 1];
  202. int i = 0;
  203. ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num));
  204. while (list[i] != NULL) {
  205. if (!strcmp(list[i], model_num)) {
  206. printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n",
  207. modestr, list[i]);
  208. return 1;
  209. }
  210. i++;
  211. }
  212. return 0;
  213. }
  214. static const char *bad_ata33[] = {
  215. "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2",
  216. "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2",
  217. "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4",
  218. "Maxtor 90510D4",
  219. "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2",
  220. "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4",
  221. "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2",
  222. NULL
  223. };
  224. static const char *bad_ata100_5[] = {
  225. "IBM-DTLA-307075",
  226. "IBM-DTLA-307060",
  227. "IBM-DTLA-307045",
  228. "IBM-DTLA-307030",
  229. "IBM-DTLA-307020",
  230. "IBM-DTLA-307015",
  231. "IBM-DTLA-305040",
  232. "IBM-DTLA-305030",
  233. "IBM-DTLA-305020",
  234. "IC35L010AVER07-0",
  235. "IC35L020AVER07-0",
  236. "IC35L030AVER07-0",
  237. "IC35L040AVER07-0",
  238. "IC35L060AVER07-0",
  239. "WDC AC310200R",
  240. NULL
  241. };
  242. /**
  243. * hpt370_filter - mode selection filter
  244. * @adev: ATA device
  245. *
  246. * Block UDMA on devices that cause trouble with this controller.
  247. */
  248. static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
  249. {
  250. if (adev->class == ATA_DEV_ATA) {
  251. if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
  252. mask &= ~ATA_MASK_UDMA;
  253. if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
  254. mask &= ~(0x1F << ATA_SHIFT_UDMA);
  255. }
  256. return ata_pci_default_filter(adev, mask);
  257. }
  258. /**
  259. * hpt370a_filter - mode selection filter
  260. * @adev: ATA device
  261. *
  262. * Block UDMA on devices that cause trouble with this controller.
  263. */
  264. static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
  265. {
  266. if (adev->class != ATA_DEV_ATA) {
  267. if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
  268. mask &= ~ (0x1F << ATA_SHIFT_UDMA);
  269. }
  270. return ata_pci_default_filter(adev, mask);
  271. }
  272. /**
  273. * hpt37x_pre_reset - reset the hpt37x bus
  274. * @ap: ATA port to reset
  275. * @deadline: deadline jiffies for the operation
  276. *
  277. * Perform the initial reset handling for the 370/372 and 374 func 0
  278. */
  279. static int hpt37x_pre_reset(struct ata_port *ap, unsigned long deadline)
  280. {
  281. u8 scr2, ata66;
  282. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  283. static const struct pci_bits hpt37x_enable_bits[] = {
  284. { 0x50, 1, 0x04, 0x04 },
  285. { 0x54, 1, 0x04, 0x04 }
  286. };
  287. if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
  288. return -ENOENT;
  289. pci_read_config_byte(pdev, 0x5B, &scr2);
  290. pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
  291. /* Cable register now active */
  292. pci_read_config_byte(pdev, 0x5A, &ata66);
  293. /* Restore state */
  294. pci_write_config_byte(pdev, 0x5B, scr2);
  295. if (ata66 & (1 << ap->port_no))
  296. ap->cbl = ATA_CBL_PATA40;
  297. else
  298. ap->cbl = ATA_CBL_PATA80;
  299. /* Reset the state machine */
  300. pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
  301. udelay(100);
  302. return ata_std_prereset(ap, deadline);
  303. }
  304. /**
  305. * hpt37x_error_handler - reset the hpt374
  306. * @ap: ATA port to reset
  307. *
  308. * Perform probe for HPT37x, except for HPT374 channel 2
  309. */
  310. static void hpt37x_error_handler(struct ata_port *ap)
  311. {
  312. ata_bmdma_drive_eh(ap, hpt37x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
  313. }
  314. static int hpt374_pre_reset(struct ata_port *ap, unsigned long deadline)
  315. {
  316. static const struct pci_bits hpt37x_enable_bits[] = {
  317. { 0x50, 1, 0x04, 0x04 },
  318. { 0x54, 1, 0x04, 0x04 }
  319. };
  320. u16 mcr3, mcr6;
  321. u8 ata66;
  322. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  323. if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no]))
  324. return -ENOENT;
  325. /* Do the extra channel work */
  326. pci_read_config_word(pdev, 0x52, &mcr3);
  327. pci_read_config_word(pdev, 0x56, &mcr6);
  328. /* Set bit 15 of 0x52 to enable TCBLID as input
  329. Set bit 15 of 0x56 to enable FCBLID as input
  330. */
  331. pci_write_config_word(pdev, 0x52, mcr3 | 0x8000);
  332. pci_write_config_word(pdev, 0x56, mcr6 | 0x8000);
  333. pci_read_config_byte(pdev, 0x5A, &ata66);
  334. /* Reset TCBLID/FCBLID to output */
  335. pci_write_config_word(pdev, 0x52, mcr3);
  336. pci_write_config_word(pdev, 0x56, mcr6);
  337. if (ata66 & (1 << ap->port_no))
  338. ap->cbl = ATA_CBL_PATA40;
  339. else
  340. ap->cbl = ATA_CBL_PATA80;
  341. /* Reset the state machine */
  342. pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
  343. udelay(100);
  344. return ata_std_prereset(ap, deadline);
  345. }
  346. /**
  347. * hpt374_error_handler - reset the hpt374
  348. * @classes:
  349. *
  350. * The 374 cable detect is a little different due to the extra
  351. * channels. The function 0 channels work like usual but function 1
  352. * is special
  353. */
  354. static void hpt374_error_handler(struct ata_port *ap)
  355. {
  356. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  357. if (!(PCI_FUNC(pdev->devfn) & 1))
  358. hpt37x_error_handler(ap);
  359. else
  360. ata_bmdma_drive_eh(ap, hpt374_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
  361. }
  362. /**
  363. * hpt370_set_piomode - PIO setup
  364. * @ap: ATA interface
  365. * @adev: device on the interface
  366. *
  367. * Perform PIO mode setup.
  368. */
  369. static void hpt370_set_piomode(struct ata_port *ap, struct ata_device *adev)
  370. {
  371. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  372. u32 addr1, addr2;
  373. u32 reg;
  374. u32 mode;
  375. u8 fast;
  376. addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
  377. addr2 = 0x51 + 4 * ap->port_no;
  378. /* Fast interrupt prediction disable, hold off interrupt disable */
  379. pci_read_config_byte(pdev, addr2, &fast);
  380. fast &= ~0x02;
  381. fast |= 0x01;
  382. pci_write_config_byte(pdev, addr2, fast);
  383. pci_read_config_dword(pdev, addr1, &reg);
  384. mode = hpt37x_find_mode(ap, adev->pio_mode);
  385. mode &= ~0x8000000; /* No FIFO in PIO */
  386. mode &= ~0x30070000; /* Leave config bits alone */
  387. reg &= 0x30070000; /* Strip timing bits */
  388. pci_write_config_dword(pdev, addr1, reg | mode);
  389. }
  390. /**
  391. * hpt370_set_dmamode - DMA timing setup
  392. * @ap: ATA interface
  393. * @adev: Device being configured
  394. *
  395. * Set up the channel for MWDMA or UDMA modes. Much the same as with
  396. * PIO, load the mode number and then set MWDMA or UDMA flag.
  397. */
  398. static void hpt370_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  399. {
  400. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  401. u32 addr1, addr2;
  402. u32 reg;
  403. u32 mode;
  404. u8 fast;
  405. addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
  406. addr2 = 0x51 + 4 * ap->port_no;
  407. /* Fast interrupt prediction disable, hold off interrupt disable */
  408. pci_read_config_byte(pdev, addr2, &fast);
  409. fast &= ~0x02;
  410. fast |= 0x01;
  411. pci_write_config_byte(pdev, addr2, fast);
  412. pci_read_config_dword(pdev, addr1, &reg);
  413. mode = hpt37x_find_mode(ap, adev->dma_mode);
  414. mode |= 0x8000000; /* FIFO in MWDMA or UDMA */
  415. mode &= ~0xC0000000; /* Leave config bits alone */
  416. reg &= 0xC0000000; /* Strip timing bits */
  417. pci_write_config_dword(pdev, addr1, reg | mode);
  418. }
  419. /**
  420. * hpt370_bmdma_start - DMA engine begin
  421. * @qc: ATA command
  422. *
  423. * The 370 and 370A want us to reset the DMA engine each time we
  424. * use it. The 372 and later are fine.
  425. */
  426. static void hpt370_bmdma_start(struct ata_queued_cmd *qc)
  427. {
  428. struct ata_port *ap = qc->ap;
  429. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  430. pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
  431. udelay(10);
  432. ata_bmdma_start(qc);
  433. }
  434. /**
  435. * hpt370_bmdma_end - DMA engine stop
  436. * @qc: ATA command
  437. *
  438. * Work around the HPT370 DMA engine.
  439. */
  440. static void hpt370_bmdma_stop(struct ata_queued_cmd *qc)
  441. {
  442. struct ata_port *ap = qc->ap;
  443. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  444. u8 dma_stat = ioread8(ap->ioaddr.bmdma_addr + 2);
  445. u8 dma_cmd;
  446. void __iomem *bmdma = ap->ioaddr.bmdma_addr;
  447. if (dma_stat & 0x01) {
  448. udelay(20);
  449. dma_stat = ioread8(bmdma + 2);
  450. }
  451. if (dma_stat & 0x01) {
  452. /* Clear the engine */
  453. pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
  454. udelay(10);
  455. /* Stop DMA */
  456. dma_cmd = ioread8(bmdma );
  457. iowrite8(dma_cmd & 0xFE, bmdma);
  458. /* Clear Error */
  459. dma_stat = ioread8(bmdma + 2);
  460. iowrite8(dma_stat | 0x06 , bmdma + 2);
  461. /* Clear the engine */
  462. pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37);
  463. udelay(10);
  464. }
  465. ata_bmdma_stop(qc);
  466. }
  467. /**
  468. * hpt372_set_piomode - PIO setup
  469. * @ap: ATA interface
  470. * @adev: device on the interface
  471. *
  472. * Perform PIO mode setup.
  473. */
  474. static void hpt372_set_piomode(struct ata_port *ap, struct ata_device *adev)
  475. {
  476. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  477. u32 addr1, addr2;
  478. u32 reg;
  479. u32 mode;
  480. u8 fast;
  481. addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
  482. addr2 = 0x51 + 4 * ap->port_no;
  483. /* Fast interrupt prediction disable, hold off interrupt disable */
  484. pci_read_config_byte(pdev, addr2, &fast);
  485. fast &= ~0x07;
  486. pci_write_config_byte(pdev, addr2, fast);
  487. pci_read_config_dword(pdev, addr1, &reg);
  488. mode = hpt37x_find_mode(ap, adev->pio_mode);
  489. printk("Find mode for %d reports %X\n", adev->pio_mode, mode);
  490. mode &= ~0x80000000; /* No FIFO in PIO */
  491. mode &= ~0x30070000; /* Leave config bits alone */
  492. reg &= 0x30070000; /* Strip timing bits */
  493. pci_write_config_dword(pdev, addr1, reg | mode);
  494. }
  495. /**
  496. * hpt372_set_dmamode - DMA timing setup
  497. * @ap: ATA interface
  498. * @adev: Device being configured
  499. *
  500. * Set up the channel for MWDMA or UDMA modes. Much the same as with
  501. * PIO, load the mode number and then set MWDMA or UDMA flag.
  502. */
  503. static void hpt372_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  504. {
  505. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  506. u32 addr1, addr2;
  507. u32 reg;
  508. u32 mode;
  509. u8 fast;
  510. addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
  511. addr2 = 0x51 + 4 * ap->port_no;
  512. /* Fast interrupt prediction disable, hold off interrupt disable */
  513. pci_read_config_byte(pdev, addr2, &fast);
  514. fast &= ~0x07;
  515. pci_write_config_byte(pdev, addr2, fast);
  516. pci_read_config_dword(pdev, addr1, &reg);
  517. mode = hpt37x_find_mode(ap, adev->dma_mode);
  518. printk("Find mode for DMA %d reports %X\n", adev->dma_mode, mode);
  519. mode &= ~0xC0000000; /* Leave config bits alone */
  520. mode |= 0x80000000; /* FIFO in MWDMA or UDMA */
  521. reg &= 0xC0000000; /* Strip timing bits */
  522. pci_write_config_dword(pdev, addr1, reg | mode);
  523. }
  524. /**
  525. * hpt37x_bmdma_end - DMA engine stop
  526. * @qc: ATA command
  527. *
  528. * Clean up after the HPT372 and later DMA engine
  529. */
  530. static void hpt37x_bmdma_stop(struct ata_queued_cmd *qc)
  531. {
  532. struct ata_port *ap = qc->ap;
  533. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  534. int mscreg = 0x50 + 4 * ap->port_no;
  535. u8 bwsr_stat, msc_stat;
  536. pci_read_config_byte(pdev, 0x6A, &bwsr_stat);
  537. pci_read_config_byte(pdev, mscreg, &msc_stat);
  538. if (bwsr_stat & (1 << ap->port_no))
  539. pci_write_config_byte(pdev, mscreg, msc_stat | 0x30);
  540. ata_bmdma_stop(qc);
  541. }
  542. static struct scsi_host_template hpt37x_sht = {
  543. .module = THIS_MODULE,
  544. .name = DRV_NAME,
  545. .ioctl = ata_scsi_ioctl,
  546. .queuecommand = ata_scsi_queuecmd,
  547. .can_queue = ATA_DEF_QUEUE,
  548. .this_id = ATA_SHT_THIS_ID,
  549. .sg_tablesize = LIBATA_MAX_PRD,
  550. .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
  551. .emulated = ATA_SHT_EMULATED,
  552. .use_clustering = ATA_SHT_USE_CLUSTERING,
  553. .proc_name = DRV_NAME,
  554. .dma_boundary = ATA_DMA_BOUNDARY,
  555. .slave_configure = ata_scsi_slave_config,
  556. .slave_destroy = ata_scsi_slave_destroy,
  557. .bios_param = ata_std_bios_param,
  558. };
  559. /*
  560. * Configuration for HPT370
  561. */
  562. static struct ata_port_operations hpt370_port_ops = {
  563. .port_disable = ata_port_disable,
  564. .set_piomode = hpt370_set_piomode,
  565. .set_dmamode = hpt370_set_dmamode,
  566. .mode_filter = hpt370_filter,
  567. .tf_load = ata_tf_load,
  568. .tf_read = ata_tf_read,
  569. .check_status = ata_check_status,
  570. .exec_command = ata_exec_command,
  571. .dev_select = ata_std_dev_select,
  572. .freeze = ata_bmdma_freeze,
  573. .thaw = ata_bmdma_thaw,
  574. .error_handler = hpt37x_error_handler,
  575. .post_internal_cmd = ata_bmdma_post_internal_cmd,
  576. .bmdma_setup = ata_bmdma_setup,
  577. .bmdma_start = hpt370_bmdma_start,
  578. .bmdma_stop = hpt370_bmdma_stop,
  579. .bmdma_status = ata_bmdma_status,
  580. .qc_prep = ata_qc_prep,
  581. .qc_issue = ata_qc_issue_prot,
  582. .data_xfer = ata_data_xfer,
  583. .irq_handler = ata_interrupt,
  584. .irq_clear = ata_bmdma_irq_clear,
  585. .irq_on = ata_irq_on,
  586. .irq_ack = ata_irq_ack,
  587. .port_start = ata_port_start,
  588. };
  589. /*
  590. * Configuration for HPT370A. Close to 370 but less filters
  591. */
  592. static struct ata_port_operations hpt370a_port_ops = {
  593. .port_disable = ata_port_disable,
  594. .set_piomode = hpt370_set_piomode,
  595. .set_dmamode = hpt370_set_dmamode,
  596. .mode_filter = hpt370a_filter,
  597. .tf_load = ata_tf_load,
  598. .tf_read = ata_tf_read,
  599. .check_status = ata_check_status,
  600. .exec_command = ata_exec_command,
  601. .dev_select = ata_std_dev_select,
  602. .freeze = ata_bmdma_freeze,
  603. .thaw = ata_bmdma_thaw,
  604. .error_handler = hpt37x_error_handler,
  605. .post_internal_cmd = ata_bmdma_post_internal_cmd,
  606. .bmdma_setup = ata_bmdma_setup,
  607. .bmdma_start = hpt370_bmdma_start,
  608. .bmdma_stop = hpt370_bmdma_stop,
  609. .bmdma_status = ata_bmdma_status,
  610. .qc_prep = ata_qc_prep,
  611. .qc_issue = ata_qc_issue_prot,
  612. .data_xfer = ata_data_xfer,
  613. .irq_handler = ata_interrupt,
  614. .irq_clear = ata_bmdma_irq_clear,
  615. .irq_on = ata_irq_on,
  616. .irq_ack = ata_irq_ack,
  617. .port_start = ata_port_start,
  618. };
  619. /*
  620. * Configuration for HPT372, HPT371, HPT302. Slightly different PIO
  621. * and DMA mode setting functionality.
  622. */
  623. static struct ata_port_operations hpt372_port_ops = {
  624. .port_disable = ata_port_disable,
  625. .set_piomode = hpt372_set_piomode,
  626. .set_dmamode = hpt372_set_dmamode,
  627. .mode_filter = ata_pci_default_filter,
  628. .tf_load = ata_tf_load,
  629. .tf_read = ata_tf_read,
  630. .check_status = ata_check_status,
  631. .exec_command = ata_exec_command,
  632. .dev_select = ata_std_dev_select,
  633. .freeze = ata_bmdma_freeze,
  634. .thaw = ata_bmdma_thaw,
  635. .error_handler = hpt37x_error_handler,
  636. .post_internal_cmd = ata_bmdma_post_internal_cmd,
  637. .bmdma_setup = ata_bmdma_setup,
  638. .bmdma_start = ata_bmdma_start,
  639. .bmdma_stop = hpt37x_bmdma_stop,
  640. .bmdma_status = ata_bmdma_status,
  641. .qc_prep = ata_qc_prep,
  642. .qc_issue = ata_qc_issue_prot,
  643. .data_xfer = ata_data_xfer,
  644. .irq_handler = ata_interrupt,
  645. .irq_clear = ata_bmdma_irq_clear,
  646. .irq_on = ata_irq_on,
  647. .irq_ack = ata_irq_ack,
  648. .port_start = ata_port_start,
  649. };
  650. /*
  651. * Configuration for HPT374. Mode setting works like 372 and friends
  652. * but we have a different cable detection procedure.
  653. */
  654. static struct ata_port_operations hpt374_port_ops = {
  655. .port_disable = ata_port_disable,
  656. .set_piomode = hpt372_set_piomode,
  657. .set_dmamode = hpt372_set_dmamode,
  658. .mode_filter = ata_pci_default_filter,
  659. .tf_load = ata_tf_load,
  660. .tf_read = ata_tf_read,
  661. .check_status = ata_check_status,
  662. .exec_command = ata_exec_command,
  663. .dev_select = ata_std_dev_select,
  664. .freeze = ata_bmdma_freeze,
  665. .thaw = ata_bmdma_thaw,
  666. .error_handler = hpt374_error_handler,
  667. .post_internal_cmd = ata_bmdma_post_internal_cmd,
  668. .bmdma_setup = ata_bmdma_setup,
  669. .bmdma_start = ata_bmdma_start,
  670. .bmdma_stop = hpt37x_bmdma_stop,
  671. .bmdma_status = ata_bmdma_status,
  672. .qc_prep = ata_qc_prep,
  673. .qc_issue = ata_qc_issue_prot,
  674. .data_xfer = ata_data_xfer,
  675. .irq_handler = ata_interrupt,
  676. .irq_clear = ata_bmdma_irq_clear,
  677. .irq_on = ata_irq_on,
  678. .irq_ack = ata_irq_ack,
  679. .port_start = ata_port_start,
  680. };
  681. /**
  682. * htp37x_clock_slot - Turn timing to PC clock entry
  683. * @freq: Reported frequency timing
  684. * @base: Base timing
  685. *
  686. * Turn the timing data intoa clock slot (0 for 33, 1 for 40, 2 for 50
  687. * and 3 for 66Mhz)
  688. */
  689. static int hpt37x_clock_slot(unsigned int freq, unsigned int base)
  690. {
  691. unsigned int f = (base * freq) / 192; /* Mhz */
  692. if (f < 40)
  693. return 0; /* 33Mhz slot */
  694. if (f < 45)
  695. return 1; /* 40Mhz slot */
  696. if (f < 55)
  697. return 2; /* 50Mhz slot */
  698. return 3; /* 60Mhz slot */
  699. }
  700. /**
  701. * hpt37x_calibrate_dpll - Calibrate the DPLL loop
  702. * @dev: PCI device
  703. *
  704. * Perform a calibration cycle on the HPT37x DPLL. Returns 1 if this
  705. * succeeds
  706. */
  707. static int hpt37x_calibrate_dpll(struct pci_dev *dev)
  708. {
  709. u8 reg5b;
  710. u32 reg5c;
  711. int tries;
  712. for(tries = 0; tries < 0x5000; tries++) {
  713. udelay(50);
  714. pci_read_config_byte(dev, 0x5b, &reg5b);
  715. if (reg5b & 0x80) {
  716. /* See if it stays set */
  717. for(tries = 0; tries < 0x1000; tries ++) {
  718. pci_read_config_byte(dev, 0x5b, &reg5b);
  719. /* Failed ? */
  720. if ((reg5b & 0x80) == 0)
  721. return 0;
  722. }
  723. /* Turn off tuning, we have the DPLL set */
  724. pci_read_config_dword(dev, 0x5c, &reg5c);
  725. pci_write_config_dword(dev, 0x5c, reg5c & ~ 0x100);
  726. return 1;
  727. }
  728. }
  729. /* Never went stable */
  730. return 0;
  731. }
  732. /**
  733. * hpt37x_init_one - Initialise an HPT37X/302
  734. * @dev: PCI device
  735. * @id: Entry in match table
  736. *
  737. * Initialise an HPT37x device. There are some interesting complications
  738. * here. Firstly the chip may report 366 and be one of several variants.
  739. * Secondly all the timings depend on the clock for the chip which we must
  740. * detect and look up
  741. *
  742. * This is the known chip mappings. It may be missing a couple of later
  743. * releases.
  744. *
  745. * Chip version PCI Rev Notes
  746. * HPT366 4 (HPT366) 0 Other driver
  747. * HPT366 4 (HPT366) 1 Other driver
  748. * HPT368 4 (HPT366) 2 Other driver
  749. * HPT370 4 (HPT366) 3 UDMA100
  750. * HPT370A 4 (HPT366) 4 UDMA100
  751. * HPT372 4 (HPT366) 5 UDMA133 (1)
  752. * HPT372N 4 (HPT366) 6 Other driver
  753. * HPT372A 5 (HPT372) 1 UDMA133 (1)
  754. * HPT372N 5 (HPT372) 2 Other driver
  755. * HPT302 6 (HPT302) 1 UDMA133
  756. * HPT302N 6 (HPT302) 2 Other driver
  757. * HPT371 7 (HPT371) * UDMA133
  758. * HPT374 8 (HPT374) * UDMA133 4 channel
  759. * HPT372N 9 (HPT372N) * Other driver
  760. *
  761. * (1) UDMA133 support depends on the bus clock
  762. */
  763. static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
  764. {
  765. /* HPT370 - UDMA100 */
  766. static const struct ata_port_info info_hpt370 = {
  767. .sht = &hpt37x_sht,
  768. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  769. .pio_mask = 0x1f,
  770. .mwdma_mask = 0x07,
  771. .udma_mask = 0x3f,
  772. .port_ops = &hpt370_port_ops
  773. };
  774. /* HPT370A - UDMA100 */
  775. static const struct ata_port_info info_hpt370a = {
  776. .sht = &hpt37x_sht,
  777. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  778. .pio_mask = 0x1f,
  779. .mwdma_mask = 0x07,
  780. .udma_mask = 0x3f,
  781. .port_ops = &hpt370a_port_ops
  782. };
  783. /* HPT370 - UDMA100 */
  784. static const struct ata_port_info info_hpt370_33 = {
  785. .sht = &hpt37x_sht,
  786. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  787. .pio_mask = 0x1f,
  788. .mwdma_mask = 0x07,
  789. .udma_mask = 0x0f,
  790. .port_ops = &hpt370_port_ops
  791. };
  792. /* HPT370A - UDMA100 */
  793. static const struct ata_port_info info_hpt370a_33 = {
  794. .sht = &hpt37x_sht,
  795. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  796. .pio_mask = 0x1f,
  797. .mwdma_mask = 0x07,
  798. .udma_mask = 0x0f,
  799. .port_ops = &hpt370a_port_ops
  800. };
  801. /* HPT371, 372 and friends - UDMA133 */
  802. static const struct ata_port_info info_hpt372 = {
  803. .sht = &hpt37x_sht,
  804. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  805. .pio_mask = 0x1f,
  806. .mwdma_mask = 0x07,
  807. .udma_mask = 0x7f,
  808. .port_ops = &hpt372_port_ops
  809. };
  810. /* HPT371, 372 and friends - UDMA100 at 50MHz clock */
  811. static const struct ata_port_info info_hpt372_50 = {
  812. .sht = &hpt37x_sht,
  813. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  814. .pio_mask = 0x1f,
  815. .mwdma_mask = 0x07,
  816. .udma_mask = 0x3f,
  817. .port_ops = &hpt372_port_ops
  818. };
  819. /* HPT374 - UDMA133 */
  820. static const struct ata_port_info info_hpt374 = {
  821. .sht = &hpt37x_sht,
  822. .flags = ATA_FLAG_SLAVE_POSS|ATA_FLAG_SRST,
  823. .pio_mask = 0x1f,
  824. .mwdma_mask = 0x07,
  825. .udma_mask = 0x7f,
  826. .port_ops = &hpt374_port_ops
  827. };
  828. static const int MHz[4] = { 33, 40, 50, 66 };
  829. const struct ata_port_info *port;
  830. void *private_data = NULL;
  831. struct ata_port_info port_info;
  832. const struct ata_port_info *ppi[] = { &port_info, NULL };
  833. u8 irqmask;
  834. u32 class_rev;
  835. u8 mcr1;
  836. u32 freq;
  837. int prefer_dpll = 1;
  838. unsigned long iobase = pci_resource_start(dev, 4);
  839. const struct hpt_chip *chip_table;
  840. int clock_slot;
  841. pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
  842. class_rev &= 0xFF;
  843. if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
  844. /* May be a later chip in disguise. Check */
  845. /* Older chips are in the HPT366 driver. Ignore them */
  846. if (class_rev < 3)
  847. return -ENODEV;
  848. /* N series chips have their own driver. Ignore */
  849. if (class_rev == 6)
  850. return -ENODEV;
  851. switch(class_rev) {
  852. case 3:
  853. port = &info_hpt370;
  854. chip_table = &hpt370;
  855. prefer_dpll = 0;
  856. break;
  857. case 4:
  858. port = &info_hpt370a;
  859. chip_table = &hpt370a;
  860. prefer_dpll = 0;
  861. break;
  862. case 5:
  863. port = &info_hpt372;
  864. chip_table = &hpt372;
  865. break;
  866. default:
  867. printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype please report (%d).\n", class_rev);
  868. return -ENODEV;
  869. }
  870. } else {
  871. switch(dev->device) {
  872. case PCI_DEVICE_ID_TTI_HPT372:
  873. /* 372N if rev >= 2*/
  874. if (class_rev >= 2)
  875. return -ENODEV;
  876. port = &info_hpt372;
  877. chip_table = &hpt372a;
  878. break;
  879. case PCI_DEVICE_ID_TTI_HPT302:
  880. /* 302N if rev > 1 */
  881. if (class_rev > 1)
  882. return -ENODEV;
  883. port = &info_hpt372;
  884. /* Check this */
  885. chip_table = &hpt302;
  886. break;
  887. case PCI_DEVICE_ID_TTI_HPT371:
  888. if (class_rev > 1)
  889. return -ENODEV;
  890. port = &info_hpt372;
  891. chip_table = &hpt371;
  892. /* Single channel device, master is not present
  893. but the BIOS (or us for non x86) must mark it
  894. absent */
  895. pci_read_config_byte(dev, 0x50, &mcr1);
  896. mcr1 &= ~0x04;
  897. pci_write_config_byte(dev, 0x50, mcr1);
  898. break;
  899. case PCI_DEVICE_ID_TTI_HPT374:
  900. chip_table = &hpt374;
  901. port = &info_hpt374;
  902. break;
  903. default:
  904. printk(KERN_ERR "pata_hpt37x: PCI table is bogus please report (%d).\n", dev->device);
  905. return -ENODEV;
  906. }
  907. }
  908. /* Ok so this is a chip we support */
  909. pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
  910. pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78);
  911. pci_write_config_byte(dev, PCI_MIN_GNT, 0x08);
  912. pci_write_config_byte(dev, PCI_MAX_LAT, 0x08);
  913. pci_read_config_byte(dev, 0x5A, &irqmask);
  914. irqmask &= ~0x10;
  915. pci_write_config_byte(dev, 0x5a, irqmask);
  916. /*
  917. * default to pci clock. make sure MA15/16 are set to output
  918. * to prevent drives having problems with 40-pin cables. Needed
  919. * for some drives such as IBM-DTLA which will not enter ready
  920. * state on reset when PDIAG is a input.
  921. */
  922. pci_write_config_byte(dev, 0x5b, 0x23);
  923. /*
  924. * HighPoint does this for HPT372A.
  925. * NOTE: This register is only writeable via I/O space.
  926. */
  927. if (chip_table == &hpt372a)
  928. outb(0x0e, iobase + 0x9c);
  929. /* Some devices do not let this value be accessed via PCI space
  930. according to the old driver */
  931. freq = inl(iobase + 0x90);
  932. if ((freq >> 12) != 0xABCDE) {
  933. int i;
  934. u8 sr;
  935. u32 total = 0;
  936. printk(KERN_WARNING "pata_hpt37x: BIOS has not set timing clocks.\n");
  937. /* This is the process the HPT371 BIOS is reported to use */
  938. for(i = 0; i < 128; i++) {
  939. pci_read_config_byte(dev, 0x78, &sr);
  940. total += sr & 0x1FF;
  941. udelay(15);
  942. }
  943. freq = total / 128;
  944. }
  945. freq &= 0x1FF;
  946. /*
  947. * Turn the frequency check into a band and then find a timing
  948. * table to match it.
  949. */
  950. clock_slot = hpt37x_clock_slot(freq, chip_table->base);
  951. if (chip_table->clocks[clock_slot] == NULL || prefer_dpll) {
  952. /*
  953. * We need to try PLL mode instead
  954. *
  955. * For non UDMA133 capable devices we should
  956. * use a 50MHz DPLL by choice
  957. */
  958. unsigned int f_low, f_high;
  959. int adjust;
  960. clock_slot = 2;
  961. if (port->udma_mask & 0xE0)
  962. clock_slot = 3;
  963. f_low = (MHz[clock_slot] * chip_table->base) / 192;
  964. f_high = f_low + 2;
  965. /* Select the DPLL clock. */
  966. pci_write_config_byte(dev, 0x5b, 0x21);
  967. for(adjust = 0; adjust < 8; adjust++) {
  968. if (hpt37x_calibrate_dpll(dev))
  969. break;
  970. /* See if it'll settle at a fractionally different clock */
  971. if ((adjust & 3) == 3) {
  972. f_low --;
  973. f_high ++;
  974. }
  975. pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
  976. }
  977. if (adjust == 8) {
  978. printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n");
  979. return -ENODEV;
  980. }
  981. if (clock_slot == 3)
  982. private_data = (void *)hpt37x_timings_66;
  983. else
  984. private_data = (void *)hpt37x_timings_50;
  985. printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[clock_slot]);
  986. } else {
  987. private_data = (void *)chip_table->clocks[clock_slot];
  988. /*
  989. * Perform a final fixup. Note that we will have used the
  990. * DPLL on the HPT372 which means we don't have to worry
  991. * about lack of UDMA133 support on lower clocks
  992. */
  993. if (clock_slot < 2 && port == &info_hpt370)
  994. port = &info_hpt370_33;
  995. if (clock_slot < 2 && port == &info_hpt370a)
  996. port = &info_hpt370a_33;
  997. printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]);
  998. }
  999. /* Now kick off ATA set up */
  1000. port_info = *port;
  1001. port_info.private_data = private_data;
  1002. return ata_pci_init_one(dev, ppi);
  1003. }
  1004. static const struct pci_device_id hpt37x[] = {
  1005. { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), },
  1006. { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT371), },
  1007. { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT372), },
  1008. { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT374), },
  1009. { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT302), },
  1010. { },
  1011. };
  1012. static struct pci_driver hpt37x_pci_driver = {
  1013. .name = DRV_NAME,
  1014. .id_table = hpt37x,
  1015. .probe = hpt37x_init_one,
  1016. .remove = ata_pci_remove_one
  1017. };
  1018. static int __init hpt37x_init(void)
  1019. {
  1020. return pci_register_driver(&hpt37x_pci_driver);
  1021. }
  1022. static void __exit hpt37x_exit(void)
  1023. {
  1024. pci_unregister_driver(&hpt37x_pci_driver);
  1025. }
  1026. MODULE_AUTHOR("Alan Cox");
  1027. MODULE_DESCRIPTION("low-level driver for the Highpoint HPT37x/30x");
  1028. MODULE_LICENSE("GPL");
  1029. MODULE_DEVICE_TABLE(pci, hpt37x);
  1030. MODULE_VERSION(DRV_VERSION);
  1031. module_init(hpt37x_init);
  1032. module_exit(hpt37x_exit);