Skip to content

Commit a977ee9

Browse files
Thippeswamy Havaligekwilczynski
authored andcommitted
PCI: xilinx-cpm: Move IRQ definitions to a common header
Move the interrupt bit definitions to the pcie-xilinx-common.h file, which then can be shared between pcie-xilinx-cpm and the new xilinx-xdma drivers. While at it, also rename them so these definitions are not CPM-specific. No functional change intended. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Thippeswamy Havalige <[email protected]> Signed-off-by: Bharat Kumar Gogada <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 0bb80ec commit a977ee9

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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_SLV_UNSUPP 20
23+
#define XILINX_PCIE_INTR_SLV_UNEXP 21
24+
#define XILINX_PCIE_INTR_SLV_COMPL 22
25+
#define XILINX_PCIE_INTR_SLV_ERRP 23
26+
#define XILINX_PCIE_INTR_SLV_CMPABT 24
27+
#define XILINX_PCIE_INTR_SLV_ILLBUR 25
28+
#define XILINX_PCIE_INTR_MST_DECERR 26
29+
#define XILINX_PCIE_INTR_MST_SLVERR 27
30+
#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)