Skip to content

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

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

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-frequency-max-mhz on the CLPC node (the ADT's unit, so the loader copies it unchanged).
  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 (hw->low_power_khz) where there is one. The ceiling code (apple_clpc_profile_ceilings() and the profile: debugfs line) reads the resulting clpc->low_power_khz.

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.

Rebased onto integration/aurora cc14570, with the resolution Ryan posted for the conflict with 48c99cf (T6041's own table, low_power_machine removed): DT property, else hw->low_power_khz.

Rows:

  • 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 on a P core ran at 4464000 kHz in balanced, 2220000 in low-power, and 4464000 again in balanced.
  • J813 (gig3m), through the DT property with aura#358: the ceiling comes from the DT alone (comment above).
  • J616s (Ryan, T6040): the loader writes 2808; a busy P core runs at 2868 MHz in low-power and 4512 MHz in balanced, matching macOS's 2867 MHz.

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 on this head: W=1 adds no warnings in drivers/soc/apple/; checkpatch --strict clean; dt_binding_check on apple,pmc.yaml and CHECK_DTBS on the J813/J815 DTBs are clean.

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

Assisted-by: LLM (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.

@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.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

Switched to apple,low-power-frequency-max-mhz, as joske and Ryan suggested. New head 6a1c203 here, and aura#358 updated to match (its head is in the reply there).

gig3m, your J813 row used the old -khz property. The kernel and the loader have to be updated together; an old loader with this kernel just falls back to the built-in value.

The J815 platform_profile frequency check will come with our next test boot, through this property. Thanks to gig3m for the J813 row and Ryan for the J616s one.

Assisted-by: Claude Opus 5.5

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for switching to apple,low-power-frequency-max-mhz, matching the binding text to #1796, and updating aura#358 in step so the loader copies the ADT value unchanged. Keeping the low_power_machine fallback until the two PRs meet is fine with us. What's left is a boot that uses the new name with the matching loader: your J815 platform_profile check, or a J813 rerun. We'll repeat our J616s row on 6a1c203 with the updated aura#358 and post it here.

@gig3m

gig3m commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5), macOS 27.2 stub, rerun with the new name: 6a1c203 (and 12d2875) in place of the old head, and aura#358 a92cf055 on sithglan's J813 aura branch 8b9c92ea:

  • The loader writes apple,low-power-frequency-max-mhz = <2220> on power-management@382700000/performance-controller@1. The old -khz property is gone.
  • 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.

low_power_machine only names apple,t6041, so on the J813 the ceiling comes from the property alone.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J813 rerun with the new property name: the ceiling coming from the DT alone on a board the machine list doesn't name is what we wanted to see.

6a1c203 now conflicts with integration/aurora. Could you rebase it? Our J616s row with aura#358 will run on the rebased head.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (MacBook Pro 14" M4 Pro, T6040) row, plus the rebase.

Row (6a1c203 on our fleet77 kernel, loader with aura#358):

  • The loader writes apple,low-power-frequency-max-mhz = <2808> on the J616s CLPC node, and its log says CLPC: Low Power mode CPU ceiling 2808 MHz.
  • T6040 has no built-in value, so the profile comes from the property alone. In low-power, one busy P core runs at 2868 MHz; in balanced it runs at 4512 MHz.
  • 2868 MHz is the first P-cluster table step above 2808 (the table goes 2616, 2868). That matches macOS: under macOS 27 Low Power Mode on the same J616s, a busy P core is held at 2867 MHz. So rounding up to the next table frequency is the right behaviour here.

Rebase. 6a1c203 conflicts with 48c99cf on integration/aurora, which gave T6041 its own table and removed low_power_machine. Our resolution, in case it helps: read the DT property, else fall back to hw->low_power_khz, and have the ceiling code (apple_clpc_profile_ceilings(), the profile: debugfs line) read clpc->low_power_khz again:

	if (!of_property_read_u32(dev->of_node, "apple,low-power-frequency-max-mhz", &mhz))
		clpc->low_power_khz = mhz * 1000;
	else
		clpc->low_power_khz = clpc->hw->low_power_khz;

On integration cc14570 with that resolution, the CLPC KUnit suite passes on arm64 (13 pass, 1 skipped). The stock clpc.kunitconfig doesn't link on integration today because the SMC calls have no stubs; that's fixed separately in #2693, and it isn't related to this PR.

Could you push the rebase (yours or the above)? It needs no new hardware row for T6040, because the conflict touches only the T6041 table.

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. The property keeps the ADT's unit
(MHz), so the loader copies the value as it is. The name and text match
the property proposed for the same ADT key on the M4 Pro and Max
MacBook Pros.

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-frequency-max-mhz.

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).

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

Copy link
Copy Markdown
Contributor Author

@RyanTheTide thanks for the J616s row and the resolution. Rebased onto cc14570 with exactly that: the DT property, else hw->low_power_khz. apple_clpc_profile_ceilings() and the profile: debugfs line read clpc->low_power_khz again.

Checks: W=1 clean, checkpatch clean, dt_binding_check on apple,pmc.yaml clean.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks. 0cbf68d reads apple,low-power-frequency-max-mhz first and falls back to hw->low_power_khz, and apple_clpc_profile_ceilings() and the profile: debugfs line use clpc->low_power_khz again, as proposed. The J616s row on 6a1c203 still covers T6040, since the rebase only touched the T6041 fallback. No further asks from us.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (MacBook Pro 16" M4 Pro, T6040) row with this head (0cbf68d) merged on integration/aurora a463112. Same kernel also merged #2549, #2784 and #2021, fleet78 config, production J616s Device Tree. The loader writes apple,low-power-frequency-max-mhz = 2808, and the driver table has no ceiling for T6040.

  • The platform profile registers: apple-clpc, choices low-power balanced performance.
  • low-power holds the P cluster at 2868 MHz, the first table step at or above 2808. One busy thread on a P core: 2868 MHz, 8.70 W system. Balanced and performance: 4512 MHz, ~12.6 W. debugfs ceilings (kHz): cpu0 2868000 cpu1 2592000 cpu9 2868000 in low-power, 0 otherwise.
  • 0 failed units, 0 AVC, 0 kernel errors.

Two things to know before this lands:

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

#2784 has landed and conflicts with this in clpc.c. Since this branch is on your fork, the rebase is in #2816: your two commits with authorship and message kept, and the conflict resolved as described in #2784 (comment) (the four new clpc->hw->low_power_khz reads use clpc->low_power_khz). Review can continue there.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Landed as #2816 (your two commits, authorship kept, rebased onto #2784 with the clpc.c conflict resolved in the second one). Thanks, Nick.

Assisted-by: LLM (Claude:Opus 5.5)

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