blob: 5f6950c2d1d10510adcdbfe202e987537691c426 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/drivers/ide/pci/rz1000.c Version 0.06 January 12, 2003
3 *
4 * Copyright (C) 1995-1998 Linus Torvalds & author (see below)
5 */
6
7/*
8 * Principal Author: mlord@pobox.com (Mark Lord)
9 *
10 * See linux/MAINTAINERS for address of current maintainer.
11 *
12 * This file provides support for disabling the buggy read-ahead
13 * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards.
14 *
15 * Dunno if this fixes both ports, or only the primary port (?).
16 */
17
18#undef REALLY_SLOW_IO /* most systems can safely undef this */
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/types.h>
21#include <linux/module.h>
22#include <linux/kernel.h>
23#include <linux/delay.h>
24#include <linux/timer.h>
25#include <linux/mm.h>
26#include <linux/ioport.h>
27#include <linux/blkdev.h>
28#include <linux/hdreg.h>
29#include <linux/pci.h>
30#include <linux/ide.h>
31#include <linux/init.h>
32
33#include <asm/io.h>
34
35static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
36{
37 u16 reg;
38 struct pci_dev *dev = hwif->pci_dev;
39
40 hwif->chipset = ide_rz1000;
41 if (!pci_read_config_word (dev, 0x40, &reg) &&
42 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
43 printk(KERN_INFO "%s: disabled chipset read-ahead "
44 "(buggy RZ1000/RZ1001)\n", hwif->name);
45 } else {
46 hwif->serialized = 1;
47 hwif->drives[0].no_unmask = 1;
48 hwif->drives[1].no_unmask = 1;
49 printk(KERN_INFO "%s: serialized, disabled unmasking "
50 "(buggy RZ1000/RZ1001)\n", hwif->name);
51 }
52}
53
54static ide_pci_device_t rz1000_chipset __devinitdata = {
55 .name = "RZ100x",
56 .init_hwif = init_hwif_rz1000,
57 .channels = 2,
58 .autodma = NODMA,
59 .bootable = ON_BOARD,
60};
61
62static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
63{
64 return ide_setup_pci_device(dev, &rz1000_chipset);
65}
66
67static struct pci_device_id rz1000_pci_tbl[] = {
68 { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
69 { PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
70 { 0, },
71};
72MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl);
73
74static struct pci_driver driver = {
75 .name = "RZ1000_IDE",
76 .id_table = rz1000_pci_tbl,
77 .probe = rz1000_init_one,
78};
79
80static int rz1000_ide_init(void)
81{
82 return ide_pci_register_driver(&driver);
83}
84
85module_init(rz1000_ide_init);
86
87MODULE_AUTHOR("Andre Hedrick");
88MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE");
89MODULE_LICENSE("GPL");
90