2 * PCIe host controller driver for Xilinx AXI PCIe Bridge
4 * Copyright (c) 2012 - 2014 Xilinx, Inc.
6 * Based on the Tegra PCIe driver
8 * Bits taken from Synopsys Designware Host controller driver and
9 * ARM PCI Host generic driver.
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 2 of the License, or
14 * (at your option) any later version.
17 #include <linux/interrupt.h>
18 #include <linux/irq.h>
19 #include <linux/irqdomain.h>
20 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <linux/msi.h>
23 #include <linux/of_address.h>
24 #include <linux/of_pci.h>
25 #include <linux/of_platform.h>
26 #include <linux/of_irq.h>
27 #include <linux/pci.h>
28 #include <linux/platform_device.h>
30 /* Register definitions */
31 #define XILINX_PCIE_REG_BIR 0x00000130
32 #define XILINX_PCIE_REG_IDR 0x00000138
33 #define XILINX_PCIE_REG_IMR 0x0000013c
34 #define XILINX_PCIE_REG_PSCR 0x00000144
35 #define XILINX_PCIE_REG_RPSC 0x00000148
36 #define XILINX_PCIE_REG_MSIBASE1 0x0000014c
37 #define XILINX_PCIE_REG_MSIBASE2 0x00000150
38 #define XILINX_PCIE_REG_RPEFR 0x00000154
39 #define XILINX_PCIE_REG_RPIFR1 0x00000158
40 #define XILINX_PCIE_REG_RPIFR2 0x0000015c
42 /* Interrupt registers definitions */
43 #define XILINX_PCIE_INTR_LINK_DOWN BIT(0)
44 #define XILINX_PCIE_INTR_ECRC_ERR BIT(1)
45 #define XILINX_PCIE_INTR_STR_ERR BIT(2)
46 #define XILINX_PCIE_INTR_HOT_RESET BIT(3)
47 #define XILINX_PCIE_INTR_CFG_TIMEOUT BIT(8)
48 #define XILINX_PCIE_INTR_CORRECTABLE BIT(9)
49 #define XILINX_PCIE_INTR_NONFATAL BIT(10)
50 #define XILINX_PCIE_INTR_FATAL BIT(11)
51 #define XILINX_PCIE_INTR_INTX BIT(16)
52 #define XILINX_PCIE_INTR_MSI BIT(17)
53 #define XILINX_PCIE_INTR_SLV_UNSUPP BIT(20)
54 #define XILINX_PCIE_INTR_SLV_UNEXP BIT(21)
55 #define XILINX_PCIE_INTR_SLV_COMPL BIT(22)
56 #define XILINX_PCIE_INTR_SLV_ERRP BIT(23)
57 #define XILINX_PCIE_INTR_SLV_CMPABT BIT(24)
58 #define XILINX_PCIE_INTR_SLV_ILLBUR BIT(25)
59 #define XILINX_PCIE_INTR_MST_DECERR BIT(26)
60 #define XILINX_PCIE_INTR_MST_SLVERR BIT(27)
61 #define XILINX_PCIE_INTR_MST_ERRP BIT(28)
62 #define XILINX_PCIE_IMR_ALL_MASK 0x1FF30FED
63 #define XILINX_PCIE_IDR_ALL_MASK 0xFFFFFFFF
65 /* Root Port Error FIFO Read Register definitions */
66 #define XILINX_PCIE_RPEFR_ERR_VALID BIT(18)
67 #define XILINX_PCIE_RPEFR_REQ_ID GENMASK(15, 0)
68 #define XILINX_PCIE_RPEFR_ALL_MASK 0xFFFFFFFF
70 /* Root Port Interrupt FIFO Read Register 1 definitions */
71 #define XILINX_PCIE_RPIFR1_INTR_VALID BIT(31)
72 #define XILINX_PCIE_RPIFR1_MSI_INTR BIT(30)
73 #define XILINX_PCIE_RPIFR1_INTR_MASK GENMASK(28, 27)
74 #define XILINX_PCIE_RPIFR1_ALL_MASK 0xFFFFFFFF
75 #define XILINX_PCIE_RPIFR1_INTR_SHIFT 27
77 /* Bridge Info Register definitions */
78 #define XILINX_PCIE_BIR_ECAM_SZ_MASK GENMASK(18, 16)
79 #define XILINX_PCIE_BIR_ECAM_SZ_SHIFT 16
81 /* Root Port Interrupt FIFO Read Register 2 definitions */
82 #define XILINX_PCIE_RPIFR2_MSG_DATA GENMASK(15, 0)
84 /* Root Port Status/control Register definitions */
85 #define XILINX_PCIE_REG_RPSC_BEN BIT(0)
87 /* Phy Status/Control Register definitions */
88 #define XILINX_PCIE_REG_PSCR_LNKUP BIT(11)
90 /* ECAM definitions */
91 #define ECAM_BUS_NUM_SHIFT 20
92 #define ECAM_DEV_NUM_SHIFT 12
94 /* Number of MSI IRQs */
95 #define XILINX_NUM_MSI_IRQS 128
98 * struct xilinx_pcie_port - PCIe port information
99 * @reg_base: IO Mapped Register Base
100 * @irq: Interrupt number
101 * @msi_pages: MSI pages
102 * @root_busno: Root Bus number
103 * @dev: Device pointer
104 * @irq_domain: IRQ domain pointer
105 * @resources: Bus Resources
107 struct xilinx_pcie_port
{
108 void __iomem
*reg_base
;
110 unsigned long msi_pages
;
113 struct irq_domain
*irq_domain
;
114 struct list_head resources
;
117 static DECLARE_BITMAP(msi_irq_in_use
, XILINX_NUM_MSI_IRQS
);
119 static inline u32
pcie_read(struct xilinx_pcie_port
*port
, u32 reg
)
121 return readl(port
->reg_base
+ reg
);
124 static inline void pcie_write(struct xilinx_pcie_port
*port
, u32 val
, u32 reg
)
126 writel(val
, port
->reg_base
+ reg
);
129 static inline bool xilinx_pcie_link_is_up(struct xilinx_pcie_port
*port
)
131 return (pcie_read(port
, XILINX_PCIE_REG_PSCR
) &
132 XILINX_PCIE_REG_PSCR_LNKUP
) ? 1 : 0;
136 * xilinx_pcie_clear_err_interrupts - Clear Error Interrupts
137 * @port: PCIe port information
139 static void xilinx_pcie_clear_err_interrupts(struct xilinx_pcie_port
*port
)
141 unsigned long val
= pcie_read(port
, XILINX_PCIE_REG_RPEFR
);
143 if (val
& XILINX_PCIE_RPEFR_ERR_VALID
) {
144 dev_dbg(port
->dev
, "Requester ID %lu\n",
145 val
& XILINX_PCIE_RPEFR_REQ_ID
);
146 pcie_write(port
, XILINX_PCIE_RPEFR_ALL_MASK
,
147 XILINX_PCIE_REG_RPEFR
);
152 * xilinx_pcie_valid_device - Check if a valid device is present on bus
153 * @bus: PCI Bus structure
154 * @devfn: device/function
156 * Return: 'true' on success and 'false' if invalid device is found
158 static bool xilinx_pcie_valid_device(struct pci_bus
*bus
, unsigned int devfn
)
160 struct xilinx_pcie_port
*port
= bus
->sysdata
;
162 /* Check if link is up when trying to access downstream ports */
163 if (bus
->number
!= port
->root_busno
)
164 if (!xilinx_pcie_link_is_up(port
))
167 /* Only one device down on each root port */
168 if (bus
->number
== port
->root_busno
&& devfn
> 0)
172 * Do not read more than one device on the bus directly attached
175 if (bus
->primary
== port
->root_busno
&& devfn
> 0)
182 * xilinx_pcie_map_bus - Get configuration base
183 * @bus: PCI Bus structure
184 * @devfn: Device/function
185 * @where: Offset from base
187 * Return: Base address of the configuration space needed to be
190 static void __iomem
*xilinx_pcie_map_bus(struct pci_bus
*bus
,
191 unsigned int devfn
, int where
)
193 struct xilinx_pcie_port
*port
= bus
->sysdata
;
196 if (!xilinx_pcie_valid_device(bus
, devfn
))
199 relbus
= (bus
->number
<< ECAM_BUS_NUM_SHIFT
) |
200 (devfn
<< ECAM_DEV_NUM_SHIFT
);
202 return port
->reg_base
+ relbus
+ where
;
205 /* PCIe operations */
206 static struct pci_ops xilinx_pcie_ops
= {
207 .map_bus
= xilinx_pcie_map_bus
,
208 .read
= pci_generic_config_read
,
209 .write
= pci_generic_config_write
,
215 * xilinx_pcie_destroy_msi - Free MSI number
216 * @irq: IRQ to be freed
218 static void xilinx_pcie_destroy_msi(unsigned int irq
)
220 struct msi_desc
*msi
;
221 struct xilinx_pcie_port
*port
;
223 if (!test_bit(irq
, msi_irq_in_use
)) {
224 msi
= irq_get_msi_desc(irq
);
225 port
= msi_desc_to_pci_sysdata(msi
);
226 dev_err(port
->dev
, "Trying to free unused MSI#%d\n", irq
);
228 clear_bit(irq
, msi_irq_in_use
);
233 * xilinx_pcie_assign_msi - Allocate MSI number
234 * @port: PCIe port structure
236 * Return: A valid IRQ on success and error value on failure.
238 static int xilinx_pcie_assign_msi(struct xilinx_pcie_port
*port
)
242 pos
= find_first_zero_bit(msi_irq_in_use
, XILINX_NUM_MSI_IRQS
);
243 if (pos
< XILINX_NUM_MSI_IRQS
)
244 set_bit(pos
, msi_irq_in_use
);
252 * xilinx_msi_teardown_irq - Destroy the MSI
253 * @chip: MSI Chip descriptor
254 * @irq: MSI IRQ to destroy
256 static void xilinx_msi_teardown_irq(struct msi_controller
*chip
,
259 xilinx_pcie_destroy_msi(irq
);
263 * xilinx_pcie_msi_setup_irq - Setup MSI request
264 * @chip: MSI chip pointer
265 * @pdev: PCIe device pointer
266 * @desc: MSI descriptor pointer
268 * Return: '0' on success and error value on failure
270 static int xilinx_pcie_msi_setup_irq(struct msi_controller
*chip
,
271 struct pci_dev
*pdev
,
272 struct msi_desc
*desc
)
274 struct xilinx_pcie_port
*port
= pdev
->bus
->sysdata
;
278 phys_addr_t msg_addr
;
280 hwirq
= xilinx_pcie_assign_msi(port
);
284 irq
= irq_create_mapping(port
->irq_domain
, hwirq
);
288 irq_set_msi_desc(irq
, desc
);
290 msg_addr
= virt_to_phys((void *)port
->msi_pages
);
293 msg
.address_lo
= msg_addr
;
296 pci_write_msi_msg(irq
, &msg
);
301 /* MSI Chip Descriptor */
302 static struct msi_controller xilinx_pcie_msi_chip
= {
303 .setup_irq
= xilinx_pcie_msi_setup_irq
,
304 .teardown_irq
= xilinx_msi_teardown_irq
,
307 /* HW Interrupt Chip Descriptor */
308 static struct irq_chip xilinx_msi_irq_chip
= {
309 .name
= "Xilinx PCIe MSI",
310 .irq_enable
= pci_msi_unmask_irq
,
311 .irq_disable
= pci_msi_mask_irq
,
312 .irq_mask
= pci_msi_mask_irq
,
313 .irq_unmask
= pci_msi_unmask_irq
,
317 * xilinx_pcie_msi_map - Set the handler for the MSI and mark IRQ as valid
318 * @domain: IRQ domain
319 * @irq: Virtual IRQ number
320 * @hwirq: HW interrupt number
322 * Return: Always returns 0.
324 static int xilinx_pcie_msi_map(struct irq_domain
*domain
, unsigned int irq
,
325 irq_hw_number_t hwirq
)
327 irq_set_chip_and_handler(irq
, &xilinx_msi_irq_chip
, handle_simple_irq
);
328 irq_set_chip_data(irq
, domain
->host_data
);
333 /* IRQ Domain operations */
334 static const struct irq_domain_ops msi_domain_ops
= {
335 .map
= xilinx_pcie_msi_map
,
339 * xilinx_pcie_enable_msi - Enable MSI support
340 * @port: PCIe port information
342 static void xilinx_pcie_enable_msi(struct xilinx_pcie_port
*port
)
344 phys_addr_t msg_addr
;
346 port
->msi_pages
= __get_free_pages(GFP_KERNEL
, 0);
347 msg_addr
= virt_to_phys((void *)port
->msi_pages
);
348 pcie_write(port
, 0x0, XILINX_PCIE_REG_MSIBASE1
);
349 pcie_write(port
, msg_addr
, XILINX_PCIE_REG_MSIBASE2
);
355 * xilinx_pcie_intx_map - Set the handler for the INTx and mark IRQ as valid
356 * @domain: IRQ domain
357 * @irq: Virtual IRQ number
358 * @hwirq: HW interrupt number
360 * Return: Always returns 0.
362 static int xilinx_pcie_intx_map(struct irq_domain
*domain
, unsigned int irq
,
363 irq_hw_number_t hwirq
)
365 irq_set_chip_and_handler(irq
, &dummy_irq_chip
, handle_simple_irq
);
366 irq_set_chip_data(irq
, domain
->host_data
);
371 /* INTx IRQ Domain operations */
372 static const struct irq_domain_ops intx_domain_ops
= {
373 .map
= xilinx_pcie_intx_map
,
376 /* PCIe HW Functions */
379 * xilinx_pcie_intr_handler - Interrupt Service Handler
381 * @data: PCIe port information
383 * Return: IRQ_HANDLED on success and IRQ_NONE on failure
385 static irqreturn_t
xilinx_pcie_intr_handler(int irq
, void *data
)
387 struct xilinx_pcie_port
*port
= (struct xilinx_pcie_port
*)data
;
388 u32 val
, mask
, status
, msi_data
;
390 /* Read interrupt decode and mask registers */
391 val
= pcie_read(port
, XILINX_PCIE_REG_IDR
);
392 mask
= pcie_read(port
, XILINX_PCIE_REG_IMR
);
398 if (status
& XILINX_PCIE_INTR_LINK_DOWN
)
399 dev_warn(port
->dev
, "Link Down\n");
401 if (status
& XILINX_PCIE_INTR_ECRC_ERR
)
402 dev_warn(port
->dev
, "ECRC failed\n");
404 if (status
& XILINX_PCIE_INTR_STR_ERR
)
405 dev_warn(port
->dev
, "Streaming error\n");
407 if (status
& XILINX_PCIE_INTR_HOT_RESET
)
408 dev_info(port
->dev
, "Hot reset\n");
410 if (status
& XILINX_PCIE_INTR_CFG_TIMEOUT
)
411 dev_warn(port
->dev
, "ECAM access timeout\n");
413 if (status
& XILINX_PCIE_INTR_CORRECTABLE
) {
414 dev_warn(port
->dev
, "Correctable error message\n");
415 xilinx_pcie_clear_err_interrupts(port
);
418 if (status
& XILINX_PCIE_INTR_NONFATAL
) {
419 dev_warn(port
->dev
, "Non fatal error message\n");
420 xilinx_pcie_clear_err_interrupts(port
);
423 if (status
& XILINX_PCIE_INTR_FATAL
) {
424 dev_warn(port
->dev
, "Fatal error message\n");
425 xilinx_pcie_clear_err_interrupts(port
);
428 if (status
& XILINX_PCIE_INTR_INTX
) {
429 /* INTx interrupt received */
430 val
= pcie_read(port
, XILINX_PCIE_REG_RPIFR1
);
432 /* Check whether interrupt valid */
433 if (!(val
& XILINX_PCIE_RPIFR1_INTR_VALID
)) {
434 dev_warn(port
->dev
, "RP Intr FIFO1 read error\n");
438 if (!(val
& XILINX_PCIE_RPIFR1_MSI_INTR
)) {
439 /* Clear interrupt FIFO register 1 */
440 pcie_write(port
, XILINX_PCIE_RPIFR1_ALL_MASK
,
441 XILINX_PCIE_REG_RPIFR1
);
443 /* Handle INTx Interrupt */
444 val
= ((val
& XILINX_PCIE_RPIFR1_INTR_MASK
) >>
445 XILINX_PCIE_RPIFR1_INTR_SHIFT
) + 1;
446 generic_handle_irq(irq_find_mapping(port
->irq_domain
,
451 if (status
& XILINX_PCIE_INTR_MSI
) {
453 val
= pcie_read(port
, XILINX_PCIE_REG_RPIFR1
);
455 if (!(val
& XILINX_PCIE_RPIFR1_INTR_VALID
)) {
456 dev_warn(port
->dev
, "RP Intr FIFO1 read error\n");
460 if (val
& XILINX_PCIE_RPIFR1_MSI_INTR
) {
461 msi_data
= pcie_read(port
, XILINX_PCIE_REG_RPIFR2
) &
462 XILINX_PCIE_RPIFR2_MSG_DATA
;
464 /* Clear interrupt FIFO register 1 */
465 pcie_write(port
, XILINX_PCIE_RPIFR1_ALL_MASK
,
466 XILINX_PCIE_REG_RPIFR1
);
468 if (IS_ENABLED(CONFIG_PCI_MSI
)) {
469 /* Handle MSI Interrupt */
470 generic_handle_irq(msi_data
);
475 if (status
& XILINX_PCIE_INTR_SLV_UNSUPP
)
476 dev_warn(port
->dev
, "Slave unsupported request\n");
478 if (status
& XILINX_PCIE_INTR_SLV_UNEXP
)
479 dev_warn(port
->dev
, "Slave unexpected completion\n");
481 if (status
& XILINX_PCIE_INTR_SLV_COMPL
)
482 dev_warn(port
->dev
, "Slave completion timeout\n");
484 if (status
& XILINX_PCIE_INTR_SLV_ERRP
)
485 dev_warn(port
->dev
, "Slave Error Poison\n");
487 if (status
& XILINX_PCIE_INTR_SLV_CMPABT
)
488 dev_warn(port
->dev
, "Slave Completer Abort\n");
490 if (status
& XILINX_PCIE_INTR_SLV_ILLBUR
)
491 dev_warn(port
->dev
, "Slave Illegal Burst\n");
493 if (status
& XILINX_PCIE_INTR_MST_DECERR
)
494 dev_warn(port
->dev
, "Master decode error\n");
496 if (status
& XILINX_PCIE_INTR_MST_SLVERR
)
497 dev_warn(port
->dev
, "Master slave error\n");
499 if (status
& XILINX_PCIE_INTR_MST_ERRP
)
500 dev_warn(port
->dev
, "Master error poison\n");
502 /* Clear the Interrupt Decode register */
503 pcie_write(port
, status
, XILINX_PCIE_REG_IDR
);
509 * xilinx_pcie_free_irq_domain - Free IRQ domain
510 * @port: PCIe port information
512 static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port
*port
)
517 /* Free IRQ Domain */
518 if (IS_ENABLED(CONFIG_PCI_MSI
)) {
520 free_pages(port
->msi_pages
, 0);
522 num_irqs
= XILINX_NUM_MSI_IRQS
;
528 for (i
= 0; i
< num_irqs
; i
++) {
529 irq
= irq_find_mapping(port
->irq_domain
, i
);
531 irq_dispose_mapping(irq
);
534 irq_domain_remove(port
->irq_domain
);
538 * xilinx_pcie_init_irq_domain - Initialize IRQ domain
539 * @port: PCIe port information
541 * Return: '0' on success and error value on failure
543 static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port
*port
)
545 struct device
*dev
= port
->dev
;
546 struct device_node
*node
= dev
->of_node
;
547 struct device_node
*pcie_intc_node
;
550 pcie_intc_node
= of_get_next_child(node
, NULL
);
551 if (!pcie_intc_node
) {
552 dev_err(dev
, "No PCIe Intc node found\n");
553 return PTR_ERR(pcie_intc_node
);
556 port
->irq_domain
= irq_domain_add_linear(pcie_intc_node
, 4,
559 if (!port
->irq_domain
) {
560 dev_err(dev
, "Failed to get a INTx IRQ domain\n");
561 return PTR_ERR(port
->irq_domain
);
565 if (IS_ENABLED(CONFIG_PCI_MSI
)) {
566 port
->irq_domain
= irq_domain_add_linear(node
,
569 &xilinx_pcie_msi_chip
);
570 if (!port
->irq_domain
) {
571 dev_err(dev
, "Failed to get a MSI IRQ domain\n");
572 return PTR_ERR(port
->irq_domain
);
575 xilinx_pcie_enable_msi(port
);
582 * xilinx_pcie_init_port - Initialize hardware
583 * @port: PCIe port information
585 static void xilinx_pcie_init_port(struct xilinx_pcie_port
*port
)
587 if (xilinx_pcie_link_is_up(port
))
588 dev_info(port
->dev
, "PCIe Link is UP\n");
590 dev_info(port
->dev
, "PCIe Link is DOWN\n");
592 /* Disable all interrupts */
593 pcie_write(port
, ~XILINX_PCIE_IDR_ALL_MASK
,
594 XILINX_PCIE_REG_IMR
);
596 /* Clear pending interrupts */
597 pcie_write(port
, pcie_read(port
, XILINX_PCIE_REG_IDR
) &
598 XILINX_PCIE_IMR_ALL_MASK
,
599 XILINX_PCIE_REG_IDR
);
601 /* Enable all interrupts */
602 pcie_write(port
, XILINX_PCIE_IMR_ALL_MASK
, XILINX_PCIE_REG_IMR
);
604 /* Enable the Bridge enable bit */
605 pcie_write(port
, pcie_read(port
, XILINX_PCIE_REG_RPSC
) |
606 XILINX_PCIE_REG_RPSC_BEN
,
607 XILINX_PCIE_REG_RPSC
);
611 * xilinx_pcie_parse_dt - Parse Device tree
612 * @port: PCIe port information
614 * Return: '0' on success and error value on failure
616 static int xilinx_pcie_parse_dt(struct xilinx_pcie_port
*port
)
618 struct device
*dev
= port
->dev
;
619 struct device_node
*node
= dev
->of_node
;
620 struct resource regs
;
624 type
= of_get_property(node
, "device_type", NULL
);
625 if (!type
|| strcmp(type
, "pci")) {
626 dev_err(dev
, "invalid \"device_type\" %s\n", type
);
630 err
= of_address_to_resource(node
, 0, ®s
);
632 dev_err(dev
, "missing \"reg\" property\n");
636 port
->reg_base
= devm_ioremap_resource(dev
, ®s
);
637 if (IS_ERR(port
->reg_base
))
638 return PTR_ERR(port
->reg_base
);
640 port
->irq
= irq_of_parse_and_map(node
, 0);
641 err
= devm_request_irq(dev
, port
->irq
, xilinx_pcie_intr_handler
,
642 IRQF_SHARED
| IRQF_NO_THREAD
,
643 "xilinx-pcie", port
);
645 dev_err(dev
, "unable to request irq %d\n", port
->irq
);
653 * xilinx_pcie_probe - Probe function
654 * @pdev: Platform device pointer
656 * Return: '0' on success and error value on failure
658 static int xilinx_pcie_probe(struct platform_device
*pdev
)
660 struct xilinx_pcie_port
*port
;
661 struct device
*dev
= &pdev
->dev
;
665 resource_size_t iobase
= 0;
671 port
= devm_kzalloc(dev
, sizeof(*port
), GFP_KERNEL
);
677 err
= xilinx_pcie_parse_dt(port
);
679 dev_err(dev
, "Parsing DT failed\n");
683 xilinx_pcie_init_port(port
);
685 err
= xilinx_pcie_init_irq_domain(port
);
687 dev_err(dev
, "Failed creating IRQ Domain\n");
691 err
= of_pci_get_host_bridge_resources(dev
->of_node
, 0, 0xff, &res
,
694 dev_err(dev
, "Getting bridge resources failed\n");
697 bus
= pci_create_root_bus(&pdev
->dev
, 0,
698 &xilinx_pcie_ops
, port
, &res
);
702 #ifdef CONFIG_PCI_MSI
703 xilinx_pcie_msi_chip
.dev
= port
->dev
;
704 bus
->msi
= &xilinx_pcie_msi_chip
;
706 pci_scan_child_bus(bus
);
707 pci_assign_unassigned_bus_resources(bus
);
708 #ifndef CONFIG_MICROBLAZE
709 pci_fixup_irqs(pci_common_swizzle
, of_irq_parse_and_map_pci
);
711 pci_bus_add_devices(bus
);
712 platform_set_drvdata(pdev
, port
);
718 * xilinx_pcie_remove - Remove function
719 * @pdev: Platform device pointer
723 static int xilinx_pcie_remove(struct platform_device
*pdev
)
725 struct xilinx_pcie_port
*port
= platform_get_drvdata(pdev
);
727 xilinx_pcie_free_irq_domain(port
);
732 static struct of_device_id xilinx_pcie_of_match
[] = {
733 { .compatible
= "xlnx,axi-pcie-host-1.00.a", },
737 static struct platform_driver xilinx_pcie_driver
= {
739 .name
= "xilinx-pcie",
740 .of_match_table
= xilinx_pcie_of_match
,
741 .suppress_bind_attrs
= true,
743 .probe
= xilinx_pcie_probe
,
744 .remove
= xilinx_pcie_remove
,
746 module_platform_driver(xilinx_pcie_driver
);
748 MODULE_AUTHOR("Xilinx Inc");
749 MODULE_DESCRIPTION("Xilinx AXI PCIe driver");
750 MODULE_LICENSE("GPL v2");