Skip to contentSkip to conversation

Add Xilinx Versal NET SMMU CSR interrupt controller support

PATCH Applied Tushar Nimkar 2 participants 5 messages Sep 28 – Oct 15

Subsystems (4)
lore
Share & tools
lore

Tushar Nimkar

author maintainer
#0 lore raw

v4 cover Add Xilinx Versal NET SMMU CSR interrupt controller support

On Xilinx Versal NET, the ARM SMMUv3 EVENTQ, PRIQ and GERROR interrupts are routed through a vendor-specific Control and Status Register (CSR) block, where they must be enabled, cleared and acknowledged before being forwarded to the parent GIC.
This series adds a small irqchip driver for the CSR block that chains to the standard arm-smmu-v3 driver, so the generic SMMUv3 driver needs no changes.
Patch 1 adds the DT binding.
Patch 2 adds the irqchip driver.

Changes in v4:
- irqchip driver (Sashiko): use handle_fasteoi_irq() + .irq_eoi() with IRQCHIP_EOI_THREADED so the sticky W1C status is cleared only after the threaded SMMUv3 handler drains the source, avoiding spurious interrupts.
- dt-bindings: No changes, Added Acked-by:Conor Dooley tag

Link to v3:
https://lore.kernel.org/all/[email protected]/

Changes in v3:
- irqchip driver (Sashiko): harden against interrupt sources left enabled/latched by a prior boot stage:
- Mask and clear every CSR source at init, including CMD_SYNC (bit 1) which the driver does not service.
- Gate the handler on the mask register (ISR & ~MASK) instead of the raw ISR, so masked-but-latched sources are not dispatched.
- Mask and clear any active source with no mapped consumer so it cannot spin the parent line.
- dt-bindings: No changes

Link to v2:
https://lore.kernel.org/all/[email protected]/#t

Changes in v2:
- Posted as a proper threaded series with a cover letter (v1 patches went out individually).
- dt-bindings (Krzysztof):
- Dropped the irrelevant arm,smmu-v3 consumer node from the example.
- Dropped the unused "smmu_irq_csr" label from the example.
- Dropped the redundant "binding" from the patch subject.
- irqchip driver (Thomas):
- Aligned kernel-doc member descriptions and used "interrupt" instead of "IRQ".
- Used guard(raw_spinlock)() in the mask/unmask/ack callbacks and addressed the comments related to lock handling.
- Thomas suggested using devm-managed allocation and irqdomain APIs; however, the driver is registered via IRQCHIP_DECLARE() and has no associated struct device, so devm APIs cannot be used. This code is left unchanged.

Link to v1:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

---
Anirudha Sarangi (2):
dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR
irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

 .../xlnx,versal-net-smmu-csr.yaml                  |  75 +++++++
 MAINTAINERS                                        |  10 +
 drivers/irqchip/Kconfig                            |  10 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-xilinx-smmu-csr.c              | 249 +++++++++++++++++++++
 5 files changed, 345 insertions(+)

---
base-commit: 0d9d0dbf2fddcff5859d623e90ca73c4054276e1
change-id: 20260917-smmu-changes-v2-9cf7435d6969

Best regards,

Signature · 1 line
Tushar Nimkar <[email protected]>
author maintainer
#1 lore raw

PATCH v4 1/2 dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

From: Anirudha Sarangi <[email protected]>

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
 .../xlnx,versal-net-smmu-csr.yaml                  | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 000000000000..38b63e51b732
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
Signature · 1 line
2.34.1
#2 lore raw

[tip: irq/drivers] dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     675b45ab71f3b17482dde264d6ee7f98690c487c
Gitweb:        https://git.kernel.org/tip/675b45ab71f3b17482dde264d6ee7f98690c487c
Author:        Anirudha Sarangi <[email protected]>
AuthorDate:    Mon, 28 Sep 2026 15:03:03 +05:30
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 15 Oct 2026 11:59:22 +02:00

dt-bindings: interrupt-controller: Add Xilinx Versal NET SMMU CSR

Add a device tree binding schema for the Xilinx Versal NET SMMU CSR (Control and Status Register) interrupt controller.

The SMMU CSR block acts as a vendor-specific interrupt controller in front of the ARM SMMUv3, providing registers to enable and clear standard SMMU interrupts such as EVENTQ, CMDQ_SYNC, GERROR and PRIQ. Interrupts must be acknowledged in this block before being forwarded to the parent interrupt controller (e.g. GIC).

---
 Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml new file +75 -0
