Skip to content

clk: samsung: acpm: Add Tensor G4 (zumapro) with a paired GPU clock - #84

Merged
derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-acpm-clk
Oct 27, 2026
Merged

derekross merged 2 commits into
derekross:omamobilefrom
W4HO-ham:tegu-acpm-clk

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

The ACPM protocol driver already creates zumapro-acpm-clk for the Tensor G4 (#24), but clk-acpm had no match for it. This adds the zumapro variant, built the way your gs201 one is:

  • 17 DVFS domains as clocks, in the G4 firmware's order: MIF, INT, CPUCL0-2, DSU, BCI, G3D, G3DL2, TPU, INTCAM, TNR, CAM, MFC, DISP, AOC, BW. That's Google's cal-if zuma order. DSU, BCI, AOC and BW are new against gs101, so G3D is 7 and G3DL2 is 8.
  • A paired gpu clock (index 17) that moves G3D and G3DL2 together through the Pixel 9a's GPU DVFS table: its stock gpu_dvfs_table_v2, from our capture of the 9a's own device tree. The top level, 940 MHz, matches gpu_dvfs_max_freq in Google's zumapro-gpu.dtsi.
  • zumapro_gpu_max_khz, read-only by default, the same as gs201_gpu_max_khz.

Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, with this file as clk-acpm.ko):

  • it binds zumapro-acpm-clk in place of our out-of-tree tegu-acpm-clk, which it replaces;
  • cpufreq-dt runs the three clusters on cpucl0-2 (1.95, 2.37 and 2.69 GHz max);
  • with zumapro_gpu_max_khz=890000, panthor's devfreq moves the GPU between 150 and 890 MHz under load (trans_stat), and clk_summary reads g3d and g3dl2 back from the firmware.

The DT side, the GPU OPP table and the CPU OPPs, comes in its own board change. checkpatch --strict is clean, and clk-acpm.o builds with W=1.

@derekross

Copy link
Copy Markdown
Owner

Thanks for this. It's a clean fit for the gs201 driver: data and an id-table entry only, and the paired-clock logic is reused as it is. I checked the parts that matter:

  • Domain ids. Your 17 domains are Google's enum acpm_dvfs_id in drivers/soc/google/cal-if/zuma/acpm_dvfs_zuma.h (soc/gs at 204078758737), in order, with G3D 7 and G3DL2 8. Keeping aoc at 15 is right, by the way. The same file's acpm_vclk_list[] leaves AOC out, but the firmware ids come from the enum, so BW is 16.
  • GPU pairs. All 14 rows match gpu_dvfs_table_v2 in Google's kernel/devices/google/zuma dts/zuma-gpu.dtsi (commit 42395e8adcb8, line 81): gpu1 is G3D and gpu0 is G3DL2, and G3DL2 is at or above G3D on every row, which the set-rate ordering needs. kernel/devices/google/zumapro dts/zumapro-gpu.dtsi (commit 8831630eee2a) includes that file and only raises gpu_dvfs_max_freq to 940000, as your comment says. So the table is public, not only in our capture.
  • gs101 and gs201. I built clk-acpm.o at the base and with your patch: the code is identical, and the gs101 and gs201 tables and gs201_gpu_max_khz are unchanged. Nothing moves for the Pixel 6 and 7 phones.

The gate and CI pass on today's base.

One change before I merge. gs101 and gs201 each have a header for these ids (include/dt-bindings/clock/google,gs101-acpm.h, and google,gs201-acpm.h with GS201_CLK_ACPM_GPU 14), and their device trees use the names. Index 17 is now part of the interface between this driver and the device tree, and #85 and #87 already hard-code <&acpm_ipc 17> and <&acpm_ipc 2>-4. Could you add a commit before this one, dt-bindings: firmware: google,gs101-acpm-ipc: Add the Tensor G4 clock ids or similar (gs201's came in c6b7953a58a1), with google,zumapro-acpm.h holding ZUMAPRO_CLK_ACPM_DVFS_MIF … _BW as 0-16 and ZUMAPRO_CLK_ACPM_GPU as 17? Then the board PRs can use the names.

