Add Altera timeout bridge driver
v3 cover Add Altera timeout bridge driver
This series adds support for the Altera's AXI Timeout Bridge IP.
The timeout bridge connects an Axi bus to the HPS and provides a downstream address space for devices implemented in the FPGA. The bridge also exposes status information and generates an interrupt when a timeout occurs.
The driver registers the timeout bridge as a bus and allows child devices behind the bridge to be described as the child nodes in the device tree.
The latest bridge documentation (as of November 2026):
https://docs.altera.com/r/docs/683609/26.1/quartus-prime-pro-edition-user-guide-platform-designer/axi-timeout-bridge-ip
---
Changes in v3:
- Addressed sashiko findings.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Address review notes
- Simplify error handling
- Provide better description for DT Schema
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Vyacheslav Yurkov (2):
dt-bindings: bus: Add Altera AXI Timeout Bridge
bus: Add Altera AXI Timeout Bridge driver
.../ABI/testing/sysfs-driver-altera-timeout-bridge | 21 +++ .../bindings/bus/altr,axi-timeout-bridge-1.0.yaml | 86 ++++++++++ MAINTAINERS | 7 + drivers/bus/Kconfig | 13 ++ drivers/bus/Makefile | 1 + drivers/bus/altera-timeout-bridge.c | 184 +++++++++++++++++++++ 6 files changed, 312 insertions(+)
---
base-commit: 65e4fd942f72a9dba0e4e257290c4fa1aa756854
change-id: 20261003-feature-timeout-ip-7a93630de299
Best regards,
Signature · 1 line
Vyacheslav Yurkov <[email protected]>
PATCH v3 1/2 dt-bindings: bus: Add Altera AXI Timeout Bridge
The Altera AXI Timeout Bridge is an FPGA IP core placed between an AXI host, such as the HPS-to-FPGA bridge, and peripherals implemented in the FPGA fabric. It forwards transactions unchanged and monitors each one for completion. If a peripheral does not respond in time, the bridge terminates the transaction with an error response so that the host does not hang, raises an interrupt, and reports the address of the timed-out transaction in its control and status registers.
--- .../bindings/bus/altr,axi-timeout-bridge-1.0.yaml | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+)
Documentation/devicetree/bindings/bus/altr,axi-timeout-bridge-1.0.yaml new file +86 -0
@@ -0,0 +1,86 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/altr,axi-timeout-bridge-1.0.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Altera AXI Timeout Bridge + +maintainers: + - Vyacheslav Yurkov <[email protected]> + +description: | + The Altera AXI Timeout Bridge is an FPGA soft IP placed between an AXI + host, such as the HPS-to-FPGA bridge, and the downstream peripherals + implemented in the FPGA fabric. It forwards transactions unchanged and + monitors each one for completion. + + If a downstream peripheral does not respond within a configured number + of clock cycles, the bridge terminates the outstanding transaction with + an error response so that the host does not hang, + and raises an interrupt. + +properties: + compatible: + const: altr,axi-timeout-bridge-1.0 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + ranges: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +patternProperties: + "^[a-zA-Z][a-zA-Z0-9,+._-]*@[0-9a-f]+$": + type: object + description: | + Device connected to the timeout bridge. + + required: + - compatible + - reg + + additionalProperties: true + +required: + - compatible + - reg + - interrupts + - ranges + - "#address-cells" + - "#size-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + bus@10000 { + compatible = "altr,axi-timeout-bridge-1.0"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x10000 0x10>; + interrupts = <0 12 IRQ_TYPE_LEVEL_HIGH>; + ranges = <0x0 0x10010 0x1000>; + + gpio@100 { + compatible = "altr,pio-1.0"; + reg = <0x100 0x10>; + interrupts = <GIC_SPI 13 IRQ_TYPE_EDGE_RISING>; + interrupt-controller; + #interrupt-cells = <2>; + gpio-controller; + #gpio-cells = <2>; + }; + };
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v3 1/2] dt-bindings: bus: Add Altera AXI Timeout Bridge
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: bus: non-canonical property order in axi-timeout-bridge example --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: bus: non-canonical property order in axi-timeout-bridge example
--
commit f9313b89c46a716fd7317e81e51cf84dd43ee870
Author: Vyacheslav Yurkov <[email protected]>
dt-bindings: bus: Add Altera AXI Timeout Bridge
This commit adds a devicetree binding schema for the Altera AXI Timeout Bridge FPGA IP core.
Quoted 6 lines
Documentation/devicetree/bindings/bus/altr,axi-timeout-bridge-1.0.yaml new file +0
-0@@ -0,0 +1,86 @@
[ ... ]
Documentation/devicetree/bindings/bus/altr,axi-timeout-bridge-1.0.yaml line 75
Quoted 12 lines
Documentation/devicetree/bindings/bus/altr,axi-timeout-bridge-1.0.yaml new file +12
-0+examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + bus@10000 { + compatible = "altr,axi-timeout-bridge-1.0"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x10000 0x10>; + interrupts = <0 12 IRQ_TYPE_LEVEL_HIGH>; + ranges = <0x0 0x10010 0x1000>;
[Severity: Low]
In the bus@10000 example node, reg and ranges should come immediately after compatible, before #address-cells, #size-cells and interrupts, to match the DTS coding style and pass scripts/dtc/dt-check-style in strict mode without property-order warnings.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v3 2/2 bus: Add Altera AXI Timeout Bridge driver
In reply to Vyacheslav YurkovThe Altera AXI Timeout Bridge sits between an AXI host and peripherals in the FPGA fabric. When a peripheral fails to respond, the bridge completes the transaction with an error response instead of letting the host hang, raises an interrupt, and latches the address of the timed-out transaction.
Add a driver that populates the peripherals behind the bridge as child devices and handles the timeout interrupt. On each timeout, the driver logs the address, clears the interrupt, and notifies user space through sysfs:
irq_count number of timeouts since the driver was bound
last_timeout_address address of the most recent timed-out transaction
last_timeout_address supports poll(), so a monitoring application can wait for timeouts without busy-polling.
The sysfs group is registered manually in order to get the kernfs node in probe, .dev_groups would register it after the probe is already done.
On the host, the error response is reported as an external abort.
--- .../ABI/testing/sysfs-driver-altera-timeout-bridge | 21 +++ MAINTAINERS | 7 + drivers/bus/Kconfig | 13 ++ drivers/bus/Makefile | 1 + drivers/bus/altera-timeout-bridge.c | 184 +++++++++++++++++++++ 5 files changed, 226 insertions(+)
Documentation/ABI/testing/sysfs-driver-altera-timeout-bridge new file +21 -0
@@ -0,0 +1,21 @@ +What: /sys/bus/platform/devices/<dev>/irq_count +Date: October 2026 +KernelVersion: 7.5 +Contact: Vyacheslav Yurkov <[email protected]> +Description: + (RO) Number of transaction timeouts reported by the + Altera AXI Timeout Bridge since the driver was bound. + +What: /sys/bus/platform/devices/<dev>/last_timeout_address +Date: October 2026 +KernelVersion: 7.5 +Contact: Vyacheslav Yurkov <[email protected]> +Description: + (RO) Address of the most recent transaction that timed + out, reported as the translated CPU address, formatted as + a hexadecimal number with a 0x prefix. Reads 0x0 until + the first timeout occurs. + + The attribute supports poll(): user space can wait for + POLLPRI | POLLERR to be notified of each new timeout, + re-reading the attribute from offset 0 afterwards.
MAINTAINERS +7 -0
@@ -974,6 +974,13 @@ ALPS PS/2 TOUCHPAD DRIVER R: Pali Rohár <[email protected]> F: drivers/input/mouse/alps.* +ALTERA AXI TIMEOUT BRIDGE DRIVER +M: Vyacheslav Yurkov <[email protected]> +S: Maintained +F: Documentation/ABI/testing/sysfs-driver-altera-timeout-bridge +F: Documentation/devicetree/bindings/bus/altr,axi-timeout-bridge-1.0.yaml +F: drivers/bus/altera-timeout-bridge.c + ALTERA MAILBOX DRIVER M: Tien Sung Ang <[email protected]> S: Maintained
drivers/bus/Kconfig +13 -0
@@ -247,6 +247,19 @@ config DA8XX_MSTPRI configuration. Allows to adjust the priorities of all master peripherals. +config ALTERA_TIMEOUT_BRIDGE + tristate "Altera AXI Timeout Bridge bus" + depends on ARCH_INTEL_SOCFPGA || COMPILE_TEST + depends on OF && HAS_IOMEM + help + Driver for the Altera AXI Timeout Bridge, an FPGA IP core that + sits between an AXI host and peripherals in the FPGA fabric. + When a peripheral does not respond in time, the bridge + terminates the transaction with an error response and raises + an interrupt. This driver populates the peripherals behind the + bridge and reports the address of each timed-out transaction + through sysfs. + source "drivers/bus/fsl-mc/Kconfig" source "drivers/bus/mhi/Kconfig"
drivers/bus/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o obj-$(CONFIG_DA8XX_MSTPRI) += da8xx-mstpri.o +obj-$(CONFIG_ALTERA_TIMEOUT_BRIDGE) += altera-timeout-bridge.o # MHI obj-y += mhi/
drivers/bus/altera-timeout-bridge.c new file +184 -0
184 lines not on this page · raw message
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v3 2/2] bus: Add Altera AXI Timeout Bridge driver
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] bus: altera-timeout-bridge: NULL deref in altera_timeout_bridge_probe() --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] bus: altera-timeout-bridge: NULL deref in altera_timeout_bridge_probe()
--
commit 2329d1b64f843a3b75217e8d1da80bb7857bd24f
Author: Vyacheslav Yurkov <[email protected]>
bus: Add Altera AXI Timeout Bridge driver
This commit adds a bus driver for the Altera AXI Timeout Bridge that populates child peripherals behind the bridge, handles timeout interrupts, and exposes timeout count and address attributes via sysfs.
Quoted 6 lines
drivers/bus/altera-timeout-bridge.c new file +0
-0@@ -0,0 +1,184 @@
[ ... ]
Quoted 2 lines
drivers/bus/altera-timeout-bridge.c new file +2
-0+static int altera_timeout_bridge_probe (struct platform_device *pdev) +{
[ ... ]
drivers/bus/altera-timeout-bridge.c line 144
Quoted 7 lines
drivers/bus/altera-timeout-bridge.c new file +7
-0+ ret =devm_device_add_group (dev, &altera_timeout_bridge_sysfs_group); +if (ret) +return ret; + + driver_data->irq_node =sysfs_get_dirent (dev->kobj.sd,"last_timeout_address" ); +if (!driver_data->irq_node) +return -ENOENT ;
[Severity: Medium]
Can sysfs_get_dirent() trigger a NULL pointer dereference or cause probe to fail when CONFIG_SYSFS is disabled?
ALTERA_TIMEOUT_BRIDGE does not depend on SYSFS. When CONFIG_SYSFS=n, devm_device_add_group() is a no-op and dev->kobj.sd remains NULL. If CONFIG_KERNFS=y (for example, via CONFIG_CGROUPS), sysfs_get_dirent() passes parent = NULL into kernfs_find_and_get_ns() -> kernfs_root(), which dereferences kn->__parent without a NULL check. If CONFIG_KERNFS=n, sysfs_get_dirent() returns NULL and altera_timeout_bridge_probe() fails with -ENOENT before requesting the IRQ or populating child devices.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2