new file mode 100644
index 0000000..38b63e5
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/xlnx,versal-net-smmu-csr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xilinx Versal NET SMMU CSR Interrupt Controller
+
+maintainers:
+  - Anirudha Sarangi <[email protected]>
+  - Tushar Nimkar <[email protected]>
+
+description: |
+  The Versal NET platform includes a Xilinx-specific SMMU CSR (Control and
+  Status Register) block that acts as an intermediate interrupt controller
+  for ARM SMMUv3.
+
+  The block provides registers to enable, disable and clear the
+  standard SMMUv3 interrupt sources (EVENTQ, CMDQ_SYNC, GERROR and PRIQ)
+  before forwarding them to the parent interrupt controller,
+  typically a GIC.
+
+  The controller receives one parent interrupt and demultiplexes CSR
+  status bits into the following child interrupt identifiers
+    0 - EVENTQ
+    1 - CMDQ_SYNC
+    2 - GERROR (GLOBAL)
+    3 - PRIQ
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    const: xlnx,versal-net-smmu-csr
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description: |
+     Single cell containing the child interrupt identifier
+      0 - EVENTQ
+      1 - CMDQ_SYNC
+      2 - GERROR (GLOBAL)
+      3 - PRIQ
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    interrupt-controller@eca10000 {
+        compatible = "xlnx,versal-net-smmu-csr";
+        reg = <0xeca10000 0x1000>;
+        interrupt-controller;
+        #interrupt-cells = <1>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+    };
author maintainer
#3 lore raw

PATCH v4 2/2 irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

In reply to Tushar Nimkar

From: Anirudha Sarangi <[email protected]>

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. Interrupts are enabled, cleared, and acknowledged through this block by writing to the relevant registers. Once an interrupt is acknowledged, it is forwarded to the parent interrupt controller for further processing.

Add an irqchip driver for the CSR block. The driver registers as an interrupt controller and chains to the upstream SMMUv3 driver, so that the standard SMMUv3 driver does not require modification while still supporting Xilinx SoCs.

The CSR block can also gate the SMMUv3 CMDQ_SYNC completion interrupt (bit 1), but it is intentionally left unsupported. The Linux arm-smmu-v3 driver signals CMDQ_SYNC completion via polling or MSI and never requests a wired CMD_SYNC interrupt, so there is no in-kernel consumer for it. Exposing it as a child line would only risk spurious, never-acked interrupts, and it is omitted from the DT binding for the same reason.

This driver is intended to operate in conjunction with the ARM SMMUv3 driver and the kernel's IOMMU DMA infrastructure. These dependencies are not selected directly in Kconfig to avoid introducing dependency recursion.

---
 MAINTAINERS                           |  10 ++
 drivers/irqchip/Kconfig               |  10 ++
 drivers/irqchip/Makefile              |   1 +
 drivers/irqchip/irq-xilinx-smmu-csr.c | 249 ++++++++++++++++++++++++++++++++++
 4 files changed, 270 insertions(+)
MAINTAINERS +10 -0
index 6e50747a621c..40ef350285a6 100644
@@ -30141,6 +30141,16 @@ F:	Documentation/misc-devices/xilinx_sdfec.rst
 F:	drivers/misc/xilinx_sdfec.c
 F:	include/uapi/misc/xilinx_sdfec.h
 
+XILINX SMMU CSR IRQ DRIVER
+M:	Anirudha Sarangi <[email protected]>
+M:	Tushar Nimkar <[email protected]>
+L:	[email protected]
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
+F:	drivers/irqchip/irq-xilinx-smmu-csr.c
+
 XILINX TRNG DRIVER
 M:	Mounika Botcha <[email protected]>
 M:	Harsh Jain <[email protected]>
drivers/irqchip/Kconfig +10 -0
index a8f8c423b795..81a2c9107601 100644
@@ -842,4 +842,14 @@ config SUNPLUS_SP7021_INTC
 	  chained controller, routing all interrupt source in P-Chip to
 	  the primary controller on C-Chip.
 
+config IRQCHIP_XILINX_SMMU_CSR
+	bool "Xilinx SMMU CSR Interrupt Driver"
+	depends on ARCH_ZYNQMP
+	select IRQ_DOMAIN
+	help
+	  This driver does the initial handling of SMMU interrupts before
+	  forwarding them to the ARM SMMU v3 driver.  It is intended for
+	  ZynqMP-class platforms where a vendor CSR block mediates SMMU
+	  interrupts.
+
 endmenu
drivers/irqchip/Makefile +1 -0
index ab33cccd8471..16a5fd126c9a 100644
@@ -135,3 +135,4 @@ obj-$(CONFIG_APPLE_AIC)			+= irq-apple-aic.o
 obj-$(CONFIG_MCHP_EIC)			+= irq-mchp-eic.o
 obj-$(CONFIG_SOPHGO_SG2042_MSI)		+= irq-sg2042-msi.o
 obj-$(CONFIG_SUNPLUS_SP7021_INTC)	+= irq-sp7021-intc.o
+obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR)	+= irq-xilinx-smmu-csr.o
drivers/irqchip/irq-xilinx-smmu-csr.c new file +249 -0

