1 /*
2 * linux/drivers/ide/rz1000.c Version 0.05 December 8, 1997
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
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>
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
35 #ifdef CONFIG_BLK_DEV_IDEPCI
36
37 void __init ide_init_rz1000 (ide_hwif_t *hwif) /* called from ide-pci.c */
38 {
39 unsigned short reg;
40 struct pci_dev *dev = hwif->pci_dev;
41
42 hwif->chipset = ide_rz1000;
43 if (!pci_read_config_word (dev, 0x40, ®)
44 && !pci_write_config_word(dev, 0x40, reg & 0xdfff))
45 {
46 printk("%s: disabled chipset read-ahead (buggy RZ1000/RZ1001)\n", hwif->name);
47 } else {
48 hwif->serialized = 1;
49 hwif->drives[0].no_unmask = 1;
50 hwif->drives[1].no_unmask = 1;
51 printk("%s: serialized, disabled unmasking (buggy RZ1000/RZ1001)\n", hwif->name);
52 }
53 }
54
55 #else
56
57 static void __init init_rz1000 (struct pci_dev *dev, const char *name)
58 {
59 unsigned short reg, h;
60
61 if (!pci_read_config_word (dev, PCI_COMMAND, ®) && !(reg & PCI_COMMAND_IO)) {
62 printk("%s: buggy IDE controller disabled (BIOS)\n", name);
63 return;
64 }
65 if (!pci_read_config_word (dev, 0x40, ®)
66 && !pci_write_config_word(dev, 0x40, reg & 0xdfff))
67 {
68 printk("IDE: disabled chipset read-ahead (buggy %s)\n", name);
69 } else {
70 for (h = 0; h < MAX_HWIFS; ++h) {
71 ide_hwif_t *hwif = &ide_hwifs[h];
72 if ((hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0 || hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
73 && (hwif->chipset == ide_unknown || hwif->chipset == ide_generic))
74 {
75 hwif->chipset = ide_rz1000;
76 hwif->serialized = 1;
77 hwif->drives[0].no_unmask = 1;
78 hwif->drives[1].no_unmask = 1;
79 if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
80 hwif->channel = 1;
81 printk("%s: serialized, disabled unmasking (buggy %s)\n", hwif->name, name);
82 }
83 }
84 }
85 }
86
87 void __init ide_probe_for_rz100x (void) /* called from ide.c */
88 {
89 struct pci_dev *dev = NULL;
90
91 while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, dev))!=NULL)
92 init_rz1000 (dev, "RZ1000");
93 while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, dev))!=NULL)
94 init_rz1000 (dev, "RZ1001");
95 }
96
97 #endif CONFIG_BLK_DEV_IDEPCI
98
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.