Linux 2.6.33-rc2
[pohmelfs.git] / include / linux / i7300_idle.h
blob1587b7dec505ff182f6f5beceaee97907ecb9381
2 #ifndef I7300_IDLE_H
3 #define I7300_IDLE_H
5 #include <linux/pci.h>
7 /*
8 * I/O AT controls (PCI bus 0 device 8 function 0)
9 * DIMM controls (PCI bus 0 device 16 function 1)
11 #define IOAT_BUS 0
12 #define IOAT_DEVFN PCI_DEVFN(8, 0)
13 #define MEMCTL_BUS 0
14 #define MEMCTL_DEVFN PCI_DEVFN(16, 1)
16 struct fbd_ioat {
17 unsigned int vendor;
18 unsigned int ioat_dev;
19 unsigned int enabled;
23 * The i5000 chip-set has the same hooks as the i7300
24 * but it is not enabled by default and must be manually
25 * manually enabled with "forceload=1" because it is
26 * only lightly validated.
29 static const struct fbd_ioat fbd_ioat_list[] = {
30 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
31 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
32 {0, 0}
35 /* table of devices that work with this driver */
36 static const struct pci_device_id pci_tbl[] = {
37 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
38 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
39 { } /* Terminating entry */
42 /* Check for known platforms with I/O-AT */
43 static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
44 struct pci_dev **ioat_dev,
45 int enable_all)
47 int i;
48 struct pci_dev *memdev, *dmadev;
50 memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
51 if (!memdev)
52 return -ENODEV;
54 for (i = 0; pci_tbl[i].vendor != 0; i++) {
55 if (memdev->vendor == pci_tbl[i].vendor &&
56 memdev->device == pci_tbl[i].device) {
57 break;
60 if (pci_tbl[i].vendor == 0)
61 return -ENODEV;
63 dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
64 if (!dmadev)
65 return -ENODEV;
67 for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
68 if (dmadev->vendor == fbd_ioat_list[i].vendor &&
69 dmadev->device == fbd_ioat_list[i].ioat_dev) {
70 if (!(fbd_ioat_list[i].enabled || enable_all))
71 continue;
72 if (fbd_dev)
73 *fbd_dev = memdev;
74 if (ioat_dev)
75 *ioat_dev = dmadev;
77 return 0;
80 return -ENODEV;
83 #endif