Lines Matching refs:hwif
237 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_tune_chipset() local
238 struct pci_dev *dev = hwif->pci_dev; in pdc202xx_tune_chipset()
355 static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) in pdc202xx_old_cable_detect() argument
357 u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10); in pdc202xx_old_cable_detect()
358 pci_read_config_word(hwif->pci_dev, 0x50, &CIS); in pdc202xx_old_cable_detect()
365 ide_hwif_t *hwif = HWIF(drive); in config_chipset_for_dma() local
366 struct pci_dev *dev = hwif->pci_dev; in config_chipset_for_dma()
368 u8 mask = hwif->channel ? 0x08 : 0x02; in config_chipset_for_dma()
381 cable = pdc202xx_old_cable_detect(hwif); in config_chipset_for_dma()
384 hwif->name, hwif->udma_four ? "80" : "40", in config_chipset_for_dma()
395 CLKSPD = hwif->INB(hwif->dma_master + 0x11); in config_chipset_for_dma()
414 hwif->channel ? "Secondary" : "Primary"); in config_chipset_for_dma()
419 hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11)); in config_chipset_for_dma()
420 …printk(KERN_WARNING "Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel… in config_chipset_for_dma()
428 if (hwif->drives[!(drive->dn%2)].present) { in config_chipset_for_dma()
429 if (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0078) { in config_chipset_for_dma()
430 hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11)); in config_chipset_for_dma()
432 hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11)); in config_chipset_for_dma()
435 hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11)); in config_chipset_for_dma()
476 hwif->tuneproc(drive, 5); in config_chipset_for_dma()
480 (void) hwif->speedproc(drive, speed); in config_chipset_for_dma()
486 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_config_drive_xfer_rate() local
493 if (hwif->ide_dma_bad_drive(drive)) in pdc202xx_config_drive_xfer_rate()
496 if (id->dma_ultra & hwif->ultra_mask) { in pdc202xx_config_drive_xfer_rate()
504 if ((id->dma_mword & hwif->mwdma_mask) || in pdc202xx_config_drive_xfer_rate()
505 (id->dma_1word & hwif->swdma_mask)) { in pdc202xx_config_drive_xfer_rate()
510 } else if (hwif->ide_dma_good_drive(drive) && in pdc202xx_config_drive_xfer_rate()
519 return hwif->ide_dma_on(drive); in pdc202xx_config_drive_xfer_rate()
523 hwif->tuneproc(drive, 5); in pdc202xx_config_drive_xfer_rate()
524 return hwif->ide_dma_off_quietly(drive); in pdc202xx_config_drive_xfer_rate()
539 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_old_ide_dma_begin() local
542 unsigned long high_16 = hwif->dma_master; in pdc202xx_old_ide_dma_begin()
543 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); in pdc202xx_old_ide_dma_begin()
545 u8 clock = hwif->INB(high_16 + 0x11); in pdc202xx_old_ide_dma_begin()
547 hwif->OUTB(clock|(hwif->channel ? 0x08 : 0x02), high_16+0x11); in pdc202xx_old_ide_dma_begin()
552 hwif->OUTL(word_count, atapi_reg); in pdc202xx_old_ide_dma_begin()
560 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_old_ide_dma_end() local
562 unsigned long high_16 = hwif->dma_master; in pdc202xx_old_ide_dma_end()
563 unsigned long atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); in pdc202xx_old_ide_dma_end()
566 hwif->OUTL(0, atapi_reg); /* zero out extra */ in pdc202xx_old_ide_dma_end()
567 clock = hwif->INB(high_16 + 0x11); in pdc202xx_old_ide_dma_end()
568 hwif->OUTB(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11); in pdc202xx_old_ide_dma_end()
575 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_old_ide_dma_test_irq() local
578 unsigned long high_16 = hwif->dma_master; in pdc202xx_old_ide_dma_test_irq()
579 u8 dma_stat = hwif->INB(hwif->dma_status); in pdc202xx_old_ide_dma_test_irq()
580 u8 sc1d = hwif->INB((high_16 + 0x001d)); in pdc202xx_old_ide_dma_test_irq()
582 if (hwif->channel) { in pdc202xx_old_ide_dma_test_irq()
611 static void pdc202xx_reset_host (ide_hwif_t *hwif) in pdc202xx_reset_host() argument
615 unsigned long high_16 = hwif->dma_master; in pdc202xx_reset_host()
617 unsigned long high_16 = pci_resource_start(hwif->pci_dev, 4); in pdc202xx_reset_host()
619 u8 udma_speed_flag = hwif->INB(high_16|0x001f); in pdc202xx_reset_host()
621 hwif->OUTB((udma_speed_flag | 0x10), (high_16|0x001f)); in pdc202xx_reset_host()
623 hwif->OUTB((udma_speed_flag & ~0x10), (high_16|0x001f)); in pdc202xx_reset_host()
627 hwif->channel ? "Secondary" : "Primary"); in pdc202xx_reset_host()
632 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_reset() local
633 ide_hwif_t *mate = hwif->mate; in pdc202xx_reset()
635 pdc202xx_reset_host(hwif); in pdc202xx_reset()
637 hwif->tuneproc(drive, 5); in pdc202xx_reset()
647 ide_hwif_t *hwif = HWIF(drive); in pdc202xx_tristate() local
649 unsigned long high_16 = hwif->dma_master; in pdc202xx_tristate()
650 u8 sc1f = hwif->INB(high_16|0x001f); in pdc202xx_tristate()
652 if (!hwif) in pdc202xx_tristate()
658 hwif->OUTB(sc1f | 0x08, (high_16|0x001f)); in pdc202xx_tristate()
660 hwif->OUTB(sc1f & ~0x08, (high_16|0x001f)); in pdc202xx_tristate()
696 static void __init init_hwif_pdc202xx (ide_hwif_t *hwif) in init_hwif_pdc202xx() argument
698 hwif->autodma = 0; in init_hwif_pdc202xx()
699 hwif->tuneproc = &config_chipset_for_pio; in init_hwif_pdc202xx()
700 hwif->quirkproc = &pdc202xx_quirkproc; in init_hwif_pdc202xx()
702 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { in init_hwif_pdc202xx()
703 hwif->busproc = &pdc202xx_tristate; in init_hwif_pdc202xx()
704 hwif->resetproc = &pdc202xx_reset; in init_hwif_pdc202xx()
707 hwif->speedproc = &pdc202xx_tune_chipset; in init_hwif_pdc202xx()
709 if (!hwif->dma_base) { in init_hwif_pdc202xx()
710 hwif->drives[0].autotune = hwif->drives[1].autotune = 1; in init_hwif_pdc202xx()
714 hwif->ultra_mask = 0x3f; in init_hwif_pdc202xx()
715 hwif->mwdma_mask = 0x07; in init_hwif_pdc202xx()
716 hwif->swdma_mask = 0x07; in init_hwif_pdc202xx()
718 hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; in init_hwif_pdc202xx()
719 hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq; in init_hwif_pdc202xx()
720 hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout; in init_hwif_pdc202xx()
722 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { in init_hwif_pdc202xx()
723 if (!(hwif->udma_four)) in init_hwif_pdc202xx()
724 hwif->udma_four = (pdc202xx_old_cable_detect(hwif)) ? 0 : 1; in init_hwif_pdc202xx()
725 hwif->ide_dma_begin = &pdc202xx_old_ide_dma_begin; in init_hwif_pdc202xx()
726 hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; in init_hwif_pdc202xx()
728 hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq; in init_hwif_pdc202xx()
731 hwif->autodma = 1; in init_hwif_pdc202xx()
732 hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; in init_hwif_pdc202xx()
735 hwif->name, hwif->udma_four ? "80" : "40"); in init_hwif_pdc202xx()
739 static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase) in init_dma_pdc202xx() argument
743 if (hwif->channel) { in init_dma_pdc202xx()
744 ide_setup_dma(hwif, dmabase, 8); in init_dma_pdc202xx()
748 udma_speed_flag = hwif->INB((dmabase|0x1f)); in init_dma_pdc202xx()
749 primary_mode = hwif->INB((dmabase|0x1a)); in init_dma_pdc202xx()
750 secondary_mode = hwif->INB((dmabase|0x1b)); in init_dma_pdc202xx()
753 "Secondary %s Mode.\n", hwif->cds->name, in init_dma_pdc202xx()
761 hwif->cds->name, udma_speed_flag, in init_dma_pdc202xx()
763 hwif->OUTB(udma_speed_flag|1,(dmabase|0x1f)); in init_dma_pdc202xx()
765 (hwif->INB(dmabase|0x1f)&1) ? "":"IN"); in init_dma_pdc202xx()
771 "0x%02x -> 0x%02x ", hwif->cds->name, in init_dma_pdc202xx()
773 hwif->OUTB(primary_mode|1, (dmabase|0x1a)); in init_dma_pdc202xx()
775 (hwif->INB((dmabase|0x1a)) & 1) ? "MASTER" : "PCI"); in init_dma_pdc202xx()
780 "0x%02x -> 0x%02x ", hwif->cds->name, in init_dma_pdc202xx()
782 hwif->OUTB(secondary_mode|1, (dmabase|0x1b)); in init_dma_pdc202xx()
784 (hwif->INB((dmabase|0x1b)) & 1) ? "MASTER" : "PCI"); in init_dma_pdc202xx()
788 ide_setup_dma(hwif, dmabase, 8); in init_dma_pdc202xx()