Lines Matching +full:ide +full:- +full:port
1 // SPDX-License-Identifier: GPL-2.0-only
3 * pata_cmd64x.c - CMD64x PATA for new ATA layer
6 * (C) 2009-2010 Bartlomiej Zolnierkiewicz
10 * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002
21 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
75 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd648_cable_detect()
80 if (r & (1 << ap->port_no)) in cmd648_cable_detect()
86 * cmd64x_set_timing - set PIO and MWDMA timing
96 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd64x_set_timing()
103 /* Port layout is not logical so use a table */ in cmd64x_set_timing()
113 int arttim = arttim_port[ap->port_no][adev->devno]; in cmd64x_set_timing()
114 int drwtim = drwtim_port[ap->port_no][adev->devno]; in cmd64x_set_timing()
122 if (ap->port_no) { in cmd64x_set_timing()
128 ata_timing_compute(pair, pair->pio_mode, &tp, T, 0); in cmd64x_set_timing()
136 t.active += t.recover - 16; in cmd64x_set_timing()
148 t.recover--; in cmd64x_set_timing()
170 * cmd64x_set_piomode - set initial PIO mode data
180 cmd64x_set_timing(ap, adev, adev->pio_mode); in cmd64x_set_piomode()
184 * cmd64x_set_dmamode - set initial DMA mode data
197 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd64x_set_dmamode()
200 int pciU = UDIDETCR0 + 8 * ap->port_no; in cmd64x_set_dmamode()
201 int pciD = BMIDESR0 + 8 * ap->port_no; in cmd64x_set_dmamode()
202 int shift = 2 * adev->devno; in cmd64x_set_dmamode()
208 regD &= ~(0x20 << adev->devno); in cmd64x_set_dmamode()
212 regU &= ~(0x05 << adev->devno); in cmd64x_set_dmamode()
214 if (adev->dma_mode >= XFER_UDMA_0) { in cmd64x_set_dmamode()
216 regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; in cmd64x_set_dmamode()
218 regU |= 1 << adev->devno; /* UDMA on */ in cmd64x_set_dmamode()
219 if (adev->dma_mode > XFER_UDMA_2) /* 15nS timing */ in cmd64x_set_dmamode()
220 regU |= 4 << adev->devno; in cmd64x_set_dmamode()
222 regU &= ~ (1 << adev->devno); /* UDMA off */ in cmd64x_set_dmamode()
223 cmd64x_set_timing(ap, adev, adev->dma_mode); in cmd64x_set_dmamode()
226 regD |= 0x20 << adev->devno; in cmd64x_set_dmamode()
233 * cmd64x_sff_irq_check - check IDE interrupt
236 * Check IDE interrupt in CFR/ARTTIM23 registers.
241 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd64x_sff_irq_check()
242 int irq_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; in cmd64x_sff_irq_check()
243 int irq_reg = ap->port_no ? ARTTIM23 : CFR; in cmd64x_sff_irq_check()
253 * cmd64x_sff_irq_clear - clear IDE interrupt
256 * Clear IDE interrupt in CFR/ARTTIM23 and DMA status registers.
261 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd64x_sff_irq_clear()
262 int irq_reg = ap->port_no ? ARTTIM23 : CFR; in cmd64x_sff_irq_clear()
272 * cmd648_sff_irq_check - check IDE interrupt
275 * Check IDE interrupt in MRDMODE register.
280 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd648_sff_irq_check()
282 int irq_mask = ap->port_no ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0; in cmd648_sff_irq_check()
289 * cmd648_sff_irq_clear - clear IDE interrupt
292 * Clear IDE interrupt in MRDMODE and DMA status registers.
297 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in cmd648_sff_irq_clear()
299 int irq_mask = ap->port_no ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0; in cmd648_sff_irq_clear()
304 /* Clear this port's interrupt bit (leaving the other port alone) */ in cmd648_sff_irq_clear()
311 * cmd646r1_bmdma_stop - DMA stop callback
380 { /* CMD 643 - no UDMA */ in cmd64x_init_one()
427 &cmd_info[id->driver_data], in cmd64x_init_one()
428 &cmd_info[id->driver_data], in cmd64x_init_one()
433 struct pci_dev *bridge = pdev->bus->self; in cmd64x_init_one()
435 int port_ok = !(bridge && bridge->vendor == in cmd64x_init_one()
438 int cntrl_ch0_ok = (id->driver_data != 0); in cmd64x_init_one()
444 if (id->driver_data == 0) /* 643 */ in cmd64x_init_one()
447 if (pdev->device == PCI_DEVICE_ID_CMD_646) in cmd64x_init_one()
448 switch (pdev->revision) { in cmd64x_init_one()
477 dev_notice(&pdev->dev, "Mobility Bridge detected, ignoring CNTRL port enable/disable\n"); in cmd64x_init_one()
479 dev_notice(&pdev->dev, "Primary port is disabled\n"); in cmd64x_init_one()
484 dev_notice(&pdev->dev, "Secondary port is disabled\n"); in cmd64x_init_one()
531 MODULE_DESCRIPTION("low-level driver for CMD64x series PATA controllers");