|
54 | 54 | PCIE_CONF_ADDR_EN) |
55 | 55 | #define PCIE_CONF_DATA_OFF 0x18fc |
56 | 56 | #define PCIE_INT_CAUSE_OFF 0x1900 |
| 57 | +#define PCIE_INT_UNMASK_OFF 0x1910 |
| 58 | +#define PCIE_INT_INTX(i) BIT(24+i) |
57 | 59 | #define PCIE_INT_PM_PME BIT(28) |
58 | | -#define PCIE_MASK_OFF 0x1910 |
59 | | -#define PCIE_MASK_ENABLE_INTS 0x0f000000 |
| 60 | +#define PCIE_INT_ALL_MASK GENMASK(31, 0) |
60 | 61 | #define PCIE_CTRL_OFF 0x1a00 |
61 | 62 | #define PCIE_CTRL_X1_MODE 0x0001 |
62 | 63 | #define PCIE_CTRL_RC_MODE BIT(1) |
@@ -235,7 +236,7 @@ static void mvebu_pcie_setup_wins(struct mvebu_pcie_port *port) |
235 | 236 |
|
236 | 237 | static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port) |
237 | 238 | { |
238 | | - u32 ctrl, lnkcap, cmd, dev_rev, mask; |
| 239 | + u32 ctrl, lnkcap, cmd, dev_rev, unmask; |
239 | 240 |
|
240 | 241 | /* Setup PCIe controller to Root Complex mode. */ |
241 | 242 | ctrl = mvebu_readl(port, PCIE_CTRL_OFF); |
@@ -288,10 +289,19 @@ static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port) |
288 | 289 | /* Point PCIe unit MBUS decode windows to DRAM space. */ |
289 | 290 | mvebu_pcie_setup_wins(port); |
290 | 291 |
|
291 | | - /* Enable interrupt lines A-D. */ |
292 | | - mask = mvebu_readl(port, PCIE_MASK_OFF); |
293 | | - mask |= PCIE_MASK_ENABLE_INTS; |
294 | | - mvebu_writel(port, mask, PCIE_MASK_OFF); |
| 292 | + /* |
| 293 | + * Unmask all legacy INTx interrupts as driver does not provide a way |
| 294 | + * for masking and unmasking of individual legacy INTx interrupts. |
| 295 | + * Legacy INTx are reported via one shared GIC source and therefore |
| 296 | + * kernel cannot distinguish which individual legacy INTx was triggered. |
| 297 | + * These interrupts are shared, so it should not cause any issue. Just |
| 298 | + * performance penalty as every PCIe interrupt handler needs to be |
| 299 | + * called when some interrupt is triggered. |
| 300 | + */ |
| 301 | + unmask = mvebu_readl(port, PCIE_INT_UNMASK_OFF); |
| 302 | + unmask |= PCIE_INT_INTX(0) | PCIE_INT_INTX(1) | |
| 303 | + PCIE_INT_INTX(2) | PCIE_INT_INTX(3); |
| 304 | + mvebu_writel(port, unmask, PCIE_INT_UNMASK_OFF); |
295 | 305 | } |
296 | 306 |
|
297 | 307 | static struct mvebu_pcie_port *mvebu_pcie_find_port(struct mvebu_pcie *pcie, |
@@ -1450,7 +1460,7 @@ static int mvebu_pcie_remove(struct platform_device *pdev) |
1450 | 1460 | mvebu_writel(port, cmd, PCIE_CMD_OFF); |
1451 | 1461 |
|
1452 | 1462 | /* Mask all interrupt sources. */ |
1453 | | - mvebu_writel(port, 0, PCIE_MASK_OFF); |
| 1463 | + mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_UNMASK_OFF); |
1454 | 1464 |
|
1455 | 1465 | /* Free config space for emulated root bridge. */ |
1456 | 1466 | pci_bridge_emul_cleanup(&port->bridge); |
|
0 commit comments