From: Jiaxing Hu <gahing@gahingwoo.com>
To: tomeu@tomeuvizoso.net, heiko@sntech.de, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, joro@8bytes.org,
will@kernel.org, robin.murphy@arm.com, p.zabel@pengutronix.de,
ogabbay@kernel.org, zhangqing@rock-chips.com
Cc: ddrake@baylibre.com, royalnet026@gmail.com,
sidong.yang@furiosa.ai, ulf.hansson@oss.qualcomm.com,
abel.vesa@oss.qualcomm.com, sebastian.reichel@collabora.com,
chaoyi.chen@rock-chips.com, shawn.lin@rock-chips.com,
finley.xiao@rock-chips.com, diederik@cknow-tech.com,
alchark@flipper.net, leonard@lausen.nl, vlwwwwww@gmail.com,
jeff.hugo@oss.qualcomm.com, dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org, iommu@lists.linux.dev,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v18 0/8] accel/rocket: RK3576 NPU (RKNN) enablement
Date: Tue, 24 Nov 2026 13:01:35 +1300 [thread overview]
Message-ID: <cover.1795478392.git.gahing@gahingwoo.com> (raw)
This series adds RK3576 NPU (RKNN) support to the mainline rocket
driver.
Changes in v18
- Rebased onto next-20261120. Patches 1-4 of v17 are in v7.4-rc4 and
are dropped. The pmdomain series has been applied by Ulf (1/3 to
fixes, 2/3 and 3/3 to next).
- 4/8 (was 8/12), following Daniel's review: the clocks are taken with
devm_clk_bulk_get_all() and the resets as a reset array, so their
number is no longer given per SoC and enum rocket_clk is gone. On the
RK3588 this changes the reset deassert order: srst_a is now released
before srst_h.
- 5/8 (was 10/12): GET_PARAM now comes before the RK3576 support. The
hardware version is taken from the match data when the first core
probes and stored in rocket_device, so READ_ONCE is not needed and
core 0 is not assumed to exist. The driver keeps its own enum rather
than PC_VERSION, which reads 0 on the RK3568. The UAPI documentation
no longer ties the version to a compatible.
- 6/8 (was 9/12): the RK3576 TASK_CON uses a register definition
generated from Mesa's registers.xml, selected by the hardware
version. The cores are counted in rocket_drv.c. The "# Conflicts:"
lines left in v17 are gone.
- 7/8 and 8/8: test notes removed from the commit messages; 8/8 states
its dependency on b1bff9ced657 in Ulf's tree.
- All commit messages shortened.
Review tags
Kept: Reviewed-by from Igor and Heiko and Tested-by from Sidong on 1/8,
Reviewed-by from Krzysztof on 2/8, Acked-by from Conor on 3/8. Dropped
Sidong's Tested-by on v17 8-10, which were rewritten.
Sidong, could you test this again on the RK3588? The reset and recovery
path after a job timeout matters most, since the deassert order has
changed.
Testing
Radxa ROCK 4D (RK3576), v7.4-rc4 with this series, in an image built
with Armbian:
- Both NPU cores probe.
- GET_PARAM returns the RK3576 hardware version (2); invalid requests
return -EINVAL.
- 30 inference runs in a row give identical output, with no job
timeout, IOMMU error or SError.
- Booted 3 times with the NPU not enabled: NPUTOP, NPU0 and NPU1 are
switched off, and so is the NPU rail.
Known issue
A core reset after a job timeout can leave bank 0 of the IOMMU paging,
and the NPU then does not recover. The fix has been sent separately:
https://lore.kernel.org/all/20261123235154.315460-1-gahing@gahingwoo.com/
With repeated forced timeouts on the ROCK 4D, about one in every 2 to
10 is not recovered from without the fix; with it, 20 in a row all
recovered.
Notes
- 594 MHz (Daniel's question): mainline does not scale the NPU
frequency or voltage yet. The NPU boots at 786 MHz and 750 mV, which
is not in the vendor's OPP table. That table runs up to 600 MHz at
725 mV, so 594 MHz is within it.
- npu-supply: the binding requires it and the RK3588 device trees set
it, but the driver does not use it. The NPU rail is switched by the
power domain through domain-supply.
- The register definitions are generated from Mesa's registers.xml;
the XML change will go with Mesa MR !43804.
LLM-assisted.
Jiaxing Hu (8):
accel/rocket: factor the completion tail out of the IRQ handler
dt-bindings: npu: rockchip: add rockchip,rk3576-rknn-core
dt-bindings: iommu: rockchip: describe the RK3576 NPU MMU
accel/rocket: take the core clocks and resets from the devicetree
accel/rocket: add a GET_PARAM ioctl for the hardware version
accel/rocket: add RK3576 NPU (RKNN) support
arm64: dts: rockchip: add NPU (RKNN) nodes to rk3576
arm64: dts: rockchip: enable the NPU on rk3576-rock-4d
.../bindings/iommu/rockchip,iommu.yaml | 26 +++++++
.../npu/rockchip,rk3588-rknn-core.yaml | 40 ++++++++++-
.../boot/dts/rockchip/rk3576-rock-4d.dts | 22 ++++++
arch/arm64/boot/dts/rockchip/rk3576.dtsi | 70 ++++++++++++++++++-
drivers/accel/rocket/rocket_core.c | 25 +++----
drivers/accel/rocket/rocket_core.h | 13 +---
drivers/accel/rocket/rocket_device.c | 11 +--
drivers/accel/rocket/rocket_device.h | 6 +-
drivers/accel/rocket/rocket_drv.c | 52 ++++++++++++--
drivers/accel/rocket/rocket_job.c | 45 ++++++++----
drivers/accel/rocket/rocket_registers.h | 32 +++++++++
include/uapi/drm/rocket_accel.h | 43 ++++++++++++
12 files changed, 329 insertions(+), 56 deletions(-)
base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
--
2.43.0
next reply other threads:[~2026-11-24 0:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 0:01 Jiaxing Hu [this message]
2026-11-24 0:01 ` [PATCH v18 1/8] accel/rocket: factor the completion tail out of the IRQ handler Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 2/8] dt-bindings: npu: rockchip: add rockchip,rk3576-rknn-core Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 3/8] dt-bindings: iommu: rockchip: describe the RK3576 NPU MMU Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 4/8] accel/rocket: take the core clocks and resets from the devicetree Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 5/8] accel/rocket: add a GET_PARAM ioctl for the hardware version Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 6/8] accel/rocket: add RK3576 NPU (RKNN) support Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 7/8] arm64: dts: rockchip: add NPU (RKNN) nodes to rk3576 Jiaxing Hu
2026-11-24 0:01 ` [PATCH v18 8/8] arm64: dts: rockchip: enable the NPU on rk3576-rock-4d Jiaxing Hu
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=cover.1795478392.git.gahing@gahingwoo.com \
--to=gahing@gahingwoo.com \
--cc=abel.vesa@oss.qualcomm.com \
--cc=alchark@flipper.net \
--cc=chaoyi.chen@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=ddrake@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=diederik@cknow-tech.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=finley.xiao@rock-chips.com \
--cc=heiko@sntech.de \
--cc=iommu@lists.linux.dev \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=joro@8bytes.org \
--cc=krzk+dt@kernel.org \
--cc=leonard@lausen.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=ogabbay@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=royalnet026@gmail.com \
--cc=sebastian.reichel@collabora.com \
--cc=shawn.lin@rock-chips.com \
--cc=sidong.yang@furiosa.ai \
--cc=tomeu@tomeuvizoso.net \
--cc=ulf.hansson@oss.qualcomm.com \
--cc=vlwwwwww@gmail.com \
--cc=will@kernel.org \
--cc=zhangqing@rock-chips.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
all inboxes | Powered by JetHome®