2 * linux/drivers/ide/pci/adma100.c -- basic support for Pacific Digital ADMA-100 boards
4 * Created 09 Apr 2002 by Mark Lord
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
11 #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
12 #include <linux/types.h>
13 #include <linux/module.h>
15 #include <linux/blkdev.h>
16 #include <linux/hdreg.h>
17 #include <linux/ide.h>
18 #include <linux/init.h>
19 #include <linux/pci.h>
24 void __init init_hwif_adma100 (ide_hwif_t *hwif)
26 unsigned long phy_admctl = pci_resource_start(hwif->pci_dev, 4) + 0x80 + (hwif->channel * 0x20);
29 hwif->autodma = 0; // not compatible with normal IDE DMA transfers
30 hwif->dma_base = 0; // disable DMA completely
31 hwif->io_ports[IDE_CONTROL_OFFSET] += 4; // chip needs offset of 6 instead of 2
32 v_admctl = ioremap_nocache(phy_admctl, 1024); // map config regs, so we can turn on drive IRQs
33 *((unsigned short *)v_admctl) &= 3; // enable aIEN; preserve PIO mode
34 iounmap(v_admctl); // all done; unmap config regs
35 printk("ADMA100: initialized %s for basic PIO-only operation\n", hwif->name);
38 extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
40 static int __devinit adma100_init_one (struct pci_dev *dev, const struct pci_device_id *id)
42 ide_pci_device_t *d = &adma100_chipsets[id->driver_data];
44 if (dev->device != d->device)
46 ide_setup_pci_device(dev, d);
51 static struct pci_device_id adma100_pci_tbl[] __devinitdata = {
52 { PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_ADMA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
56 static struct pci_driver driver = {
57 .name = "ADMA100 IDE",
58 .id_table = adma100_pci_tbl,
59 .probe = adma100_init_one,
62 static int adma100_ide_init (void)
64 return ide_pci_register_driver(&driver);
67 static void adma100_ide_exit (void)
69 ide_pci_unregister_driver(&driver);
72 module_init(adma100_ide_init);
73 module_exit(adma100_ide_exit);
75 MODULE_AUTHOR("Mark Lord");
76 MODULE_DESCRIPTION("Basic PIO support for ADMA100 IDE");
77 MODULE_LICENSE("GPL");