Skip to content

soc: apple: clpc: Take the Low Power mode ceiling from the DT - #1906

Open
m0d16l14n1 wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-clpc-lpm
Open

m0d16l14n1 wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-clpc-lpm

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The CLPC's Low Power mode ceiling now comes from the device tree, so any machine whose ADT has one gets the low-power platform profile. Before, it was a constant on the T8142 profile, limited to apple,j815.

  1. dt-bindings: apple,low-power-cpu-max-khz on the CLPC node.
  2. soc: apple: clpc: the driver registers the low-power platform profile wherever the node has that property, using its value as the ceiling. A node without it keeps the SoC's built-in value where there is one. That way the T6041 and T8140 profiles behave the same under an older loader.

The boot loader copies the ADT's pmgr/clpc cpu-low-power-frequency-max (MHz) into the property: aurora-silicon/aura#358. The value is 2220 MHz on J704, J813 and J815, 2088 MHz on J713 and 3144 MHz on J700.

Tested on J815 (MacBook Air 15" M5, macOS 27.2 stub), with the same 2220 MHz ceiling built into the driver at the time. One busy loop pinned to a P core:

profile P-core frequency (kHz)
balanced 4464000
low-power 2220000
balanced again 4464000

The run through the DT property and aurora-silicon/aura#358 is in the next J815 test build.

Needs CONFIG_ACPI=y, because the platform profile class is only compiled with ACPI. On this device-tree boot ACPI stays disabled at run time.

Checks: checkpatch --strict clean; dt_binding_check clean on apple,pmc.yaml; clpc.o builds.

Part of the J815 bring-up; board results are summarised in #135.

Assisted-by: Claude Opus 5.5

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr ready for review: on the J815, Low Power mode takes the P cluster 4464 → 2220 → 4464 MHz through platform_profile, the ceiling from the ADT's cpu-low-power-frequency-max. Green and mergeable.

Assisted-by: Claude Opus 5.5

@gig3m

gig3m commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The J813 has the same value. Its macOS 27.0 ADT's pmgr/clpc has cpu-low-power-frequency-max = 2220 (and pkg-low-power-target-tc = 100), so apple,j813 can share the ceiling.

Tested on my J813 (macOS 27.2 stub) with this commit, low_power_machine changed to "apple,j813", #2199, and CONFIG_ACPI=y / CONFIG_ACPI_PLATFORM_PROFILE=y. The base is #2135's merged head 408e27268fd6.

  • apple-clpc registers as /sys/class/platform-profile/platform-profile-0, choices low-power balanced performance.
  • One busy loop pinned to CPU 0 (P cluster, policy0 = CPUs 0, 7-9), profile written to the class device:
    • balanced: 4464000 kHz
    • low-power: 2220000 kHz (scaling_max_freq 2220000)
    • balanced again: 4464000 kHz
  • ACPI stays disabled at run time ("ACPI: Interpreter disabled"), so there's no /sys/firmware/acpi/platform_profile. Stock power-profiles-daemon 0.30 only reads that file. It needs the class-interface patch, which [aurora]'s power-profiles-daemon 0.30-1.1 and Omarchy's omarchy-power-profiles-daemon 0.30-9 carry.

low_power_machine holds one compatible, so covering both Airs needs a list. Dropping the scope isn't safe: t8142-j704.dts also has a CLPC node, and I haven't checked its value.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for wiring up the Low Power mode ceiling on the M5, and for quoting the ADT value it comes from.

One request on how it is selected. In this tree we pick behaviour by a hardware property, not by the list of machines it was checked on. drivers/soc/apple/clpc.c:1624-1625 puts a fixed .low_power_khz = 2220000 on the T8142 profile and limits it with .low_power_machine = "apple,j815", so the J813 and any later T8142 board miss it even though their ADT carries the same cpu-low-power-frequency-max key.

Could the ceiling come from the device tree instead? For example, the boot loader copies cpu-low-power-frequency-max into a property on the CLPC node, and the driver turns the platform profile on wherever that property is present. Then the machine string is not needed and the value always matches the machine's own ADT.

If it helps, we can run Low Power mode rows on our M1 Pro, M2, M4 Pro and A18 Pro once it is property-driven.

Let the boot loader pass the CPU frequency ceiling of macOS's Low Power
mode, which the ADT has as pmgr/clpc cpu-low-power-frequency-max, on
the performance controller node.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The ADT has macOS's Low Power mode CPU ceiling as pmgr/clpc
cpu-low-power-frequency-max: 2220 MHz on the J704, J813 and J815 (M5),
2088 MHz on the J713 (M4 Air), 3144 MHz on the J700. The boot loader
now copies it into the CLPC node as apple,low-power-cpu-max-khz.

Register the low-power platform profile wherever the node has that
property, with its value as the ceiling. A node without it keeps the
SoC's built-in value where there is one, so the T6041 and T8140
profiles stay as they are under an older loader.

With the same ceiling built into the driver for the J815, low-power
took its P cluster from 4464 to 2220 MHz and back (M5, 27.2 stub).

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1 m0d16l14n1 changed the title soc: apple: clpc: T8142: the J815's Low Power mode ceiling soc: apple: clpc: Take the Low Power mode ceiling from the DT Nov 19, 2026
@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@RyanTheTide done, new head 39d354e:

  • Boot loader: kboot: pass the CLPC's Low Power mode ceiling to the OS aura#358 copies the ADT's pmgr/clpc cpu-low-power-frequency-max onto the CLPC node as apple,low-power-cpu-max-khz. It finds the node by its apple,<soc>-clpc compatible, not by machine.
  • Driver: registers the low-power platform profile wherever that property is present, and uses it as the ceiling. The apple,j815 limit no longer applies to a node that has the property. A node without it keeps the SoC's built-in value, so the T6041/T8140 profiles don't change under an older loader.
  • Binding: added to apple,pmc.yaml; dt_binding_check is clean.

The ADT values are 2220 MHz on J704, J813 and J815, 2088 on J713 and 3144 on J700. A J815 run through the property is in the next test build. Your Low Power rows on M1 Pro, M2, M4 Pro and A18 Pro would be very welcome.

Assisted-by: Claude Opus 5.5

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

J815 boot on head 39d354e with aurora-silicon/aura#358 as Stage 2: 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

Thanks for 39d354e and the loader side, and for the J815 log showing the ceiling arriving from the ADT. One coordination point: #1796 adds apple,low-power-frequency-max-mhz for the same ADT key, so the two should agree on one property name and unit (MHz matches the ADT) before either lands. We will run Low Power mode rows on our lab Macs once that settles; the J815 platform_profile frequency check is still open.

@gig3m

gig3m commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5), macOS 27.2 stub, with 39d354e and aura#358 on sithglan's J813 aura branch:

  • The loader writes apple,low-power-cpu-max-khz = <2220000> on power-management@382700000/performance-controller@1, matching J813's ADT value.
  • apple-clpc registers low-power balanced performance.
  • Under a busy loop, the fastest CPU runs at 2220000 kHz in low-power and 4464000 kHz in balanced.

This replaces the local apple,j813 machine line we carried for the old head.

🤖 Generated with Claude Code

@joske

joske commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Hi, #1796 adds a property for the same ADT key on the M4 Pro and M4 Max MacBook Pros: apple,low-power-frequency-max-mhz on the CLPC node. Ryan asked us to settle on one name and unit before either lands.

Could we use apple,low-power-frequency-max-mhz? It's in MHz, like the ADT's cpu-low-power-frequency-max, so aura#358 could copy the value without converting it. -mhz is one of dtschema's standard unit suffixes; the driver multiplies by 1000.

Once your loader fills it on every machine, the four board values in #1796's .dts files only matter for older loaders. I'm happy to rebase on whichever PR lands first, and to drop or keep the T6050 fallback to fit yours.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the property name: we're happy with apple,low-power-frequency-max-mhz as joske suggests. It keeps the ADT's unit, so the loader can copy the value without converting it, and -mhz is a standard dtschema suffix. If you're OK with that, could #1906 and aura#358 switch to that name? Then whichever PR lands second only needs a rebase. Thanks also to gig3m for the J813 row showing the 2220 MHz ceiling working through the property.

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.

4 participants