// SPDX-License-Identifier: GPL-2.0-only /* * pata_mpiix.c - Intel MPIIX PATA for new ATA layer * (C) 2005-2006 Red Hat Inc * Alan Cox <alan@lxorguk.ukuu.org.uk> * * The MPIIX is different enough to the PIIX4 and friends that we give it * a separate driver. The old ide/pci code handles this by just not tuning * MPIIX at all. * * The MPIIX also differs in another important way from the majority of PIIX * devices. The chip is a bridge (pardon the pun) between the old world of * ISA IDE and PCI IDE. Although the ATA timings are PCI configured the actual * IDE controller is not decoded in PCI space and the chip does not claim to * be IDE class PCI. This requires slightly non-standard probe logic compared * with PCI IDE and also that we do not disable the device when our driver is * unloaded (as it has many other functions). * * The driver consciously keeps this logic internally to avoid pushing quirky * PATA history into the clean libata layer. * * Thinkpad specific note: If you boot an MPIIX using a thinkpad with a PCMCIA * hard disk present this driver will not detect it. This is not a bug. In this * configuration the secondary port of the MPIIX is disabled and the addresses * are decoded by the PCMCIA bridge and therefore are for a generic IDE driver * to operate.
*/
if (!pci_test_config_bits(pdev, &mpiix_enable_bits)) return -ENOENT;
return ata_sff_prereset(link, deadline);
}
/** * mpiix_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * * Called to do the PIO mode setup. The MPIIX allows us to program the * IORDY sample point (2-5 clocks), recovery (1-4 clocks) and whether * prefetching or IORDY are used. * * This would get very ugly because we can only program timing for one * device at a time, the other gets PIO0. Fortunately libata calls * our qc_issue command before a command is issued so we can flip the * timings back and forth to reduce the pain.
*/
/* Mask the IORDY/TIME/PPE for this device */ if (adev->class == ATA_DEV_ATA)
control |= PPE; /* Enable prefetch/posting for disk */ if (ata_pio_need_iordy(adev))
control |= IORDY; if (pio > 1)
control |= FTIM; /* This drive is on the fast timing bank */
/* Mask out timing and clear both TIME bank selects */
idetim &= 0xCCEE;
idetim &= ~(0x07 << (4 * adev->devno));
idetim |= control << (4 * adev->devno);
/* We use ap->private_data as a pointer to the device currently
loaded for timing */
ap->private_data = adev;
}
/** * mpiix_qc_issue - command issue * @qc: command pending * * Called when the libata layer is about to issue a command. We wrap * this interface so that we can load the correct ATA timings if * necessary. Our logic also clears TIME0/TIME1 for the other device so * that, even if we get this wrong, cycles to the other device will * be made PIO0.
*/
/* If modes have been configured and the channel data is not loaded then load it. We have to check if pio_mode is set as the core code does not set adev->pio_mode to XFER_PIO_0 while probing as would be
logical */
if (adev->pio_mode && adev != ap->private_data)
mpiix_set_piomode(ap, adev);
/* We do our own plumbing to avoid leaking special cases for whacko ancient hardware into the core code. There are two issues to worry about. #1 The chip is a bridge so if in legacy mode and without BARs set fools the setup. #2 If you pci_disable_device
the MPIIX your box goes castors up */
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.