Skip to contentSkip to conversation

accel: Add Arm Ethos-U NPU

RFC PATCH Superseded Rob Herring (Arm) 1 participant 3 messages Jul 22, 2025

Subsystems (5)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

cover accel: Add Arm Ethos-U NPU

The Arm Ethos-U65/85 NPUs are designed for edge AI inference applications[0].

The driver works with Mesa Teflon. WIP support is available here[1]. The UAPI should also be compatible with the downstream driver stack[2] and Vela compiler though that has not been implemented.

Testing so far has been on i.MX93 boards with Ethos-U65. Support for U85 is still todo. Only minor changes on driver side will be needed for U85 support.

A git tree is here[3].

Rob

[0] https://www.arm.com/products/silicon-ip-cpu?families=ethos%20npus
[1] https://gitlab.freedesktop.org/tomeu/mesa.git ethos
[2] https://gitlab.arm.com/artificial-intelligence/ethos-u/
[3] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git ethos

---
Rob Herring (Arm) (2):
dt-bindings: npu: Add Arm Ethos-U65/U85
accel: Add Arm Ethos-U NPU driver

 .../devicetree/bindings/npu/arm,ethos.yaml         |  79 +++
 MAINTAINERS                                        |   9 +
 drivers/accel/Kconfig                              |   1 +
 drivers/accel/Makefile                             |   1 +
 drivers/accel/ethos/Kconfig                        |  10 +
 drivers/accel/ethos/Makefile                       |   4 +
 drivers/accel/ethos/ethos_device.h                 | 186 ++++++
 drivers/accel/ethos/ethos_drv.c                    | 412 ++++++++++++
 drivers/accel/ethos/ethos_drv.h                    |  15 +
 drivers/accel/ethos/ethos_gem.c                    | 707 +++++++++++++++++++++
 drivers/accel/ethos/ethos_gem.h                    |  46 ++
 drivers/accel/ethos/ethos_job.c                    | 527 +++++++++++++++
 drivers/accel/ethos/ethos_job.h                    |  41 ++
 include/uapi/drm/ethos_accel.h                     | 262 ++++++++
 14 files changed, 2300 insertions(+)

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250715-ethos-3fdd39ef6f19

Best regards,

Signature · 1 line
Rob Herring (Arm) <[email protected]>
author maintainer
#1 lore raw

RFC PATCH 1/2 dt-bindings: npu: Add Arm Ethos-U65/U85

Add a binding schema for Arm Ethos-U65/U85 NPU. The Arm Ethos-U NPUs are designed for edge AI inference applications.

---
 .../devicetree/bindings/npu/arm,ethos.yaml         | 79 ++++++++++++++++++++++
 1 file changed, 79 insertions(+)
Documentation/devicetree/bindings/npu/arm,ethos.yaml new file +79 -0
new file mode 100644
index 000000000000..716c4997f976
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/npu/arm,ethos.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Arm Ethos U65/U85
+
+maintainers:
+  - Rob Herring <[email protected]>
+
+description: >
+  The Arm Ethos-U NPUs are designed for IoT inference applications. The NPUs
+  can accelerate 8-bit and 16-bit integer quantized networks:
+
+    Transformer networks (U85 only)
+    Convolutional Neural Networks (CNN)
+    Recurrent Neural Networks (RNN)
+
+  Further documentation is available here:
+
+    U65 TRM: https://developer.arm.com/documentation/102023/
+    U85 TRM: https://developer.arm.com/documentation/102685/
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx93-npu
+          - const: arm,ethos-u65
+      - items:
+          - {}
+          - const: arm,ethos-u85
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: core
+      - const: apb
+
+  power-domains:
+    maxItems: 1
+
+  sram:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/imx93-clock.h>
+
+    npu@4a900000 {
+        compatible = "fsl,imx93-npu", "arm,ethos-u65";
+        reg = <0x4a900000 0x1000>;
+        interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
+        power-domains = <&mlmix>;
+        clocks = <&clk IMX93_CLK_ML>, <&clk IMX93_CLK_ML_APB>;
+        clock-names = "core", "apb";
+        sram = <&sram>;
+    };
+...
Signature · 1 line
2.47.2
author maintainer
#2 lore raw

RFC PATCH 2/2 accel: Add Arm Ethos-U NPU driver

In reply to Rob Herring (Arm)

Add a driver for Arm Ethos-U65/U85 NPUs. The Ethos-U NPU has a relatively simple interface with single command stream to describe buffers, operation settings, and network operations. It supports up to 8 memory regions (though no h/w bounds on a region). The Ethos NPUs are designed to use an SRAM for scratch memory. Region 2 is reserved for SRAM (like the downstream driver stack and compiler). Userspace doesn't need access to the SRAM.

The h/w has no MMU nor external IOMMU and is a DMA engine which can read and write anywhere in memory without h/w bounds checks. The user submitted command streams must be validated against the bounds of the GEM BOs. This is similar to the VC4 design which validates shaders.

The job submit is based on the rocket driver for the Rockchip NPU utilizing the GPU scheduler. It is simpler as there's only 1 core rather than 3.

Tested on i.MX93 platform (U65) with WIP Mesa Teflon support.

