Import 2.3.9pre5
[davej-history.git] / drivers / block / sl82c105.c
blob2f08740eadfe689d84d87c5010552253cd9f7c17
1 #include <linux/config.h>
2 #include <linux/types.h>
3 #include <linux/kernel.h>
4 #include <linux/timer.h>
5 #include <linux/mm.h>
6 #include <linux/ioport.h>
7 #include <linux/interrupt.h>
8 #include <linux/blkdev.h>
9 #include <linux/hdreg.h>
10 #include <linux/pci.h>
11 #include <linux/ide.h>
13 #include <asm/io.h>
14 #include <asm/dma.h>
16 #include "ide_modes.h"
18 void ide_init_sl82c105(ide_hwif_t *hwif)
20 struct pci_dev *dev = hwif->pci_dev;
21 unsigned short t16;
22 unsigned int t32;
23 pci_read_config_word(dev, PCI_COMMAND, &t16);
24 printk("SL82C105 command word: %x\n",t16);
25 t16 |= PCI_COMMAND_IO;
26 pci_write_config_word(dev, PCI_COMMAND, t16);
27 /* IDE timing */
28 pci_read_config_dword(dev, 0x44, &t32);
29 printk("IDE timing: %08x, resetting to PIO0 timing\n",t32);
30 pci_write_config_dword(dev, 0x44, 0x03e4);
31 #ifndef CONFIG_MBX
32 pci_read_config_dword(dev, 0x40, &t32);
33 printk("IDE control/status register: %08x\n",t32);
34 pci_write_config_dword(dev, 0x40, 0x10ff08a1);
35 #endif /* CONFIG_MBX */