rz1000.c 2.3 KB

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