249 lines not on this page · raw message

Signature · 1 line
2.34.1
#4 lore raw

[tip: irq/drivers] irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     3cbc11fcefc85093965f2b5bb0c4b205b02fd071
Gitweb:        https://git.kernel.org/tip/3cbc11fcefc85093965f2b5bb0c4b205b02fd071
Author:        Anirudha Sarangi <[email protected]>
AuthorDate:    Mon, 28 Sep 2026 15:03:04 +05:30
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 15 Oct 2026 11:59:22 +02:00

irqchip: Add Xilinx Versal NET SMMU CSR interrupt controller driver

The Xilinx Versal NET SoC implements a Control and Status Register (CSR) block in front of the ARM SMMUv3 to manage EVENTQ, PRIQ and GLOBAL interrupts. Interrupts are enabled, cleared, and acknowledged through this block by writing to the relevant registers. Once an interrupt is acknowledged, it is forwarded to the parent interrupt controller for further processing.

Add an irqchip driver for the CSR block. The driver registers as an interrupt controller and chains to the upstream SMMUv3 driver, so that the standard SMMUv3 driver does not require modification while still supporting Xilinx SoCs.

The CSR block can also gate the SMMUv3 CMDQ_SYNC completion interrupt (bit 1), but it is intentionally left unsupported. The Linux arm-smmu-v3 driver signals CMDQ_SYNC completion via polling or MSI and never requests a wired CMD_SYNC interrupt, so there is no in-kernel consumer for it. Exposing it as a child line would only risk spurious, never-acked interrupts, and it is omitted from the DT binding for the same reason.

This driver is intended to operate in conjunction with the ARM SMMUv3 driver and the kernel's IOMMU DMA infrastructure. These dependencies are not selected directly in Kconfig to avoid introducing dependency recursion.

---
 MAINTAINERS                           |  10 +-
 drivers/irqchip/Kconfig               |  10 +-
 drivers/irqchip/Makefile              |   1 +-
 drivers/irqchip/irq-xilinx-smmu-csr.c | 244 +++++++++++++++++++++++++-
 4 files changed, 265 insertions(+)
 create mode 100644 drivers/irqchip/irq-xilinx-smmu-csr.c
MAINTAINERS +10 -0
index 3a19da7..f6007e7 100644
@@ -29913,6 +29913,16 @@ F:	Documentation/misc-devices/xilinx_sdfec.rst
 F:	drivers/misc/xilinx_sdfec.c
 F:	include/uapi/misc/xilinx_sdfec.h
 
+XILINX SMMU CSR IRQ DRIVER
+M:	Anirudha Sarangi <[email protected]>
+M:	Tushar Nimkar <[email protected]>
+L:	[email protected]
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/interrupt-controller/xlnx,versal-net-smmu-csr.yaml
+F:	drivers/irqchip/irq-xilinx-smmu-csr.c
+
 XILINX TRNG DRIVER
 M:	Mounika Botcha <[email protected]>
 M:	Harsh Jain <[email protected]>
drivers/irqchip/Kconfig +10 -0
index 06d5cbf..136bab4 100644
@@ -842,4 +842,14 @@ config SUNPLUS_SP7021_INTC
 	  chained controller, routing all interrupt source in P-Chip to
 	  the primary controller on C-Chip.
 
+config IRQCHIP_XILINX_SMMU_CSR
+	bool "Xilinx SMMU CSR Interrupt Driver"
+	depends on ARCH_ZYNQMP
+	select IRQ_DOMAIN
+	help
+	  This driver does the initial handling of SMMU interrupts before
+	  forwarding them to the ARM SMMU v3 driver.  It is intended for
+	  ZynqMP-class platforms where a vendor CSR block mediates SMMU
+	  interrupts.
+
 endmenu
drivers/irqchip/Makefile +1 -0
index ab33ccc..16a5fd1 100644
@@ -135,3 +135,4 @@ obj-$(CONFIG_APPLE_AIC)			+= irq-apple-aic.o
 obj-$(CONFIG_MCHP_EIC)			+= irq-mchp-eic.o
 obj-$(CONFIG_SOPHGO_SG2042_MSI)		+= irq-sg2042-msi.o
 obj-$(CONFIG_SUNPLUS_SP7021_INTC)	+= irq-sp7021-intc.o
+obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR)	+= irq-xilinx-smmu-csr.o
drivers/irqchip/irq-xilinx-smmu-csr.c new file +244 -0

244 lines not on this page · raw message