Repository navigation
arm64: apple: add initial M5 CPU frequency control - #162
Merged
Merged
Conversation
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]>
This was referenced Oct 2, 2026
Acelogic
marked this pull request as ready for review
October 2, 2026 18:40
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_freqreports command state, not a live clock measurement.