Skip to content

arm64: apple: add initial M5 CPU frequency control - #162

Merged
Acelogic merged 4 commits into
codex/m5-smpfrom
codex/m5-cpufreq
Oct 2, 2026
Merged

Acelogic merged 4 commits into
codex/m5-smpfrom
codex/m5-cpufreq

Conversation

@Acelogic

@Acelogic Acelogic commented Oct 2, 2026

Copy link
Copy Markdown
Member

Add initial M5/J813 CPU frequency control with shared cluster OPP tables and verified command completion. Expose 300–972 MHz on E cores and 300–3516 MHz on P cores, capped at the measured firmware handoff states. Preserve firmware voltage, PLL and CLPC/PMP configuration, and enable the userspace governor for bring-up.

Also fix T8142 register loss on WFIT in kernel delay loops: frequency transition polling otherwise returns with a cleared pointer and faults.

Stacked on #160, following merged #159. Tested with m1n1 SMP #12 and frequency initialization #13.

Validation on J813: ARM64 Image/DTB build and targeted schemas passed; both policies completed two full state sweeps. Three pairs of pinned, checksum-verified workloads measured approximately 3.24× E and 11.73× P speed changes between minimum and maximum states. All ten CPUs then passed timer-progress and pinned SHA-256 checks. Dependent-loop measurements independently confirmed every exposed state's frequency.

Higher states, automatic governors, sustained thermal behavior and suspend remain unqualified. scaling_cur_freq reports command state, not a live clock measurement.

Add the M5 compatible for its five-bit P-state command interface. The
controller retains firmware voltage and CLPC/PMP configuration.

Signed-off-by: Acelogic <[email protected]>
T8142 can clear registers when returning from WFIT, just as it can with
WFI in the idle task. The second Linux cluster-frequency transition on
J813 reached __const_udelay while polling the command register, then
returned with a cleared callee-saved pointer and faulted in cpufreq.

Use the existing counter delay loop on both T8142 core types. The idle
task's register/FP flush path cannot be used by arbitrary kernel delays
which may have live SIMD state.

With this change, repeated E/P state sweeps and pinned integer workloads
complete on J813, followed by timer progress and SHA-256 jobs on all ten
CPUs. Other CPU models retain their existing delay paths.

Signed-off-by: Acelogic <[email protected]>
Use five-bit P-state requests with the existing busy timeout, expected
state and completion checks. Preserve firmware voltage, PLL and CLPC/PMP
configuration; stop requests after an unexpected state or timeout.

Separate T8140's SMC thermal-policy requirement from command verification
so T8142 can use verified transitions with its bounded initial OPP table.
T8140 retains its thermal requirement and behavior.

Signed-off-by: Acelogic <[email protected]>
Describe both shared cluster policies and enable the userspace governor
in the J813 configuration. Expose only the states up to the observed
firmware handoff: E state 2 at 972 MHz and P state 10 at 3516 MHz.

State 1 is a 300 MHz floor before the firmware SRAM table entries.
Dependent decrement-loop timing on J813 confirmed every exposed state's
frequency. Document repeatable state sweeps and qualification limits.

Signed-off-by: Acelogic <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Acelogic
Acelogic merged commit 0abc47f into aurora-wip Oct 2, 2026
@Acelogic
Acelogic deleted the codex/m5-cpufreq branch October 2, 2026 21:03
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