1 // SPDX-License-Identifier: GPL-2.0-only
3 * Host side test driver to test endpoint functionality
5 * Copyright (C) 2017 Texas Instruments
6 * Author: Kishon Vijay Abraham I <kishon@ti.com>
9 #include <linux/crc32.h>
10 #include <linux/delay.h>
13 #include <linux/interrupt.h>
14 #include <linux/irq.h>
15 #include <linux/miscdevice.h>
16 #include <linux/module.h>
17 #include <linux/mutex.h>
18 #include <linux/random.h>
19 #include <linux/slab.h>
20 #include <linux/pci.h>
21 #include <linux/pci_ids.h>
23 #include <linux/pci_regs.h>
25 #include <uapi/linux/pcitest.h>
27 #define DRV_MODULE_NAME "pci-endpoint-test"
29 #define IRQ_TYPE_UNDEFINED -1
30 #define IRQ_TYPE_LEGACY 0
31 #define IRQ_TYPE_MSI 1
32 #define IRQ_TYPE_MSIX 2
34 #define PCI_ENDPOINT_TEST_MAGIC 0x0
36 #define PCI_ENDPOINT_TEST_COMMAND 0x4
37 #define COMMAND_RAISE_LEGACY_IRQ BIT(0)
38 #define COMMAND_RAISE_MSI_IRQ BIT(1)
39 #define COMMAND_RAISE_MSIX_IRQ BIT(2)
40 #define COMMAND_READ BIT(3)
41 #define COMMAND_WRITE BIT(4)
42 #define COMMAND_COPY BIT(5)
44 #define PCI_ENDPOINT_TEST_STATUS 0x8
45 #define STATUS_READ_SUCCESS BIT(0)
46 #define STATUS_READ_FAIL BIT(1)
47 #define STATUS_WRITE_SUCCESS BIT(2)
48 #define STATUS_WRITE_FAIL BIT(3)
49 #define STATUS_COPY_SUCCESS BIT(4)
50 #define STATUS_COPY_FAIL BIT(5)
51 #define STATUS_IRQ_RAISED BIT(6)
52 #define STATUS_SRC_ADDR_INVALID BIT(7)
53 #define STATUS_DST_ADDR_INVALID BIT(8)
55 #define PCI_ENDPOINT_TEST_LOWER_SRC_ADDR 0x0c
56 #define PCI_ENDPOINT_TEST_UPPER_SRC_ADDR 0x10
58 #define PCI_ENDPOINT_TEST_LOWER_DST_ADDR 0x14
59 #define PCI_ENDPOINT_TEST_UPPER_DST_ADDR 0x18
61 #define PCI_ENDPOINT_TEST_SIZE 0x1c
62 #define PCI_ENDPOINT_TEST_CHECKSUM 0x20
64 #define PCI_ENDPOINT_TEST_IRQ_TYPE 0x24
65 #define PCI_ENDPOINT_TEST_IRQ_NUMBER 0x28
67 #define PCI_DEVICE_ID_TI_AM654 0xb00c
69 #define is_am654_pci_dev(pdev) \
70 ((pdev)->device == PCI_DEVICE_ID_TI_AM654)
72 static DEFINE_IDA(pci_endpoint_test_ida
);
74 #define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \
78 module_param(no_msi
, bool, 0444);
79 MODULE_PARM_DESC(no_msi
, "Disable MSI interrupt in pci_endpoint_test");
81 static int irq_type
= IRQ_TYPE_MSI
;
82 module_param(irq_type
, int, 0444);
83 MODULE_PARM_DESC(irq_type
, "IRQ mode selection in pci_endpoint_test (0 - Legacy, 1 - MSI, 2 - MSI-X)");
94 struct pci_endpoint_test
{
97 void __iomem
*bar
[PCI_STD_NUM_BARS
];
98 struct completion irq_raised
;
101 /* mutex to protect the ioctls */
103 struct miscdevice miscdev
;
104 enum pci_barno test_reg_bar
;
108 struct pci_endpoint_test_data
{
109 enum pci_barno test_reg_bar
;
114 static inline u32
pci_endpoint_test_readl(struct pci_endpoint_test
*test
,
117 return readl(test
->base
+ offset
);
120 static inline void pci_endpoint_test_writel(struct pci_endpoint_test
*test
,
121 u32 offset
, u32 value
)
123 writel(value
, test
->base
+ offset
);
126 static inline u32
pci_endpoint_test_bar_readl(struct pci_endpoint_test
*test
,
129 return readl(test
->bar
[bar
] + offset
);
132 static inline void pci_endpoint_test_bar_writel(struct pci_endpoint_test
*test
,
133 int bar
, u32 offset
, u32 value
)
135 writel(value
, test
->bar
[bar
] + offset
);
138 static irqreturn_t
pci_endpoint_test_irqhandler(int irq
, void *dev_id
)
140 struct pci_endpoint_test
*test
= dev_id
;
143 reg
= pci_endpoint_test_readl(test
, PCI_ENDPOINT_TEST_STATUS
);
144 if (reg
& STATUS_IRQ_RAISED
) {
145 test
->last_irq
= irq
;
146 complete(&test
->irq_raised
);
147 reg
&= ~STATUS_IRQ_RAISED
;
149 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_STATUS
,
155 static void pci_endpoint_test_free_irq_vectors(struct pci_endpoint_test
*test
)
157 struct pci_dev
*pdev
= test
->pdev
;
159 pci_free_irq_vectors(pdev
);
162 static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test
*test
,
166 struct pci_dev
*pdev
= test
->pdev
;
167 struct device
*dev
= &pdev
->dev
;
171 case IRQ_TYPE_LEGACY
:
172 irq
= pci_alloc_irq_vectors(pdev
, 1, 1, PCI_IRQ_LEGACY
);
174 dev_err(dev
, "Failed to get Legacy interrupt\n");
177 irq
= pci_alloc_irq_vectors(pdev
, 1, 32, PCI_IRQ_MSI
);
179 dev_err(dev
, "Failed to get MSI interrupts\n");
182 irq
= pci_alloc_irq_vectors(pdev
, 1, 2048, PCI_IRQ_MSIX
);
184 dev_err(dev
, "Failed to get MSI-X interrupts\n");
187 dev_err(dev
, "Invalid IRQ type selected\n");
194 test
->num_irqs
= irq
;
199 static void pci_endpoint_test_release_irq(struct pci_endpoint_test
*test
)
202 struct pci_dev
*pdev
= test
->pdev
;
203 struct device
*dev
= &pdev
->dev
;
205 for (i
= 0; i
< test
->num_irqs
; i
++)
206 devm_free_irq(dev
, pci_irq_vector(pdev
, i
), test
);
211 static bool pci_endpoint_test_request_irq(struct pci_endpoint_test
*test
)
215 struct pci_dev
*pdev
= test
->pdev
;
216 struct device
*dev
= &pdev
->dev
;
218 for (i
= 0; i
< test
->num_irqs
; i
++) {
219 err
= devm_request_irq(dev
, pci_irq_vector(pdev
, i
),
220 pci_endpoint_test_irqhandler
,
221 IRQF_SHARED
, DRV_MODULE_NAME
, test
);
230 case IRQ_TYPE_LEGACY
:
231 dev_err(dev
, "Failed to request IRQ %d for Legacy\n",
232 pci_irq_vector(pdev
, i
));
235 dev_err(dev
, "Failed to request IRQ %d for MSI %d\n",
236 pci_irq_vector(pdev
, i
),
240 dev_err(dev
, "Failed to request IRQ %d for MSI-X %d\n",
241 pci_irq_vector(pdev
, i
),
249 static bool pci_endpoint_test_bar(struct pci_endpoint_test
*test
,
250 enum pci_barno barno
)
255 struct pci_dev
*pdev
= test
->pdev
;
257 if (!test
->bar
[barno
])
260 size
= pci_resource_len(pdev
, barno
);
262 if (barno
== test
->test_reg_bar
)
265 for (j
= 0; j
< size
; j
+= 4)
266 pci_endpoint_test_bar_writel(test
, barno
, j
, 0xA0A0A0A0);
268 for (j
= 0; j
< size
; j
+= 4) {
269 val
= pci_endpoint_test_bar_readl(test
, barno
, j
);
270 if (val
!= 0xA0A0A0A0)
277 static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test
*test
)
281 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_TYPE
,
283 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_NUMBER
, 0);
284 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_COMMAND
,
285 COMMAND_RAISE_LEGACY_IRQ
);
286 val
= wait_for_completion_timeout(&test
->irq_raised
,
287 msecs_to_jiffies(1000));
294 static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test
*test
,
295 u16 msi_num
, bool msix
)
298 struct pci_dev
*pdev
= test
->pdev
;
300 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_TYPE
,
301 msix
== false ? IRQ_TYPE_MSI
:
303 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_NUMBER
, msi_num
);
304 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_COMMAND
,
305 msix
== false ? COMMAND_RAISE_MSI_IRQ
:
306 COMMAND_RAISE_MSIX_IRQ
);
307 val
= wait_for_completion_timeout(&test
->irq_raised
,
308 msecs_to_jiffies(1000));
312 if (pci_irq_vector(pdev
, msi_num
- 1) == test
->last_irq
)
318 static bool pci_endpoint_test_copy(struct pci_endpoint_test
*test
, size_t size
)
323 dma_addr_t src_phys_addr
;
324 dma_addr_t dst_phys_addr
;
325 struct pci_dev
*pdev
= test
->pdev
;
326 struct device
*dev
= &pdev
->dev
;
328 dma_addr_t orig_src_phys_addr
;
330 dma_addr_t orig_dst_phys_addr
;
332 size_t alignment
= test
->alignment
;
336 if (size
> SIZE_MAX
- alignment
)
339 if (irq_type
< IRQ_TYPE_LEGACY
|| irq_type
> IRQ_TYPE_MSIX
) {
340 dev_err(dev
, "Invalid IRQ type option\n");
344 orig_src_addr
= dma_alloc_coherent(dev
, size
+ alignment
,
345 &orig_src_phys_addr
, GFP_KERNEL
);
346 if (!orig_src_addr
) {
347 dev_err(dev
, "Failed to allocate source buffer\n");
352 if (alignment
&& !IS_ALIGNED(orig_src_phys_addr
, alignment
)) {
353 src_phys_addr
= PTR_ALIGN(orig_src_phys_addr
, alignment
);
354 offset
= src_phys_addr
- orig_src_phys_addr
;
355 src_addr
= orig_src_addr
+ offset
;
357 src_phys_addr
= orig_src_phys_addr
;
358 src_addr
= orig_src_addr
;
361 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_LOWER_SRC_ADDR
,
362 lower_32_bits(src_phys_addr
));
364 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_UPPER_SRC_ADDR
,
365 upper_32_bits(src_phys_addr
));
367 get_random_bytes(src_addr
, size
);
368 src_crc32
= crc32_le(~0, src_addr
, size
);
370 orig_dst_addr
= dma_alloc_coherent(dev
, size
+ alignment
,
371 &orig_dst_phys_addr
, GFP_KERNEL
);
372 if (!orig_dst_addr
) {
373 dev_err(dev
, "Failed to allocate destination address\n");
375 goto err_orig_src_addr
;
378 if (alignment
&& !IS_ALIGNED(orig_dst_phys_addr
, alignment
)) {
379 dst_phys_addr
= PTR_ALIGN(orig_dst_phys_addr
, alignment
);
380 offset
= dst_phys_addr
- orig_dst_phys_addr
;
381 dst_addr
= orig_dst_addr
+ offset
;
383 dst_phys_addr
= orig_dst_phys_addr
;
384 dst_addr
= orig_dst_addr
;
387 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_LOWER_DST_ADDR
,
388 lower_32_bits(dst_phys_addr
));
389 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_UPPER_DST_ADDR
,
390 upper_32_bits(dst_phys_addr
));
392 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_SIZE
,
395 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_TYPE
, irq_type
);
396 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_NUMBER
, 1);
397 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_COMMAND
,
400 wait_for_completion(&test
->irq_raised
);
402 dst_crc32
= crc32_le(~0, dst_addr
, size
);
403 if (dst_crc32
== src_crc32
)
406 dma_free_coherent(dev
, size
+ alignment
, orig_dst_addr
,
410 dma_free_coherent(dev
, size
+ alignment
, orig_src_addr
,
417 static bool pci_endpoint_test_write(struct pci_endpoint_test
*test
, size_t size
)
422 dma_addr_t phys_addr
;
423 struct pci_dev
*pdev
= test
->pdev
;
424 struct device
*dev
= &pdev
->dev
;
426 dma_addr_t orig_phys_addr
;
428 size_t alignment
= test
->alignment
;
431 if (size
> SIZE_MAX
- alignment
)
434 if (irq_type
< IRQ_TYPE_LEGACY
|| irq_type
> IRQ_TYPE_MSIX
) {
435 dev_err(dev
, "Invalid IRQ type option\n");
439 orig_addr
= dma_alloc_coherent(dev
, size
+ alignment
, &orig_phys_addr
,
442 dev_err(dev
, "Failed to allocate address\n");
447 if (alignment
&& !IS_ALIGNED(orig_phys_addr
, alignment
)) {
448 phys_addr
= PTR_ALIGN(orig_phys_addr
, alignment
);
449 offset
= phys_addr
- orig_phys_addr
;
450 addr
= orig_addr
+ offset
;
452 phys_addr
= orig_phys_addr
;
456 get_random_bytes(addr
, size
);
458 crc32
= crc32_le(~0, addr
, size
);
459 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_CHECKSUM
,
462 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_LOWER_SRC_ADDR
,
463 lower_32_bits(phys_addr
));
464 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_UPPER_SRC_ADDR
,
465 upper_32_bits(phys_addr
));
467 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_SIZE
, size
);
469 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_TYPE
, irq_type
);
470 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_NUMBER
, 1);
471 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_COMMAND
,
474 wait_for_completion(&test
->irq_raised
);
476 reg
= pci_endpoint_test_readl(test
, PCI_ENDPOINT_TEST_STATUS
);
477 if (reg
& STATUS_READ_SUCCESS
)
480 dma_free_coherent(dev
, size
+ alignment
, orig_addr
, orig_phys_addr
);
486 static bool pci_endpoint_test_read(struct pci_endpoint_test
*test
, size_t size
)
490 dma_addr_t phys_addr
;
491 struct pci_dev
*pdev
= test
->pdev
;
492 struct device
*dev
= &pdev
->dev
;
494 dma_addr_t orig_phys_addr
;
496 size_t alignment
= test
->alignment
;
499 if (size
> SIZE_MAX
- alignment
)
502 if (irq_type
< IRQ_TYPE_LEGACY
|| irq_type
> IRQ_TYPE_MSIX
) {
503 dev_err(dev
, "Invalid IRQ type option\n");
507 orig_addr
= dma_alloc_coherent(dev
, size
+ alignment
, &orig_phys_addr
,
510 dev_err(dev
, "Failed to allocate destination address\n");
515 if (alignment
&& !IS_ALIGNED(orig_phys_addr
, alignment
)) {
516 phys_addr
= PTR_ALIGN(orig_phys_addr
, alignment
);
517 offset
= phys_addr
- orig_phys_addr
;
518 addr
= orig_addr
+ offset
;
520 phys_addr
= orig_phys_addr
;
524 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_LOWER_DST_ADDR
,
525 lower_32_bits(phys_addr
));
526 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_UPPER_DST_ADDR
,
527 upper_32_bits(phys_addr
));
529 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_SIZE
, size
);
531 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_TYPE
, irq_type
);
532 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_IRQ_NUMBER
, 1);
533 pci_endpoint_test_writel(test
, PCI_ENDPOINT_TEST_COMMAND
,
536 wait_for_completion(&test
->irq_raised
);
538 crc32
= crc32_le(~0, addr
, size
);
539 if (crc32
== pci_endpoint_test_readl(test
, PCI_ENDPOINT_TEST_CHECKSUM
))
542 dma_free_coherent(dev
, size
+ alignment
, orig_addr
, orig_phys_addr
);
547 static bool pci_endpoint_test_set_irq(struct pci_endpoint_test
*test
,
550 struct pci_dev
*pdev
= test
->pdev
;
551 struct device
*dev
= &pdev
->dev
;
553 if (req_irq_type
< IRQ_TYPE_LEGACY
|| req_irq_type
> IRQ_TYPE_MSIX
) {
554 dev_err(dev
, "Invalid IRQ type option\n");
558 if (irq_type
== req_irq_type
)
561 pci_endpoint_test_release_irq(test
);
562 pci_endpoint_test_free_irq_vectors(test
);
564 if (!pci_endpoint_test_alloc_irq_vectors(test
, req_irq_type
))
567 if (!pci_endpoint_test_request_irq(test
))
570 irq_type
= req_irq_type
;
574 pci_endpoint_test_free_irq_vectors(test
);
575 irq_type
= IRQ_TYPE_UNDEFINED
;
579 static long pci_endpoint_test_ioctl(struct file
*file
, unsigned int cmd
,
584 struct pci_endpoint_test
*test
= to_endpoint_test(file
->private_data
);
585 struct pci_dev
*pdev
= test
->pdev
;
587 mutex_lock(&test
->mutex
);
591 if (bar
< 0 || bar
> 5)
593 if (is_am654_pci_dev(pdev
) && bar
== BAR_0
)
595 ret
= pci_endpoint_test_bar(test
, bar
);
597 case PCITEST_LEGACY_IRQ
:
598 ret
= pci_endpoint_test_legacy_irq(test
);
602 ret
= pci_endpoint_test_msi_irq(test
, arg
, cmd
== PCITEST_MSIX
);
605 ret
= pci_endpoint_test_write(test
, arg
);
608 ret
= pci_endpoint_test_read(test
, arg
);
611 ret
= pci_endpoint_test_copy(test
, arg
);
613 case PCITEST_SET_IRQTYPE
:
614 ret
= pci_endpoint_test_set_irq(test
, arg
);
616 case PCITEST_GET_IRQTYPE
:
622 mutex_unlock(&test
->mutex
);
626 static const struct file_operations pci_endpoint_test_fops
= {
627 .owner
= THIS_MODULE
,
628 .unlocked_ioctl
= pci_endpoint_test_ioctl
,
631 static int pci_endpoint_test_probe(struct pci_dev
*pdev
,
632 const struct pci_device_id
*ent
)
639 struct device
*dev
= &pdev
->dev
;
640 struct pci_endpoint_test
*test
;
641 struct pci_endpoint_test_data
*data
;
642 enum pci_barno test_reg_bar
= BAR_0
;
643 struct miscdevice
*misc_device
;
645 if (pci_is_bridge(pdev
))
648 test
= devm_kzalloc(dev
, sizeof(*test
), GFP_KERNEL
);
652 test
->test_reg_bar
= 0;
657 irq_type
= IRQ_TYPE_LEGACY
;
659 data
= (struct pci_endpoint_test_data
*)ent
->driver_data
;
661 test_reg_bar
= data
->test_reg_bar
;
662 test
->test_reg_bar
= test_reg_bar
;
663 test
->alignment
= data
->alignment
;
664 irq_type
= data
->irq_type
;
667 init_completion(&test
->irq_raised
);
668 mutex_init(&test
->mutex
);
670 err
= pci_enable_device(pdev
);
672 dev_err(dev
, "Cannot enable PCI device\n");
676 err
= pci_request_regions(pdev
, DRV_MODULE_NAME
);
678 dev_err(dev
, "Cannot obtain PCI resources\n");
679 goto err_disable_pdev
;
682 pci_set_master(pdev
);
684 if (!pci_endpoint_test_alloc_irq_vectors(test
, irq_type
))
685 goto err_disable_irq
;
687 if (!pci_endpoint_test_request_irq(test
))
688 goto err_disable_irq
;
690 for (bar
= 0; bar
< PCI_STD_NUM_BARS
; bar
++) {
691 if (pci_resource_flags(pdev
, bar
) & IORESOURCE_MEM
) {
692 base
= pci_ioremap_bar(pdev
, bar
);
694 dev_err(dev
, "Failed to read BAR%d\n", bar
);
695 WARN_ON(bar
== test_reg_bar
);
697 test
->bar
[bar
] = base
;
701 test
->base
= test
->bar
[test_reg_bar
];
704 dev_err(dev
, "Cannot perform PCI test without BAR%d\n",
709 pci_set_drvdata(pdev
, test
);
711 id
= ida_simple_get(&pci_endpoint_test_ida
, 0, 0, GFP_KERNEL
);
714 dev_err(dev
, "Unable to get id\n");
718 snprintf(name
, sizeof(name
), DRV_MODULE_NAME
".%d", id
);
719 misc_device
= &test
->miscdev
;
720 misc_device
->minor
= MISC_DYNAMIC_MINOR
;
721 misc_device
->name
= kstrdup(name
, GFP_KERNEL
);
722 if (!misc_device
->name
) {
726 misc_device
->fops
= &pci_endpoint_test_fops
,
728 err
= misc_register(misc_device
);
730 dev_err(dev
, "Failed to register device\n");
737 kfree(misc_device
->name
);
740 ida_simple_remove(&pci_endpoint_test_ida
, id
);
743 for (bar
= 0; bar
< PCI_STD_NUM_BARS
; bar
++) {
745 pci_iounmap(pdev
, test
->bar
[bar
]);
747 pci_endpoint_test_release_irq(test
);
750 pci_endpoint_test_free_irq_vectors(test
);
751 pci_release_regions(pdev
);
754 pci_disable_device(pdev
);
759 static void pci_endpoint_test_remove(struct pci_dev
*pdev
)
763 struct pci_endpoint_test
*test
= pci_get_drvdata(pdev
);
764 struct miscdevice
*misc_device
= &test
->miscdev
;
766 if (sscanf(misc_device
->name
, DRV_MODULE_NAME
".%d", &id
) != 1)
771 misc_deregister(&test
->miscdev
);
772 kfree(misc_device
->name
);
773 ida_simple_remove(&pci_endpoint_test_ida
, id
);
774 for (bar
= 0; bar
< PCI_STD_NUM_BARS
; bar
++) {
776 pci_iounmap(pdev
, test
->bar
[bar
]);
779 pci_endpoint_test_release_irq(test
);
780 pci_endpoint_test_free_irq_vectors(test
);
782 pci_release_regions(pdev
);
783 pci_disable_device(pdev
);
786 static const struct pci_endpoint_test_data am654_data
= {
787 .test_reg_bar
= BAR_2
,
789 .irq_type
= IRQ_TYPE_MSI
,
792 static const struct pci_device_id pci_endpoint_test_tbl
[] = {
793 { PCI_DEVICE(PCI_VENDOR_ID_TI
, PCI_DEVICE_ID_TI_DRA74x
) },
794 { PCI_DEVICE(PCI_VENDOR_ID_TI
, PCI_DEVICE_ID_TI_DRA72x
) },
795 { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE
, 0x81c0) },
796 { PCI_DEVICE_DATA(SYNOPSYS
, EDDA
, NULL
) },
797 { PCI_DEVICE(PCI_VENDOR_ID_TI
, PCI_DEVICE_ID_TI_AM654
),
798 .driver_data
= (kernel_ulong_t
)&am654_data
802 MODULE_DEVICE_TABLE(pci
, pci_endpoint_test_tbl
);
804 static struct pci_driver pci_endpoint_test_driver
= {
805 .name
= DRV_MODULE_NAME
,
806 .id_table
= pci_endpoint_test_tbl
,
807 .probe
= pci_endpoint_test_probe
,
808 .remove
= pci_endpoint_test_remove
,
810 module_pci_driver(pci_endpoint_test_driver
);
812 MODULE_DESCRIPTION("PCI ENDPOINT TEST HOST DRIVER");
813 MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
814 MODULE_LICENSE("GPL v2");