aboutsummaryrefslogtreecommitdiff
path: root/0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch
diff options
context:
space:
mode:
authorNick Moore <nicholasvmoore@gmail.com>2026-11-17 08:13:59 -0600
committerNick Moore <nicholasvmoore@gmail.com>2026-11-17 08:14:12 -0600
commit8a4e71cb0f3dda9c3c9f981f825302ce69616719 (patch)
treee1dd11ef23cea3cbd1d50a933c1dd11054407580 /0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch
RK3328 VPU clock fix: DTS patch, CRU tool, boot-pin units, watchdog, write-ups
Out-of-box RK3328 BSP kernels boot the video decoder clocks at 100 MHz and the mpp driver's auto-frequency path never fires, capping 4K HEVC decode at 33.8 fps (57% of datasheet spec). Consumer-node clock assignment at 400 MHz restores the driver's own declared advanced rate: 70.2 fps decode, 40.8 fps dec->RGA. Includes a no-rebuild boot-pin alternative (OpenRC + systemd) and a repin watchdog.
Diffstat (limited to '0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch')
-rw-r--r--0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch b/0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch
new file mode 100644
index 0000000..f05915b
--- /dev/null
+++ b/0001-arm64-dts-rockchip-rk3328-pin-VPU-decode-and-RGA-clock-rates.patch
@@ -0,0 +1,64 @@
+From: Nick Moore <nicholasvmoore@gmail.com>
+Subject: [PATCH] arm64: dts: rockchip: pin RK3328 rkvdec/RGA clocks at the
+ mpp advanced rate
+
+The rk3328.dtsi CRU assigned-clock-rates boot the video decoder
+interfaces at 100 MHz (ACLK_RKVDEC_PRE, SCLK_VDEC_CABAC,
+SCLK_VDEC_CORE) and the RGA at 100 MHz. On the Rockchip 6.12 BSP (rkr)
+mpp stack the rkvdec auto-frequency path never fires on RK3328:
+/proc/mpp_service/rkvdec/{aclk,clk_core,clk_cabac,clk_hevc_cabac}
+report real_rate_hz of 0, idle and under full load, so the driver's
+rockchip,normal-rates (300 MHz) and rockchip,advanced-rates (400 MHz)
+are never applied and decode runs at the 100 MHz boot pin — 33.8 fps
+4K HEVC vs 70.2 fps with the clocks at 400 MHz (117% of the 60 fps
+datasheet spec, RK3328 datasheet v1.4).
+
+Fix by assigning the clocks on the consumer nodes at the advanced
+rate. Consumer-node assignments execute at device probe, after the CRU
+has raised CPLL to 1.2 GHz, so the rate resolves exactly (1200/3) and
+CCF selects the CPLL parent. The venc (H.264 encoder) side is left
+alone: the venc driver self-manages its clocks (runtime-resume ->
+300 MHz default, idle -> 50 MHz reduce rate) via working CCF writes.
+
+Measured on Rock Pi E (RK3328, kernel 6.12.81-rkr12, 2160p50 HEVC
+11.6 Mbps test stream):
+
+ clocks decode 4K HEVC dec->RGA->null
+ boot pins (100/50 MHz) 33.79 fps 31.55 fps
+ decoder + RGA @ 400 MHz 70.21 fps 40.84 fps
+
+RGA note: the clk_rga mux can rest on GPLL (reset default), leaving it
+at 491.52/3 = 163.84 MHz even after a divider change. Assigning
+SCLK_RGA at boot forces the CPLL parent; measured dec->RGA->null went
+31.4 -> 40.8 fps.
+
+Signed-off-by: Nick Moore <nicholasvmoore@gmail.com>
+---
+ arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+index a1a1a1a..b2b2b2b 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+@@ -1066,6 +1066,9 @@
+ operating-points-v2 = <&rkvdec_opp_table>;
+ #cooling-cells = <2>;
+ devfreq = <&dmc>;
++ assigned-clocks = <&cru ACLK_RKVDEC_PRE>, <&cru SCLK_VDEC_CORE>,
++ <&cru SCLK_VDEC_CABAC>;
++ assigned-clock-rates = <400000000>, <400000000>,
++ <400000000>;
+ status = "disabled";
+
+ vcodec_power_model: vcodec_power_model {
+@@ -1216,4 +1216,6 @@
+ clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA>;
+ clock-names = "aclk_rga", "hclk_rga", "clk_rga";
++ assigned-clocks = <&cru ACLK_RGA_PRE>, <&cru SCLK_RGA>;
++ assigned-clock-rates = <400000000>, <400000000>;
+ status = "disabled";
+ };
+--
+2.47.1
+