Skip to content

Commit d100de0

Browse files
committed
Merge branch 'pci/controller/xilinx-xdma'
- Move Xilinx IRQ definitions to a common header shared by pcie-xilinx-cpm and xilinx-xdma (Thippeswamy Havalige) - Add Xilinx XDMA driver and DT schema (Thippeswamy Havalige) * pci/controller/xilinx-xdma: PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx XDMA PCIe Root Port Bridge PCI: xilinx-cpm: Move IRQ definitions to a common header
2 parents fb3d102 + 8d78614 commit d100de0

File tree

6 files changed

+978
-31
lines changed

6 files changed

+978
-31
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/xlnx,xdma-host.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Xilinx XDMA PL PCIe Root Port Bridge
8+
9+
maintainers:
10+
- Thippeswamy Havalige <[email protected]>
11+
12+
allOf:
13+
- $ref: /schemas/pci/pci-bus.yaml#
14+
15+
properties:
16+
compatible:
17+
const: xlnx,xdma-host-3.00
18+
19+
reg:
20+
maxItems: 1
21+
22+
ranges:
23+
maxItems: 2
24+
25+
interrupts:
26+
items:
27+
- description: interrupt asserted when miscellaneous interrupt is received.
28+
- description: msi0 interrupt asserted when an MSI is received.
29+
- description: msi1 interrupt asserted when an MSI is received.
30+
31+
interrupt-names:
32+
items:
33+
- const: misc
34+
- const: msi0
35+
- const: msi1
36+
37+
interrupt-map-mask:
38+
items:
39+
- const: 0
40+
- const: 0
41+
- const: 0
42+
- const: 7
43+
44+
interrupt-map:
45+
maxItems: 4
46+
47+
"#interrupt-cells":
48+
const: 1
49+
50+
interrupt-controller:
51+
description: identifies the node as an interrupt controller
52+
type: object
53+
properties:
54+
interrupt-controller: true
55+
56+
"#address-cells":
57+
const: 0
58+
59+
"#interrupt-cells":
60+
const: 1
61+
62+
required:
63+
- interrupt-controller
64+
- "#address-cells"
65+
- "#interrupt-cells"
66+
67+
additionalProperties: false
68+
69+
required:
70+
- compatible
71+
- reg
72+
- ranges
73+
- interrupts
74+
- interrupt-map
75+
- interrupt-map-mask
76+
- "#interrupt-cells"
77+
- interrupt-controller
78+
79+
unevaluatedProperties: false
80+
81+
examples:
82+
83+
- |
84+
#include <dt-bindings/interrupt-controller/arm-gic.h>
85+
#include <dt-bindings/interrupt-controller/irq.h>
86+
87+
soc {
88+
#address-cells = <2>;
89+
#size-cells = <2>;
90+
pcie@a0000000 {
91+
compatible = "xlnx,xdma-host-3.00";
92+
reg = <0x0 0xa0000000 0x0 0x10000000>;
93+
ranges = <0x2000000 0x0 0xb0000000 0x0 0xb0000000 0x0 0x1000000>,
94+
<0x43000000 0x5 0x0 0x5 0x0 0x0 0x1000000>;
95+
#address-cells = <3>;
96+
#size-cells = <2>;
97+
#interrupt-cells = <1>;
98+
device_type = "pci";
99+
interrupt-parent = <&gic>;
100+
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
101+
<GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
102+
interrupt-names = "misc", "msi0", "msi1";
103+
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
104+
interrupt-map = <0 0 0 1 &pcie_intc_0 0>,
105+
<0 0 0 2 &pcie_intc_0 1>,
106+
<0 0 0 3 &pcie_intc_0 2>,
107+
<0 0 0 4 &pcie_intc_0 3>;
108+
pcie_intc_0: interrupt-controller {
109+
#address-cells = <0>;
110+
#interrupt-cells = <1>;
111+
interrupt-controller;
112+
};
113+
};
114+
};

drivers/pci/controller/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ config PCIE_XILINX
324324
Say 'Y' here if you want kernel to support the Xilinx AXI PCIe
325325
Host Bridge driver.
326326

