// SPDX-License-Identifier: GPL-2.0-only /* * pata_artop.c - ARTOP ATA controller driver * * (C) 2006 Red Hat * (C) 2007,2011 Bartlomiej Zolnierkiewicz * * Based in part on drivers/ide/pci/aec62xx.c * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> * 865/865R fixes for Macintosh card version from a patch to the old * driver by Thibaut VARENE <varenet@parisc-linux.org> * When setting the PCI latency we must set 0x80 or higher for burst * performance Alessandro Zummo <alessandro.zummo@towertech.it> * * TODO * Investigate no_dsc on 850R * Clock detect
*/
/* * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we * get PCI bus speed functionality we leave this as 0. Its a variable * for when we get the functionality and also for folks wanting to * test stuff.
*/
staticint clock = 0;
/** * artop62x0_pre_reset - probe begin * @link: link * @deadline: deadline jiffies for the operation * * Nothing complicated needed here.
*/
/* Odd numbered device ids are the units with enable bits. */ if ((pdev->device & 1) &&
!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) return -ENOENT;
return ata_sff_prereset(link, deadline);
}
/** * artop6260_cable_detect - identify cable type * @ap: Port * * Identify the cable type for the ARTOP interface in question
*/
/** * artop6210_load_piomode - Load a set of PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device * @pio: PIO mode * * Set PIO mode for device, in host controller PCI config space. This * is used both to set PIO timings in PIO mode and also to set the * matching PIO clocking for UDMA, as well as the MWDMA timings. * * LOCKING: * None (inherited from caller).
*/
}; /* Load the PIO timing active/recovery bits */
pci_write_config_word(pdev, 0x40 + 2 * dn, timing[clock][pio]);
}
/** * artop6210_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device we are configuring * * Set PIO mode for device, in host controller PCI config space. For * ARTOP we must also clear the UDMA bits if we are not doing UDMA. In * the event UDMA is used the later call to set_dmamode will set the * bits as required. * * LOCKING: * None (inherited from caller).
*/
/* Clear the UDMA mode bits (set_dmamode will redo this if needed) */
pci_read_config_byte(pdev, 0x54, &ultra);
ultra &= ~(3 << (2 * dn));
pci_write_config_byte(pdev, 0x54, ultra);
}
/** * artop6260_load_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device we are configuring * @pio: PIO mode * * Set PIO mode for device, in host controller PCI config space. The * ARTOP6260 and relatives store the timing data differently. * * LOCKING: * None (inherited from caller).
*/
}; /* Load the PIO timing active/recovery bits */
pci_write_config_byte(pdev, 0x40 + dn, timing[clock][pio]);
}
/** * artop6260_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device we are configuring * * Set PIO mode for device, in host controller PCI config space. For * ARTOP we must also clear the UDMA bits if we are not doing UDMA. In * the event UDMA is used the later call to set_dmamode will set the * bits as required. * * LOCKING: * None (inherited from caller).
*/
/* Clear the UDMA mode bits (set_dmamode will redo this if needed) */
pci_read_config_byte(pdev, 0x44 + ap->port_no, &ultra);
ultra &= ~(7 << (4 * adev->devno)); /* One nibble per drive */
pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra);
}
/** * artop6210_set_dmamode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device whose timings we are configuring * * Set DMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller).
*/
/** * artop6260_set_dmamode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device we are configuring * * Set DMA mode for device, in host controller PCI config space. The * ARTOP6260 and relatives store the timing data differently. * * LOCKING: * None (inherited from caller).
*/
/* First apply the usual rules */
rc = ata_std_qc_defer(qc); if (rc != 0) return rc;
/* Now apply serialization rules. Only allow a command if the
other channel state machine is idle */ if (alt && alt->qc_active) return ATA_DEFER_PORT; return 0;
}
switch (pdev->device) { case 0x0005: /* BIOS may have left us in UDMA, clear it before libata probe */
pci_write_config_byte(pdev, 0x54, 0); break; case 0x0008: case 0x0009: /* Mac systems come up with some registers not set as we
will need them */
/* PCI latency must be > 0x80 for burst mode, tweak it * if required.
*/
pci_read_config_byte(pdev, PCI_LATENCY_TIMER, ®); if (reg <= 0x80)
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x90);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.