// SPDX-License-Identifier: GPL-2.0-only /* * pata_efar.c - EFAR PIIX clone controller driver * * (C) 2005 Red Hat * (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Some parts based on ata_piix.c by Jeff Garzik and others. * * The EFAR is a PIIX4 clone with UDMA66 support. Unlike the later * Intel ICH controllers the EFAR widened the UDMA mode register bits * and doesn't require the funky clock selection.
*/
/** * efar_pre_reset - Enable bits * @link: ATA link * @deadline: deadline jiffies for the operation * * Perform cable detection for the EFAR ATA interface. This is * different to the PIIX arrangement
*/
if (!pci_test_config_bits(pdev, &efar_enable_bits[ap->port_no])) return -ENOENT;
return ata_sff_prereset(link, deadline);
}
/** * efar_cable_detect - check for 40/80 pin * @ap: Port * * Perform cable detection for the EFAR ATA interface. This is * different to the PIIX arrangement
*/
/** * efar_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device to program * * Set PIO mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller).
*/
if (pio > 1)
control |= 1; /* TIME */ if (ata_pio_need_iordy(adev)) /* PIO 3/4 require IORDY */
control |= 2; /* IE */ /* Intel specifies that the prefetch/posting is for disk only */ if (adev->class == ATA_DEV_ATA)
control |= 4; /* PPE */
/** * efar_set_dmamode - Initialize host controller PATA DMA timings * @ap: Port whose timings we are configuring * @adev: Device to program * * Set UDMA/MWDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller).
*/
/* Load the UDMA mode number */
pci_read_config_word(dev, 0x4A, &udma_timing);
udma_timing &= ~(7 << (4 * devid));
udma_timing |= udma << (4 * devid);
pci_write_config_word(dev, 0x4A, udma_timing);
} else { /* * MWDMA is driven by the PIO timings. We must also enable * IORDY unconditionally along with TIME1. PPE has already * been set when the PIO timing was set.
*/ unsignedint mwdma = adev->dma_mode - XFER_MW_DMA_0; unsignedint control;
u8 slave_data; constunsignedint needed_pio[3] = {
XFER_PIO_0, XFER_PIO_3, XFER_PIO_4
}; int pio = needed_pio[mwdma] - XFER_PIO_0;
control = 3; /* IORDY|TIME1 */
/* If the drive MWDMA is faster than it can do PIO then
we must force PIO into PIO0 */
if (adev->pio_mode < needed_pio[mwdma]) /* Enable DMA timing only */
control |= 8; /* PIO cycles in PIO0 */
/** * efar_init_one - Register EFAR ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in efar_pci_tbl matching with @pdev * * Called from kernel PCI layer. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value.
*/
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.