Lines Matching +full:pio +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * pata_radisys.c - Intel PATA/SATA controllers
30 * radisys_set_piomode - Initialize host controller PATA PIO timings
34 * Set PIO mode for device, in host controller PCI config space.
42 unsigned int pio = adev->pio_mode - XFER_PIO_0; in radisys_set_piomode() local
43 struct pci_dev *dev = to_pci_dev(ap->host->dev); in radisys_set_piomode()
48 * See Intel Document 298600-004 for the timing programing rules in radisys_set_piomode()
61 if (pio > 0) in radisys_set_piomode()
71 idetm_data |= (control << (4 * adev->devno)); in radisys_set_piomode()
72 idetm_data |= (timings[pio][0] << 12) | in radisys_set_piomode()
73 (timings[pio][1] << 8); in radisys_set_piomode()
77 ap->private_data = adev; in radisys_set_piomode()
81 * radisys_set_dmamode - Initialize host controller PATA DMA timings
85 * Set MWDMA mode for device, in host controller PCI config space.
93 struct pci_dev *dev = to_pci_dev(ap->host->dev); in radisys_set_dmamode()
105 * MWDMA is driven by the PIO timings. We must also enable in radisys_set_dmamode()
112 if (adev->dma_mode < XFER_UDMA_0) { in radisys_set_dmamode()
113 unsigned int mwdma = adev->dma_mode - XFER_MW_DMA_0; in radisys_set_dmamode()
117 int pio = needed_pio[mwdma] - XFER_PIO_0; in radisys_set_dmamode() local
120 /* If the drive MWDMA is faster than it can do PIO then in radisys_set_dmamode()
121 we must force PIO0 for PIO cycles. */ in radisys_set_dmamode()
123 if (adev->pio_mode < needed_pio[mwdma]) in radisys_set_dmamode()
130 idetm_data |= control << (4 * adev->devno); in radisys_set_dmamode()
131 idetm_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); in radisys_set_dmamode()
133 udma_enable &= ~(1 << adev->devno); in radisys_set_dmamode()
141 if (adev->xfer_mode == XFER_UDMA_2) in radisys_set_dmamode()
142 udma_mode &= ~(2 << (adev->devno * 4)); in radisys_set_dmamode()
144 udma_mode |= (2 << (adev->devno * 4)); in radisys_set_dmamode()
148 udma_enable |= (1 << adev->devno); in radisys_set_dmamode()
154 ap->private_data = adev; in radisys_set_dmamode()
158 * radisys_qc_issue - command issue
170 struct ata_port *ap = qc->ap; in radisys_qc_issue()
171 struct ata_device *adev = qc->dev; in radisys_qc_issue()
173 if (adev != ap->private_data) { in radisys_qc_issue()
175 if (adev->dma_mode < XFER_UDMA_0 || !ata_dma_enabled(adev)) { in radisys_qc_issue()
178 else if (adev->pio_mode) in radisys_qc_issue()
200 * radisys_init_one - Register PIIX ATA PCI device with kernel services
204 * Called from kernel PCI layer. We probe for combined mode (sigh),
211 * Zero on success, or -ERRNO value.
225 ata_print_version_once(&pdev->dev, DRV_VERSION); in radisys_init_one()
250 MODULE_DESCRIPTION("SCSI low-level driver for Radisys R82600 controllers");