rz1000.c 2.2 KB

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