Skip to content

kboot: pass the CLPC's Low Power mode ceiling to the OS - #358

Open
m0d16l14n1 wants to merge 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:j815/clpc-low-power
Open

m0d16l14n1 wants to merge 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:j815/clpc-low-power

Conversation

@m0d16l14n1

Copy link
Copy Markdown
Contributor

The ADT has macOS's Low Power mode CPU ceiling as pmgr/clpc cpu-low-power-frequency-max, in MHz:

machine value
J704, J813, J815 (M5) 2220
J713 (M4 Air) 2088
J700 3144

Change: copy the ADT value onto the OS's enabled performance-controller node (any apple,<soc>-clpc compatible) as apple,low-power-cpu-max-khz. The node is found by that compatible pattern; there is no list of machines or chips. When the ADT or the DT has no such node, nothing changes. The boot log line is FDT: CLPC: Low Power mode CPU ceiling <n> MHz.

Kernel side: aurora-silicon/linux#1906 now takes the ceiling from this property, as RyanTheTide asked there.

Checks: builds clean (USE_CLANG=1 RELEASE=1 ... ESP_STAGE2=1, no kboot warnings) and passes clang-format 20.1.8. It hasn't run on hardware yet; a J815 run with the matching kernel follows.

Assisted-by: Claude Opus 5.5

The ADT has macOS's Low Power mode CPU ceiling as pmgr/clpc
cpu-low-power-frequency-max, in MHz: 2220 on the J704, J813 and J815
(M5), 2088 on the J713 (M4 Air), 3144 on the J700. Copy it onto the
OS's performance-controller node ("apple,<soc>-clpc") as
apple,low-power-cpu-max-khz, so that the kernel's CLPC driver offers
the low-power platform profile with the machine's own ceiling.

Machines whose ADT or DT has no such node are left as they are.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, this is the shape we want: the value comes from the ADT and the node is found by its compatible pattern, with no machine list. We'll run it on a J700 (A18 Pro, expect 3144 MHz) and a J616s (M4 Pro) and post the boot log line and the property from /proc/device-tree here.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

J815 boot with this branch (ce52818, on top of our deployed Stage 2) and aurora-silicon/linux#1906 at 39d354eb: aura read the ceiling from the ADT and passed it on.

FDT: CLPC: Low Power mode CPU ceiling 2220 MHz

The boot didn't get to the platform_profile frequency check (low-power with one busy core). That row still needs to be run.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (M4 Pro) row with this PR stacked on current main (aura-try Stage 2 trial): FDT: CLPC: Low Power mode CPU ceiling 2808 MHz, and apple,low-power-cpu-max-khz = <2808000> on performance-controller@1. Same boot: Enforcing, 0 kernel errors, s2idle 3/3, 0 DART faults. On an M2 the tree has no such value and nothing changes. A J700 row follows.

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