// SPDX-License-Identifier: GPL-2.0-only /* * pata_atiixp.c - ATI PATA for new ATA layer * (C) 2005 Red Hat Inc * (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Based on * * linux/drivers/ide/pci/atiixp.c Version 0.01-bart2 Feb. 26, 2004 * * Copyright (C) 2003 ATI Inc. <hyu@ati.com> * Copyright (C) 2004 Bartlomiej Zolnierkiewicz *
*/
if (dmi_check_system(attixp_cable_override_dmi_table)) return ATA_CBL_PATA40_SHORT;
/* Hack from drivers/ide/pci. Really we want to know how to do the
raw detection not play follow the bios mode guess */
pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma); if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40) return ATA_CBL_PATA80; return ATA_CBL_PATA40;
}
static DEFINE_SPINLOCK(atiixp_lock);
/** * atiixp_prereset - perform reset handling * @link: ATA link * @deadline: deadline jiffies for the operation * * Reset sequence checking enable bits to see which ports are * active.
*/
if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) return -ENOENT;
return ata_sff_prereset(link, deadline);
}
/** * atiixp_set_pio_timing - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * @pio: Requested PIO * * Called by both the pio and dma setup functions to set the controller * timings for PIO transfers. We must load both the mode number and * timing values into the controller.
*/
/** * atiixp_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * * Called to do the PIO mode setup. We use a shared helper for this * as the DMA setup must also adjust the PIO timing information.
*/
/** * atiixp_set_dmamode - set initial DMA mode data * @ap: ATA interface * @adev: ATA device * * Called to do the DMA mode setup. We use timing tables for most * modes but must tune an appropriate PIO mode to match.
*/
pci_read_config_dword(pdev, ATIIXP_IDE_MWDMA_TIMING,
&mwdma_timing_data);
mwdma_timing_data &= ~(0xFF << timing_shift);
mwdma_timing_data |= (mwdma_timings[dma] << timing_shift);
pci_write_config_dword(pdev, ATIIXP_IDE_MWDMA_TIMING,
mwdma_timing_data);
} /* * We must now look at the PIO mode situation. We may need to * adjust the PIO mode to keep the timings acceptable
*/ if (adev->dma_mode >= XFER_MW_DMA_2)
wanted_pio = 4; elseif (adev->dma_mode == XFER_MW_DMA_1)
wanted_pio = 3; elseif (adev->dma_mode == XFER_MW_DMA_0)
wanted_pio = 0; else BUG();
if (adev->pio_mode != wanted_pio)
atiixp_set_pio_timing(ap, adev, wanted_pio);
spin_unlock_irqrestore(&atiixp_lock, flags);
}
/** * atiixp_bmdma_start - DMA start callback * @qc: Command in progress * * When DMA begins we need to ensure that the UDMA control * register for the channel is correctly set. * * Note: The host lock held by the libata layer protects * us from two channels both trying to set DMA bits at once
*/
/** * atiixp_bmdma_stop - DMA stop callback * @qc: Command in progress * * DMA has completed. Clear the UDMA flag as the next operations will * be PIO ones not UDMA data transfer. * * Note: The host lock held by the libata layer protects * us from two channels both trying to set DMA bits at once
*/
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.