327+
config PCIE_XILINX_DMA_PL
328+
bool "Xilinx DMA PL PCIe host bridge support"
329+
depends on ARCH_ZYNQMP || COMPILE_TEST
330+
depends on PCI_MSI
331+
select PCI_HOST_COMMON
332+
help
333+
Say 'Y' here if you want kernel support for the Xilinx PL DMA
334+
PCIe host bridge. The controller is a Soft IP which can act as
335+
Root Port. If your system provides Xilinx PCIe host controller
336+
bridge DMA as Soft IP say 'Y'; if you are not sure, say 'N'.
337+
327338
config PCIE_XILINX_NWL
328339
bool "Xilinx NWL PCIe controller"
329340
depends on ARCH_ZYNQMP || COMPILE_TEST

drivers/pci/controller/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ obj-$(CONFIG_PCI_HOST_THUNDER_PEM) += pci-thunder-pem.o
1717
obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx.o
1818
obj-$(CONFIG_PCIE_XILINX_NWL) += pcie-xilinx-nwl.o
1919
obj-$(CONFIG_PCIE_XILINX_CPM) += pcie-xilinx-cpm.o
20+
obj-$(CONFIG_PCIE_XILINX_DMA_PL) += pcie-xilinx-dma-pl.o
2021
obj-$(CONFIG_PCI_V3_SEMI) += pci-v3-semi.o
2122
obj-$(CONFIG_PCI_XGENE) += pci-xgene.o
2223
obj-$(CONFIG_PCI_XGENE_MSI) += pci-xgene-msi.o
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* (C) Copyright 2023, Xilinx, Inc.
4+
*/
5+
6+
#include <linux/pci.h>
7+
#include <linux/pci-ecam.h>
8+
#include <linux/platform_device.h>
9+
10+
/* Interrupt registers definitions */
11+
#define XILINX_PCIE_INTR_LINK_DOWN 0
12+
#define XILINX_PCIE_INTR_HOT_RESET 3
13+
#define XILINX_PCIE_INTR_CFG_PCIE_TIMEOUT 4
14+
#define XILINX_PCIE_INTR_CFG_TIMEOUT 8
15+
#define XILINX_PCIE_INTR_CORRECTABLE 9
16+
#define XILINX_PCIE_INTR_NONFATAL 10
17+
#define XILINX_PCIE_INTR_FATAL 11
18+
#define XILINX_PCIE_INTR_CFG_ERR_POISON 12
19+
#define XILINX_PCIE_INTR_PME_TO_ACK_RCVD 15
20+
#define XILINX_PCIE_INTR_INTX 16
21+
#define XILINX_PCIE_INTR_PM_PME_RCVD 17
22+
#define XILINX_PCIE_INTR_MSI 17
23+
#define XILINX_PCIE_INTR_SLV_UNSUPP 20
24+
#define XILINX_PCIE_INTR_SLV_UNEXP 21
25+
#define XILINX_PCIE_INTR_SLV_COMPL 22
26+
#define XILINX_PCIE_INTR_SLV_ERRP 23
27+
#define XILINX_PCIE_INTR_SLV_CMPABT 24
28+
#define XILINX_PCIE_INTR_SLV_ILLBUR 25
29+
#define XILINX_PCIE_INTR_MST_DECERR 26
30+
#define XILINX_PCIE_INTR_MST_SLVERR 27
31+
#define XILINX_PCIE_INTR_SLV_PCIE_TIMEOUT 28

drivers/pci/controller/pcie-xilinx-cpm.c

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
#include <linux/of_address.h>
1717
#include <linux/of_pci.h>
1818
#include <linux/of_platform.h>
19-
#include <linux/pci.h>
20-
#include <linux/platform_device.h>
21-
#include <linux/pci-ecam.h>
2219

2320
#include "../pci.h"
21+
#include "pcie-xilinx-common.h"
2422

