From c897cc131d80fccfe1d372bf5ae52136ea1171cc Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 19 Nov 2026 21:41:34 +0700 Subject: [PATCH 1/2] dt-bindings: power: apple,pmc: Add the CLPC's Low Power mode ceiling 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 --- Documentation/devicetree/bindings/power/apple,pmc.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/power/apple,pmc.yaml b/Documentation/devicetree/bindings/power/apple,pmc.yaml index fe47291dff0dc..c0f1af75560ae 100644 --- a/Documentation/devicetree/bindings/power/apple,pmc.yaml +++ b/Documentation/devicetree/bindings/power/apple,pmc.yaml @@ -268,6 +268,13 @@ patternProperties: The SMC, whose package power reading the low-power platform profile holds the CPU clusters to. + apple,low-power-cpu-max-khz: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + CPU frequency ceiling of the low-power platform profile, in kHz. + The boot loader copies it from the ADT (pmgr/clpc + cpu-low-power-frequency-max, in MHz). + required: - compatible - reg From 39d354ebf92c2b3b66e99e9ed1e797a2f137026f Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 19 Nov 2026 21:41:34 +0700 Subject: [PATCH 2/2] soc: apple: clpc: Take the Low Power mode ceiling from the DT 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 --- drivers/soc/apple/clpc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/soc/apple/clpc.c b/drivers/soc/apple/clpc.c index ff859036c040d..71283507dc4b1 100644 --- a/drivers/soc/apple/clpc.c +++ b/drivers/soc/apple/clpc.c @@ -104,7 +104,8 @@ enum apple_clpc_rail { * @idle_on_time: sample every period even with no vote held, instead of * from a deferrable timer * @low_power_khz: CPU frequency ceiling of the low-power platform profile, - * taken up to the next table frequency; 0 for no platform profile + * taken up to the next table frequency, for a node without + * apple,low-power-cpu-max-khz; 0 for no platform profile * @low_power_machine: the machine compatible @low_power_khz was read for; SoCs * sharing this CLPC without it get no low-power profile. NULL for any * @low_power_mw: package power (the SMC's PHPC key) the low-power profile @@ -232,7 +233,7 @@ struct apple_clpc { /* The platform profile and, for its power target, the SMC */ enum platform_profile_option profile; bool low_power; - /* hw->low_power_khz where it applies to this machine, else 0 */ + /* the DT ceiling, else hw->low_power_khz where it applies, else 0 */ unsigned int low_power_khz; struct device_node *smc_np; struct apple_smc *smc; @@ -1431,7 +1432,15 @@ static int apple_clpc_probe(struct platform_device *pdev) clpc->profile = PLATFORM_PROFILE_BALANCED; clpc->power_next = jiffies; - if (!clpc->hw->low_power_machine || of_machine_is_compatible(clpc->hw->low_power_machine)) + /* + * The boot loader copies the ADT's Low Power mode CPU ceiling + * (pmgr/clpc cpu-low-power-frequency-max) into the node. Without it, + * a SoC's own value applies where it has one. + */ + if (of_property_read_u32(dev->of_node, "apple,low-power-cpu-max-khz", + &clpc->low_power_khz) && + (!clpc->hw->low_power_machine || + of_machine_is_compatible(clpc->hw->low_power_machine))) clpc->low_power_khz = clpc->hw->low_power_khz; if (clpc->low_power_khz && IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)) { struct device *ppdev;