Skip to content

kboot: pass the CLPC's Low Power mode power target - #580

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:j815/clpc-lpm-target
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:j815/clpc-lpm-target

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What: pass the ADT's Low Power mode package power target (pmgr/clpc pkg-lpm-power-target) to the CLPC node as apple,low-power-mw, next to the CPU ceiling the loader already passes. It does so only where the board DT names the SMC reading the OS holds at it (apple,power-key-id), so the kernel's low-power limit gets its target from the machine and no other board changes.
Tested: J815, aura 1cf188d5 (main f417b84 + #363 + this change): the loader logs FDT: CLPC: Low Power mode power target 5000 mW, the CLPC node carries apple,low-power-mw = 5000, and with aurora-silicon/linux#3646 Power Saver holds the reading at it (4.95 W all-core, 4.54 W GPU, 4.91 W mixed). Build clean at the head.
Risk: two-way door. J813/J815 only (the only DT with apple,power-key-id, from the linux PR below). Every other CLPC node is left as it is.
Not yet: J813 (its ADT target is read the same way).

Details
  • The ADT value is watts in 8.24 fixed point; 255.0 (0xff000000) means none and is skipped. The loader writes milliwatts ((v * 1000) >> 24).
  • Without apple,power-key-id on the node nothing is written: boards whose DT already wires apple,smc to the CLPC (T6050, T604x, T602x, T8112, T8140, T8152) keep their present behaviour, including T6050's own 15 W target in the driver.
  • Kernel side (binding, driver, DT): soc: apple: clpc / drm/asahi: g17: hold the low-power target with the CPUs and the GPU (J813/J815) linux#3646. Without this change that PR changes only debugfs.
Evidence

J815 boot:

FDT: CLPC: Low Power mode CPU ceiling 2220 MHz
FDT: CLPC: Low Power mode power target 5000 mW
build/aura.bin: verified aurora logos at 48, 128, and 256 px
  BOOT  build/aura-boot.macho: 4046848 bytes, entry at file offset 0x10800, no __TEXT_BOOT_EXEC
build rc 0   (no kboot.c warnings)

Where the CLPC node names the SMC power reading the OS holds in its
low-power profile (apple,power-key-id), pass the ADT's Low Power mode
package power target (pmgr/clpc pkg-lpm-power-target, watts in 8.24 fixed
point, 255.0 meaning none) as apple,low-power-mw, in milliwatts, next to
the CPU ceiling. Nodes without the key keep their own target, so no other
machine changes.

Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@sithglan @gig3m: the kernel side (aurora-silicon/linux#3646) is ready for testing too; the test steps are there. A J813 boot log line FDT: CLPC: Low Power mode power target ... mW would already help. Thank you!

@github-actions github-actions Bot added door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at 15ecd34b: not ready yet

Check Detail
CI at head ok 27 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 15ecd34b
Conflicts ok none
PR text ok Risk: two-way · . J813/J815 only (the only DT with apple,power-key-id, from the linux PR below). Every other CLPC node is left as it is.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@RyanTheTide @DjDeveloperr check please

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 15ecd34b

Blockers:

  • Exact-head hardware row at 15ecd34b: Code and all 27 CI checks at head 15ecd34b are clean, but the current J815 hardware row was recorded on combined tree 1cf188d5 (main + #363 + this change) rather than exact head 15ecd34b. Please post an exact-head 15ecd34b boot row on J815 or J813 (confirming clean boot and FDT: CLPC: Low Power mode power target ... mW when booted with an apple,power-key-id DTB, or unchanged boot without it); ready to approve immediately once recorded.

Checked:

  • src/kboot.c (dt_set_clpc_low_power()): reads /arm-io/pmgr/clpc pkg-lpm-power-target (u32, 8.24 fixed-point watts), skips 0 and sentinel >= 255.0 (255U << 24), and converts overflow-safely via (u32)(((u64)target * 1000) >> 24) (5.0 W -> 5000 mW, max < 255,000 mW, skipping mw == 0).
  • Scoping: writes apple,low-power-mw only when mw != 0 and the CLPC node already carries apple,power-key-id, leaving all other boards (including T6050 and boards with apple,smc but no apple,power-key-id) completely unchanged.
  • Error handling: fdt_setprop_u32() failure calls bail(...), consistent with apple,low-power-frequency-max-mhz immediately above.
  • CI at 15ecd34b: all 27 checks passed (build, ESP stage 2 vital size, format-check, gcc, clang-macos, policy, selftest, pr-text, readiness, fedora, alarm, nix, and all 5 Pytest matrices).
Evidence
  • Diff reviewed: aura#580 at 15ecd34beb3268ce17502424005b8af395f397f2 (+16/-0, 1 file src/kboot.c, 1 commit, MERGEABLE on main).
  • Companion kernel PR: aurora-silicon/linux#3646.

@sithglan

Copy link
Copy Markdown
Contributor

Note from J813 (air5): this J813's enrolled Stage 1 (1.0.0b12-g693083b4-dirty) uses direct boot= rather than Stage 2 chainload, so 15ecd34b cannot be tested via aura-try Stage 2 without modifying Stage 1/1TR. I verified the paired kernel PR (aurora-silicon/linux#3646 ed8b022d) on J813 with apple,low-power-frequency-max-mhz = <2220> and apple,low-power-mw = <5000> injected into the trial DTB (full results posted on linux#3646), and confirmed aura#580 (15ecd34b) builds cleanly locally. A live Stage 1/Stage 2 loader row on J813 will still need a chainloading Stage 1 or tethered boot.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 15ecd34beb32

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - src/kboot.c (dt_set_clpc_low_power()): reads /arm-io/pmgr/clpc pkg-lpm-power-target (u32, 8.24 fixed-point watts), skips 0 and sentinel >= 255.0 (255U << 24), and converts overflow-safely via (u32)(((u64)target * 1000) >> 24) (5.0 W -> 5000 mW, max < 255,000 mW, skipping mw == 0).

  • Scoping: writes apple,low-power-mw only when mw != 0 and the CLPC node already carries apple,power-key-id, leaving all other boards (including T6050 and boards with apple,smc but no apple,power-key-id) completely unchanged.
  • Error handling: fdt_setprop_u32() failure calls bail(...), consistent with apple,low-power-frequency-max-mhz immediately above.
  • CI at 15ecd34b: all 27 checks passed (build, ESP stage 2 vital size, format-check, gcc, clang-macos, policy, selftest, pr-text, readiness, fedora, alarm, nix, and all 5 Pytest matrices).

Follow-ups (not blocking): exact-head J815/J813 boot row

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 15ecd34beb32 (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: m0d16l14n1's comment at 15ecd34. CI: aura train A1 = main 2a7854a + #590 #338 #432 #556 #580 #587 (candidate 69c9345e): gcc normal + ESP_STAGE2 build pass with no new warnings, pytest 1730 passed / 0 failed. Hosted CI at this head is queued behind the org backlog; this local run is the same build + pytest set. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 39d3957 into aurora-silicon:main Dec 1, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants