]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * Copyright (C) 1995-1998 Linus Torvalds & author (see below) |
3 | */ | |
4 | ||
5 | /* | |
6 | * Principal Author: [email protected] (Mark Lord) | |
7 | * | |
8 | * See linux/MAINTAINERS for address of current maintainer. | |
9 | * | |
10 | * This file provides support for disabling the buggy read-ahead | |
11 | * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards. | |
12 | * | |
13 | * Dunno if this fixes both ports, or only the primary port (?). | |
14 | */ | |
15 | ||
1da177e4 LT |
16 | #include <linux/types.h> |
17 | #include <linux/module.h> | |
18 | #include <linux/kernel.h> | |
1da177e4 LT |
19 | #include <linux/pci.h> |
20 | #include <linux/ide.h> | |
21 | #include <linux/init.h> | |
22 | ||
ced3ec8a BZ |
23 | #define DRV_NAME "rz1000" |
24 | ||
1da177e4 LT |
25 | static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif) |
26 | { | |
36501650 | 27 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1da177e4 | 28 | u16 reg; |
1da177e4 | 29 | |
1da177e4 LT |
30 | if (!pci_read_config_word (dev, 0x40, ®) && |
31 | !pci_write_config_word(dev, 0x40, reg & 0xdfff)) { | |
32 | printk(KERN_INFO "%s: disabled chipset read-ahead " | |
33 | "(buggy RZ1000/RZ1001)\n", hwif->name); | |
34 | } else { | |
746f312a BZ |
35 | if (hwif->mate) |
36 | hwif->mate->serialized = hwif->serialized = 1; | |
807b90d0 | 37 | hwif->host_flags |= IDE_HFLAG_NO_UNMASK_IRQS; |
1da177e4 LT |
38 | printk(KERN_INFO "%s: serialized, disabled unmasking " |
39 | "(buggy RZ1000/RZ1001)\n", hwif->name); | |
40 | } | |
41 | } | |
42 | ||
85620436 | 43 | static const struct ide_port_info rz1000_chipset __devinitdata = { |
ced3ec8a | 44 | .name = DRV_NAME, |
1da177e4 | 45 | .init_hwif = init_hwif_rz1000, |
528a572d | 46 | .chipset = ide_rz1000, |
5e71d9c5 | 47 | .host_flags = IDE_HFLAG_NO_DMA, |
1da177e4 LT |
48 | }; |
49 | ||
50 | static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |
51 | { | |
6cdf6eb3 | 52 | return ide_pci_init_one(dev, &rz1000_chipset, NULL); |
1da177e4 LT |
53 | } |
54 | ||
9cbcc5e3 BZ |
55 | static const struct pci_device_id rz1000_pci_tbl[] = { |
56 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), 0 }, | |
57 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001), 0 }, | |
1da177e4 LT |
58 | { 0, }, |
59 | }; | |
60 | MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl); | |
61 | ||
a9ab09e2 | 62 | static struct pci_driver rz1000_pci_driver = { |
1da177e4 LT |
63 | .name = "RZ1000_IDE", |
64 | .id_table = rz1000_pci_tbl, | |
65 | .probe = rz1000_init_one, | |
0fd18804 | 66 | .remove = ide_pci_remove, |
1da177e4 LT |
67 | }; |
68 | ||
82ab1eec | 69 | static int __init rz1000_ide_init(void) |
1da177e4 | 70 | { |
a9ab09e2 | 71 | return ide_pci_register_driver(&rz1000_pci_driver); |
1da177e4 LT |
72 | } |
73 | ||
0fd18804 BZ |
74 | static void __exit rz1000_ide_exit(void) |
75 | { | |
a9ab09e2 | 76 | pci_unregister_driver(&rz1000_pci_driver); |
0fd18804 BZ |
77 | } |
78 | ||
1da177e4 | 79 | module_init(rz1000_ide_init); |
0fd18804 | 80 | module_exit(rz1000_ide_exit); |
1da177e4 LT |
81 | |
82 | MODULE_AUTHOR("Andre Hedrick"); | |
83 | MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE"); | |
84 | MODULE_LICENSE("GPL"); | |
85 |