2 * linux/drivers/block/rz1000.c Version 0.05 December 8, 1997
4 * Copyright (C) 1995-1998 Linus Torvalds & author (see below)
8 * Principal Author: mlord@pobox.com (Mark Lord)
10 * See linux/MAINTAINERS for address of current maintainer.
12 * This file provides support for disabling the buggy read-ahead
13 * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards.
15 * Dunno if this fixes both ports, or only the primary port (?).
18 #undef REALLY_SLOW_IO /* most systems can safely undef this */
20 #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
21 #include <linux/types.h>
22 #include <linux/kernel.h>
23 #include <linux/delay.h>
24 #include <linux/timer.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>
34 #ifdef CONFIG_BLK_DEV_IDEPCI
36 __initfunc(void ide_init_rz1000 (ide_hwif_t
*hwif
)) /* called from ide-pci.c */
39 struct pci_dev
*dev
= hwif
->pci_dev
;
41 hwif
->chipset
= ide_rz1000
;
42 if (!pci_read_config_word (dev
, 0x40, ®
)
43 && !pci_write_config_word(dev
, 0x40, reg
& 0xdfff))
45 printk("%s: disabled chipset read-ahead (buggy RZ1000/RZ1001)\n", hwif
->name
);
48 hwif
->drives
[0].no_unmask
= 1;
49 hwif
->drives
[1].no_unmask
= 1;
50 printk("%s: serialized, disabled unmasking (buggy RZ1000/RZ1001)\n", hwif
->name
);
56 __initfunc(static void init_rz1000 (struct pci_dev
*dev
, const char *name
))
58 unsigned short reg
, h
;
60 if (!pci_read_config_word (dev
, PCI_COMMAND
, ®
) && !(reg
& PCI_COMMAND_IO
)) {
61 printk("%s: buggy IDE controller disabled (BIOS)\n", name
);
64 if (!pci_read_config_word (dev
, 0x40, ®
)
65 && !pci_write_config_word(dev
, 0x40, reg
& 0xdfff))
67 printk("IDE: disabled chipset read-ahead (buggy %s)\n", name
);
69 for (h
= 0; h
< MAX_HWIFS
; ++h
) {
70 ide_hwif_t
*hwif
= &ide_hwifs
[h
];
71 if ((hwif
->io_ports
[IDE_DATA_OFFSET
] == 0x1f0 || hwif
->io_ports
[IDE_DATA_OFFSET
] == 0x170)
72 && (hwif
->chipset
== ide_unknown
|| hwif
->chipset
== ide_generic
))
74 hwif
->chipset
= ide_rz1000
;
76 hwif
->drives
[0].no_unmask
= 1;
77 hwif
->drives
[1].no_unmask
= 1;
78 if (hwif
->io_ports
[IDE_DATA_OFFSET
] == 0x170)
80 printk("%s: serialized, disabled unmasking (buggy %s)\n", hwif
->name
, name
);
86 __initfunc(void ide_probe_for_rz100x (void)) /* called from ide.c */
88 struct pci_dev
*dev
= NULL
;
90 while (dev
= pci_find_device(PCI_VENDOR_ID_PCTECH
, PCI_DEVICE_ID_PCTECH_RZ1000
, dev
))
91 init_rz1000 (dev
, "RZ1000");
92 while (dev
= pci_find_device(PCI_VENDOR_ID_PCTECH
, PCI_DEVICE_ID_PCTECH_RZ1001
, dev
))
93 init_rz1000 (dev
, "RZ1001");
96 #endif CONFIG_BLK_DEV_IDEPCI