From: Andrew Davis <afd@ti.com>
To: "Tomeu Vizoso" <tomeu@tomeuvizoso.net>,
"Nishanth Menon" <nm@ti.com>, "Randolph Sapp" <rs@ti.com>,
"Jonathan Humphreys" <j-humphreys@ti.com>,
"Andrei Aldea" <a-aldea@ti.com>,
"Chirag Shilwant" <c-shilwant@ti.com>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Tero Kristo" <kristo@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Oded Gabbay" <ogabbay@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Robert Nelson" <robertcnelson@gmail.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>
Cc: <linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>, <linux-doc@vger.kernel.org>,
<linux-media@vger.kernel.org>, <linaro-mm-sig@lists.linaro.org>
Subject: Re: [PATCH v2 2/5] accel/thames: Add driver for the C7x DSPs in TI SoCs
Date: Wed, 14 Jan 2026 12:01:33 -0600 [thread overview]
Message-ID: <7628b04f-df46-47cc-a33d-c40650b256e7@ti.com> (raw)
In-Reply-To: <20260114-thames-v2-2-e94a6636e050@tomeuvizoso.net>
On 1/14/26 2:46 AM, Tomeu Vizoso wrote:
> Some SoCs from Texas Instruments contain DSPs that can be used for
> general compute tasks.
>
> This driver provides a drm/accel UABI to userspace for submitting jobs
> to the DSP cores and managing the input, output and intermediate memory.
>
> Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
> ---
> Documentation/accel/thames/index.rst | 28 +++++
> MAINTAINERS | 9 ++
> drivers/accel/Kconfig | 1 +
> drivers/accel/Makefile | 3 +-
> drivers/accel/thames/Kconfig | 26 +++++
> drivers/accel/thames/Makefile | 9 ++
> drivers/accel/thames/thames_core.c | 155 ++++++++++++++++++++++++++
> drivers/accel/thames/thames_core.h | 53 +++++++++
> drivers/accel/thames/thames_device.c | 93 ++++++++++++++++
> drivers/accel/thames/thames_device.h | 46 ++++++++
> drivers/accel/thames/thames_drv.c | 155 ++++++++++++++++++++++++++
> drivers/accel/thames/thames_drv.h | 21 ++++
> drivers/accel/thames/thames_ipc.h | 204 +++++++++++++++++++++++++++++++++++
> drivers/accel/thames/thames_rpmsg.c | 155 ++++++++++++++++++++++++++
> drivers/accel/thames/thames_rpmsg.h | 27 +++++
> 15 files changed, 984 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/accel/thames/index.rst b/Documentation/accel/thames/index.rst
> new file mode 100644
> index 0000000000000000000000000000000000000000..ca8391031f226f7ef1dc210a356c86acbe126c6f
> --- /dev/null
> +++ b/Documentation/accel/thames/index.rst
> @@ -0,0 +1,28 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +============================================================
> + accel/thames Driver for the C7x DSPs from Texas Instruments
> +============================================================
> +
> +The accel/thames driver supports the C7x DSPs inside some Texas Instruments SoCs
> +such as the J722S. These can be used as accelerators for various workloads,
> +including machine learning inference.
> +
> +This driver controls the power state of the hardware via :doc:`remoteproc </staging/remoteproc>`
> +and communicates with the firmware running on the DSP via :doc:`rpmsg_virtio </staging/rpmsg_virtio>`.
> +The kernel driver itself allocates buffers, manages contexts, and submits jobs
> +to the DSP firmware. Buffers are mapped by the DSP itself using its MMU,
> +providing memory isolation among different clients.
> +
> +The source code for the firmware running on the DSP is available at:
> +https://gitlab.freedesktop.org/tomeu/thames_firmware/.
> +
> +Everything else is done in userspace, as a Gallium driver (also called thames)
> +that is part of the Mesa3D project: https://docs.mesa3d.org/teflon.html
> +
> +If there is more than one core that advertises the same rpmsg_virtio service
> +name, the driver will load balance jobs between them with drm-gpu-scheduler.
> +
> +Hardware currently supported:
> +
> +* J722S
> diff --git a/MAINTAINERS b/MAINTAINERS
> index dc731d37c8feeff25613c59fe9c929927dadaa7e..a3fc809c797269d0792dfe5202cc1b49f6ff57e9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7731,6 +7731,15 @@ F: Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml
> F: drivers/accel/rocket/
> F: include/uapi/drm/rocket_accel.h
>
> +DRM ACCEL DRIVER FOR TI C7x DSPS
> +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: Documentation/accel/thames/
> +F: drivers/accel/thames/
> +F: include/uapi/drm/thames_accel.h
> +
> DRM COMPUTE ACCELERATORS DRIVERS AND FRAMEWORK
> M: Oded Gabbay <ogabbay@kernel.org>
> L: dri-devel@lists.freedesktop.org
> diff --git a/drivers/accel/Kconfig b/drivers/accel/Kconfig
> index bdf48ccafcf21b2fd685ec963e39e256196e6e17..cb49c71cd4e4a4220624f7041a75ba950a1a2ee1 100644
> --- a/drivers/accel/Kconfig
> +++ b/drivers/accel/Kconfig
> @@ -30,5 +30,6 @@ source "drivers/accel/habanalabs/Kconfig"
> source "drivers/accel/ivpu/Kconfig"
> source "drivers/accel/qaic/Kconfig"
> source "drivers/accel/rocket/Kconfig"
> +source "drivers/accel/thames/Kconfig"
>
> endif
> diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile
> index 1d3a7251b950f39e2ae600a2fc07a3ef7e41831e..8472989cbe22746f1e7292d2401fa0f7424a6c15 100644
> --- a/drivers/accel/Makefile
> +++ b/drivers/accel/Makefile
> @@ -5,4 +5,5 @@ 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/
> -obj-$(CONFIG_DRM_ACCEL_ROCKET) += rocket/
> \ No newline at end of file
> +obj-$(CONFIG_DRM_ACCEL_ROCKET) += rocket/
> +obj-$(CONFIG_DRM_ACCEL_THAMES) += thames/
> \ No newline at end of file
> diff --git a/drivers/accel/thames/Kconfig b/drivers/accel/thames/Kconfig
> new file mode 100644
> index 0000000000000000000000000000000000000000..50e0b6ac2a16a942ba8463333991f5b0161b99ac
> --- /dev/null
> +++ b/drivers/accel/thames/Kconfig
> @@ -0,0 +1,26 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +config DRM_ACCEL_THAMES
> + tristate "Thames (support for TI C7x DSP accelerators)"
> + depends on DRM_ACCEL
> + depends on TI_K3_R5_REMOTEPROC || COMPILE_TEST
COMPILE_TEST part shouldn't be needed here, TI_K3_R5_REMOTEPROC can be built
under COMPILE_TEST so TI_K3_R5_REMOTEPROC would just be enabled to test.
> + depends on RPMSG
> + depends on MMU
> + select DRM_SCHED
> + select DRM_GEM_SHMEM_HELPER
> + help
> + Choose this option if you have a Texas Instruments SoC that contains
> + C7x DSP cores that can be used as compute accelerators. This includes
> + SoCs such as the AM62A, J721E, J721S2, and J784S4.
> +
> + The C7x DSP cores can be used for general-purpose compute acceleration
> + and are exposed through the DRM accel subsystem.
> +
> + The interface exposed to userspace is described in
> + include/uapi/drm/thames_accel.h and is used by the Thames userspace
> + driver in Mesa3D.
> +
> + If unsure, say N.
> +
> + To compile this driver as a module, choose M here: the
> + module will be called thames.
> diff --git a/drivers/accel/thames/Makefile b/drivers/accel/thames/Makefile
> new file mode 100644
> index 0000000000000000000000000000000000000000..7ccd8204f0f5ea800f30e84b319f355be948109d
> --- /dev/null
> +++ b/drivers/accel/thames/Makefile
> @@ -0,0 +1,9 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +obj-$(CONFIG_DRM_ACCEL_THAMES) := thames.o
> +
> +thames-y := \
> + thames_core.o \
> + thames_device.o \
> + thames_drv.o \
> + thames_rpmsg.o
> diff --git a/drivers/accel/thames/thames_core.c b/drivers/accel/thames/thames_core.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..92af1d68063116bcfa28a33960cbe829029fc1bf
> --- /dev/null
> +++ b/drivers/accel/thames/thames_core.c
> @@ -0,0 +1,155 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/* Copyright 2026 Texas Instruments Incorporated - https://www.ti.com/ */
> +
> +#include "linux/remoteproc.h"
> +#include <linux/dev_printk.h>
> +#include <linux/err.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/completion.h>
> +#include <linux/jiffies.h>
> +#include <linux/rpmsg.h>
> +
> +#include "thames_core.h"
> +#include "thames_device.h"
> +#include "thames_rpmsg.h"
> +
> +/* Shift to convert bytes to megabytes (divide by 1048576) */
> +#define THAMES_BYTES_TO_MB_SHIFT 20
Seems unused/unneeded.
[...]
> +
> +static const struct rpmsg_device_id thames_rpmsg_id_table[] = { { .name = THAMES_SERVICE_NAME },
> + {} };
> +
Some odd formatting here.
> +static struct rpmsg_driver thames_rpmsg_driver = {
> + .drv = {
> + .name = "thames",
> + .owner = THIS_MODULE,
Above line shoulnd't be needed.
Andrew
next prev parent reply other threads:[~2026-01-14 18:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 8:46 [PATCH v2 0/5] New DRM accel driver for Texas Instruments' C7x DSPs Tomeu Vizoso
2026-01-14 8:46 ` [PATCH v2 1/5] arm64: dts: ti: k3-j722s-ti-ipc-firmware: Add memory pool for DSP i/o buffers Tomeu Vizoso
2026-01-14 17:53 ` Andrew Davis
2026-01-14 8:46 ` [PATCH v2 2/5] accel/thames: Add driver for the C7x DSPs in TI SoCs Tomeu Vizoso
2026-01-14 17:02 ` Markus Elfring
2026-01-14 18:01 ` Andrew Davis [this message]
2026-01-14 18:54 ` Randy Dunlap
2026-01-14 8:46 ` [PATCH v2 4/5] accel/thames: Add IOCTL for job submission Tomeu Vizoso
2026-01-14 17:51 ` Markus Elfring
2026-01-14 19:06 ` Randy Dunlap
2026-01-19 13:26 ` Tvrtko Ursulin
2026-01-14 8:46 ` [PATCH v2 5/5] accel/thames: Add IOCTL for memory synchronization Tomeu Vizoso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7628b04f-df46-47cc-a33d-c40650b256e7@ti.com \
--to=afd@ti.com \
--cc=a-aldea@ti.com \
--cc=airlied@gmail.com \
--cc=c-shilwant@ti.com \
--cc=christian.koenig@amd.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=j-humphreys@ti.com \
--cc=kristo@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nm@ti.com \
--cc=ogabbay@kernel.org \
--cc=robertcnelson@gmail.com \
--cc=robh@kernel.org \
--cc=rs@ti.com \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=tomeu@tomeuvizoso.net \
--cc=tzimmermann@suse.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox