// SPDX-License-Identifier: GPL-2.0-only /* * pata_cmd64x.c - CMD64x PATA for new ATA layer * (C) 2005 Red Hat Inc * Alan Cox <[email protected]> * (C) 2009-2010 Bartlomiej Zolnierkiewicz * (C) 2012 MontaVista Software, LLC <[email protected]> * * Based upon * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002 * * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. * Note, this driver is not used at all on other systems because * there the "BIOS" has done all of the following already. * Due to massive hardware bugs, UltraDMA is only supported * on the 646U2 and not on the 646U. * * Copyright (C) 1998 Eddie C. Dost ([email protected]) * Copyright (C) 1998 David S. Miller ([email protected]) * * Copyright (C) 1999-2002 Andre Hedrick <[email protected]> * * TODO * Testing work */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #define DRV_NAME … #define DRV_VERSION … /* * CMD64x specific registers definition. */ enum { … }; static int cmd648_cable_detect(struct ata_port *ap) { … } /** * cmd64x_set_timing - set PIO and MWDMA timing * @ap: ATA interface * @adev: ATA device * @mode: mode * * Called to do the PIO and MWDMA mode setup. */ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 mode) { … } /** * cmd64x_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device * * Used when configuring the devices ot set the PIO timings. All the * actual work is done by the PIO/MWDMA setting helper */ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev) { … } /** * cmd64x_set_dmamode - set initial DMA mode data * @ap: ATA interface * @adev: ATA device * * Called to do the DMA mode setup. */ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) { … } /** * cmd64x_sff_irq_check - check IDE interrupt * @ap: ATA interface * * Check IDE interrupt in CFR/ARTTIM23 registers. */ static bool cmd64x_sff_irq_check(struct ata_port *ap) { … } /** * cmd64x_sff_irq_clear - clear IDE interrupt * @ap: ATA interface * * Clear IDE interrupt in CFR/ARTTIM23 and DMA status registers. */ static void cmd64x_sff_irq_clear(struct ata_port *ap) { … } /** * cmd648_sff_irq_check - check IDE interrupt * @ap: ATA interface * * Check IDE interrupt in MRDMODE register. */ static bool cmd648_sff_irq_check(struct ata_port *ap) { … } /** * cmd648_sff_irq_clear - clear IDE interrupt * @ap: ATA interface * * Clear IDE interrupt in MRDMODE and DMA status registers. */ static void cmd648_sff_irq_clear(struct ata_port *ap) { … } /** * cmd646r1_bmdma_stop - DMA stop callback * @qc: Command in progress * * Stub for now while investigating the r1 quirk in the old driver. */ static void cmd646r1_bmdma_stop(struct ata_queued_cmd *qc) { … } static const struct scsi_host_template cmd64x_sht = …; static const struct ata_port_operations cmd64x_base_ops = …; static struct ata_port_operations cmd64x_port_ops = …; static struct ata_port_operations cmd646r1_port_ops = …; static struct ata_port_operations cmd646r3_port_ops = …; static struct ata_port_operations cmd648_port_ops = …; static void cmd64x_fixup(struct pci_dev *pdev) { … } static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) { … } #ifdef CONFIG_PM_SLEEP static int cmd64x_reinit_one(struct pci_dev *pdev) { … } #endif static const struct pci_device_id cmd64x[] = …; static struct pci_driver cmd64x_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, cmd64x); MODULE_VERSION(…);