|
@@ -75,6 +75,11 @@
|
|
|
#define PCI_ENDPOINT_TEST_IRQ_TYPE 0x24
|
|
#define PCI_ENDPOINT_TEST_IRQ_TYPE 0x24
|
|
|
#define PCI_ENDPOINT_TEST_IRQ_NUMBER 0x28
|
|
#define PCI_ENDPOINT_TEST_IRQ_NUMBER 0x28
|
|
|
|
|
|
|
|
|
|
+#define PCI_DEVICE_ID_TI_AM654 0xb00c
|
|
|
|
|
+
|
|
|
|
|
+#define is_am654_pci_dev(pdev) \
|
|
|
|
|
+ ((pdev)->device == PCI_DEVICE_ID_TI_AM654)
|
|
|
|
|
+
|
|
|
static DEFINE_IDA(pci_endpoint_test_ida);
|
|
static DEFINE_IDA(pci_endpoint_test_ida);
|
|
|
|
|
|
|
|
#define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \
|
|
#define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \
|
|
@@ -588,6 +593,7 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
|
|
|
int ret = -EINVAL;
|
|
int ret = -EINVAL;
|
|
|
enum pci_barno bar;
|
|
enum pci_barno bar;
|
|
|
struct pci_endpoint_test *test = to_endpoint_test(file->private_data);
|
|
struct pci_endpoint_test *test = to_endpoint_test(file->private_data);
|
|
|
|
|
+ struct pci_dev *pdev = test->pdev;
|
|
|
|
|
|
|
|
mutex_lock(&test->mutex);
|
|
mutex_lock(&test->mutex);
|
|
|
switch (cmd) {
|
|
switch (cmd) {
|
|
@@ -595,6 +601,8 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
|
|
|
bar = arg;
|
|
bar = arg;
|
|
|
if (bar < 0 || bar > 5)
|
|
if (bar < 0 || bar > 5)
|
|
|
goto ret;
|
|
goto ret;
|
|
|
|
|
+ if (is_am654_pci_dev(pdev) && bar == BAR_0)
|
|
|
|
|
+ goto ret;
|
|
|
ret = pci_endpoint_test_bar(test, bar);
|
|
ret = pci_endpoint_test_bar(test, bar);
|
|
|
break;
|
|
break;
|
|
|
case PCITEST_LEGACY_IRQ:
|
|
case PCITEST_LEGACY_IRQ:
|
|
@@ -785,10 +793,18 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev)
|
|
|
pci_disable_device(pdev);
|
|
pci_disable_device(pdev);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static const struct pci_endpoint_test_data am654_data = {
|
|
|
|
|
+ .test_reg_bar = BAR_2,
|
|
|
|
|
+ .alignment = SZ_64K,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
static const struct pci_device_id pci_endpoint_test_tbl[] = {
|
|
static const struct pci_device_id pci_endpoint_test_tbl[] = {
|
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA74x) },
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA74x) },
|
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA72x) },
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_DRA72x) },
|
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, 0xedda) },
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, 0xedda) },
|
|
|
|
|
+ { PCI_DEVICE(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_AM654),
|
|
|
|
|
+ .driver_data = (kernel_ulong_t)&am654_data
|
|
|
|
|
+ },
|
|
|
{ }
|
|
{ }
|
|
|
};
|
|
};
|
|
|
MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);
|
|
MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);
|