i7300_idle.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef I7300_IDLE_H
  2. #define I7300_IDLE_H
  3. #include <linux/pci.h>
  4. /*
  5. * I/O AT controls (PCI bus 0 device 8 function 0)
  6. * DIMM controls (PCI bus 0 device 16 function 1)
  7. */
  8. #define IOAT_BUS 0
  9. #define IOAT_DEVFN PCI_DEVFN(8, 0)
  10. #define MEMCTL_BUS 0
  11. #define MEMCTL_DEVFN PCI_DEVFN(16, 1)
  12. struct fbd_ioat {
  13. unsigned int vendor;
  14. unsigned int ioat_dev;
  15. };
  16. /*
  17. * The i5000 chip-set has the same hooks as the i7300
  18. * but support is disabled by default because this driver
  19. * has not been validated on that platform.
  20. */
  21. #define SUPPORT_I5000 0
  22. static const struct fbd_ioat fbd_ioat_list[] = {
  23. {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB},
  24. #if SUPPORT_I5000
  25. {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT},
  26. #endif
  27. {0, 0}
  28. };
  29. /* table of devices that work with this driver */
  30. static const struct pci_device_id pci_tbl[] = {
  31. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
  32. #if SUPPORT_I5000
  33. { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
  34. #endif
  35. { } /* Terminating entry */
  36. };
  37. /* Check for known platforms with I/O-AT */
  38. static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
  39. struct pci_dev **ioat_dev)
  40. {
  41. int i;
  42. struct pci_dev *memdev, *dmadev;
  43. memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
  44. if (!memdev)
  45. return -ENODEV;
  46. for (i = 0; pci_tbl[i].vendor != 0; i++) {
  47. if (memdev->vendor == pci_tbl[i].vendor &&
  48. memdev->device == pci_tbl[i].device) {
  49. break;
  50. }
  51. }
  52. if (pci_tbl[i].vendor == 0)
  53. return -ENODEV;
  54. dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
  55. if (!dmadev)
  56. return -ENODEV;
  57. for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
  58. if (dmadev->vendor == fbd_ioat_list[i].vendor &&
  59. dmadev->device == fbd_ioat_list[i].ioat_dev) {
  60. if (fbd_dev)
  61. *fbd_dev = memdev;
  62. if (ioat_dev)
  63. *ioat_dev = dmadev;
  64. return 0;
  65. }
  66. }
  67. return -ENODEV;
  68. }
  69. #endif