// SPDX-License-Identifier: GPL-2.0-only /* * pata_it8213.c - iTE Tech. Inc. IT8213 PATA driver * * The IT8213 is a very Intel ICH like device for timing purposes, having * a similar register layout and the same split clock arrangement. Cable * detection is different, and it does not have slave channels or all the * clutter of later ICH/SATA setups.
*/
/** * it8213_pre_reset - probe begin * @link: link * @deadline: deadline jiffies for the operation * * Filter out ports by the enable bits before doing the normal reset * and probe.
*/
/** * it8213_cable_detect - check for 40/80 pin * @ap: Port * * Perform cable detection for the 8213 ATA interface. This is * different to the PIIX arrangement
*/
/** * it8213_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring * @adev: Device whose timings we are configuring * * 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 */ /* Bit 2 is set for ATAPI on the IT8213 - reverse of ICH/PIIX */ if (adev->class != ATA_DEV_ATA)
control |= 4; /* PPE */
master_data |= 0x4000; /* Ensure SITRE is set */
pci_write_config_word(dev, master_port, master_data);
}
/** * it8213_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. * This device is basically an ICH alike. * * LOCKING: * None (inherited from caller).
*/
/* Load the clock selection */
pci_read_config_word(dev, 0x54, &ideconf);
ideconf &= ~(0x1001 << devid);
ideconf |= u_clock << devid;
pci_write_config_word(dev, 0x54, ideconf);
} 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; staticconstunsignedint 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 */
/** * it8213_init_one - Register 8213 ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in it8213_pci_tbl matching with @pdev * * Called from kernel PCI layer. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value.
*/
staticint it8213_init_one (struct pci_dev *pdev, conststruct pci_device_id *ent)
{ staticconststruct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA12_ONLY,
.udma_mask = ATA_UDMA6,
.port_ops = &it8213_ops,
}; /* Current IT8213 stuff is single port */ conststruct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
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.