ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / ide / pci / adma100.c
1 /*
2  *  linux/drivers/ide/pci/adma100.c -- basic support for Pacific Digital ADMA-100 boards
3  *
4  *     Created 09 Apr 2002 by Mark Lord
5  *
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
8  *  more details.
9  */
10
11 #include <linux/mm.h>
12 #include <linux/blkdev.h>
13 #include <linux/hdreg.h>
14 #include <linux/ide.h>
15 #include <linux/init.h>
16 #include <linux/pci.h>
17 #include <asm/io.h>
18
19 void __init ide_init_adma100 (ide_hwif_t *hwif)
20 {
21         unsigned long  phy_admctl = pci_resource_start(hwif->pci_dev, 4) + 0x80 + (hwif->channel * 0x20);
22         void *v_admctl;
23
24         hwif->autodma = 0;              // not compatible with normal IDE DMA transfers
25         hwif->dma_base = 0;             // disable DMA completely
26         hwif->io_ports[IDE_CONTROL_OFFSET] += 4;        // chip needs offset of 6 instead of 2
27         v_admctl = ioremap_nocache(phy_admctl, 1024);   // map config regs, so we can turn on drive IRQs
28         *((unsigned short *)v_admctl) &= 3;             // enable aIEN; preserve PIO mode
29         iounmap(v_admctl);                              // all done; unmap config regs
30 }