This series adds RK3576 NPU (RKNN) support to the mainline DRM rocket driver.
Based on: next-20261113 The pmdomain part of v16 9/16 is now a separate series on Ulf's next (v16 10/16 is dropped). 12/12 needs its 2/3 to make the NPU domain take its supply: https://lore.kernel.org/all/[email protected]/ Changes in v17: - Dropped v16 7/16, 10/16 and 14/16 (the power-domain reset and the extra domain clocks), following Finley Xiao's (Rockchip) review. - Following Heiko, the clock indices are now ROCKET_CLK_* constants (1/12 and 9/12). - The pmdomain changes are now a separate series, linked above. Testing: Tested on a Radxa ROCK 4D running Armbian edge 7.3, with the v17 changes backported (this series and the pmdomain series): - charsiu (https://github.com/gahingwoo/charsiu), an open source LLM runtime that drives the NPU through the rocket UAPI (/dev/accel) without Mesa or the vendor runtime, ran Qwen3-0.6B (Q4_0) 30 times after a warm reboot and 30 times after a cold power-on. Each run starts with the NPU power domain off. All 60 outputs are identical, with no job timeout, IOMMU error or SError. - Job timeouts forced with a 1 ms timeout, three times in one boot: after each, the next run gives the same output as before, with no error. The v15/v16 comparison of the reset order is in 4/12. Logs: https://github.com/gahingwoo/linux-rk3576-npu/tree/main/board-logs Known issue: in v16 I saw the IOMMU not recover after repeated resets with a 2 ms job timeout ("MMU_DTE_ADDR is not functioning"). With v17, after three rounds of forced timeouts in one boot, it recovered each time; I have not looked into what changed. Tool use: An LLM helped me read code and technical material and write part of the implementation. Some of the code in the series was first drafted by an LLM, and the commit messages and cover letters of earlier versions were mostly written by an LLM. I reviewed the generated code and tested the changes on real hardware. I also used an LLM to write test scripts and to compare register write traces. For v17 I wrote the cover letter, commit messages and code comments myself in Chinese first and translated them into English with an LLM. Tag changes: - 1/12 changed in v17. Heiko, does your Reviewed-by still apply? If the change goes beyond what you reviewed, please take another look. - 7/12 keeps Conor's Acked-by. The clock count changed from five to four in v16; Conor, please confirm it still applies. - Tomeu, the GET_PARAM enum in 10/12 is unchanged (RK3588 = 1, RK3576 = 2). Is that fine? Igor Paunovic (1): accel/rocket: request the core clocks by name Jiaxing Hu (11): accel/rocket: take the completion register writes under job_lock accel/rocket: wait for a running IRQ handler before resetting a core accel/rocket: let the core suspend after a reset 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: select the per-core clock and reset counts from match data accel/rocket: add RK3576 NPU (RKNN) support accel/rocket: add a GET_PARAM ioctl for the hardware version 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 | 14 +++- drivers/accel/rocket/rocket_core.h | 20 ++++- drivers/accel/rocket/rocket_device.c | 3 +- drivers/accel/rocket/rocket_drv.c | 61 ++++++++++++-- drivers/accel/rocket/rocket_drv.h | 2 + drivers/accel/rocket/rocket_job.c | 84 ++++++++++++++----- include/uapi/drm/rocket_accel.h | 40 +++++++++ 11 files changed, 345 insertions(+), 37 deletions(-) base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48 -- 2.43.0