Two smaller things while you're there:

  • Please add Link: trailers for the three sources above (the enum, the v2 table and the 940 MHz max), and the blob id of the clk-acpm.c you built as clk-acpm.ko next to the release string.
  • Your test capped the GPU at 890 MHz, so the 940/950 point hasn't been sent yet. That's fine with the cap read-only by default. Just say so in the board PR that sets the cap, and the tegu device package will need an options clk_acpm zumapro_gpu_max_khz=… line like cheetah's.

On order: this one doesn't depend on the clock stack and can land before or after it, but it has to land before #85 and #87, since their GPU and CPU frequency nodes need this provider.

… ids

The Tensor G4 (zumapro) ACPM firmware has 17 DVFS domains, numbered as
Google's enum acpm_dvfs_id: MIF, INT, CPUCL0-2, DSU, BCI, G3D, G3DL2,
TPU, INTCAM, TNR, CAM, MFC, DISP, AOC and BW. Add their clock ids, and
the paired GPU clock after them (17), as gs201's header does, so device
trees can name them.

Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/204078758737776959ecc85c527a00fd2cabb62f/drivers/soc/google/cal-if/zuma/acpm_dvfs_zuma.h
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The ACPM protocol driver already creates a "zumapro-acpm-clk" child for
the Tensor G4, but clk-acpm had no match for it. The G4 firmware has 17
DVFS domains, with DSU, BCI, AOC and BW among them, so the indices differ
from gs101's: G3D is 7 and G3DL2 is 8.

Add the zumapro variant: the 17 domains as clocks, and a paired "gpu"
clock (index 17) that moves G3D and G3DL2 together through the Pixel
9a's GPU DVFS table, the same way the gs201 "gpu" clock does. Its rate
is capped by zumapro_gpu_max_khz, read-only by default, as gs201's is.

Tested on the Pixel 9a: clk-acpm binds zumapro-acpm-clk in place of the
out-of-tree driver it replaces, cpufreq-dt runs the three CPU clusters
on cpucl0-2, and with zumapro_gpu_max_khz=890000 panthor's devfreq
moves the GPU between 150 and 890 MHz under load. The tested
clk-acpm.c is this one (blob 82dae93). The 940 MHz point was not
sent: the cap stayed at 890 MHz.

Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/204078758737776959ecc85c527a00fd2cabb62f/drivers/soc/google/cal-if/zuma/acpm_dvfs_zuma.h
Link: https://android.googlesource.com/kernel/devices/google/zuma/+/42395e8adcb880aa336f0da6bb2a19ed53929c40/dts/zuma-gpu.dtsi
Link: https://android.googlesource.com/kernel/devices/google/zumapro/+/8831630eee2ad095b85ed452944e6353940966a5/dts/zumapro-gpu.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks for tracing the sources. Pushed, rebased onto today's omamobile:

  • A new commit before the driver adds include/dt-bindings/clock/google,zumapro-acpm.h: ZUMAPRO_CLK_ACPM_DVFS_MIF … _BW as 0-16 and ZUMAPRO_CLK_ACPM_GPU as 17, with a Link: to acpm_dvfs_zuma.h. checkpatch asks about MAINTAINERS, but the Tensor block's include/dt-bindings/clock/google,zumapro* already covers the file.
  • The driver commit has the three Link: lines (the enum, zuma-gpu.dtsi at 42395e8adcb8 for the v2 table, and zumapro-gpu.dtsi at 8831630eee2a for the 940 MHz max). It also names the tested clk-acpm.c: blob 82dae93f4f46, the same as this head's.
  • It says the 940/950 point was never sent, since the cap was 890 MHz. The board PR that sets the cap will say so too, and the tegu package gets the options clk_acpm zumapro_gpu_max_khz=… line.

#85 and #87 will use the names.

@derekross

Copy link
Copy Markdown
Owner

Thanks, that's everything. The header's ids follow Google's enum, with the GPU at 17 as the driver registers it, and the three Link: lines and the blob id are there (82dae93f4f46 is this head's clk-acpm.c). The driver change is the same as before, so nothing moves for the Pixel 6 and 7 phones. The gate and CI pass on today's omamobile. I'll rebase-merge this now. When you rebase the board stack afterwards, git will drop your copy of the header commit, since it's already in.

@derekross
derekross merged commit f171fb4 into derekross:omamobile Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants