Lines Matching +full:disable +full:- +full:report +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0-only
9 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
12 * Portions Copyright (C) 2005-2010 MontaVista Software, Inc.
85 * hpt3x2n_find_mode - reset the hpt3x2n bus
99 while (clocks->xfer_speed) { in hpt3x2n_find_mode()
100 if (clocks->xfer_speed == speed) in hpt3x2n_find_mode()
101 return clocks->timing; in hpt3x2n_find_mode()
109 * hpt372n_filter - mode selection filter
111 * @mask: mode mask
116 static unsigned int hpt372n_filter(struct ata_device *adev, unsigned int mask) in hpt372n_filter() argument
118 if (ata_id_is_sata(adev->id)) in hpt372n_filter()
119 mask &= ~((0xE << ATA_SHIFT_UDMA) | ATA_MASK_MWDMA); in hpt372n_filter()
121 return mask; in hpt372n_filter()
125 * hpt3x2n_cable_detect - Detect the cable type
134 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt3x2n_cable_detect()
146 if (ata66 & (2 >> ap->port_no)) in hpt3x2n_cable_detect()
153 * hpt3x2n_pre_reset - reset the hpt3x2n bus
163 struct ata_port *ap = link->ap; in hpt3x2n_pre_reset()
164 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt3x2n_pre_reset()
171 if (!pci_test_config_bits(pdev, &hpt3x2n_enable_bits[ap->port_no])) in hpt3x2n_pre_reset()
172 return -ENOENT; in hpt3x2n_pre_reset()
175 pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); in hpt3x2n_pre_reset()
178 /* Fast interrupt prediction disable, hold off interrupt disable */ in hpt3x2n_pre_reset()
179 pci_read_config_byte(pdev, 0x51 + 4 * ap->port_no, &mcr2); in hpt3x2n_pre_reset()
181 pci_write_config_byte(pdev, 0x51 + 4 * ap->port_no, mcr2); in hpt3x2n_pre_reset()
189 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt3x2n_set_mode()
190 int addr = 0x40 + 4 * (adev->devno + 2 * ap->port_no); in hpt3x2n_set_mode()
191 u32 reg, timing, mask; in hpt3x2n_set_mode() local
193 /* Determine timing mask and find matching mode entry */ in hpt3x2n_set_mode()
195 mask = 0xcfc3ffff; in hpt3x2n_set_mode()
197 mask = 0x31c001ff; in hpt3x2n_set_mode()
199 mask = 0x303c0000; in hpt3x2n_set_mode()
204 reg = (reg & ~mask) | (timing & mask); in hpt3x2n_set_mode()
209 * hpt3x2n_set_piomode - PIO setup
218 hpt3x2n_set_mode(ap, adev, adev->pio_mode); in hpt3x2n_set_piomode()
222 * hpt3x2n_set_dmamode - DMA timing setup
231 hpt3x2n_set_mode(ap, adev, adev->dma_mode); in hpt3x2n_set_dmamode()
235 * hpt3x2n_bmdma_stop - DMA engine stop
243 struct ata_port *ap = qc->ap; in hpt3x2n_bmdma_stop()
244 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in hpt3x2n_bmdma_stop()
245 int mscreg = 0x50 + 4 * ap->port_no; in hpt3x2n_bmdma_stop()
250 if (bwsr_stat & (1 << ap->port_no)) in hpt3x2n_bmdma_stop()
256 * hpt3x2n_set_clock - clock control
264 * - writing
265 * - second channel UDMA7 (SATA ports) or higher
266 * - 66MHz PCI
273 void __iomem *bmdma = ap->ioaddr.bmdma_addr - ap->port_no * 8; in hpt3x2n_set_clock()
297 long flags = (long)ap->host->private_data; in hpt3x2n_use_dpll()
309 struct ata_port *ap = qc->ap; in hpt3x2n_qc_defer()
310 struct ata_port *alt = ap->host->ports[ap->port_no ^ 1]; in hpt3x2n_qc_defer()
311 int rc, flags = (long)ap->host->private_data; in hpt3x2n_qc_defer()
312 int dpll = hpt3x2n_use_dpll(ap, qc->tf.flags & ATA_TFLAG_WRITE); in hpt3x2n_qc_defer()
319 if ((flags & USE_DPLL) != dpll && alt->qc_active) in hpt3x2n_qc_defer()
326 struct ata_port *ap = qc->ap; in hpt3x2n_qc_issue()
327 int flags = (long)ap->host->private_data; in hpt3x2n_qc_issue()
328 int dpll = hpt3x2n_use_dpll(ap, qc->tf.flags & ATA_TFLAG_WRITE); in hpt3x2n_qc_issue()
333 ap->host->private_data = (void *)(long)flags; in hpt3x2n_qc_issue()
372 * hpt3xn_calibrate_dpll - Calibrate the DPLL loop
421 dev_warn(&pdev->dev, "BIOS clock data not set\n"); in hpt3x2n_pci_clock()
446 * hpt3x2n_init_one - Initialise an HPT37X/302
451 * here. Firstly the chip may report 366 and be one of several variants.
475 /* HPT372N - UDMA133 */ in hpt3x2n_init_one()
483 /* HPT302N and HPT371N - UDMA133 */ in hpt3x2n_init_one()
492 u8 rev = dev->revision; in hpt3x2n_init_one()
505 switch (dev->device) { in hpt3x2n_init_one()
509 return -ENODEV; in hpt3x2n_init_one()
514 return -ENODEV; in hpt3x2n_init_one()
519 return -ENODEV; in hpt3x2n_init_one()
524 return -ENODEV; in hpt3x2n_init_one()
531 dev_err(&dev->dev,"PCI table is bogus, please report (%d)\n", in hpt3x2n_init_one()
532 dev->device); in hpt3x2n_init_one()
533 return -ENODEV; in hpt3x2n_init_one()
550 * So, we manually disable the non-existing channel here in hpt3x2n_init_one()
553 if (dev->device == PCI_DEVICE_ID_TTI_HPT371) { in hpt3x2n_init_one()
581 dev_err(&dev->dev, "DPLL did not stabilize!\n"); in hpt3x2n_init_one()
582 return -ENODEV; in hpt3x2n_init_one()
585 dev_info(&dev->dev, "bus clock %dMHz, using 66MHz DPLL\n", pci_mhz); in hpt3x2n_init_one()
599 if (dev->device == PCI_DEVICE_ID_TTI_HPT371) in hpt3x2n_init_one()
626 MODULE_DESCRIPTION("low-level driver for the Highpoint HPT3xxN");