---
Open issues/TODO:
- Fix "Memory manager not clean during takedown." warning
- U85 support (minor changes and testing needed)
- Improve AXI bus config. This needs to be per platform probably and is also different for U85. The downstream driver parameterizes everything into DT properties (and a whole other driver!). There's little reason to parameterize everything for a couple of fixed registers to initialize. All that should be needed is per platform match data.
- Automatic h/w clock/power gating with Q channel. (Perhaps not needed with runtime PM?)
- SRAM support not working on i.MX93 as some DMA writes to SRAM are corrupted/dropped (AXI bus config?)

---
 MAINTAINERS                        |   9 +
 drivers/accel/Kconfig              |   1 +
 drivers/accel/Makefile             |   1 +
 drivers/accel/ethos/Kconfig        |  10 +
 drivers/accel/ethos/Makefile       |   4 +
 drivers/accel/ethos/ethos_device.h | 186 ++++++++++
 drivers/accel/ethos/ethos_drv.c    | 412 +++++++++++++++++++++
 drivers/accel/ethos/ethos_drv.h    |  15 +
 drivers/accel/ethos/ethos_gem.c    | 707 +++++++++++++++++++++++++++++++++++++
 drivers/accel/ethos/ethos_gem.h    |  46 +++
 drivers/accel/ethos/ethos_job.c    | 527 +++++++++++++++++++++++++++
 drivers/accel/ethos/ethos_job.h    |  41 +++
 include/uapi/drm/ethos_accel.h     | 262 ++++++++++++++
 13 files changed, 2221 insertions(+)
MAINTAINERS +9 -0
index a92290fffa16..e748eb565fad 100644
@@ -1954,6 +1954,15 @@ F:	arch/arm/include/asm/arch_timer.h
 F:	arch/arm64/include/asm/arch_timer.h
 F:	drivers/clocksource/arm_arch_timer.c
 
+ARM ETHOS-U NPU DRIVER
+M:	Rob Herring (Arm) <[email protected]>
+M:	Tomeu Vizoso <[email protected]>
+L:	[email protected]
+S:	Supported
+T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F:	drivers/accel/ethos/
+F:	include/uapi/drm/ethos_accel.h
+
 ARM GENERIC INTERRUPT CONTROLLER DRIVERS
 M:	Marc Zyngier <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/accel/Kconfig +1 -0
index 5b9490367a39..6317644b6a5a 100644
@@ -25,6 +25,7 @@ menuconfig DRM_ACCEL
 	  and debugfs).
 
 source "drivers/accel/amdxdna/Kconfig"
+source "drivers/accel/ethos/Kconfig"
 source "drivers/accel/habanalabs/Kconfig"
 source "drivers/accel/ivpu/Kconfig"
 source "drivers/accel/qaic/Kconfig"
drivers/accel/Makefile +1 -0
index a301fb6089d4..f18868037484 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 obj-$(CONFIG_DRM_ACCEL_AMDXDNA)		+= amdxdna/
+obj-$(CONFIG_DRM_ACCEL_ARM_ETHOS)	+= ethos/
 obj-$(CONFIG_DRM_ACCEL_HABANALABS)	+= habanalabs/
 obj-$(CONFIG_DRM_ACCEL_IVPU)		+= ivpu/
 obj-$(CONFIG_DRM_ACCEL_QAIC)		+= qaic/
drivers/accel/ethos/Kconfig new file +10 -0
new file mode 100644
index 000000000000..127afbae43f0
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_ACCEL_ARM_ETHOS
+	tristate "Arm Ethos-U65/U85 NPU"
+	depends on HAS_IOMEM
+	depends on DRM_ACCEL
+	select DRM_GEM_DMA_HELPER
+	select DRM_SCHED
+	help
+	  Enables driver for Arm Ethos-U65/U85 NPUs
drivers/accel/ethos/Makefile new file +4 -0
new file mode 100644
index 000000000000..8b4a8bbf41d4
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_DRM_ACCEL_ARM_ETHOS) := ethos.o
+ethos-y += ethos_drv.o ethos_gem.o ethos_job.o
drivers/accel/ethos/ethos_device.h new file +186 -0

186 lines not on this page · raw message

drivers/accel/ethos/ethos_drv.c new file +412 -0

412 lines not on this page · raw message

drivers/accel/ethos/ethos_drv.h new file +15 -0
new file mode 100644
index 000000000000..39a55c1a6bd6
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+/* Copyright 2025 Arm, Ltd. */
+#ifndef __ETHOS_DRV_H__
+#define __ETHOS_DRV_H__
+
+#include <drm/gpu_scheduler.h>
+
+struct ethos_device;
+
+struct ethos_file_priv {
+	struct ethos_device *edev;
+	struct drm_sched_entity sched_entity;
+};
+
+#endif
drivers/accel/ethos/ethos_gem.c new file +707 -0

707 lines not on this page · raw message

drivers/accel/ethos/ethos_gem.h new file +46 -0

46 lines not on this page · raw message

drivers/accel/ethos/ethos_job.c new file +527 -0

527 lines not on this page · raw message

drivers/accel/ethos/ethos_job.h new file +41 -0

41 lines not on this page · raw message

include/uapi/drm/ethos_accel.h new file +262 -0

262 lines not on this page · raw message

Signature · 1 line
2.47.2