// SPDX-License-Identifier: GPL-2.0-only /* * pata_amd.c - AMD PATA for new ATA layer * (C) 2005-2006 Red Hat Inc * * Based on pata-sil680. Errata information is taken from data sheets * and the amd74xx.c driver by Vojtech Pavlik. Nvidia SATA devices are * claimed by sata-nv.c. * * TODO: * Variable system clock when/if it makes sense * Power management on ports * * * Documentation publicly available.
*/
/** * timing_setup - shared timing computation and load * @ap: ATA port being set up * @adev: drive being configured * @offset: port offset * @speed: target speed * @clock: clock multiplier (number of times 33MHz for this part) * * Perform the actual timing set up for Nvidia or AMD PATA devices. * The actual devices vary so they all call into this helper function * providing the clock multipler and offset (because AMD and Nvidia put * the ports at different locations).
*/
/** * amd_pre_reset - perform reset handling * @link: ATA link * @deadline: deadline jiffies for the operation * * Reset sequence checking enable bits to see which ports are * active.
*/
/** * amd_fifo_setup - set the PIO FIFO for ATA/ATAPI * @ap: ATA interface * * Set the PCI fifo for this device according to the devices present * on the bus at this point in time. We need to turn the post write buffer * off for ATAPI devices as we may need to issue a word sized write to the * device as the final I/O
*/
ata_for_each_dev(adev, &ap->link, ENABLED) { if (adev->class == ATA_DEV_ATAPI)
fifo = 0;
} if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411) /* FIFO is broken */
fifo = 0;
/* On the later chips the read prefetch bits become no-op bits */
pci_read_config_byte(pdev, 0x41, &r);
r &= ~fifobit[ap->port_no];
r |= fifo;
pci_write_config_byte(pdev, 0x41, r);
}
/** * amd33_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * * Program the AMD registers for PIO mode.
*/
/** * amd33_set_dmamode - set initial DMA mode data * @ap: ATA interface * @adev: ATA device * * Program the MWDMA/UDMA modes for the AMD and Nvidia * chipset.
*/
/* Both host-side and drive-side detection results are worthless on NV * PATAs. Ignore them and just follow what BIOS configured. Both the * current configuration in PCI config reg and ACPI GTM result are * cached during driver attach and are consulted to select transfer * mode.
*/ staticunsignedint nv_mode_filter(struct ata_device *dev, unsignedint xfer_mask)
{ staticconstunsignedint udma_mask_map[] =
{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
ATA_UDMA3, ATA_UDMA4, ATA_UDMA5, ATA_UDMA6 }; struct ata_port *ap = dev->link->ap; char acpi_str[32] = "";
u32 saved_udma, udma; conststruct ata_acpi_gtm *gtm; unsignedint bios_limit = 0, acpi_limit = 0, limit;
/* find out what BIOS configured */
udma = saved_udma = (unsignedlong)ap->host->private_data;
if (ap->port_no == 0)
udma >>= 16; if (dev->devno == 0)
udma >>= 8;
/* be optimistic, EH can take care of things if something goes wrong */
limit = bios_limit | acpi_limit;
/* If PIO or DMA isn't configured at all, don't limit. Let EH * handle it.
*/ if (!(limit & ATA_MASK_PIO))
limit |= ATA_MASK_PIO; if (!(limit & (ATA_MASK_MWDMA | ATA_MASK_UDMA)))
limit |= ATA_MASK_MWDMA | ATA_MASK_UDMA; /* PIO4, MWDMA2, UDMA2 should always be supported regardless of
cable detection result */
limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
/** * nv_pre_reset - cable detection * @link: ATA link * @deadline: deadline jiffies for the operation * * Perform cable detection. The BIOS stores this in PCI config * space for us.
*/
/** * nv100_set_dmamode - set initial DMA mode data * @ap: ATA interface * @adev: ATA device * * Program the MWDMA/UDMA modes for the AMD and Nvidia * chipset.
*/
MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, amd);
MODULE_VERSION(DRV_VERSION);
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.2Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-08)
¤
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.