Lines Matching +full:flip +full:- +full:chip
1 // SPDX-License-Identifier: GPL-2.0-only
3 * pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer
29 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in pdc2026x_cable_detect()
33 if (cis & (1 << (10 + ap->port_no))) in pdc2026x_cable_detect()
41 iowrite8(tf->command, ap->ioaddr.command_addr); in pdc202xx_exec_command()
47 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in pdc202xx_irq_check()
51 if (ap->port_no) { in pdc202xx_irq_check()
67 * pdc202xx_configure_piomode - set chip PIO timing
79 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in pdc202xx_configure_piomode()
80 int port = 0x60 + 8 * ap->port_no + 4 * adev->devno; in pdc202xx_configure_piomode()
95 if (adev->class == ATA_DEV_ATA) in pdc202xx_configure_piomode()
102 * pdc202xx_set_piomode - set initial PIO mode data
112 pdc202xx_configure_piomode(ap, adev, adev->pio_mode - XFER_PIO_0); in pdc202xx_set_piomode()
116 * pdc202xx_set_dmamode - set DMA mode in chip
120 * Load DMA cycle times into the chip ready for a DMA transfer
126 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in pdc202xx_set_dmamode()
127 int port = 0x60 + 8 * ap->port_no + 4 * adev->devno; in pdc202xx_set_dmamode()
149 if (adev->dma_mode >= XFER_UDMA_0) { in pdc202xx_set_dmamode()
150 int speed = adev->dma_mode - XFER_UDMA_0; in pdc202xx_set_dmamode()
155 int speed = adev->dma_mode - XFER_MW_DMA_0; in pdc202xx_set_dmamode()
165 * pdc2026x_bmdma_start - DMA engine begin
177 struct ata_port *ap = qc->ap; in pdc2026x_bmdma_start()
178 struct ata_device *adev = qc->dev; in pdc2026x_bmdma_start()
179 struct ata_taskfile *tf = &qc->tf; in pdc2026x_bmdma_start()
180 int sel66 = ap->port_no ? 0x08: 0x02; in pdc2026x_bmdma_start()
182 void __iomem *master = ap->host->ports[0]->ioaddr.bmdma_addr; in pdc2026x_bmdma_start()
184 void __iomem *atapi_reg = master + 0x20 + (4 * ap->port_no); in pdc2026x_bmdma_start()
189 if (adev->dma_mode > XFER_UDMA_2) in pdc2026x_bmdma_start()
196 pdc202xx_set_dmamode(ap, qc->dev); in pdc2026x_bmdma_start()
199 if ((tf->flags & ATA_TFLAG_LBA48) || tf->protocol == ATAPI_PROT_DMA) { in pdc2026x_bmdma_start()
200 len = qc->nbytes / 2; in pdc2026x_bmdma_start()
202 if (tf->flags & ATA_TFLAG_WRITE) in pdc2026x_bmdma_start()
215 * pdc2026x_bmdma_stop - DMA engine stop
227 struct ata_port *ap = qc->ap; in pdc2026x_bmdma_stop()
228 struct ata_device *adev = qc->dev; in pdc2026x_bmdma_stop()
229 struct ata_taskfile *tf = &qc->tf; in pdc2026x_bmdma_stop()
231 int sel66 = ap->port_no ? 0x08: 0x02; in pdc2026x_bmdma_stop()
233 void __iomem *master = ap->host->ports[0]->ioaddr.bmdma_addr; in pdc2026x_bmdma_stop()
235 void __iomem *atapi_reg = master + 0x20 + (4 * ap->port_no); in pdc2026x_bmdma_stop()
238 if (tf->protocol == ATAPI_PROT_DMA || (tf->flags & ATA_TFLAG_LBA48)) { in pdc2026x_bmdma_stop()
242 /* Flip back to 33Mhz for PIO */ in pdc2026x_bmdma_stop()
243 if (adev->dma_mode > XFER_UDMA_2) in pdc2026x_bmdma_stop()
250 * pdc2026x_dev_config - device setup hook
253 * Perform chip specific early setup. We need to lock the transfer
260 adev->max_sectors = 256; in pdc2026x_dev_config()
265 void __iomem *bmdma = ap->ioaddr.bmdma_addr; in pdc2026x_port_start()
275 * pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
278 * Just say no - not supported on older Promise.
349 const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL }; in pdc202xx_init_one()
351 if (dev->device == PCI_DEVICE_ID_PROMISE_20265) { in pdc202xx_init_one()
352 struct pci_dev *bridge = dev->bus->self; in pdc202xx_init_one()
354 if (bridge && bridge->vendor == PCI_VENDOR_ID_INTEL) { in pdc202xx_init_one()
355 if (bridge->device == PCI_DEVICE_ID_INTEL_I960) in pdc202xx_init_one()
356 return -ENODEV; in pdc202xx_init_one()
357 if (bridge->device == PCI_DEVICE_ID_INTEL_I960RM) in pdc202xx_init_one()
358 return -ENODEV; in pdc202xx_init_one()
388 MODULE_DESCRIPTION("low-level driver for Promise 2024x and 20262-20267");