Skip to content

arm64: dts: exynos: google: gs201: CPU frequency scaling and thermal zones (Pixel 7 Pro) - #169

Merged
derekross merged 4 commits into
omamobilefrom
omamobile-cpufreq
Nov 1, 2026
Merged

derekross merged 4 commits into
omamobilefrom
omamobile-cpufreq

Conversation

@derekross

Copy link
Copy Markdown
Owner

Base: omamobile. The four commits need nothing from the curated 7 Pro stack (#140-#147). omamobile already has the gs201 ACPM nodes, clk-acpm's gs201 variant and gs101_acpm_tmu. The changes are identical, line for line, to the ones the Pixel 7 Pro booted on the test kernel.

What

CPU frequency scaling and thermal zones for gs201 (Tensor G2, Pixel 7 Pro):

  1. dt-bindings: firmware: google,gs101-acpm-ipc: Add the Tensor G2 TMU adds google,gs201-acpm-tmu.
  2. thermal: samsung: gs101_acpm_tmu: Add the Tensor G2 adds match data for the gs201 compatible only (ACPM channel 9, 7 sensors, with AUR after gs101's six). gs101 and zumapro keep theirs.
  3. arm64: dts: exynos: google: gs201: add the ACPM TMU and thermal zones adds the sensor under acpm_ipc and zones for big, mid, little, GPU, ISP and TPU, each critical at 110 °C.
  4. arm64: dts: exynos: google: gs201: add CPU DVFS and CPU cooling adds:
    • the CPUs' ACPM DVFS clocks (cpucl0-2) through cpufreq-dt;
    • three shared OPP tables;
    • stock's dynamic power coefficients (89/513/757) and #cooling-cells;
    • the CPU zones' passive trips and cooling maps.

Why

Until now the 7 Pro had no cpufreq. Every core stayed at the bootloader's level: about 1.2 GHz little, 0.9-1.2 GHz mid and 1.0-1.1 GHz big, against stock's 1.8/2.35/2.85 GHz. On-device Whisper speech recognition ran at about real time.

Design

It follows the Pixel 6 (gs101) tree, the 9a (#87) and the 8 Pro (#158):

  • cpufreq-dt on clk-acpm's DVFS clocks, with no opp-microvolt. ACPM sets the rail voltages from its fused ASV tables, and Google's gs201 exynos-acme does nothing beyond the ACPM request.
  • The levels are the ECT's own, cut at stock's exynos-acme max-freq (Google's gs201-cpu.dtsi). The ECT levels above are listed in comments.
  • Raven's lesson: with 85 °C trips, a UI burst took gs101's big cluster past 110 °C in 6 s. So the zones poll every 250 ms (100 ms when passive), throttle from 75 °C, and drop deep at a second trip.

Levels, ceiling and trips

Cluster Normal levels (MHz) turbo-mode opp-suspend
little (0-3) 300 574 738 930 1098 1197 1328 1401 1598 1704 1803 none 1197
mid (4-5) 400 553 696 799 910 1024 1197 1328 1491 1663 1836 1999 2130 2253 2348 1491
big (6-7) 500 851 984 1106 1277 1426 1582 1745 1826 2048 2188 2252 2401 2507 2630 2704 2802 2850 1826

The BCL caveat. Stock's battery current limiter caps mid and big at 1999 and 2252 MHz whenever the battery voltage droops (vdroop1/vdroop2/smpl_gm in Google's gs201-cloudripper-bcl.dtsi). There is no BCL driver here, so the levels above those caps are turbo-mode. They stay off unless /sys/devices/system/cpu/cpufreq/boost is set, and boost stays off for now. opp-suspend is stock's resume-freq.

Trips:

  • at 75 °C, mid and big leave turbo at once (states 3 and 6), then step_wise takes over;
  • at 85 °C, each cluster drops to stock's BATOILO caps: 930, 1197 and 1426 MHz (states 7, 8 and 12);
  • critical at 110 °C.

Stock throttles from 100 °C and is "hot" at 120 °C.

Tested on the Pixel 7 Pro

Release 7.3.0-rc6-omamobile-push1-g63c35fb0c871, these four commits on the test kernel, 2026-10-31:

  • At boot:
    • six zones at 47-50 °C idle;
    • three schedutil policies, 300-1803, 400-1999 and 500-2252 MHz, with boost 0;
    • cooling devices cpufreq-cpu0 0/10, cpufreq-cpu4 0/14 and cpufreq-cpu6 0/17;
    • no new errors, and no UFS error-handler runs.
  • Whisper:
    • 12 s of speech in 2.36 s with tiny.en (before: 3.9 s per 10 s) and 5.97 s with base.en (before: 8.8 s per 10 s);
    • throttling engaged during that job: 56 to 77-80 °C, with the ceilings down to 1598/1663/2048 MHz.
  • All eight cores busy for 180 s, on the charger:
    • peak 83 °C at 20 s, then a steady 78-80 °C;
    • the ceilings settled at about 1598-1704 MHz little, 1024-1328 mid and 1277-1426 big;
    • back to 56 °C within 20 s afterwards;
    • no TMU or ACPM errors.
  • One s2idle cycle woke on the RTC alarm, and all policies scaled after resume.

Not tested: load on battery, boost, and the other gs201 boards (Pixel 7, 7a and Fold). They inherit this from gs201.dtsi.

Gates

tools/kernel-pr-check --merge --build OUT omamobile HEAD:

  • merges cleanly;
  • subjects ok;
  • checkpatch --strict: no errors, only the Co-Authored-By form warning;
  • policy ok;
  • 8 device trees with W=1 and dtbs_check, no new warnings;
  • dt_binding_check ok;
  • gs101_acpm_tmu.c builds with W=1 and no warnings in the project container. The host run lacked bc.

The only failure is the missing human Signed-off-by.

Derek: before merging

Add your Signed-off-by to each commit (AI agents don't add one), then force-push:

git fetch github omamobile-cpufreq && git switch -c omamobile-cpufreq github/omamobile-cpufreq
git rebase --signoff github/omamobile
git push --force-with-lease github omamobile-cpufreq

🤖 Generated with Claude Code

derekross and others added 4 commits October 31, 2026 21:19
The Tensor G2 (gs201) reads its SoC temperatures through the same ACPM
TMU service as gs101, on channel 9, with a seventh sensor, AUR, after
the six gs101 has (Google's gs201 device tree lists BIG, MID, LITTLE,
G3D, ISP, TPU and AUR as TMU ids 0-6). Add google,gs201-acpm-tmu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Ross <derekross@gmail.com>
The Tensor G2 (gs201) reads its SoC temperatures through the same ACPM
TMU service on channel 9 as gs101 (Google's gs201 device tree gives the
acpm_tmu node acpm-ipc-channel = <9>), with the same sensor order plus a
seventh, AUR (tmuctrl_6 in Google's gs201-b0.dts). Add
google,gs201-acpm-tmu with seven sensors. gs101 and zumapro keep their
match data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Ross <derekross@gmail.com>
Add the ACPM TMU sensor under acpm_ipc and a thermal zone for each of
the six sensors that gs101 also has (big, mid and little CPU clusters,
GPU, ISP, TPU), in the order of Google's gs201 tmuctrl ids. The driver
only reads temperatures and programs no hardware thresholds.

Every zone is critical at 110 C. Stock's own trips are higher: its CPU
and GPU zones start throttling at 100 C and are "hot" at 120 C (Google's
gs201-b0.dts). The CPU zones poll every 250 ms, and every 100 ms once a
passive trip is crossed, as on gs101, where a big cluster burst outran
slower polling; the cooling maps come with CPU DVFS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Ross <derekross@gmail.com>
Run the three CPU clusters on their ACPM DVFS clocks (cpucl0-2) through
cpufreq-dt, with the CPUs as cooling devices of their thermal zones.
Until now every core stayed at the bootloader's rate: about 1.2 GHz
little, 0.9-1.2 GHz mid and 1.0-1.1 GHz big.

- The operating points are the ACPM firmware's own levels, from the ECT
  the bootloader leaves at 0x90000000, up to each cluster's max-freq in
  stock's exynos-acme domains (Google's gs201-cpu.dtsi): 300-1803 MHz
  little (11 levels), 400-2348 MHz mid (15) and 500-2850 MHz big (18).
  These are also the levels of stock's pixel-em table. The ECT's levels
  above those maximums are listed in comments and left out, as stock
  leaves them out. The firmware sets the rail voltages from its fused
  ASV tables, so there is no opp-microvolt.

- Stock's battery current limiter caps the mid and big clusters at 1999
  and 2252 MHz while the battery voltage droops (Google's
  gs201-cloudripper-bcl.dtsi). Without a BCL driver, the levels above
  those caps (2130-2348 MHz mid, 2401-2850 MHz big) are turbo-mode, so
  they stay off until boost is enabled in sysfs.

- opp-suspend is stock's resume-freq for each cluster (1197, 1491 and
  1826 MHz), the level stock's cpufreq driver holds through suspend.

- The dynamic power coefficients are stock's (89, 513 and 757).

- The CPU zones throttle from 75 C, as on gs101: at 75 C the mid and
  big clusters leave their turbo levels at once, and at 85 C each
  cluster drops to stock's battery-overcurrent caps (930, 1197 and
  1426 MHz). Every zone stays critical at 110 C. Stock throttles from
  100 C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Ross <derekross@gmail.com>
@derekross
derekross marked this pull request as ready for review November 1, 2026 01:20
@derekross
derekross merged commit c534374 into omamobile Nov 1, 2026
1 check passed
@derekross

Copy link
Copy Markdown
Owner Author

Booted on the Pixel 7 Pro (7.3.0-rc6-omamobile-push1-g63c35fb0c871, the same changes before your sign-off): 6 thermal zones and 3 CPU policies up, Whisper transcription ~2x faster, a 180 s all-core load settled at 78-80 C under throttling with no errors, and one s2idle cycle resumed cleanly. Merged. Boost (the turbo levels) stays off for now; device/cheetah/CPUFREQ-PLAN.md (omarchy-mobile #239) has the runbook and results.

derekross added a commit that referenced this pull request Nov 8, 2026
…s apart

The MAX77759 model load waits twice after setting Config2.LdMdl: for
the gauge to clear LdMdl, and for RepCap, which the load procedure
zeroes first, to become non-zero again. Both timeouts print the same
"model load did not complete: -110".

On a Pixel 7 Pro (gs201) that message appears only on the first boot
after the battery ran flat (issue #169: at 3.26 V it failed, two hours
later at 3.87 V on the same kernel it loaded). The cheetah model's
VEmpty is 0xa561, an empty voltage of 3.30 V, so on such a cell the
model's RepCap is 0 and the second wait can time out even when the
load itself completed.

Keep the message for LdMdl and give the RepCap wait its own, with the
cell voltage, so that a log tells which of the two it was.

Assisted-by: Claude Opus 5.5
Signed-off-by: Derek Ross <derekross@gmail.com>
derekross added a commit that referenced this pull request Nov 8, 2026
When the MAX77759 model load fails at probe, the driver keeps POR set
so that the next probe tries again, and until then reports from the
gauge's default model: on a Pixel 7 Pro (gs201) half the design
capacity, 0 %, and a charge_now that means nothing (issue #169). The
next probe is the next boot. The failure is seen on the first boot
after the battery ran flat, and the same kernel loads the model on a
later boot once the cell has charged.

Try again from the init work instead. A retry waits for the cell
voltage to rise 100 mV above the model's VEmpty (3.30 V on the 7 Pro),
reading VCell once a minute, since the load waits for a RepCap that an
empty cell does not have. Then it loads the model again, with 30 s
between attempts doubling to at most 5 minutes, and gives up after 8
attempts; POR stays set, so the next probe still retries.

The battery stays readable meanwhile: init_complete is set after the
first attempt as before, so voltage, current and temperature keep
coming from the gauge, which the charger's temperature guard needs.
power_supply_changed() is sent after the first attempt and after the
load that succeeds. The retries run on the freezable workqueue, so a
load never overlaps system suspend.

Only gauges with a battery model in the device tree (maxim,fg-model,
the MAX77759 on gs201 phones) take this path; the others are
unchanged, and a load that succeeds at probe behaves as before.

Assisted-by: Claude Opus 5.5
Signed-off-by: Derek Ross <derekross@gmail.com>
derekross added a commit that referenced this pull request Nov 8, 2026
The temperature guard inhibits charging when it cannot read the
battery: without a temperature it can't tell whether charging is safe.
It then looks again a guard period, 30 s, later. At boot that is the
usual case: the charger probes about a second before the MAX77759 fuel
gauge answers (it returns -EAGAIN until its battery model is loaded),
so every boot of a Pixel 7 Pro (gs201) starts with

  max77759-charger: no reading from max170xx_battery: charging inhibited
  max17042 5-0036: battery model loaded (...)                    (+0.9 s)
  max77759-charger: battery 29.4 C, 3747 mV: band 20-42 C, ...   (+31 s)

and the battery is not charged for those 30 s. On a flat battery with
the screen on, the phone draws more than the 500 mA input limit, the
battery supplies the rest, and the phone browned out at 3.14 V
(issue #169).

Keep the rule, no reading, no charging, but while there is no reading
look again every 2 s, and at once when the battery named by guard_psy
reports a change, as the gauge does when its initialization ends. The
guard period, the bands and their hysteresis are unchanged once there
is a reading, as is the inhibit for a reading out of band.

The guard work is set up before the power supply notifier now, so
that on unbind the notifier, which can queue it, is removed before the
work is cancelled.

This applies wherever temp_guard is on (the Pixel 7 Pro and the
Pixel 6 Pro use it); it changes only how soon a missing reading is
read again.

Assisted-by: Claude Opus 5.5
Signed-off-by: Derek Ross <derekross@gmail.com>
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.

1 participant