mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 16:25:27 +07:00
2f102607ac
Testing the i7300_idle driver on i5000-series hardware required an edit to i7300_idle.h to "#define SUPPORT_I5000 1" and a re-build of both i7300_idle and ioat_dma. Replace that build-time scheme with a load-time module parameter: "7300_idle.forceload=1" to make it easier to test the driver on hardware that while not officially validated, works fine and is much more commonly available. By default (no modparam) the driver will continue to load only on the i7300. Note that ioat_dma runs a copy of i7300_idle's probe routine to know to reserve an IOAT channel for i7300_idle. This change makes ioat_dma do that always on the i5000, just like it does on the i7300. Signed-off-by: Len Brown <len.brown@intel.com> Acked-by: Andrew Henroid <andrew.d.henroid@intel.com>
84 lines
1.9 KiB
C
84 lines
1.9 KiB
C
|
|
#ifndef I7300_IDLE_H
|
|
#define I7300_IDLE_H
|
|
|
|
#include <linux/pci.h>
|
|
|
|
/*
|
|
* I/O AT controls (PCI bus 0 device 8 function 0)
|
|
* DIMM controls (PCI bus 0 device 16 function 1)
|
|
*/
|
|
#define IOAT_BUS 0
|
|
#define IOAT_DEVFN PCI_DEVFN(8, 0)
|
|
#define MEMCTL_BUS 0
|
|
#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
|
|
|
|
struct fbd_ioat {
|
|
unsigned int vendor;
|
|
unsigned int ioat_dev;
|
|
unsigned int enabled;
|
|
};
|
|
|
|
/*
|
|
* The i5000 chip-set has the same hooks as the i7300
|
|
* but it is not enabled by default and must be manually
|
|
* manually enabled with "forceload=1" because it is
|
|
* only lightly validated.
|
|
*/
|
|
|
|
static const struct fbd_ioat fbd_ioat_list[] = {
|
|
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
|
|
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
|
|
{0, 0}
|
|
};
|
|
|
|
/* table of devices that work with this driver */
|
|
static const struct pci_device_id pci_tbl[] = {
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
|
|
{ } /* Terminating entry */
|
|
};
|
|
|
|
/* Check for known platforms with I/O-AT */
|
|
static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
|
|
struct pci_dev **ioat_dev,
|
|
int enable_all)
|
|
{
|
|
int i;
|
|
struct pci_dev *memdev, *dmadev;
|
|
|
|
memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
|
|
if (!memdev)
|
|
return -ENODEV;
|
|
|
|
for (i = 0; pci_tbl[i].vendor != 0; i++) {
|
|
if (memdev->vendor == pci_tbl[i].vendor &&
|
|
memdev->device == pci_tbl[i].device) {
|
|
break;
|
|
}
|
|
}
|
|
if (pci_tbl[i].vendor == 0)
|
|
return -ENODEV;
|
|
|
|
dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
|
|
if (!dmadev)
|
|
return -ENODEV;
|
|
|
|
for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
|
|
if (dmadev->vendor == fbd_ioat_list[i].vendor &&
|
|
dmadev->device == fbd_ioat_list[i].ioat_dev) {
|
|
if (!(fbd_ioat_list[i].enabled || enable_all))
|
|
continue;
|
|
if (fbd_dev)
|
|
*fbd_dev = memdev;
|
|
if (ioat_dev)
|
|
*ioat_dev = dmadev;
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
return -ENODEV;
|
|
}
|
|
|
|
#endif
|