pata_amd.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. /*
  2. * pata_amd.c - AMD PATA for new ATA layer
  3. * (C) 2005-2006 Red Hat Inc
  4. * Alan Cox <alan@redhat.com>
  5. *
  6. * Based on pata-sil680. Errata information is taken from data sheets
  7. * and the amd74xx.c driver by Vojtech Pavlik. Nvidia SATA devices are
  8. * claimed by sata-nv.c.
  9. *
  10. * TODO:
  11. * Variable system clock when/if it makes sense
  12. * Power management on ports
  13. *
  14. *
  15. * Documentation publically available.
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/module.h>
  19. #include <linux/pci.h>
  20. #include <linux/init.h>
  21. #include <linux/blkdev.h>
  22. #include <linux/delay.h>
  23. #include <scsi/scsi_host.h>
  24. #include <linux/libata.h>
  25. #define DRV_NAME "pata_amd"
  26. #define DRV_VERSION "0.3.10"
  27. /**
  28. * timing_setup - shared timing computation and load
  29. * @ap: ATA port being set up
  30. * @adev: drive being configured
  31. * @offset: port offset
  32. * @speed: target speed
  33. * @clock: clock multiplier (number of times 33MHz for this part)
  34. *
  35. * Perform the actual timing set up for Nvidia or AMD PATA devices.
  36. * The actual devices vary so they all call into this helper function
  37. * providing the clock multipler and offset (because AMD and Nvidia put
  38. * the ports at different locations).
  39. */
  40. static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offset, int speed, int clock)
  41. {
  42. static const unsigned char amd_cyc2udma[] = {
  43. 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7
  44. };
  45. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  46. struct ata_device *peer = ata_dev_pair(adev);
  47. int dn = ap->port_no * 2 + adev->devno;
  48. struct ata_timing at, apeer;
  49. int T, UT;
  50. const int amd_clock = 33333; /* KHz. */
  51. u8 t;
  52. T = 1000000000 / amd_clock;
  53. UT = T;
  54. if (clock >= 2)
  55. UT = T / 2;
  56. if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
  57. dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed);
  58. return;
  59. }
  60. if (peer) {
  61. /* This may be over conservative */
  62. if (peer->dma_mode) {
  63. ata_timing_compute(peer, peer->dma_mode, &apeer, T, UT);
  64. ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT);
  65. }
  66. ata_timing_compute(peer, peer->pio_mode, &apeer, T, UT);
  67. ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT);
  68. }
  69. if (speed == XFER_UDMA_5 && amd_clock <= 33333) at.udma = 1;
  70. if (speed == XFER_UDMA_6 && amd_clock <= 33333) at.udma = 15;
  71. /*
  72. * Now do the setup work
  73. */
  74. /* Configure the address set up timing */
  75. pci_read_config_byte(pdev, offset + 0x0C, &t);
  76. t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(at.setup, 1, 4) - 1) << ((3 - dn) << 1));
  77. pci_write_config_byte(pdev, offset + 0x0C , t);
  78. /* Configure the 8bit I/O timing */
  79. pci_write_config_byte(pdev, offset + 0x0E + (1 - (dn >> 1)),
  80. ((clamp_val(at.act8b, 1, 16) - 1) << 4) | (clamp_val(at.rec8b, 1, 16) - 1));
  81. /* Drive timing */
  82. pci_write_config_byte(pdev, offset + 0x08 + (3 - dn),
  83. ((clamp_val(at.active, 1, 16) - 1) << 4) | (clamp_val(at.recover, 1, 16) - 1));
  84. switch (clock) {
  85. case 1:
  86. t = at.udma ? (0xc0 | (clamp_val(at.udma, 2, 5) - 2)) : 0x03;
  87. break;
  88. case 2:
  89. t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 2, 10)]) : 0x03;
  90. break;
  91. case 3:
  92. t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 10)]) : 0x03;
  93. break;
  94. case 4:
  95. t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 15)]) : 0x03;
  96. break;
  97. default:
  98. return;
  99. }
  100. /* UDMA timing */
  101. if (at.udma)
  102. pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
  103. }
  104. /**
  105. * amd_pre_reset - perform reset handling
  106. * @link: ATA link
  107. * @deadline: deadline jiffies for the operation
  108. *
  109. * Reset sequence checking enable bits to see which ports are
  110. * active.
  111. */
  112. static int amd_pre_reset(struct ata_link *link, unsigned long deadline)
  113. {
  114. static const struct pci_bits amd_enable_bits[] = {
  115. { 0x40, 1, 0x02, 0x02 },
  116. { 0x40, 1, 0x01, 0x01 }
  117. };
  118. struct ata_port *ap = link->ap;
  119. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  120. if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no]))
  121. return -ENOENT;
  122. return ata_sff_prereset(link, deadline);
  123. }
  124. static int amd_cable_detect(struct ata_port *ap)
  125. {
  126. static const u32 bitmask[2] = {0x03, 0x0C};
  127. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  128. u8 ata66;
  129. pci_read_config_byte(pdev, 0x42, &ata66);
  130. if (ata66 & bitmask[ap->port_no])
  131. return ATA_CBL_PATA80;
  132. return ATA_CBL_PATA40;
  133. }
  134. /**
  135. * amd33_set_piomode - set initial PIO mode data
  136. * @ap: ATA interface
  137. * @adev: ATA device
  138. *
  139. * Program the AMD registers for PIO mode.
  140. */
  141. static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev)
  142. {
  143. timing_setup(ap, adev, 0x40, adev->pio_mode, 1);
  144. }
  145. static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev)
  146. {
  147. timing_setup(ap, adev, 0x40, adev->pio_mode, 2);
  148. }
  149. static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev)
  150. {
  151. timing_setup(ap, adev, 0x40, adev->pio_mode, 3);
  152. }
  153. static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev)
  154. {
  155. timing_setup(ap, adev, 0x40, adev->pio_mode, 4);
  156. }
  157. /**
  158. * amd33_set_dmamode - set initial DMA mode data
  159. * @ap: ATA interface
  160. * @adev: ATA device
  161. *
  162. * Program the MWDMA/UDMA modes for the AMD and Nvidia
  163. * chipset.
  164. */
  165. static void amd33_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  166. {
  167. timing_setup(ap, adev, 0x40, adev->dma_mode, 1);
  168. }
  169. static void amd66_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  170. {
  171. timing_setup(ap, adev, 0x40, adev->dma_mode, 2);
  172. }
  173. static void amd100_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  174. {
  175. timing_setup(ap, adev, 0x40, adev->dma_mode, 3);
  176. }
  177. static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  178. {
  179. timing_setup(ap, adev, 0x40, adev->dma_mode, 4);
  180. }
  181. /* Both host-side and drive-side detection results are worthless on NV
  182. * PATAs. Ignore them and just follow what BIOS configured. Both the
  183. * current configuration in PCI config reg and ACPI GTM result are
  184. * cached during driver attach and are consulted to select transfer
  185. * mode.
  186. */
  187. static unsigned long nv_mode_filter(struct ata_device *dev,
  188. unsigned long xfer_mask)
  189. {
  190. static const unsigned int udma_mask_map[] =
  191. { ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
  192. ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 };
  193. struct ata_port *ap = dev->link->ap;
  194. char acpi_str[32] = "";
  195. u32 saved_udma, udma;
  196. const struct ata_acpi_gtm *gtm;
  197. unsigned long bios_limit = 0, acpi_limit = 0, limit;
  198. /* find out what BIOS configured */
  199. udma = saved_udma = (unsigned long)ap->host->private_data;
  200. if (ap->port_no == 0)
  201. udma >>= 16;
  202. if (dev->devno == 0)
  203. udma >>= 8;
  204. if ((udma & 0xc0) == 0xc0)
  205. bios_limit = ata_pack_xfermask(0, 0, udma_mask_map[udma & 0x7]);
  206. /* consult ACPI GTM too */
  207. gtm = ata_acpi_init_gtm(ap);
  208. if (gtm) {
  209. acpi_limit = ata_acpi_gtm_xfermask(dev, gtm);
  210. snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
  211. gtm->drive[0].dma, gtm->drive[1].dma, gtm->flags);
  212. }
  213. /* be optimistic, EH can take care of things if something goes wrong */
  214. limit = bios_limit | acpi_limit;
  215. /* If PIO or DMA isn't configured at all, don't limit. Let EH
  216. * handle it.
  217. */
  218. if (!(limit & ATA_MASK_PIO))
  219. limit |= ATA_MASK_PIO;
  220. if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
  221. limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA;
  222. ata_port_printk(ap, KERN_DEBUG, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
  223. "BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
  224. xfer_mask, limit, xfer_mask & limit, bios_limit,
  225. saved_udma, acpi_limit, acpi_str);
  226. return xfer_mask & limit;
  227. }
  228. /**
  229. * nv_probe_init - cable detection
  230. * @lin: ATA link
  231. *
  232. * Perform cable detection. The BIOS stores this in PCI config
  233. * space for us.
  234. */
  235. static int nv_pre_reset(struct ata_link *link, unsigned long deadline)
  236. {
  237. static const struct pci_bits nv_enable_bits[] = {
  238. { 0x50, 1, 0x02, 0x02 },
  239. { 0x50, 1, 0x01, 0x01 }
  240. };
  241. struct ata_port *ap = link->ap;
  242. struct pci_dev *pdev = to_pci_dev(ap->host->dev);
  243. if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no]))
  244. return -ENOENT;
  245. return ata_sff_prereset(link, deadline);
  246. }
  247. /**
  248. * nv100_set_piomode - set initial PIO mode data
  249. * @ap: ATA interface
  250. * @adev: ATA device
  251. *
  252. * Program the AMD registers for PIO mode.
  253. */
  254. static void nv100_set_piomode(struct ata_port *ap, struct ata_device *adev)
  255. {
  256. timing_setup(ap, adev, 0x50, adev->pio_mode, 3);
  257. }
  258. static void nv133_set_piomode(struct ata_port *ap, struct ata_device *adev)
  259. {
  260. timing_setup(ap, adev, 0x50, adev->pio_mode, 4);
  261. }
  262. /**
  263. * nv100_set_dmamode - set initial DMA mode data
  264. * @ap: ATA interface
  265. * @adev: ATA device
  266. *
  267. * Program the MWDMA/UDMA modes for the AMD and Nvidia
  268. * chipset.
  269. */
  270. static void nv100_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  271. {
  272. timing_setup(ap, adev, 0x50, adev->dma_mode, 3);
  273. }
  274. static void nv133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
  275. {
  276. timing_setup(ap, adev, 0x50, adev->dma_mode, 4);
  277. }
  278. static void nv_host_stop(struct ata_host *host)
  279. {
  280. u32 udma = (unsigned long)host->private_data;
  281. /* restore PCI config register 0x60 */
  282. pci_write_config_dword(to_pci_dev(host->dev), 0x60, udma);
  283. }
  284. static struct scsi_host_template amd_sht = {
  285. ATA_BMDMA_SHT(DRV_NAME),
  286. };
  287. static const struct ata_port_operations amd_base_port_ops = {
  288. .inherits = &ata_bmdma_port_ops,
  289. .prereset = amd_pre_reset,
  290. };
  291. static struct ata_port_operations amd33_port_ops = {
  292. .inherits = &amd_base_port_ops,
  293. .cable_detect = ata_cable_40wire,
  294. .set_piomode = amd33_set_piomode,
  295. .set_dmamode = amd33_set_dmamode,
  296. };
  297. static struct ata_port_operations amd66_port_ops = {
  298. .inherits = &amd_base_port_ops,
  299. .cable_detect = ata_cable_unknown,
  300. .set_piomode = amd66_set_piomode,
  301. .set_dmamode = amd66_set_dmamode,
  302. };
  303. static struct ata_port_operations amd100_port_ops = {
  304. .inherits = &amd_base_port_ops,
  305. .cable_detect = ata_cable_unknown,
  306. .set_piomode = amd100_set_piomode,
  307. .set_dmamode = amd100_set_dmamode,
  308. };
  309. static struct ata_port_operations amd133_port_ops = {
  310. .inherits = &amd_base_port_ops,
  311. .cable_detect = amd_cable_detect,
  312. .set_piomode = amd133_set_piomode,
  313. .set_dmamode = amd133_set_dmamode,
  314. };
  315. static const struct ata_port_operations nv_base_port_ops = {
  316. .inherits = &ata_bmdma_port_ops,
  317. .cable_detect = ata_cable_ignore,
  318. .mode_filter = nv_mode_filter,
  319. .prereset = nv_pre_reset,
  320. .host_stop = nv_host_stop,
  321. };
  322. static struct ata_port_operations nv100_port_ops = {
  323. .inherits = &nv_base_port_ops,
  324. .set_piomode = nv100_set_piomode,
  325. .set_dmamode = nv100_set_dmamode,
  326. };
  327. static struct ata_port_operations nv133_port_ops = {
  328. .inherits = &nv_base_port_ops,
  329. .set_piomode = nv133_set_piomode,
  330. .set_dmamode = nv133_set_dmamode,
  331. };
  332. static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
  333. {
  334. static const struct ata_port_info info[10] = {
  335. { /* 0: AMD 7401 */
  336. .flags = ATA_FLAG_SLAVE_POSS,
  337. .pio_mask = 0x1f,
  338. .mwdma_mask = 0x07, /* No SWDMA */
  339. .udma_mask = 0x07, /* UDMA 33 */
  340. .port_ops = &amd33_port_ops
  341. },
  342. { /* 1: Early AMD7409 - no swdma */
  343. .flags = ATA_FLAG_SLAVE_POSS,
  344. .pio_mask = 0x1f,
  345. .mwdma_mask = 0x07,
  346. .udma_mask = ATA_UDMA4, /* UDMA 66 */
  347. .port_ops = &amd66_port_ops
  348. },
  349. { /* 2: AMD 7409, no swdma errata */
  350. .flags = ATA_FLAG_SLAVE_POSS,
  351. .pio_mask = 0x1f,
  352. .mwdma_mask = 0x07,
  353. .udma_mask = ATA_UDMA4, /* UDMA 66 */
  354. .port_ops = &amd66_port_ops
  355. },
  356. { /* 3: AMD 7411 */
  357. .flags = ATA_FLAG_SLAVE_POSS,
  358. .pio_mask = 0x1f,
  359. .mwdma_mask = 0x07,
  360. .udma_mask = ATA_UDMA5, /* UDMA 100 */
  361. .port_ops = &amd100_port_ops
  362. },
  363. { /* 4: AMD 7441 */
  364. .flags = ATA_FLAG_SLAVE_POSS,
  365. .pio_mask = 0x1f,
  366. .mwdma_mask = 0x07,
  367. .udma_mask = ATA_UDMA5, /* UDMA 100 */
  368. .port_ops = &amd100_port_ops
  369. },
  370. { /* 5: AMD 8111*/
  371. .flags = ATA_FLAG_SLAVE_POSS,
  372. .pio_mask = 0x1f,
  373. .mwdma_mask = 0x07,
  374. .udma_mask = ATA_UDMA6, /* UDMA 133, no swdma */
  375. .port_ops = &amd133_port_ops
  376. },
  377. { /* 6: AMD 8111 UDMA 100 (Serenade) */
  378. .flags = ATA_FLAG_SLAVE_POSS,
  379. .pio_mask = 0x1f,
  380. .mwdma_mask = 0x07,
  381. .udma_mask = ATA_UDMA5, /* UDMA 100, no swdma */
  382. .port_ops = &amd133_port_ops
  383. },
  384. { /* 7: Nvidia Nforce */
  385. .flags = ATA_FLAG_SLAVE_POSS,
  386. .pio_mask = 0x1f,
  387. .mwdma_mask = 0x07,
  388. .udma_mask = ATA_UDMA5, /* UDMA 100 */
  389. .port_ops = &nv100_port_ops
  390. },
  391. { /* 8: Nvidia Nforce2 and later */
  392. .flags = ATA_FLAG_SLAVE_POSS,
  393. .pio_mask = 0x1f,
  394. .mwdma_mask = 0x07,
  395. .udma_mask = ATA_UDMA6, /* UDMA 133, no swdma */
  396. .port_ops = &nv133_port_ops
  397. },
  398. { /* 9: AMD CS5536 (Geode companion) */
  399. .flags = ATA_FLAG_SLAVE_POSS,
  400. .pio_mask = 0x1f,
  401. .mwdma_mask = 0x07,
  402. .udma_mask = ATA_UDMA5, /* UDMA 100 */
  403. .port_ops = &amd100_port_ops
  404. }
  405. };
  406. const struct ata_port_info *ppi[] = { NULL, NULL };
  407. static int printed_version;
  408. int type = id->driver_data;
  409. void *hpriv = NULL;
  410. u8 fifo;
  411. int rc;
  412. if (!printed_version++)
  413. dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
  414. rc = pcim_enable_device(pdev);
  415. if (rc)
  416. return rc;
  417. pci_read_config_byte(pdev, 0x41, &fifo);
  418. /* Check for AMD7409 without swdma errata and if found adjust type */
  419. if (type == 1 && pdev->revision > 0x7)
  420. type = 2;
  421. /* Serenade ? */
  422. if (type == 5 && pdev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
  423. pdev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
  424. type = 6; /* UDMA 100 only */
  425. /*
  426. * Okay, type is determined now. Apply type-specific workarounds.
  427. */
  428. ppi[0] = &info[type];
  429. if (type < 3)
  430. ata_pci_bmdma_clear_simplex(pdev);
  431. /* Check for AMD7411 */
  432. if (type == 3)
  433. /* FIFO is broken */
  434. pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
  435. else
  436. pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
  437. /* Cable detection on Nvidia chips doesn't work too well,
  438. * cache BIOS programmed UDMA mode.
  439. */
  440. if (type == 7 || type == 8) {
  441. u32 udma;
  442. pci_read_config_dword(pdev, 0x60, &udma);
  443. hpriv = (void *)(unsigned long)udma;
  444. }
  445. /* And fire it up */
  446. return ata_pci_sff_init_one(pdev, ppi, &amd_sht, hpriv);
  447. }
  448. #ifdef CONFIG_PM
  449. static int amd_reinit_one(struct pci_dev *pdev)
  450. {
  451. struct ata_host *host = dev_get_drvdata(&pdev->dev);
  452. int rc;
  453. rc = ata_pci_device_do_resume(pdev);
  454. if (rc)
  455. return rc;
  456. if (pdev->vendor == PCI_VENDOR_ID_AMD) {
  457. u8 fifo;
  458. pci_read_config_byte(pdev, 0x41, &fifo);
  459. if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
  460. /* FIFO is broken */
  461. pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
  462. else
  463. pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
  464. if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
  465. pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
  466. ata_pci_bmdma_clear_simplex(pdev);
  467. }
  468. ata_host_resume(host);
  469. return 0;
  470. }
  471. #endif
  472. static const struct pci_device_id amd[] = {
  473. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
  474. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
  475. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 3 },
  476. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 4 },
  477. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 5 },
  478. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 7 },
  479. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 8 },
  480. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 8 },
  481. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 8 },
  482. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 8 },
  483. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 8 },
  484. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 8 },
  485. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 8 },
  486. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 8 },
  487. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 8 },
  488. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 8 },
  489. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 8 },
  490. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 8 },
  491. { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 8 },
  492. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 9 },
  493. { },
  494. };
  495. static struct pci_driver amd_pci_driver = {
  496. .name = DRV_NAME,
  497. .id_table = amd,
  498. .probe = amd_init_one,
  499. .remove = ata_pci_remove_one,
  500. #ifdef CONFIG_PM
  501. .suspend = ata_pci_device_suspend,
  502. .resume = amd_reinit_one,
  503. #endif
  504. };
  505. static int __init amd_init(void)
  506. {
  507. return pci_register_driver(&amd_pci_driver);
  508. }
  509. static void __exit amd_exit(void)
  510. {
  511. pci_unregister_driver(&amd_pci_driver);
  512. }
  513. MODULE_AUTHOR("Alan Cox");
  514. MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
  515. MODULE_LICENSE("GPL");
  516. MODULE_DEVICE_TABLE(pci, amd);
  517. MODULE_VERSION(DRV_VERSION);
  518. module_init(amd_init);
  519. module_exit(amd_exit);