2523
/* Register definitions */
2624
#define XILINX_CPM_PCIE_REG_IDR 0x00000E10
@@ -38,29 +36,7 @@
3836
#define XILINX_CPM_PCIE_IR_ENABLE 0x000002A8
3937
#define XILINX_CPM_PCIE_IR_LOCAL BIT(0)
4038

41-
/* Interrupt registers definitions */
42-
#define XILINX_CPM_PCIE_INTR_LINK_DOWN 0
43-
#define XILINX_CPM_PCIE_INTR_HOT_RESET 3
44-
#define XILINX_CPM_PCIE_INTR_CFG_PCIE_TIMEOUT 4
45-
#define XILINX_CPM_PCIE_INTR_CFG_TIMEOUT 8
46-
#define XILINX_CPM_PCIE_INTR_CORRECTABLE 9
47-
#define XILINX_CPM_PCIE_INTR_NONFATAL 10
48-
#define XILINX_CPM_PCIE_INTR_FATAL 11
49-
#define XILINX_CPM_PCIE_INTR_CFG_ERR_POISON 12
50-
#define XILINX_CPM_PCIE_INTR_PME_TO_ACK_RCVD 15
51-
#define XILINX_CPM_PCIE_INTR_INTX 16
52-
#define XILINX_CPM_PCIE_INTR_PM_PME_RCVD 17
53-
#define XILINX_CPM_PCIE_INTR_SLV_UNSUPP 20
54-
#define XILINX_CPM_PCIE_INTR_SLV_UNEXP 21
55-
#define XILINX_CPM_PCIE_INTR_SLV_COMPL 22
56-
#define XILINX_CPM_PCIE_INTR_SLV_ERRP 23
57-
#define XILINX_CPM_PCIE_INTR_SLV_CMPABT 24
58-
#define XILINX_CPM_PCIE_INTR_SLV_ILLBUR 25
59-
#define XILINX_CPM_PCIE_INTR_MST_DECERR 26
60-
#define XILINX_CPM_PCIE_INTR_MST_SLVERR 27
61-
#define XILINX_CPM_PCIE_INTR_SLV_PCIE_TIMEOUT 28
62-
63-
#define IMR(x) BIT(XILINX_CPM_PCIE_INTR_ ##x)
39+
#define IMR(x) BIT(XILINX_PCIE_INTR_ ##x)
6440

6541
#define XILINX_CPM_PCIE_IMR_ALL_MASK \
6642
( \
@@ -323,7 +299,7 @@ static void xilinx_cpm_pcie_event_flow(struct irq_desc *desc)
323299
}
324300

325301
#define _IC(x, s) \
326-
[XILINX_CPM_PCIE_INTR_ ## x] = { __stringify(x), s }
302+
[XILINX_PCIE_INTR_ ## x] = { __stringify(x), s }
327303

328304
static const struct {
329305
const char *sym;
@@ -359,9 +335,9 @@ static irqreturn_t xilinx_cpm_pcie_intr_handler(int irq, void *dev_id)
359335
d = irq_domain_get_irq_data(port->cpm_domain, irq);
360336

361337
switch (d->hwirq) {
362-
case XILINX_CPM_PCIE_INTR_CORRECTABLE:
363-
case XILINX_CPM_PCIE_INTR_NONFATAL:
364-
case XILINX_CPM_PCIE_INTR_FATAL:
338+
case XILINX_PCIE_INTR_CORRECTABLE:
339+
case XILINX_PCIE_INTR_NONFATAL:
340+
case XILINX_PCIE_INTR_FATAL:
365341
cpm_pcie_clear_err_interrupts(port);
366342
fallthrough;
367343

@@ -466,7 +442,7 @@ static int xilinx_cpm_setup_irq(struct xilinx_cpm_pcie *port)
466442
}
467443

468444
port->intx_irq = irq_create_mapping(port->cpm_domain,
469-
XILINX_CPM_PCIE_INTR_INTX);
445+
XILINX_PCIE_INTR_INTX);
470446
if (!port->intx_irq) {
471447
dev_err(dev, "Failed to map INTx interrupt\n");
472448
return -ENXIO;

0 commit comments

Comments
 (0)