blob: 6b10ae260fa29e148ae6f9f874400ce1d0997381 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/types.h>
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/delay.h>
22#include <linux/timer.h>
23#include <linux/mm.h>
24#include <linux/ioport.h>
25#include <linux/blkdev.h>
26#include <linux/hdreg.h>
27#include <linux/pci.h>
28#include <linux/ide.h>
29#include <linux/init.h>
30
31#include <asm/io.h>
32
33static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
34{
35 u16 reg;
36 struct pci_dev *dev = hwif->pci_dev;
37
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 if (!pci_read_config_word (dev, 0x40, &reg) &&
39 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
40 printk(KERN_INFO "%s: disabled chipset read-ahead "
41 "(buggy RZ1000/RZ1001)\n", hwif->name);
42 } else {
Bartlomiej Zolnierkiewicz746f3122007-10-20 00:32:29 +020043 if (hwif->mate)
44 hwif->mate->serialized = hwif->serialized = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 hwif->drives[0].no_unmask = 1;
46 hwif->drives[1].no_unmask = 1;
47 printk(KERN_INFO "%s: serialized, disabled unmasking "
48 "(buggy RZ1000/RZ1001)\n", hwif->name);
49 }
50}
51
Bartlomiej Zolnierkiewicz85620432007-10-20 00:32:34 +020052static const struct ide_port_info rz1000_chipset __devinitdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 .name = "RZ100x",
54 .init_hwif = init_hwif_rz1000,
Bartlomiej Zolnierkiewicz528a5722007-10-20 00:32:30 +020055 .chipset = ide_rz1000,
Bartlomiej Zolnierkiewicz47b68782007-10-19 00:30:06 +020056 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE,
Linus Torvalds1da177e2005-04-16 15:20:36 -070057};
58
59static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
60{
61 return ide_setup_pci_device(dev, &rz1000_chipset);
62}
63
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +020064static const struct pci_device_id rz1000_pci_tbl[] = {
65 { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), 0 },
66 { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001), 0 },
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 { 0, },
68};
69MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl);
70
71static struct pci_driver driver = {
72 .name = "RZ1000_IDE",
73 .id_table = rz1000_pci_tbl,
74 .probe = rz1000_init_one,
75};
76
Bartlomiej Zolnierkiewicz82ab1ee2007-01-27 13:46:56 +010077static int __init rz1000_ide_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070078{
79 return ide_pci_register_driver(&driver);
80}
81
82module_init(rz1000_ide_init);
83
84MODULE_AUTHOR("Andre Hedrick");
85MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE");
86MODULE_LICENSE("GPL");
87