Commit 5a5e9c02 authored by Rob Herring (Arm)'s avatar Rob Herring (Arm)
Browse files

accel: Add Arm Ethos-U NPU driver



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) and FVP (U85) with Mesa Teflon
support.

Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarTomeu Vizoso <tomeu@tomeuvizoso.net>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251020-ethos-v6-2-ecebc383c4b7@kernel.org


Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
parent b3e29b6e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2017,6 +2017,15 @@ F: arch/arm64/include/asm/arch_timer.h
F:	drivers/clocksource/arm_arch_timer.c
F:	drivers/clocksource/arm_arch_timer_mmio.c
ARM ETHOS-U NPU DRIVER
M:	Rob Herring (Arm) <robh@kernel.org>
M:	Tomeu Vizoso <tomeu@tomeuvizoso.net>
L:	dri-devel@lists.freedesktop.org
S:	Supported
T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
F:	drivers/accel/ethosu/
F:	include/uapi/drm/ethosu_accel.h
ARM GENERIC INTERRUPT CONTROLLER DRIVERS
M:	Marc Zyngier <maz@kernel.org>
L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ menuconfig DRM_ACCEL
	  and debugfs).

source "drivers/accel/amdxdna/Kconfig"
source "drivers/accel/ethosu/Kconfig"
source "drivers/accel/habanalabs/Kconfig"
source "drivers/accel/ivpu/Kconfig"
source "drivers/accel/qaic/Kconfig"
+1 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_DRM_ACCEL_AMDXDNA)		+= amdxdna/
obj-$(CONFIG_DRM_ACCEL_ARM_ETHOSU)	+= ethosu/
obj-$(CONFIG_DRM_ACCEL_HABANALABS)	+= habanalabs/
obj-$(CONFIG_DRM_ACCEL_IVPU)		+= ivpu/
obj-$(CONFIG_DRM_ACCEL_QAIC)		+= qaic/
+11 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

config DRM_ACCEL_ARM_ETHOSU
	tristate "Arm Ethos-U65/U85 NPU"
	depends on HAS_IOMEM
	depends on DRM_ACCEL
	select DRM_GEM_DMA_HELPER
	select DRM_SCHED
	select GENERIC_ALLOCATOR
	help
	  Enables driver for Arm Ethos-U65/U85 NPUs
+4 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_DRM_ACCEL_ARM_ETHOSU) := ethosu.o
ethosu-y += ethosu_drv.o ethosu_gem.o ethosu_job.o
Loading