Lines Matching +full:pio +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * pata_oldpiix.c - Intel PATA/SATA controllers
31 * oldpiix_pre_reset - probe begin
40 struct ata_port *ap = link->ap; in oldpiix_pre_reset()
41 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in oldpiix_pre_reset()
47 if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no])) in oldpiix_pre_reset()
48 return -ENOENT; in oldpiix_pre_reset()
54 * oldpiix_set_piomode - Initialize host controller PATA PIO timings
58 * Set PIO mode for device, in host controller PCI config space.
66 unsigned int pio = adev->pio_mode - XFER_PIO_0; in oldpiix_set_piomode() local
67 struct pci_dev *dev = to_pci_dev(ap->host->dev); in oldpiix_set_piomode()
68 unsigned int idetm_port= ap->port_no ? 0x42 : 0x40; in oldpiix_set_piomode()
73 * See Intel Document 298600-004 for the timing programing rules in oldpiix_set_piomode()
85 if (pio > 1) in oldpiix_set_piomode()
91 if (adev->class == ATA_DEV_ATA) in oldpiix_set_piomode()
100 if (adev->devno == 0) { in oldpiix_set_piomode()
107 idetm_data |= (timings[pio][0] << 12) | in oldpiix_set_piomode()
108 (timings[pio][1] << 8); in oldpiix_set_piomode()
112 ap->private_data = adev; in oldpiix_set_piomode()
116 * oldpiix_set_dmamode - Initialize host controller PATA DMA timings
120 * Set MWDMA mode for device, in host controller PCI config space.
128 struct pci_dev *dev = to_pci_dev(ap->host->dev); in oldpiix_set_dmamode()
129 u8 idetm_port = ap->port_no ? 0x42 : 0x40; in oldpiix_set_dmamode()
140 * MWDMA is driven by the PIO timings. We must also enable in oldpiix_set_dmamode()
142 * been set when the PIO timing was set. in oldpiix_set_dmamode()
145 unsigned int mwdma = adev->dma_mode - XFER_MW_DMA_0; in oldpiix_set_dmamode()
150 int pio = needed_pio[mwdma] - XFER_PIO_0; in oldpiix_set_dmamode() local
156 if (adev->class == ATA_DEV_ATA) in oldpiix_set_dmamode()
159 /* If the drive MWDMA is faster than it can do PIO then in oldpiix_set_dmamode()
160 we must force PIO into PIO0 */ in oldpiix_set_dmamode()
162 if (adev->pio_mode < needed_pio[mwdma]) in oldpiix_set_dmamode()
164 control |= 8; /* PIO cycles in PIO0 */ in oldpiix_set_dmamode()
168 if (adev->devno == 0) { in oldpiix_set_dmamode()
175 idetm_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); in oldpiix_set_dmamode()
179 ap->private_data = adev; in oldpiix_set_dmamode()
183 * oldpiix_qc_issue - command issue
195 struct ata_port *ap = qc->ap; in oldpiix_qc_issue()
196 struct ata_device *adev = qc->dev; in oldpiix_qc_issue()
198 if (adev != ap->private_data) { in oldpiix_qc_issue()
222 * oldpiix_init_one - Register PIIX ATA PCI device with kernel services
226 * Called from kernel PCI layer. We probe for combined mode (sigh),
233 * Zero on success, or -ERRNO value.
246 ata_print_version_once(&pdev->dev, DRV_VERSION); in oldpiix_init_one()
271 MODULE_DESCRIPTION("SCSI low-level driver for early PIIX series controllers");