2 * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
3 * Copyright (C) 2003 Red Hat <alan@redhat.com>
4 * Copyright (C) 2007 MontaVista Software, Inc.
5 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
7 * May be copied or modified under the terms of the GNU General Public License
9 * Documentation for CMD680:
10 * http://gkernel.sourceforge.net/specs/sii/sii-0680a-v1.31.pdf.bz2
12 * Documentation for SiI 3112:
13 * http://gkernel.sourceforge.net/specs/sii/3112A_SiI-DS-0095-B2.pdf.bz2
15 * Errata and other documentation only available under NDA.
19 * If you are using Marvell SATA-IDE adapters with Maxtor drives
20 * ensure the system is set up for ATA100/UDMA5 not UDMA6.
22 * If you are using WD drives with SATA bridges you must set the
23 * drive to "Single". "Master" will hang
25 * If you have strange problems with nVidia chipset systems please
26 * see the SI support documentation and update your system BIOS
29 * The Dell DRAC4 has some interesting features including effectively hot
30 * unplugging/replugging the virtual CD interface when the DRAC is reset.
31 * This often causes drivers/ide/siimage to panic but is ok with the rather
32 * smarter code in libata.
39 #include <linux/types.h>
40 #include <linux/module.h>
41 #include <linux/pci.h>
42 #include <linux/hdreg.h>
43 #include <linux/ide.h>
44 #include <linux/init.h>
49 * pdev_is_sata - check if device is SATA
50 * @pdev: PCI device to check
52 * Returns true if this is a SATA controller
55 static int pdev_is_sata(struct pci_dev *pdev)
57 #ifdef CONFIG_BLK_DEV_IDE_SATA
58 switch(pdev->device) {
59 case PCI_DEVICE_ID_SII_3112:
60 case PCI_DEVICE_ID_SII_1210SA:
62 case PCI_DEVICE_ID_SII_680:
71 * is_sata - check if hwif is SATA
72 * @hwif: interface to check
74 * Returns true if this is a SATA controller
77 static inline int is_sata(ide_hwif_t *hwif)
79 return pdev_is_sata(to_pci_dev(hwif->dev));
83 * siimage_selreg - return register base
87 * Turn a config register offset into the right address in either
88 * PCI space or MMIO space to access the control register in question
89 * Thankfully this is a configuration operation so isnt performance
93 static unsigned long siimage_selreg(ide_hwif_t *hwif, int r)
95 unsigned long base = (unsigned long)hwif->hwif_data;
98 base += (hwif->channel << 6);
100 base += (hwif->channel << 4);
105 * siimage_seldev - return register base
109 * Turn a config register offset into the right address in either
110 * PCI space or MMIO space to access the control register in question
111 * including accounting for the unit shift.
114 static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
116 ide_hwif_t *hwif = HWIF(drive);
117 unsigned long base = (unsigned long)hwif->hwif_data;
120 base += (hwif->channel << 6);
122 base += (hwif->channel << 4);
123 base |= drive->select.b.unit << drive->select.b.unit;
128 * sil_udma_filter - compute UDMA mask
131 * Compute the available UDMA speeds for the device on the interface.
133 * For the CMD680 this depends on the clocking mode (scsc), for the
134 * SI3112 SATA controller life is a bit simpler.
137 static u8 sil_pata_udma_filter(ide_drive_t *drive)
139 ide_hwif_t *hwif = drive->hwif;
140 struct pci_dev *dev = to_pci_dev(hwif->dev);
141 unsigned long base = (unsigned long) hwif->hwif_data;
142 u8 mask = 0, scsc = 0;
145 scsc = hwif->INB(base + 0x4A);
147 pci_read_config_byte(dev, 0x8A, &scsc);
149 if ((scsc & 0x30) == 0x10) /* 133 */
151 else if ((scsc & 0x30) == 0x20) /* 2xPCI */
153 else if ((scsc & 0x30) == 0x00) /* 100 */
155 else /* Disabled ? */
161 static u8 sil_sata_udma_filter(ide_drive_t *drive)
163 return strstr(drive->id->model, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6;
167 * sil_set_pio_mode - set host controller for PIO mode
169 * @pio: PIO mode number
171 * Load the timing settings for this device mode into the
172 * controller. If we are in PIO mode 3 or 4 turn on IORDY
173 * monitoring (bit 9). The TF timing is bits 31:16
176 static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
178 const u16 tf_speed[] = { 0x328a, 0x2283, 0x1281, 0x10c3, 0x10c1 };
179 const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1 };
181 ide_hwif_t *hwif = HWIF(drive);
182 ide_drive_t *pair = ide_get_paired_drive(drive);
185 unsigned long addr = siimage_seldev(drive, 0x04);
186 unsigned long tfaddr = siimage_selreg(hwif, 0x02);
187 unsigned long base = (unsigned long)hwif->hwif_data;
189 u8 addr_mask = hwif->channel ? (hwif->mmio ? 0xF4 : 0x84)
190 : (hwif->mmio ? 0xB4 : 0x80);
192 u8 unit = drive->select.b.unit;
194 /* trim *taskfile* PIO to the slowest of the master/slave */
196 u8 pair_pio = ide_get_best_pio_mode(pair, 255, 4);
198 if (pair_pio < tf_pio)
202 /* cheat for now and use the docs */
203 speedp = data_speed[pio];
204 speedt = tf_speed[tf_pio];
207 hwif->OUTW(speedp, addr);
208 hwif->OUTW(speedt, tfaddr);
209 /* Now set up IORDY */
211 hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2);
213 hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2);
215 mode = hwif->INB(base + addr_mask);
216 mode &= ~(unit ? 0x30 : 0x03);
217 mode |= (unit ? 0x10 : 0x01);
218 hwif->OUTB(mode, base + addr_mask);
220 struct pci_dev *dev = to_pci_dev(hwif->dev);
222 pci_write_config_word(dev, addr, speedp);
223 pci_write_config_word(dev, tfaddr, speedt);
224 pci_read_config_word(dev, tfaddr - 2, &speedp);
226 /* Set IORDY for mode 3 or 4 */
229 pci_write_config_word(dev, tfaddr - 2, speedp);
231 pci_read_config_byte(dev, addr_mask, &mode);
232 mode &= ~(unit ? 0x30 : 0x03);
233 mode |= (unit ? 0x10 : 0x01);
234 pci_write_config_byte(dev, addr_mask, mode);
239 * sil_set_dma_mode - set host controller for DMA mode
243 * Tune the SiI chipset for the desired DMA mode.
246 static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
248 u8 ultra6[] = { 0x0F, 0x0B, 0x07, 0x05, 0x03, 0x02, 0x01 };
249 u8 ultra5[] = { 0x0C, 0x07, 0x05, 0x04, 0x02, 0x01 };
250 u16 dma[] = { 0x2208, 0x10C2, 0x10C1 };
252 ide_hwif_t *hwif = HWIF(drive);
253 struct pci_dev *dev = to_pci_dev(hwif->dev);
254 u16 ultra = 0, multi = 0;
255 u8 mode = 0, unit = drive->select.b.unit;
256 unsigned long base = (unsigned long)hwif->hwif_data;
257 u8 scsc = 0, addr_mask = ((hwif->channel) ?
258 ((hwif->mmio) ? 0xF4 : 0x84) :
259 ((hwif->mmio) ? 0xB4 : 0x80));
261 unsigned long ma = siimage_seldev(drive, 0x08);
262 unsigned long ua = siimage_seldev(drive, 0x0C);
265 scsc = hwif->INB(base + 0x4A);
266 mode = hwif->INB(base + addr_mask);
267 multi = hwif->INW(ma);
268 ultra = hwif->INW(ua);
270 pci_read_config_byte(dev, 0x8A, &scsc);
271 pci_read_config_byte(dev, addr_mask, &mode);
272 pci_read_config_word(dev, ma, &multi);
273 pci_read_config_word(dev, ua, &ultra);
276 mode &= ~((unit) ? 0x30 : 0x03);
278 scsc = ((scsc & 0x30) == 0x00) ? 0 : 1;
280 scsc = is_sata(hwif) ? 1 : scsc;
282 if (speed >= XFER_UDMA_0) {
284 ultra |= (scsc ? ultra6[speed - XFER_UDMA_0] :
285 ultra5[speed - XFER_UDMA_0]);
286 mode |= (unit ? 0x30 : 0x03);
288 multi = dma[speed - XFER_MW_DMA_0];
289 mode |= (unit ? 0x20 : 0x02);
293 hwif->OUTB(mode, base + addr_mask);
294 hwif->OUTW(multi, ma);
295 hwif->OUTW(ultra, ua);
297 pci_write_config_byte(dev, addr_mask, mode);
298 pci_write_config_word(dev, ma, multi);
299 pci_write_config_word(dev, ua, ultra);
303 /* returns 1 if dma irq issued, 0 otherwise */
304 static int siimage_io_dma_test_irq(ide_drive_t *drive)
306 ide_hwif_t *hwif = HWIF(drive);
307 struct pci_dev *dev = to_pci_dev(hwif->dev);
309 unsigned long addr = siimage_selreg(hwif, 1);
311 /* return 1 if INTR asserted */
312 if ((hwif->INB(hwif->dma_status) & 4) == 4)
315 /* return 1 if Device INTR asserted */
316 pci_read_config_byte(dev, addr, &dma_altstat);
318 return 0; //return 1;
323 * siimage_mmio_dma_test_irq - check we caused an IRQ
324 * @drive: drive we are testing
326 * Check if we caused an IDE DMA interrupt. We may also have caused
327 * SATA status interrupts, if so we clean them up and continue.
330 static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
332 ide_hwif_t *hwif = HWIF(drive);
333 unsigned long addr = siimage_selreg(hwif, 0x1);
334 void __iomem *sata_error_addr
335 = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET];
337 if (sata_error_addr) {
338 unsigned long base = (unsigned long)hwif->hwif_data;
339 u32 ext_stat = readl((void __iomem *)(base + 0x10));
342 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) {
343 u32 sata_error = readl(sata_error_addr);
345 writel(sata_error, sata_error_addr);
346 watchdog = (sata_error & 0x00680000) ? 1 : 0;
347 printk(KERN_WARNING "%s: sata_error = 0x%08x, "
348 "watchdog = %d, %s\n",
349 drive->name, sata_error, watchdog,
353 watchdog = (ext_stat & 0x8000) ? 1 : 0;
357 if (!(ext_stat & 0x0404) && !watchdog)
361 /* return 1 if INTR asserted */
362 if ((readb((void __iomem *)hwif->dma_status) & 0x04) == 0x04)
365 /* return 1 if Device INTR asserted */
366 if ((readb((void __iomem *)addr) & 8) == 8)
367 return 0; //return 1;
372 static int siimage_dma_test_irq(ide_drive_t *drive)
374 if (drive->hwif->mmio)
375 return siimage_mmio_dma_test_irq(drive);
377 return siimage_io_dma_test_irq(drive);
381 * sil_sata_reset_poll - wait for SATA reset
382 * @drive: drive we are resetting
384 * Poll the SATA phy and see whether it has come back from the dead
388 static int sil_sata_reset_poll(ide_drive_t *drive)
390 ide_hwif_t *hwif = drive->hwif;
391 void __iomem *sata_status_addr
392 = (void __iomem *)hwif->sata_scr[SATA_STATUS_OFFSET];
394 if (sata_status_addr) {
395 /* SATA Status is available only when in MMIO mode */
396 u32 sata_stat = readl(sata_status_addr);
398 if ((sata_stat & 0x03) != 0x03) {
399 printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n",
400 hwif->name, sata_stat);
401 HWGROUP(drive)->polling = 0;
410 * sil_sata_pre_reset - reset hook
411 * @drive: IDE device being reset
413 * For the SATA devices we need to handle recalibration/geometry
417 static void sil_sata_pre_reset(ide_drive_t *drive)
419 if (drive->media == ide_disk) {
420 drive->special.b.set_geometry = 0;
421 drive->special.b.recalibrate = 0;
426 * proc_reports_siimage - add siimage controller to proc
428 * @clocking: SCSC value
429 * @name: controller name
431 * Report the clocking mode of the controller and add it to
432 * the /proc interface layer
435 static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *name)
437 if (!pdev_is_sata(dev)) {
438 printk(KERN_INFO "%s: BASE CLOCK ", name);
441 case 0x03: printk("DISABLED!\n"); break;
442 case 0x02: printk("== 2X PCI\n"); break;
443 case 0x01: printk("== 133\n"); break;
444 case 0x00: printk("== 100\n"); break;
450 * setup_mmio_siimage - switch an SI controller into MMIO
451 * @dev: PCI device we are configuring
454 * Attempt to put the device into mmio mode. There are some slight
455 * complications here with certain systems where the mmio bar isnt
456 * mapped so we have to be sure we can fall back to I/O.
459 static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
461 resource_size_t bar5 = pci_resource_start(dev, 5);
462 unsigned long barsize = pci_resource_len(dev, 5);
464 void __iomem *ioaddr;
468 * Drop back to PIO if we can't map the mmio. Some
469 * systems seem to get terminally confused in the PCI
473 if(!request_mem_region(bar5, barsize, name))
475 printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n");
479 ioaddr = ioremap(bar5, barsize);
483 release_mem_region(bar5, barsize);
488 pci_set_drvdata(dev, (void *) ioaddr);
490 if (pdev_is_sata(dev)) {
491 /* make sure IDE0/1 interrupts are not masked */
492 irq_mask = (1 << 22) | (1 << 23);
493 tmp = readl(ioaddr + 0x48);
494 if (tmp & irq_mask) {
496 writel(tmp, ioaddr + 0x48);
497 readl(ioaddr + 0x48); /* flush */
499 writel(0, ioaddr + 0x148);
500 writel(0, ioaddr + 0x1C8);
503 writeb(0, ioaddr + 0xB4);
504 writeb(0, ioaddr + 0xF4);
505 tmpbyte = readb(ioaddr + 0x4A);
507 switch(tmpbyte & 0x30) {
509 /* In 100 MHz clocking, try and switch to 133 */
510 writeb(tmpbyte|0x10, ioaddr + 0x4A);
513 /* On 133Mhz clocking */
516 /* On PCIx2 clocking */
519 /* Clocking is disabled */
520 /* 133 clock attempt to force it on */
521 writeb(tmpbyte & ~0x20, ioaddr + 0x4A);
525 writeb( 0x72, ioaddr + 0xA1);
526 writew( 0x328A, ioaddr + 0xA2);
527 writel(0x62DD62DD, ioaddr + 0xA4);
528 writel(0x43924392, ioaddr + 0xA8);
529 writel(0x40094009, ioaddr + 0xAC);
530 writeb( 0x72, ioaddr + 0xE1);
531 writew( 0x328A, ioaddr + 0xE2);
532 writel(0x62DD62DD, ioaddr + 0xE4);
533 writel(0x43924392, ioaddr + 0xE8);
534 writel(0x40094009, ioaddr + 0xEC);
536 if (pdev_is_sata(dev)) {
537 writel(0xFFFF0000, ioaddr + 0x108);
538 writel(0xFFFF0000, ioaddr + 0x188);
539 writel(0x00680000, ioaddr + 0x148);
540 writel(0x00680000, ioaddr + 0x1C8);
543 tmpbyte = readb(ioaddr + 0x4A);
545 proc_reports_siimage(dev, (tmpbyte>>4), name);
550 * init_chipset_siimage - set up an SI device
554 * Perform the initial PCI set up for this device. Attempt to switch
555 * to 133MHz clocking if the system isn't already set up to do it.
558 static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, const char *name)
560 u8 rev = dev->revision, tmpbyte = 0, BA5_EN = 0;
562 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, rev ? 1 : 255);
564 pci_read_config_byte(dev, 0x8A, &BA5_EN);
565 if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) {
566 if (setup_mmio_siimage(dev, name)) {
571 pci_write_config_byte(dev, 0x80, 0x00);
572 pci_write_config_byte(dev, 0x84, 0x00);
573 pci_read_config_byte(dev, 0x8A, &tmpbyte);
574 switch(tmpbyte & 0x30) {
576 /* 133 clock attempt to force it on */
577 pci_write_config_byte(dev, 0x8A, tmpbyte|0x10);
579 /* if clocking is disabled */
580 /* 133 clock attempt to force it on */
581 pci_write_config_byte(dev, 0x8A, tmpbyte & ~0x20);
586 /* BIOS set PCI x2 clocking */
590 pci_read_config_byte(dev, 0x8A, &tmpbyte);
592 pci_write_config_byte(dev, 0xA1, 0x72);
593 pci_write_config_word(dev, 0xA2, 0x328A);
594 pci_write_config_dword(dev, 0xA4, 0x62DD62DD);
595 pci_write_config_dword(dev, 0xA8, 0x43924392);
596 pci_write_config_dword(dev, 0xAC, 0x40094009);
597 pci_write_config_byte(dev, 0xB1, 0x72);
598 pci_write_config_word(dev, 0xB2, 0x328A);
599 pci_write_config_dword(dev, 0xB4, 0x62DD62DD);
600 pci_write_config_dword(dev, 0xB8, 0x43924392);
601 pci_write_config_dword(dev, 0xBC, 0x40094009);
603 proc_reports_siimage(dev, (tmpbyte>>4), name);
608 * init_mmio_iops_siimage - set up the iops for MMIO
609 * @hwif: interface to set up
611 * The basic setup here is fairly simple, we can use standard MMIO
612 * operations. However we do have to set the taskfile register offsets
613 * by hand as there isnt a standard defined layout for them this
616 * The hardware supports buffered taskfiles and also some rather nice
617 * extended PRD tables. For better SI3112 support use the libata driver
620 static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
622 struct pci_dev *dev = to_pci_dev(hwif->dev);
623 void *addr = pci_get_drvdata(dev);
624 u8 ch = hwif->channel;
627 struct ide_io_ports *io_ports = &hwif->io_ports;
630 * Fill in the basic HWIF bits
633 default_hwif_mmiops(hwif);
634 hwif->hwif_data = addr;
637 * Now set up the hw. We have to do this ourselves as
638 * the MMIO layout isnt the same as the standard port
642 memset(io_ports, 0, sizeof(*io_ports));
644 base = (unsigned long)addr;
651 * The buffered task file doesn't have status/control
652 * so we can't currently use it sanely since we want to
655 io_ports->data_addr = base;
656 io_ports->error_addr = base + 1;
657 io_ports->nsect_addr = base + 2;
658 io_ports->lbal_addr = base + 3;
659 io_ports->lbam_addr = base + 4;
660 io_ports->lbah_addr = base + 5;
661 io_ports->device_addr = base + 6;
662 io_ports->status_addr = base + 7;
663 io_ports->ctl_addr = base + 10;
665 if (pdev_is_sata(dev)) {
666 base = (unsigned long)addr;
669 hwif->sata_scr[SATA_STATUS_OFFSET] = base + 0x104;
670 hwif->sata_scr[SATA_ERROR_OFFSET] = base + 0x108;
671 hwif->sata_scr[SATA_CONTROL_OFFSET] = base + 0x100;
674 hwif->irq = dev->irq;
676 hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00);
681 static int is_dev_seagate_sata(ide_drive_t *drive)
683 const char *s = &drive->id->model[0];
686 len = strnlen(s, sizeof(drive->id->model));
688 if ((len > 4) && (!memcmp(s, "ST", 2))) {
689 if ((!memcmp(s + len - 2, "AS", 2)) ||
690 (!memcmp(s + len - 3, "ASL", 3))) {
691 printk(KERN_INFO "%s: applying pessimistic Seagate "
692 "errata fix\n", drive->name);
700 * sil_quirkproc - post probe fixups
703 * Called after drive probe we use this to decide whether the
704 * Seagate fixup must be applied. This used to be in init_iops but
705 * that can occur before we know what drives are present.
708 static void __devinit sil_quirkproc(ide_drive_t *drive)
710 ide_hwif_t *hwif = drive->hwif;
712 /* Try and raise the rqsize */
713 if (!is_sata(hwif) || !is_dev_seagate_sata(drive))
718 * init_iops_siimage - set up iops
719 * @hwif: interface to set up
721 * Do the basic setup for the SIIMAGE hardware interface
722 * and then do the MMIO setup if we can. This is the first
723 * look in we get for setting up the hwif so that we
724 * can get the iops right before using them.
727 static void __devinit init_iops_siimage(ide_hwif_t *hwif)
729 struct pci_dev *dev = to_pci_dev(hwif->dev);
731 hwif->hwif_data = NULL;
733 /* Pessimal until we finish probing */
736 if (pci_get_drvdata(dev) == NULL)
739 init_mmio_iops_siimage(hwif);
743 * sil_cable_detect - cable detection
744 * @hwif: interface to check
746 * Check for the presence of an ATA66 capable cable on the
750 static u8 __devinit sil_cable_detect(ide_hwif_t *hwif)
752 struct pci_dev *dev = to_pci_dev(hwif->dev);
753 unsigned long addr = siimage_selreg(hwif, 0);
756 if (pci_get_drvdata(dev) == NULL)
757 pci_read_config_byte(dev, addr, &ata66);
759 ata66 = hwif->INB(addr);
761 return (ata66 & 0x01) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
764 static const struct ide_port_ops sil_pata_port_ops = {
765 .set_pio_mode = sil_set_pio_mode,
766 .set_dma_mode = sil_set_dma_mode,
767 .quirkproc = sil_quirkproc,
768 .udma_filter = sil_pata_udma_filter,
769 .cable_detect = sil_cable_detect,
772 static const struct ide_port_ops sil_sata_port_ops = {
773 .set_pio_mode = sil_set_pio_mode,
774 .set_dma_mode = sil_set_dma_mode,
775 .reset_poll = sil_sata_reset_poll,
776 .pre_reset = sil_sata_pre_reset,
777 .quirkproc = sil_quirkproc,
778 .udma_filter = sil_sata_udma_filter,
779 .cable_detect = sil_cable_detect,
782 static struct ide_dma_ops sil_dma_ops = {
783 .dma_test_irq = siimage_dma_test_irq,
786 #define DECLARE_SII_DEV(name_str, p_ops) \
789 .init_chipset = init_chipset_siimage, \
790 .init_iops = init_iops_siimage, \
792 .dma_ops = &sil_dma_ops, \
793 .pio_mask = ATA_PIO4, \
794 .mwdma_mask = ATA_MWDMA2, \
795 .udma_mask = ATA_UDMA6, \
798 static const struct ide_port_info siimage_chipsets[] __devinitdata = {
799 /* 0 */ DECLARE_SII_DEV("SiI680", &sil_pata_port_ops),
800 /* 1 */ DECLARE_SII_DEV("SiI3112 Serial ATA", &sil_sata_port_ops),
801 /* 2 */ DECLARE_SII_DEV("Adaptec AAR-1210SA", &sil_sata_port_ops)
805 * siimage_init_one - pci layer discovery entry
807 * @id: ident table entry
809 * Called by the PCI code when it finds an SI680 or SI3112 controller.
810 * We then use the IDE PCI generic helper to do most of the work.
813 static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id)
815 struct ide_port_info d;
816 u8 idx = id->driver_data;
818 d = siimage_chipsets[idx];
821 static int first = 1;
824 printk(KERN_INFO "siimage: For full SATA support you "
825 "should use the libata sata_sil module.\n");
829 d.host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
832 return ide_setup_pci_device(dev, &d);
835 static const struct pci_device_id siimage_pci_tbl[] = {
836 { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), 0 },
837 #ifdef CONFIG_BLK_DEV_IDE_SATA
838 { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_3112), 1 },
839 { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_1210SA), 2 },
843 MODULE_DEVICE_TABLE(pci, siimage_pci_tbl);
845 static struct pci_driver driver = {
847 .id_table = siimage_pci_tbl,
848 .probe = siimage_init_one,
851 static int __init siimage_ide_init(void)
853 return ide_pci_register_driver(&driver);
856 module_init(siimage_ide_init);
858 MODULE_AUTHOR("Andre Hedrick, Alan Cox");
859 MODULE_DESCRIPTION("PCI driver module for SiI IDE");
860 MODULE_LICENSE("GPL");