[PATCH v2] arm64: dts: rockchip: Enable the NPU on LubanCat 4
Pufan Jin <[email protected]> Thu, 6 Aug 2026 00:57:06 +0800
| Newsgroups | org.infradead.lists.linux-rockchip,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The three RKNN cores and their IOMMUs are disabled by default in the SoC dtsi, so the board has to describe the NPU supply before they can be enabled. This board feeds both the NPU logic and its SRAM from a single RK8602 output on i2c1. The vendor DTS makes that explicit by giving the same regulator node two labels, vdd_npu_s0 and vdd_npu_mem_s0, and then handing one to rknpu-supply and the other to mem-supply. There is no separate memory rail to describe, so npu-supply and sram-supply both point at vdd_npu_s0. The binding requires both properties. Neither property is what actually enables the rail: the rocket driver never requests a regulator, it only takes clocks, resets, register ranges and a power domain. The rk3588 power domain driver marks RK3588_PD_NPU as needing a regulator, so the rail has to be described on pd_npu, the root of VD_NPU that the three per-core domains hang off. This matches what rock-5b does. Since pd_npu now controls the rail, drop regulator-always-on from vdd_npu_s0 so the domain can power it down while the NPU is idle. Nothing else is supplied from this rail, and rock-5b describes the same regulator without the property. Mainline has no NPU OPP table, so all three cores stay at the 200 MHz the SoC dtsi assigns to the shared SCMI clock. Clocking them higher needs an OPP table to move vdd_npu_s0 along with the frequency, which is left for later work. Tested on rev 20241026 hardware: all three cores probe, each reporting NPU core version 1179210309 and landing in its own IOMMU group, the rocket driver registers /dev/accel/accel0, and dmesg is free of NPU errors. With the rail no longer pinned on, regulator_summary shows vdd_npu_s0 at a use count of zero while the NPU is idle, so pd_npu is free to drop it. Signed-off-by: Pufan Jin <[email protected]> --- Changes in v2: - Drop regulator-always-on from vdd_npu_s0, so pd_npu can actually power the rail down. Thanks to Jimmy Hon for spotting it. This mirrors commit de5b39d16318 ("arm64: dts: rockchip: Remove workaround that prevented Turing RK1 GPU power regulator control"), which did the same for vdd_gpu_s0 once the domain-supply was in place. - Mention the change in the commit message and retest with it. - v1: https://lore.kernel.org/linux-rockchip/[email protected]/ .../boot/dts/rockchip/rk3588s-lubancat-4.dts | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts b/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts index a0fc128ce6e1..e5c2e77d86c2 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-lubancat-4.dts @@ -276,7 +276,6 @@ vdd_npu_s0: regulator@42 { reg = <0x42>; fcs,suspend-voltage-selector = <1>; regulator-name = "vdd_npu_s0"; - regulator-always-on; regulator-boot-on; regulator-min-microvolt = <550000>; regulator-max-microvolt = <950000>; @@ -365,6 +364,10 @@ &pd_gpu { domain-supply = <&vdd_gpu_s0>; }; +&pd_npu { + domain-supply = <&vdd_npu_s0>; +}; + &pinctrl { hym8563 { hym8563_int: hym8563-int { @@ -407,6 +410,36 @@ &pwm0 { status = "okay"; }; +&rknn_core_0 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_core_1 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_core_2 { + npu-supply = <&vdd_npu_s0>; + sram-supply = <&vdd_npu_s0>; + status = "okay"; +}; + +&rknn_mmu_0 { + status = "okay"; +}; + +&rknn_mmu_1 { + status = "okay"; +}; + +&rknn_mmu_2 { + status = "okay"; +}; + &saradc { vref-supply = <&avcc_1v8_s0>; status = "okay"; -- 2.55.0 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip